abt keyboard IRP_MJ_READ

Hi ppl…want some info. abt the IRP_MJ_READ for the
keyboard…wat i have read is that wen we press the
key, the make code of key is in
irp->assosiatedirp.systembuffer. Well, if that is so,
then a filter driver should be able to get the
required scan code from this fixed part of the IRP. I
am doing
Key=(PKEYBOARD_INPUT_DATA)
irp->associatedirp.systembuffer.

and then writing this into a file. This is something
exactly shown in the ZWCREATE example. Only thing is
that I am doing this in the dispatch routine of
IRP_MJ_READ instead of completion routine. After doing
the above, i close the file and call the next level
driver that is the keyboard class…well, the problem
is that it isnt working :(…i think there is some
problem from where i am picking the scan codes…any
help and suggestion is greatly appreciated…

with regards
Arijit

The scan codes are placed in the buffer only in the completion of the
read request. Furthermore, the buffer being returned is an array of
KEYBOARD_INPUT_DATA, not just a solitary instance of the structure. You
must look at irp->IoStatus.Information to see how many instances of the
structure are being returned (numInstances =
irp->IoStatus.Information/sizeof(KEYBOARD_INPUT_DATA)).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Arijit
Bhattacharrya
Sent: Wednesday, August 18, 2004 2:09 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] abt keyboard IRP_MJ_READ

Hi ppl…want some info. abt the IRP_MJ_READ for the
keyboard…wat i have read is that wen we press the
key, the make code of key is in
irp->assosiatedirp.systembuffer. Well, if that is so,
then a filter driver should be able to get the
required scan code from this fixed part of the IRP. I
am doing
Key=(PKEYBOARD_INPUT_DATA)
irp->associatedirp.systembuffer.

and then writing this into a file. This is something
exactly shown in the ZWCREATE example. Only thing is
that I am doing this in the dispatch routine of
IRP_MJ_READ instead of completion routine. After doing
the above, i close the file and call the next level
driver that is the keyboard class…well, the problem
is that it isnt working :(…i think there is some
problem from where i am picking the scan codes…any
help and suggestion is greatly appreciated…

with regards
Arijit


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi d

Ok…i get ur point…but then there is another problem. The point is that
if the scan codes are being put “after” the read request is completed,
then that means that I have to use the Zwxxx functions in the completion
routine of the filter driver. This is not possible since Zwxxx routines
run at IRP_PASSIVE level and the completion routines run in IRP_DISPATCH
level. How to get over this problem??

waiting for an answer

Arijit

The scan codes are placed in the buffer only in the completion of the
read request. Furthermore, the buffer being returned is an array of
KEYBOARD_INPUT_DATA, not just a solitary instance of the structure. You
must look at irp->IoStatus.Information to see how many instances of the
structure are being returned (numInstances
irp->IoStatus.Information/sizeof(KEYBOARD_INPUT_DATA)).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Arijit
Bhattacharrya
Sent: Wednesday, August 18, 2004 2:09 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] abt keyboard IRP_MJ_READ

Hi ppl…want some info. abt the IRP_MJ_READ for the
keyboard…wat i have read is that wen we press the
key, the make code of key is in
irp->assosiatedirp.systembuffer. Well, if that is so,
then a filter driver should be able to get the
required scan code from this fixed part of the IRP. I
am doing
Key=(PKEYBOARD_INPUT_DATA)
irp->associatedirp.systembuffer.

and then writing this into a file. This is something
exactly shown in the ZWCREATE example. Only thing is
that I am doing this in the dispatch routine of
IRP_MJ_READ instead of completion routine. After doing
the above, i close the file and call the next level
driver that is the keyboard class…well, the problem
is that it isnt working :(…i think there is some
problem from where i am picking the scan codes…any
help and suggestion is greatly appreciated…

with regards
Arijit


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi again

I solved my problem…saving the scancodes in the device context was
supposedly a good idea :). ok…but still i want to know abt some clean up
stuff. My driver works properly when i register and start the driver using
OSR loader…but the problem is that when I stop the driver…the next
keystroke causes a system reboot…i have duly detached and deleted the
device object for the filter driver in the unload routine…but the
problem persists…can anyone tell me more abt wat extra i should take
care when unloading??..the system reboot is particularly annoying :frowning:

