Hi all,
I wrote a filter driver intended to filter/extend functionality for some HID devices. Since these devices require the driver to send device vendor requests, I decided, to have access to the USB iotarget to write a lower filter driver for hidusb and look for IOCTL_INTERNAL_USB_SUBMIT_URB function URB_FUNCTION_BULK_OR_TRANSFER.
For several reasons I needed to decouple the requests coming from hidusb and the one sent down so I used a cont reader to read from the device and serve the URBs coming form the top.
The driver works just fine with several devices with one USB interface.
Unfortunately I’m having weird problems with one that has 2 USB interfaces. Ideally the driver would need to run on only one of them so, as a first attempt I tried loading it on the interface instance. As soon as the cont reader starts, the device stops sending reports.
I’m going to snoop the USB traffic to understand the problem better but I wonder if there’s anything that wrong that I’m doing in my setup.
Another thing: on the same device (which is a special mouse), I tried to avoid the cont reader and install a completion routine on the IOCTL_INTERNAL_USB_SUBMIT_URB/URB_FUNCTION_BULK_OR_TRANSFER request. At completion, I use WdfRequestRetrieveOutputBuffer to retrieve the buffer. Some initial requests complete with a NULL buffer (however WdfRequestRetrieveOutputBuffer doesn’t fail which I find weird), whereas upon movement (of the mouse) I get a buffer with a gigantic size (a number that doesn’t really make any sense and looks more like a pointer than anything else). On those completions, if I look at the Information field of CompletionParams->IoStatus, the returned size is 0. In those cases, if I just complete the requrest without doing anything, I see the cursor moving on the screen which means that data is somewhere but I just don’t see it.
Does anybody have insights on this?
Thanks in advance,
Marco.