kbfilter mask keys

I am trying to mask key via a keyboard filter driver and it works great with a usb keyboard but when I tried with ps2 and I execute the code below, when maskkey is true, I noticed that the KbFilter_ServiceCallback just continues to be called and I get no other key presses. To drop a key press, is it insufficient to just not call the next filter in the chain or is there a cleaner way to do this?

Should I call the chain with start/end set to a null or something of the sort to possible signal that the key was handled?

VOID KbFilter_ServiceCallback(…)
{
if (!maskkey)
{
(*(PSERVICE_CALLBACK_ROUTINE)(ULONG_PTR) devExt->UpperConnectData.ClassService)(
devExt->UpperConnectData.ClassDeviceObject,
InputDataStart,
InputDataEnd,
InputDataConsumed);
}
}

If you want to throw away a key press you need to set

*InputDataConsumed = number of packets thrown away;

Apparently there is a bug in the kbdhid stack that doesn’t look at the result of InputDataConsumed when the callback returns :wink:

d


From: xxxxx@gmail.commailto:xxxxx
Sent: ?12/?18/?2012 2:34 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] kbfilter mask keys

I am trying to mask key via a keyboard filter driver and it works great with a usb keyboard but when I tried with ps2 and I execute the code below, when maskkey is true, I noticed that the KbFilter_ServiceCallback just continues to be called and I get no other key presses. To drop a key press, is it insufficient to just not call the next filter in the chain or is there a cleaner way to do this?

Should I call the chain with start/end set to a null or something of the sort to possible signal that the key was handled?

VOID KbFilter_ServiceCallback(…)
{
if (!maskkey)
{
(*(PSERVICE_CALLBACK_ROUTINE)(ULONG_PTR) devExt->UpperConnectData.ClassService)(
devExt->UpperConnectData.ClassDeviceObject,
InputDataStart,
InputDataEnd,
InputDataConsumed);
}
}


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</mailto:xxxxx></mailto:xxxxx>