Question

I do have a USB device which is using the WinUSB driver (winusb.sys) as it's function driver. Now I need to write a video capture driver (has to be a kernel mode driver) which accesses this device.

My question is: Can I access and work with a WinUSB device from kernel mode? If so, is there any kind of documentation to do so?

All documentation I've found is talking about accessing WinUSB from user mode with the WinUSB.dll but this is not an option for me. I've already tried to use IoGetDeviceObjectPointer() to get the needed file handle for the USB pipes I'm communicating with on the USB device but the call always fails with STATUS_ACCESS_DENIED. I know that I could write my own KMDF driver for the USB device but it would be much easier to use the already in place WinUSB driver.

Any help would be much appreciate.

Was it helpful?

Solution

This could work ... but is very hard to do.

You can send i/o requests to the winusb device in kernel mode. You cannot use WinUSB functions to communicate, you have to use the actual IO requests to communicate from one i/o stack to another.

I wrote a AVStream miniport driver for a USB device, and can say, that the USB portion is not the hard part. Especially when using kmdf USB IO queue in miniport mode.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top