Driver to driver communcation


My USB mouse exposes a keyboard and a mouse interface. I’ve created two filter driver for each of these interfaces and I’d like to be able to have them communicating, if possible by sharing a common buffer.

I’m trying to follow this guide :

I have a few questions :

  • Is this guide still valid ? is it the WDF way to do this ?
  • What does “context block” means ? Can you point me to the function that will help me create one ?
  • As I need a PDEVICE_OBJECT to use IoCallDriver, I’ll need (from the mouse filter driver point of view) to get the one corresponding to the keyboard interface. I tried using IoGetDeviceObjectPointer but I need to determine the ObjectName…
    So I tried using IoGetDeviceInterfaces to get the names of the device interfaces corresponding to the keyboard and I end up listing all the keyboard interfaces available on my computer. How can I narrow down this list to the keyboard interfaces of my physical device only ?

Hope someone will be able to help me sort this out.

Best regards,

I tried using :

status = IoGetDeviceInterfaces((GUID*)&GUID_DEVINTERFACE_KEYBOARD,

But I end up with no results at all.

You don’t get to your own physical device object on the stack where you find the device interface for another stack. are the 2 filters in the same driver object/.sys file? if so, you can judiciously use globals to keep track of state and then you don’t have to send io requests to each filter. opening a handle to a filter in the input stacks is difficult; mouclass and kbdclass will not let your io requests go through to the filter below them.


The two filters are not in the same .sys file. But if it’s possible I’d like to do that.
I definitely need more precision about that if that could be done, and I’d like to understand what’s the difference between my situation and the one related in the article ?

When I try referencing the same .sys in both .INF I end up with this error :

Windows cannot load the device driver for this hardware because a previous instance of the device driver is still in memory. (Code 38)

Any clue ?

I think the problem was the service installation in the INF file.
I can use globals now, and I think this will solve my problem.

Thank you !