Re: Need some help getting started with low-level USB I/O requests

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

.



Relevant Pages

  • Installation problems with Buffalo WLI-USB-G54
    ... I just bought a WLI-USB-G54 and a WLI-CB-G54A card for my laptop. ... need is to setup an ad-hoc connection between the two devices. ... disconnect the USB device, reboot and reconnect it the system still ...
    (microsoft.public.win2000.general)
  • Re: CD/DVD drive a USB device?
    ... Then after a while Some USB device ... login, but the screen stayed dark, even through ... the inconsistent behaviour of drive detection is either due to the drive not having a secure connection or it showing signs of failing. ... with the system powered off, remove the retaining screw for the drive, slide out the entire drive assembly, reinstall firmly, and replace the retaining screw. ...
    (alt.sys.pc-clone.dell)
  • Re: Recognizing two identical usb devices
    ... instead of using a fixed name, you should use a device interface. ... you can then enumerate the device interface and find all ... each usb device seams to get lost in the usb bus. ... > The software driver creates a distinct device name for each usb device ...
    (microsoft.public.development.device.drivers)
  • USB Connected Hard Drive
    ... I have purchased an external drive enclosure and a new ... the jumper to "Cable Select". ... When making the connection ... to my computer it says "USB Device Not Recognized" and ...
    (microsoft.public.windowsxp.hardware)
  • Re: USB RNIDS+Socket communication problem
    ... There is a WinCE-Device,and i want to communicate with the PC using the ... to communicate with some other host via that network connection? ... operational problems with disconnecting a USB device from your hardware, ...
    (microsoft.public.windowsce.app.development)