Tech Support > Microsoft Windows > Drivers > From a old post: How do I find the drive letter mapped to a generic volume (e.g. USB mass storage device)...?
From a old post: How do I find the drive letter mapped to a generic volume (e.g. USB mass storage device)...?
Posted by Remi Mathieu on November 25th, 2004


Hello all,

This is the text of a old post from John Hawkins send in October 2002.
Does anybody have any ideas or sample code which does this?

Thanks

Remi


I know this question has been asked before, but I couldn't find a
complete answer anywhere so I thought I would ask it again.

Using SetupDiGetClassDevs and SetupDiEnumDeviceInfo I can get a list
of all devices attached to the system. Then using
SetupDiGetDeviceRegistryProperty to retrieve SPDRP_DEVICEDESC I can
see that some of these devices are listed as "Generic Volume", one for
each drive (hard drive, floppy drive, removable disk and so on) I have
attached to my system. So, given a SP_DEVINFO_DATA structure, and
knowing I'm dealing with a generic volume, how can I find out which
drive letter a given generic volume is mapped to?

Does it perhaps have something to do with SetupDiEnumDeviceInterfaces
and SetupDiGetDeviceInterfaceDetail? I did try this briefly, but
couldn't work out which GUID to pass in to
SetupDiEnumDeviceInterfaces.

Basically, I'd like to be able to generate the same tree the "Unplug
and Eject Hardware" window in Windows 2000 generates, which links a
drive letter, through a generic volume, to the original device which
provides it (for example, a USB mass storage device or a USB digital
camera). I know I can use CM_Get_Child and CM_Get_Parent to find out
for any given device which devices its parents and children are, but I
can't seem to find out which drive letter any given generic volume
represents.

Posted by nospam@cristalink.com on November 25th, 2004


IOCTL_MOUNTMGR_QUERY_POINTS
IOCTL_MOUNTDEV_QUERY_UNIQUE_ID
IOCTL_MOUNTDEV_QUERY_DEVICE_NAME

--
http://www.firestreamer.com - NTBACKUP to DVD and DV


"Remi Mathieu" <rmathieu@cae.com> wrote in message
news:cc8225b9.0411251033.339f8c66@posting.google.c om...




Similar Posts