Scan For Devices On USB Host Controllers

I was handed down an assignment at work today and I don't know where to start. The goal of the program I am supposed to make, is to find a specific device connected through USB, report back which host controller the device is connected to. It is to then use the location to find it in the registry and change a value. the last part I have, I just can't seem to find a way to find the device and where it is connected, so any help I can get would be greatly appreciated.
Having done something along theses lines recently - You can use the DeviceIoControl function to send IOCTL requests to
a HOSTCONTROLLER, or HUB to get information about connected devices.
You can send IOCTL requests to get the device descriptors.

See here for the DeviceIoControl function.
http://msdn.microsoft.com/en-us/library/aa363216%28VS.85%29.aspx

See here for info about the USB IOCTLs
http://msdn.microsoft.com/en-us/library/aa476228.aspx


You will need the DDK headers - which the Microsoft SDK does not include by default. But you can download MINGW which does include the DDK header files.



Thank you very much, I will give these a look at and let you know if I can get it working.
By the way, the HostController names are like this:
HCD0, HCD1, and so forth

The name to pass to the windows createfile function looks like this:
char HostControllerName[]="\\\\.\\HCD0";


Topic archived. No new replies allowed.