Re: How to make link between USB physical port and drive letter mount by windows
- From: "Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx>
- Date: Tue, 10 Jun 2008 08:52:11 -0500
max_mont wrote:
Thank you very much for your help. But I'm a newbie in driver
development (I usually develop in higer level).
I don't see how I can get parent device and get "driver key name).
Have you got a piece of code ?
Use CM_Get_Parent to get the parent device.
Many thanks in advance again.
On 10 juin, 09:12, Uwe Sieber <m...@xxxxxxxxxxxxx> wrote:
max_mont wrote:
I would like to enumerate all USB storage plugged on a PC, identify
all by physical port and by drive letter.
I can enumerate all USB device with DDK sample (usbview) but I can't
manage to find drive letter for each storage.
You need an enumeration of all VOLUMES. Get their device
numbers. The enumerate all DISKs, CDROMs and FLOPPYs. Match
them with the volumes by their device numbers. I've shown
this here:http://www.codeproject.com/system/RemoveDriveByLetter.asp
For each drive with BusType==BusTypeUsb get the parent
device of the DISK/CDROM/FLOPPY which is the USB device
itself. Get their "driver key name" (SPDRP_DRIVER / CM_DRP_DRIVER).
Match it with the driver key name of the USB devices found
thru the USB API (IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME).
Good luck :-)
Uwe
.
- References:
- Prev by Date: Re: debugview line size not unlimited !
- Next by Date: RE: dpinst - uninstall problems - when hardware is not present
- Previous by thread: Re: How to make link between USB physical port and drive letter mount by windows
- Next by thread: Re: How to make link between USB physical port and drive letter mount by windows
- Index(es):
Relevant Pages
|