How could I get a USB Flash disk's drive letter?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In XP, I used these functions to get a usb device volume to compare, but it
cannot work in Vista
SetupDiGetClassDev ==> get GUID_DEVINTERFACE_VOLUME device
SetupDiEnumDeviceInterface ==> get all volume device
CM_Get_Parent twice ==> get device id for USB
GetVolumeNameForVolumeMountPoint ==> compare

Might anybody help me?
Thx,
 
ChuYuan said:
In XP, I used these functions to get a usb device volume to compare, but it
cannot work in Vista
SetupDiGetClassDev ==> get GUID_DEVINTERFACE_VOLUME device
SetupDiEnumDeviceInterface ==> get all volume device
CM_Get_Parent twice ==> get device id for USB
GetVolumeNameForVolumeMountPoint ==> compare

Might anybody help me?

Yes, this has changed in Vista. DRIVE_REMOVABLE drives are now handled
as DRIVE_FIXED drives are under XP.
Have a look at my sample project, it explains it:
http://www.codeproject.com/system/RemoveDriveByLetter.asp


Uwe
 
Back
Top