***
The MSDN entry for the Win32 GetDriveType function says:
"To determine whether a drive is a USB-type drive, call
SetupDiGetDeviceRegistryProperty and specify the SPDRP_REMOVAL_POLICY
property."
I am curious about how this can be done as I cannot determine the
association between a drive letter and the device interface.
I can enumerate the USB devices with SetupDiEnumDeviceInterfaces and locate
my drive with physical device object name "\Device\USBPDO-7".
I can find the MS-DOS device name associated with the drive letter using
QueryDosDevice, which is "\Device\Harddisk1\DP(1)0-0+c".
This is where I get stuck.
How do I bridge the gap between the device interface and the drive letter?
Regards,
Andrew
--
V.
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Andrew Jarvis" <someone@somewhere> wrote in message
news:u9fwnojx...@TK2MSFTNGP04.phx.gbl...
--
V.
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Volodymyr M. Shcherbyna" <v_sch...@online.mvps.org> wrote in message
news:OLdxi0lx...@TK2MSFTNGP05.phx.gbl...
I think this is wrong. A removal policy
CM_REMOVAL_POLICY_EXPECT_SURPRISE_REMOVAL is
found on FireWire drives too.
Using IOCTL_STORAGE_QUERY_PROPERTY is the
right choice.
> I am curious about how this can be done as I cannot determine the
> association between a drive letter and the device interface.
The device numbers of the volume on the one side and of
disk/cdrom/floppy on the other side is the link.
I've shown this here (user mode):
http://www.codeproject.com/system/RemoveDriveByLetter.asp
Uwe