Brief Overview:
I have a mini-driver (setup as a filter because of KMDF) that receives HID READ report requests from HID class driver. The filter simply deposits these onto manual dispatch queue and waits until it receives a message when to complete these.
Filter’s pending HID READ report request is completed by using a global control device that is setup as a legacy control device (very similar to toaster example with sideband communication). Note, the control uses serial queue for receiving custom IOCTLs.
Note, that filters that the control device services are sitting in a global collection.
The client sends custom IOCTL with some data (joystick input) to global control device, - the design question I have is what is the best way to complete filter’s pending HID READ reports? Here what I think my options are numbered in the order of my preference:
-
On receiving IOCTL (joy input from user) on the control device, go through each filter in the collection, get reference to filter’s I/O manual queue where pending HID read report request is and complete it.
-
On filter setup, create yet another manual queue, - this one used to receive a message from control device to inform when new IOCTL arrived. When new IOCTL arrives on the control device, loop through each filter, create WDFREQUEST, copy user input buffer to my new WDFREQUEST buffer, and forward the new created request to the filter.
-
On filter setup create a polling timer (for each filter);- when new IOCTL arrives on the control device, copy input buffer to my global control device’s control data (using device context). The polling time on each filter will read global control data and complete the request. (I believe I will need some way to sync read/write access to the global control data)
Any comments what’s the best way of handling this scenario would be greately appreciated.
Thanks,
lk