Lower level filter

Hi,
Sample code for upper-level keyboard filter (kbfiltr.c) is available in the DDK src/input/kbfiltr.

Do we have any sample code for lower-level filter for keyboard.

Regards.
Joshua

What do you want to do with the keyboard lower filter? For instance, a lower filter on a ps2 keyboard makes no sense b/c you won’t see any i/o IRPs. On the other hand, a filter below kbdhid for a HID keyboard would allow you to filter HID data. So knowing what you want to filter and why you believe filtering below the FDO is the right way to go will help in figuring out what direction we can point you in.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, November 27, 2007 10:00 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Lower level filter

Hi,
Sample code for upper-level keyboard filter (kbfiltr.c) is available in the DDK src/input/kbfiltr.

Do we have any sample code for lower-level filter for keyboard.

Regards.
Joshua


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

Hi,

I receive keyboard scan codes data through serial port and write to
a buffer and I want to transfer the scan code to the kbdclass service
callback routine.

What I thought is to create a upper filter to serenum and lower filter to
the kbdclass so that I can transfer the scan code that is received from
serial port to kbdclass.

Can you please help me on this ?

Regards,
J. Joshua David

On 11/28/07, xxxxx@gmail.com wrote:
>
> Hi,
> Sample code for upper-level keyboard filter (kbfiltr.c) is available in
> the DDK src/input/kbfiltr.
>
> Do we have any sample code for lower-level filter for keyboard.
>
> Regards.
> Joshua
>
> —
> 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
>

Does serenum detect and enumerate a device ? if you view by connection in device manager and look at the serial port, is there a child device off of it?

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Joshua David
Sent: Tuesday, November 27, 2007 11:35 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Lower level filter

Hi,

I receive keyboard scan codes data through serial port and write to a buffer and I want to transfer the scan code to the kbdclass service callback routine.

What I thought is to create a upper filter to serenum and lower filter to the kbdclass so that I can transfer the scan code that is received from serial port to kbdclass.

Can you please help me on this ?

Regards,
J. Joshua David

On 11/28/07, xxxxx@gmail.commailto:xxxxx > wrote:
Hi,
Sample code for upper-level keyboard filter (kbfiltr.c) is available in the DDK src/input/kbfiltr.

Do we have any sample code for lower-level filter for keyboard.

Regards.
Joshua


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

— 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>

Serenum is for a PCI based serial port(device) that enumerates the serial
ports available on the PCI card.
I receive serial data (scan codes) from another program that simulates the
keyboard data.

How do I transfer the data (scan codes) received serially to the I/O
manager.
my idea is to fill the “InputDataStart” buffer call the keyboard service
callback. Is this right idea ?

Please help.

On 11/28/07, Doron Holan wrote:
>
> Does serenum detect and enumerate a device ? if you view by connection
> in device manager and look at the serial port, is there a child device off
> of it?
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *Joshua David
> Sent: Tuesday, November 27, 2007 11:35 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Lower level filter
>
>
>
> Hi,
>
>
>
> I receive keyboard scan codes data through serial port and write to
> a buffer and I want to transfer the scan code to the kbdclass service
> callback routine.
>
>
>
> What I thought is to create a upper filter to serenum and lower filter to
> the kbdclass so that I can transfer the scan code that is received from
> serial port to kbdclass.
>
>
>
> Can you please help me on this ?
>
>
>
> Regards,
>
> J. Joshua David
>
>
>
> On 11/28/07, xxxxx@gmail.com wrote:
>
> Hi,
> Sample code for upper-level keyboard filter (kbfiltr.c) is available in
> the DDK src/input/kbfiltr.
>
> Do we have any sample code for lower-level filter for keyboard.
>
> Regards.
> Joshua
>
> —
> 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
>
>
> — 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
>
> —
> 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
>

> Sample code for upper-level keyboard filter (kbfiltr.c) is available in the

DDK src/input/kbfiltr. Do we have any sample code for lower-level filter for keyboard.

