Re: Need some help getting started with low-level USB I/O requests
- From: "Doron Holan [MSFT]" <doronh@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 18 Jul 2007 22:41:50 -0700
you will have to go the controller/hub enumeration route. look at usbview in the wdk, it will give you a good starting point. you cannot open a handle to an arbitrary usb function driver and then expect a particular ioctl to work across all device classes. the function upon receiving an unknown IOCTL will fail it, not send it down to the PDO.
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kris" <kris@xxxxxxxx> wrote in message news:%23ZhtrTsxHHA.140@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
Let's summarize things...
I'm now focusing on retrieving the USB device descriptor. However, currently I somewhat stuck. Here's what I've done so far and I was hoping someone could help me out...
[1] Get the devicepath of a device for which I want to retrieve the device descriptor. E.g. \\?\usb#vid_03f0&pid_3005#cn3asb732793#{6bdd1fc6-810f-11d0-bec7-08002be2092f}
[2] Use CreateFile() with DevicePath as parameter to open a handle to USB device.
[3] Then I believe I'm supposed to use DeviceIoControl() to send a device descriptor retrieval request (something like USB_DEVICE_DESCRIPTOR_TYPE) to the device. Unfortunately, I can't find the right IOCTL request.
The only IOCTL that apparently produces the information I need I found is IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION(). But unfortunately it apparently doesn't accept a direct link to a specific device. Instead, it requires you to specify a hub and the port index to which the device is connected (i.e. it requires me to enumerate host controllers, hubs and downstream ports). This is great if you want to build an overview of all hubs/ports/devices connected to the system. But if you already know which device you want to query, it's way too much overhead.
It would be great if I could somehow query the USB device so that I know its connection parameters (such as connected hub and port index). This way I can still use IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION() without having to enumerate all USB ports on the system.
Currently I don't know how to piece things together. Also, I find lots of references for driver development. However, in my case, I just want a normal user-mode application to retrieve this USB device descriptor.
Any help is very much appreciated.
Regards,
Kris
.
- Follow-Ups:
- References:
- Need some help getting started with low-level USB I/O requests
- From: Kris
- Re: Need some help getting started with low-level USB I/O requests
- From: Doron Holan [MSFT]
- Re: Need some help getting started with low-level USB I/O requests
- From: Kris
- Need some help getting started with low-level USB I/O requests
- Prev by Date: Re: Determining device driver for logical volume.
- Next by Date: Re: Need some help getting started with low-level USB I/O requests
- Previous by thread: Re: Need some help getting started with low-level USB I/O requests
- Next by thread: Re: Need some help getting started with low-level USB I/O requests
- Index(es):
Relevant Pages
|