Windows 7 - Reading USB descriptors w/o a driver installed?

Asked By ryan01701 on 15-Jun-10 08:20 AM
Using the UCView tool in the WinDDK, I can read the USB descriptors of
devices that are attached even if I do not have a driver installed for them
(show up in Device Manager with yellow exclamation mark).

What is the standard way of doing this programatically?  I have only ever
gotten descriptors using calls into the driver (WinUSB or otherwise).  Is it
accessible through SetupAPI somehow?

I am specifically interested in getting string descriptors, although I
assume if I can get the device descriptor, I will be able to get any available
descriptors.

Thanks,

--
Ryan




Don Burn replied to ryan01701 on 15-Jun-10 08:32 AM
The sources of USBView are supplied with the WDK, you should have all you
need from these.


Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Wilhelm Noeker replied to ryan01701 on 15-Jun-10 09:35 AM
IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION is what you want. Sample
code is either UsbView (as Don Burn already pointed out), or this
console tool from Intel:
http://www.intel.com/intelpress/usb/examples/DUSBVC.PDF
ryan01701 replied to Wilhelm Noeker on 15-Jun-10 11:14 AM
This looks like it will work.  I assume that I will have to walk the USB
device tree to find the hub to which the device is attached and its port
index in order to properly use this ioctl.  That's what I see going on in the
USBView source code.

Thanks,

--
Ryan