You could enumerate physical disk devices using the GUID_DEVINTERFACE_DISK. Using:
SetupDiGetClassDevs
(
&GUID_DEVINTERFACE_DISK,
NULL,
NULL,
DIGCF_PRESENT | DIGCF_DEVICEINTERFACE
)
Then, query the storage adapter descriptor.
STORAGE_PROPERTY_QUERY storageProperty;
//...setup
PSTORAGE_ADAPTER_DESCRIPTOR pstorageAdapterDesc;
pstorageAdapterDesc = (PSTORAGE_ADAPTER_DESCRIPTOR)LocallAlloc( LPTR, storageDescHeader.Size );
DeviceIoControl
(
handle,
IOCTL_STORAGE_QUERY_PROPERTY,
&storageProperty,
sizeof( STORAGE_PROPERTY_QUERY ),
pstorageAdapterDesc,
storageDescHeader.Size,
bytesReturned,
NULL
)
In the descriptor, you could use the "BusType" and check for USB.