Input filter drivers not observing input

I have two class filter input drivers (mouse and keyboard) that are
installed via the UpperFilters registry key. They work fine on quite a few
systems up until now, but I recently discovered a system (a laptop computer)
where, when my drivers are installed, neither keyboard nor mouse input
works.

However, plugging in an external mouse works, i.e. the touchpad has no input
but the external mouse works fine. I installed my debug build drivers and
enabled debug output and both the keyboard and mouse drivers are initialized
without errors. Take the keyboard filter, for instance: DeviceAdd ,
IOCTL_INTERNAL_KEYBOARD_CONNECT, IOCTL_INTERNAL_I8042_HOOK_KEYBOARD,
InitializationRoutine are all being called and complete with STATUS_SUCCESS.
I can also connect and talk to the raw PDO device without problems.

Hitting a key on the keyboard never results in KbFilter_ServiceCallback
being called, however.

Does anybody have an idea what could be causing this or how I debug a
scenario like this?

Cheers and happy New Year to all,

Soren

>IOCTL_INTERNAL_KEYBOARD_CONNECT, IOCTL_INTERNAL_I8042_HOOK_KEYBOARD,

Avoid using the second one, only use the first.

Just avoid using anything i8042-specific in your code.

Will this help?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

what other filters are in the stacks ? what does !devnode say for each stack where you are not seeing input come through the service callbacks?

d

So, I performed some further analysis the other day and here are some
updates:

* I can install my keyboard filter just fine, but as soon as I add my mouse
filter before mouclass in the UpperFilters key, both keyboard and mouse
input stop working for the laptop’s keyboard and mouse. The external mouse,
as I mentioned previously, still works.

* I tried using the moufiltr sample from the WDK I had lying around
(7600.16385.0) and I observed the same behavior as above.

* If I put the mouse filter *after* mouclass in the UpperFilters key,
everything works as expected.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@Microsoft.com
Sent: Monday, January 03, 2011 9:28 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Input filter drivers not observing input

what other filters are in the stacks ? what does !devnode say for each stack
where you are not seeing input come through the service callbacks?

d


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

I posted some updates to this issue in a different post, but just a general
question regarding your response:

Should I avoid any i8042-specific code in both the keyboard and mouse
filters?

Thanks,
Soren

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Sunday, January 02, 2011 12:09 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Input filter drivers not observing input

IOCTL_INTERNAL_KEYBOARD_CONNECT, IOCTL_INTERNAL_I8042_HOOK_KEYBOARD,

Avoid using the second one, only use the first.

Just avoid using anything i8042-specific in your code.

Will this help?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

> Should I avoid any i8042-specific code in both the keyboard and mouse

filters?

Depends on your task.

If you need to control some extended version of i8042 controller, or a driver for i8042-daisy-chained hardware - then no.

And, if you need to control generic keyboard/mouse, USB included - then yes, avoid i8042 stuff.

Since your mouse filter causes keyboard to malfunction, I expect the issue is in i8042 stuff in your code, which drives the i8042 chip mad.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

If I want to avoid all i8042-specific code in the filters, what do I return
when I receive IOCTL_INTERNAL_I8042_HOOK_KEYBOARD? Just ERROR_SUCCESS and
forward it down the stack?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Monday, January 03, 2011 6:12 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Input filter drivers not observing input

Should I avoid any i8042-specific code in both the keyboard and mouse
filters?

Depends on your task.

If you need to control some extended version of i8042 controller, or a
driver for i8042-daisy-chained hardware - then no.

And, if you need to control generic keyboard/mouse, USB included - then yes,
avoid i8042 stuff.

Since your mouse filter causes keyboard to malfunction, I expect the
issue is in i8042 stuff in your code, which drives the i8042 chip mad.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

just ioskip/iocalldriver the i8042 IOCTLs and you will be fine. what other filters are in the stack (ie the output of !devstack ) ?

d

> when I receive IOCTL_INTERNAL_I8042_HOOK_KEYBOARD?

Just pass it down.

The problem with the sample is that it demonstrates both techniques - a) PnP filter b) hooks to i8042prt.sys.

You only need a). b) is only intended for hardware daisy-chained to PS/2 port.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Maxim/Doron,

Thanks for the help here. Ignoring all the i8042-specific IOCTLs fixed the
problem. For some reason it didn’t play nicely with whatever was on that
machine.

Cheers!

Soren

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Tuesday, January 04, 2011 12:15 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Input filter drivers not observing input

when I receive IOCTL_INTERNAL_I8042_HOOK_KEYBOARD?

Just pass it down.

The problem with the sample is that it demonstrates both techniques - a)
PnP filter b) hooks to i8042prt.sys.

You only need a). b) is only intended for hardware daisy-chained to PS/2
port.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer