How to detect the USB devices plugged in?

How can I prgrammatically detect the USB devices connected to a system. I have observed that the device manager does detect all of them but for some reason lists some and some it does not. Basically I want to go down the USB chain which might spawn multiple cascading external hubs and list all the USB devices hooked up. Any help, advice or pointers would be most welcome. Thanks.

C:\WinDDK\7600.16385.1\src\usb\usbview
I just saw this. If there is a easier way out or a better way out please suggest or else please ignore my question, I shall dig into the above and hopefully it will solve my problem. If anyone has used usbview and if it has some gotchas please do share.

Two gotchas I’ve spotted:

  1. USB3 Superspeed is printed as “unknown” - this is easily fixed in code once you’ve seen it.
  2. It doesn’t drill down into composite devices to print the components.

Regards,
Tim.


From: xxxxx@lists.osr.com [xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com [xxxxx@gmail.com]
Sent: 13 February 2012 21:10
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How to detect the USB devices plugged in?

C:\WinDDK\7600.16385.1\src\usb\usbview
I just saw this. If there is a easier way out or a better way out please suggest or else please ignore my question, I shall dig into the above and hopefully it will solve my problem. If anyone has used usbview and if it has some gotchas please do share.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer