How can I make a keyboard filter driver first in line

I’m playing around with the code which I found on the net that filters keyboard scancodes. I would like to be the first filter driver to receive the scan code before they are passed on to the next lower filter driver. I am assuming that the first filter driver to receive the scancode is the lowest on the chain ? Can this be done and if yes how can I go about doing this ? Thanks in advance. Just a side note I’m quite new to window driver development so please be patient.

Thanks in advance

Victor

>driver. I am assuming that the first filter driver to receive the scancode is the lowest on the chain ? Can

this be done

No, it cannot.

You cannot provide any guarantees that there is no other filters below you.


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

> No, it cannot.

Thanks Maxim for the reply.

Why do you think you need to be first? Are you starting with the kbfiltr WDK example?

d

dent from a phpne with no keynoard

-----Original Message-----
From: xxxxx@hotmail.com
Sent: July 25, 2010 3:15 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How can I make a keyboard filter driver first in line

> No, it cannot.

Thanks Maxim for the reply.


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

The answer is you have no way to control this. Think about it, if you
did have a way to say you are first and another driver did the same what
would be the result. If you want more information, go back through the
archives this question is as old as this list.

Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

-----Original Message-----
From: xxxxx@hotmail.com [mailto:xxxxx@hotmail.com]
Posted At: Sunday, July 25, 2010 5:50 PM
Posted To: ntdev
Conversation: How can I make a keyboard filter driver first in line
Subject: How can I make a keyboard filter driver first in line

I’m playing around with the code which I found on the net that filters
keyboard scancodes. I would like to be the first filter driver to
receive the
scan code before they are passed on to the next lower filter driver. I
am
assuming that the first filter driver to receive the scancode is the
lowest on
the chain ? Can this be done and if yes how can I go about doing this
? Thanks
in advance. Just a side note I’m quite new to window driver
development so
please be patient.

Thanks in advance

Victor

__________ Information from ESET Smart Security, version of virus
signature
database 5311 (20100725) __________

The message was checked by ESET Smart Security.

http://www.eset.com

If talking about 8042 filtering, there are some very poor drivers out there. For instance, just hope you don’t get loaded on a system with Synaptics drivers. They will absolutely crash any filter loaded after them. They simply got the ISR chaining code wrong. The convoluted way the DDK samples show how to do ISR chaining may be part of their confusion. The only way around it is to be sure you are in front of them in the chain. As far as I can see there is no documented way to do this, but it can be done if it must though I would not advocate it.

The DDK kbfiltr/moufiltr has the below convoluted and confusing chaining code:

if (IsrHook) {
retVal = (*IsrHook) (…);

if (!retVal || !(*ContinueProcessing)) {
return retVal;
}
}

*ContinueProcessing = TRUE;

return retVal;

It could be more cleanly and concisely be written as:

if (IsrHook)
retVal = (*IsrHook)(…);
else
*ContinueProcessing = TRUE;

return retVal;

Well you can blame me for those samples :), at least the xp versions…

d

dent from a phpne with no keynoard

-----Original Message-----
From: xxxxx@gmail.com
Sent: July 25, 2010 6:57 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How can I make a keyboard filter driver first in line

If talking about 8042 filtering, there are some very poor drivers out there. For instance, just hope you don’t get loaded on a system with Synaptics drivers. They will absolutely crash any filter loaded after them. They simply got the ISR chaining code wrong. The convoluted way the DDK samples show how to do ISR chaining may be part of their confusion. The only way around it is to be sure you are in front of them in the chain. As far as I can see there is no documented way to do this, but it can be done if it must though I would not advocate it.

The DDK kbfiltr/moufiltr has the below convoluted and confusing chaining code:

if (IsrHook) {
retVal = (*IsrHook) (…);

if (!retVal || !(*ContinueProcessing)) {
return retVal;
}
}

*ContinueProcessing = TRUE;

return retVal;

It could be more cleanly and concisely be written as:

if (IsrHook)
retVal = (*IsrHook)(…);
else
*ContinueProcessing = TRUE;

return retVal;


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

Oh, it’s a lot older than that. Timeless, really.

Just in case the op is having thoughts of replacing the keyboard driver to
attempt to hack this up, this would almost certainly break other things and
the EULA frowns on this sort of thing anyway, I believe.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Sunday, July 25, 2010 6:31 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How can I make a keyboard filter driver first in line

The answer is you have no way to control this. Think about it, if you did
have a way to say you are first and another driver did the same what would
be the result. If you want more information, go back through the archives
this question is as old as this list.

Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

-----Original Message-----
From: xxxxx@hotmail.com [mailto:xxxxx@hotmail.com] Posted At: Sunday,
July 25, 2010 5:50 PM Posted To: ntdev
Conversation: How can I make a keyboard filter driver first in line
Subject: How can I make a keyboard filter driver first in line

I’m playing around with the code which I found on the net that filters
keyboard scancodes. I would like to be the first filter driver to
receive the
scan code before they are passed on to the next lower filter driver. I
am
assuming that the first filter driver to receive the scancode is the
lowest on
the chain ? Can this be done and if yes how can I go about doing this
? Thanks
in advance. Just a side note I’m quite new to window driver
development so
please be patient.

Thanks in advance

Victor

__________ Information from ESET Smart Security, version of virus
signature
database 5311 (20100725) __________

The message was checked by ESET Smart Security.

http://www.eset.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

Yes Doron I am working with both Klog and kbfiltr. Thanks for the replies everyone.

No idea what klog is or where you got it from, so you are on your own there.

d

dent from a phpne with no keynoard

-----Original Message-----
From: xxxxx@hotmail.com
Sent: July 28, 2010 5:08 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How can I make a keyboard filter driver first in line

Yes Doron I am working with both Klog and kbfiltr. Thanks for the replies everyone.


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