Re: How to enumerate USB Mass Storage devices?



Wan-Hi wrote:

I wonder how to close the bridge between the Device Installation functions and the Volume Management functions. When enumerating all devices that expose GUID_DEVINTERFACE_VOLUME the path value in each SP_DEVICE_INTERFACE_DETAIL_DATA begins with STORAGE instead of VOLUME. So I can't use the path value to retrieve the mount points of a specific volume. Why is that so? I can create a file with that value, but can't use it for querying mount points? I tried to go over the Removable Storage Manager by using GetVolumesFromDrive, but that didn't work either.

Feed the original DevicePath you got from SetupDiGetDeviceInterfaceDetail to GetVolumeNameForVolumeMountPoint.
The only thing to do it to add a trailing backslath to the DevicePath first.
If you want to match to drive letters then feed "A:\\" through "Z:\\" to GetVolumeNameForVolumeMountPoint and see if the result matches the above result.


The main drawback is that the Volume Mount Point API is XP only.
.



Relevant Pages

  • Re: Non-hard drive partitions on locked down server?
    ... > need persistent storage and don't care much ... > filesystem mount points within a SINGLE physical flash drive? ... > multiple files to use as loopback mounts? ...
    (comp.os.linux.security)
  • Re: [2.6 patch] bio.c: make bio_destructor static
    ... returns -EXDEV if someone attempts an mv operation accross mount points ... moving the data up to user space and back down. ... The bio interface in the buffer cache (and some ... If you are using remote Fiber Channel adapters that map storage ...
    (Linux-Kernel)
  • Re: Slave Drive (resend)
    ... Wayne Smith wrote: ... want to use it separately from the Filesystem as storage for my files. ... mount it up otherwise and use it. ...
    (Ubuntu)
  • Re: Slave Drive
    ... Wayne Smith wrote: ... want to use it separately from the Filesystem as storage for my files. ... mount it up otherwise and use it. ...
    (Ubuntu)