Maxim
Thu May 18 08:52:02 CDT 2006
Enum all USB-attached devices using SetupDi APIs, skip all for which the
enumerator name is not "USBSTOR".
For the remaining non-skipped devices, call
SetupDiGetDeviceInterfaceDetail, which will give you the name for CreateFile.
Do this CreateFile, and then IOCTL_STORAGE_GET_DEVICE_NUMBER, it returns
exactly the same number which is in \\.\PhysicalDrive%d.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
"Brett" <elderdodds@yahoo.notnet> wrote in message
news:E0D14ED9-9263-4E28-B7D1-E8B344B3BE7F@microsoft.com...
> I need to get a file handle to only the USB storage drives on my system.
> So, I know I need to do a Createfile("\\\\.\\PhysicalDriveX"... but, how do
> I determine that PhysicalDriveX is of type USBSTOR\DISK.
> I've browsed through the SetupDi functions and the devcon.exe source code,
> but I don't see how I can tie the two together.
> Any suggestions?
> Thanks in advance...
> -Brett