Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


keyboard filter missing Irp completion

OSR_Community_UserOSR_Community_User Member Posts: 110,217
I have a keyboard filter running under NT 4.0 and everything works fine
with one exception. I'm monitoring keystrokes by looking at the IRP_MJ_READ
IRPs moving through my driver. My problem is the very first keystroke that
occurs after my driver loads. Debug statements show that the IRP for the
"key down" does enter my read routine, my IRP completion routine is
successfully set and then the IRP is successfully passed down to the
filtered device. However, I never see the IRP in the completion routine
(which is where the keyboard data is actually available). This only happens
on the very first IRP. The corresponding "key up" IRP for that first
keystroke is seen in both my read and my completion routines. Every
following keystroke also works correctly.

More info:
1) When I set my completion routine, I pass TRUE for the three InvokeOnXxx
parameters.
2) This problem occurs whether I load the driver during boot or load it
dynamically later after a user has logged on.
3) The first keystroke doesn't have to be a "real" key - it does the same
thing whether it is an alphabetic key or something like the CTRL or SHIFT
key.
4) Which service pack is installed doesn't make a difference - I've tried 3
different ones and they all (mis)behave the same.

Any and all help will be greatly appreciated.

Judy Labovitz

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    You should start your driver before the system thread makes first
    IRP_MJ_READ. For example, you can start your filter on boot just after
    kbdclass in Keyboard Class group.

    ---------
    Bye,
    Sab


    > -----Original Message-----
    > From: [email protected] [SMTP:[email protected]]
    > Sent: Friday, May 12, 2000 10:45 AM
    > To: NT Developers Interest List
    > Subject: [ntdev] keyboard filter missing Irp completion
    >
    > I have a keyboard filter running under NT 4.0 and everything works
    > fine
    > with one exception. I'm monitoring keystrokes by looking at the
    > IRP_MJ_READ
    > IRPs moving through my driver. My problem is the very first keystroke
    > that
    > occurs after my driver loads. Debug statements show that the IRP for
    > the
    > "key down" does enter my read routine, my IRP completion routine is
    > successfully set and then the IRP is successfully passed down to the
    > filtered device. However, I never see the IRP in the completion
    > routine
    > (which is where the keyboard data is actually available). This only
    > happens
    > on the very first IRP. The corresponding "key up" IRP for that first
    > keystroke is seen in both my read and my completion routines. Every
    > following keystroke also works correctly.
    >
    > More info:
    > 1) When I set my completion routine, I pass TRUE for the three
    > InvokeOnXxx
    > parameters.
    > 2) This problem occurs whether I load the driver during boot or load
    > it
    > dynamically later after a user has logged on.
    > 3) The first keystroke doesn't have to be a "real" key - it does the
    > same
    > thing whether it is an alphabetic key or something like the CTRL or
    > SHIFT
    > key.
    > 4) Which service pack is installed doesn't make a difference - I've
    > tried 3
    > different ones and they all (mis)behave the same.
    >
    > Any and all help will be greatly appreciated.
    >
    > Judy Labovitz
    >
    >
    > ---
    > You are currently subscribed to ntdev as: [email protected]
    > To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    I don't think this is the problem. I'm not missing that first IRP_MJ_READ
    in my filter. The io completion routine I set when I process that very
    first read is never called. If the completion routine is never called, I
    never get the keyboard data.

    Judy

    On 05/12/00, ""Sasha Bublik - (BS)" " wrote:
    > You should start your driver before the system thread makes first
    > IRP_MJ_READ. For example, you can start your filter on boot just after
    > kbdclass in Keyboard Class group.
    >
    > > I have a keyboard filter running under NT 4.0 and everything works
    > > fine
    > > with one exception. I'm monitoring keystrokes by looking at the
    > > IRP_MJ_READ
    > > IRPs moving through my driver. My problem is the very first keystroke
    > > that
    > > occurs after my driver loads. Debug statements show that the IRP for
    > > the
    > > "key down" does enter my read routine, my IRP completion routine is
    > > successfully set and then the IRP is successfully passed down to the
    > > filtered device. However, I never see the IRP in the completion
    > > routine
    > > (which is where the keyboard data is actually available). This only
    > > happens
    > > on the very first IRP. The corresponding "key up" IRP for that first
    > > keystroke is seen in both my read and my completion routines. Every
    > > following keystroke also works correctly.
    > >
    > > More info:
    > > 1) When I set my completion routine, I pass TRUE for the three
    > > InvokeOnXxx
    > > parameters.
    > > 2) This problem occurs whether I load the driver during boot or load
    > > it
    > > dynamically later after a user has logged on.
    > > 3) The first keystroke doesn't have to be a "real" key - it does the
    > > same
    > > thing whether it is an alphabetic key or something like the CTRL or
    > > SHIFT
    > > key.
    > > 4) Which service pack is installed doesn't make a difference - I've
    > > tried 3
    > > different ones and they all (mis)behave the same.
    > >
    > > Any and all help will be greatly appreciated.
    > >
    > > Judy Labovitz
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Then your problem is very strange. I don't have any problems with my
    keyboard filter. However I would suggest to check the problem which I've
    described.

    ---------
    Bye,
    Sab


    > -----Original Message-----
    > From: [email protected] [SMTP:[email protected]]
    > Sent: Friday, May 12, 2000 4:23 PM
    > To: NT Developers Interest List
    > Subject: [ntdev] RE: keyboard filter missing Irp completion
    >
    > I don't think this is the problem. I'm not missing that first
    > IRP_MJ_READ
    > in my filter. The io completion routine I set when I process that very
    >
    > first read is never called. If the completion routine is never called,
    > I
    > never get the keyboard data.
    >
    > Judy
    >
    > On 05/12/00, ""Sasha Bublik - (BS)" " wrote:
    > > You should start your driver before the system thread makes first
    > > IRP_MJ_READ. For example, you can start your filter on boot just
    > after
    > > kbdclass in Keyboard Class group.
    > >
    > > > I have a keyboard filter running under NT 4.0 and everything works
    > > > fine
    > > > with one exception. I'm monitoring keystrokes by looking at the
    > > > IRP_MJ_READ
    > > > IRPs moving through my driver. My problem is the very first
    > keystroke
    > > > that
    > > > occurs after my driver loads. Debug statements show that the IRP
    > for
    > > > the
    > > > "key down" does enter my read routine, my IRP completion routine
    > is
    > > > successfully set and then the IRP is successfully passed down to
    > the
    > > > filtered device. However, I never see the IRP in the completion
    > > > routine
    > > > (which is where the keyboard data is actually available). This
    > only
    > > > happens
    > > > on the very first IRP. The corresponding "key up" IRP for that
    > first
    > > > keystroke is seen in both my read and my completion routines.
    > Every
    > > > following keystroke also works correctly.
    > > >
    > > > More info:
    > > > 1) When I set my completion routine, I pass TRUE for the three
    > > > InvokeOnXxx
    > > > parameters.
    > > > 2) This problem occurs whether I load the driver during boot or
    > load
    > > > it
    > > > dynamically later after a user has logged on.
    > > > 3) The first keystroke doesn't have to be a "real" key - it does
    > the
    > > > same
    > > > thing whether it is an alphabetic key or something like the CTRL
    > or
    > > > SHIFT
    > > > key.
    > > > 4) Which service pack is installed doesn't make a difference -
    > I've
    > > > tried 3
    > > > different ones and they all (mis)behave the same.
    > > >
    > > > Any and all help will be greatly appreciated.
    > > >
    > > > Judy Labovitz
    >
    > ---
    > You are currently subscribed to ntdev as: [email protected]
    > To unsubscribe send a blank email to $subst('Email.Unsub')
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 20-24 May 2024 Live, Online