Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > KbFilter_ServiceCallback -- inserting and deleting packets

Reply
Thread Tools Display Modes

KbFilter_ServiceCallback -- inserting and deleting packets

 
 
Starlight
Guest
Posts: n/a

 
      05-03-2010
Hello,

Presently I'm adapting a simple 'kbfiltr.sys' driver. Have it working and
performing some modifications in the scan-code/key-press stream.

Now would like to insert and delete packets from the stream. No luck
finding an example of how exactly it's done. Seems the incoming packet array
is typically a section of a ring queue, but have no way to know when to wrap
the pointers or where the beginning of the buffer lies. Don't see a way to
replace the buffer either. Is it possible to insert an event? Or are the
comments misleading in this regard? Does one perhaps have to hold DataEnd as
constant and adjust the entries that precede it and the count? If so ring
wrap remains a concern.

Thanks,

 
Reply With Quote
 
 
 
 
Ray Trent
Guest
Posts: n/a

 
      05-03-2010
Umm, if you're a filter you can do anything you want with that buffer, including discarding it
entirely and sending exactly whatever keystrokes you want when you call the higher-level callback.

You typically just replace the mouclass callback in the IRP when it's registered with your own
callback, and save the pointer so you can call it when you want to. Then the lower-level driver only
sees your callback and you have full control of the data that is passed up.

On 5/3/2010 2:03 PM, Starlight wrote:
> Hello,
>
> Presently I'm adapting a simple 'kbfiltr.sys' driver. Have it working and
> performing some modifications in the scan-code/key-press stream.
>
> Now would like to insert and delete packets from the stream. No luck
> finding an example of how exactly it's done. Seems the incoming packet array
> is typically a section of a ring queue, but have no way to know when to wrap
> the pointers or where the beginning of the buffer lies. Don't see a way to
> replace the buffer either. Is it possible to insert an event? Or are the
> comments misleading in this regard? Does one perhaps have to hold DataEnd as
> constant and adjust the entries that precede it and the count? If so ring
> wrap remains a concern.
>
> Thanks,
>



--
Ray
 
Reply With Quote
 
Starlight
Guest
Posts: n/a

 
      05-04-2010
Oh cancel my pointless question!

Too may interruptions the last couple of days--my brain stuttered over the
call that passes packets to the next layer, thinking that changes had to be
made in place. Obviously one can construct and pass a new key-press packet
array to the next layer.

 
Reply With Quote
 
Starlight
Guest
Posts: n/a

 
      05-04-2010
Thank you for replying Ray--much appreciated. Sorry I didn't unconfound
myself my faster and save you effort.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
chkdsk : NTFS on Vista x64 Nigel Windows Vista File Management 5 06-02-2008 02:02 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59