You cannot really have a filter for kbdclass itself, because kbdclass it is not a FDO - it is an upper filter itself , at least in PnP terms (assuming PS2 stack, it attaches itself to the stack where i8042prt is FDO). Therefore, no matter if you attach your filter above or below kbdclass, it will alway be an upper filter for underlying FDO. Filter sample that comes with WDK attaches itself below kbdclass, and, if I got it right, this is exactly what you need here - you just got mislead by the term “upper fiilter”…

Anton Bassov

To answer your question, you don’t want a filter driver, you want a
keyboard *port* driver. There are a number of discussions on how to do
this in the list archives.

xxxxx@gmail.com wrote:

Hi,
Sample code for upper-level keyboard filter (kbfiltr.c) is available in the DDK src/input/kbfiltr.

Do we have any sample code for lower-level filter for keyboard.

Regards.
Joshua


Ray
(If you want to reply to me off list, please remove “spamblock.” from my
email address)

> To answer your question, you don’t want a filter driver, you want a keyboard *port* driver.

… or just a user-mode helper app. What he has to do in order to simulate the keystrokes is either:

A Emulate a separate kbd stack properly, so that kbdclass attaches its device to it and registers its callbacks. I think this is a bit too much work to do - an easier option is available.

B. Send simulated keystrokes to the user-mode helper app that injects them into an input queue with SendInput(). I think this is a better option - after all, this is the kind of thing that is really easy to implement with inverted calls…

Anton Bassov

The UM helper application does not help if you want to inject the SAS (e.g. Ctrl+Alt+Delete) and have it work. There are also issues with UAC IIRC. If the device on the other end of the serial port is serial enumerable (E.g. serenum creates a child stack for it), you don’t have to create a 2nd keyboard stack. You can use the serenum enumerated stack as the keyboard stack.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Wednesday, November 28, 2007 9:15 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Lower level filter

To answer your question, you don’t want a filter driver, you want a keyboard *port* driver.

… or just a user-mode helper app. What he has to do in order to simulate the keystrokes is either:

A Emulate a separate kbd stack properly, so that kbdclass attaches its device to it and registers its callbacks. I think this is a bit too much work to do - an easier option is available.

B. Send simulated keystrokes to the user-mode helper app that injects them into an input queue with SendInput(). I think this is a better option - after all, this is the kind of thing that is really easy to implement with inverted calls…

Anton Bassov


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 UM helper application does not help if you want to inject the SAS

(e.g. Ctrl+Alt+Delete) and have it work.

Sure. However, I think Ctrl+Alt+Delete is not a kind of combination that you would normally expect to receive via a serial port (in fact, from any source, other than a physical kbd.)…

If the device on the other end of the serial port is serial enumerable
(E.g. serenum creates a child stack for it), you don’t have to create a 2nd
keyboard stack. You can use the serenum enumerated stack as the keyboard stack.

Well, although you don’t have to create the stack itself (i.e. PDO), you still have to create a FDO so that kbd class can attach its device to it, so that the vast majority of work still has to be done by your driver, rather than by serenum…

Anton Bassov

Dear All,

Thank you for your inputs.
Dear Doron,

How can I make the serenum enumerated stack as the keyboard stack. Can you please explain me in detail.

Regards,
J. Joshua

You need to write an INF for the device. The HW ID you will use will be the HWID generated by serenum. To see that IDs generated by serenum, open up device manager, view by connection and then find the child device enumerated by serenum (the COM port will be its parent). Open up the properties of the child device and then goto the Details tab and in the Property list box, choose “Hardware Ids”. You see some strings, pick the first one and copy it. Put that in the INF as the HW ID to match for. The INF’s class will be

Class=Keyboard
ClassGUID={4D36E96B-E325-11CE-BFC1-08002BE10318}

And then you will install your driver as the FDO in the normal fashion (no filter required) acting as the keyboard “port” driver.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, December 05, 2007 5:46 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Lower level filter

Dear All,

Thank you for your inputs.
Dear Doron,

How can I make the serenum enumerated stack as the keyboard stack. Can you please explain me in detail.

Regards,
J. Joshua


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

Hi Guys,

Thank you for your support, I am able to send data to kbfiltr from user app.

Regards,
J. Joshua David