with regards
Arijit

Hi d

Ok…i get ur point…but then there is another problem. The point is that
if the scan codes are being put “after” the read request is completed,
then that means that I have to use the Zwxxx functions in the completion
routine of the filter driver. This is not possible since Zwxxx routines
run at IRP_PASSIVE level and the completion routines run in IRP_DISPATCH
level. How to get over this problem??

waiting for an answer

Arijit
> The scan codes are placed in the buffer only in the completion of the
> read request. Furthermore, the buffer being returned is an array of
> KEYBOARD_INPUT_DATA, not just a solitary instance of the structure. You
> must look at irp->IoStatus.Information to see how many instances of the
> structure are being returned (numInstances
> irp->IoStatus.Information/sizeof(KEYBOARD_INPUT_DATA)).
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Arijit
> Bhattacharrya
> Sent: Wednesday, August 18, 2004 2:09 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] abt keyboard IRP_MJ_READ
>
> Hi ppl…want some info. abt the IRP_MJ_READ for the
> keyboard…wat i have read is that wen we press the
> key, the make code of key is in
> irp->assosiatedirp.systembuffer. Well, if that is so,
> then a filter driver should be able to get the
> required scan code from this fixed part of the IRP. I
> am doing
> Key=(PKEYBOARD_INPUT_DATA)
> irp->associatedirp.systembuffer.
>
> and then writing this into a file. This is something
> exactly shown in the ZWCREATE example. Only thing is
> that I am doing this in the dispatch routine of
> IRP_MJ_READ instead of completion routine. After doing
> the above, i close the file and call the next level
> driver that is the keyboard class…well, the problem
> is that it isnt working :(…i think there is some
> problem from where i am picking the scan codes…any
> help and suggestion is greatly appreciated…
>
> with regards
> Arijit
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
> ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
> ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Either you have your own thread which you signal or you queue a work
item which you preallocated. I would create my own ring buffer, update
the entries when the read completes, and then signal the worker
thread/item. If you are going this route, you might as well hook into
the service callback chain *below* kbdclass so you don’t have to deal
with IRPs at all, rather you can get called directly via a function
pointer with the data. See kbdfiltr in the ddk.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Arijit
Bhattacharrya
Sent: Thursday, August 19, 2004 1:50 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] abt keyboard IRP_MJ_READ

Hi d

Ok…i get ur point…but then there is another problem. The point is that
if the scan codes are being put “after” the read request is completed,
then that means that I have to use the Zwxxx functions in the completion
routine of the filter driver. This is not possible since Zwxxx routines
run at IRP_PASSIVE level and the completion routines run in IRP_DISPATCH
level. How to get over this problem??

waiting for an answer

Arijit

The scan codes are placed in the buffer only in the completion of the
read request. Furthermore, the buffer being returned is an array of
KEYBOARD_INPUT_DATA, not just a solitary instance of the structure.
You
must look at irp->IoStatus.Information to see how many instances of
the
structure are being returned (numInstances
irp->IoStatus.Information/sizeof(KEYBOARD_INPUT_DATA)).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Arijit
Bhattacharrya
Sent: Wednesday, August 18, 2004 2:09 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] abt keyboard IRP_MJ_READ

Hi ppl…want some info. abt the IRP_MJ_READ for the
keyboard…wat i have read is that wen we press the
key, the make code of key is in
irp->assosiatedirp.systembuffer. Well, if that is so,
then a filter driver should be able to get the
required scan code from this fixed part of the IRP. I
am doing
Key=(PKEYBOARD_INPUT_DATA)
irp->associatedirp.systembuffer.

and then writing this into a file. This is something
exactly shown in the ZWCREATE example. Only thing is
that I am doing this in the dispatch routine of
IRP_MJ_READ instead of completion routine. After doing
the above, i close the file and call the next level
driver that is the keyboard class…well, the problem
is that it isnt working :(…i think there is some
problem from where i am picking the scan codes…any
help and suggestion is greatly appreciated…

with regards
Arijit


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com