how to determine if given IRP is completed?

Discussion in 'Windows Vista Drivers' started by Isajanyan, Jun 4, 2005.

  1. Isajanyan

    Isajanyan Guest

    Hi,

    Could anyone tell me how to determine if given IRP is completed?
    Here is my problem: I have a keyboard filter driver based on Ctrl2Cap from
    sysinternals.
    I need it to generate keystrokes. In order to do that I hold a global
    pointer to the last IRP passed to the lower driver in stack and if there is a
    need to generate a keystroke I complete that IRP, the IO manager creates and
    sends another IRP to me which I fill with the data, complete and return
    without passing it down (is this method right by the way, if not which is the
    right method?). The bugcheck sometimes occur when I complete the globally
    saved IRP which has been already completed by lower driver in stack, that's
    why I'm thinking of checking somehow if IRP has been completed and complete
    it only if it has not.

    Any suggestions are welcome, thanks to everyone.
     
    Isajanyan, Jun 4, 2005
    #1
    1. Advertisements

  2. use kbfiltr instead. for your scheme to work, you need to catch the read
    irp, send your own read irp down teh stack and complete teh caught read irp
    when either
    a) you have your own data to report
    or
    b) the lower stack has data to report via the irp you sent

    in either case, if there is no pending irp, you have to store teh data in a
    buffer and then complete the incoming read irp immediately if you have
    stored data.

    all of this complexity goes away if you use kbfiltr and just invoke the
    upper service callback routine when you have data to report.

    d
     
    Doron Holan [MS], Jun 4, 2005
    #2
    1. Advertisements

  3. Isajanyan

    Isajanyan Guest

    Doron, thank you very much for your answer. Ok, so it seems there is no way
    to determine if the IRP is completed and my approach was wrong.
    I considered using kbfiltr, but the installation of that driver seems to be
    different (it requires using device manager, which is unacceptable in my
    case). Could you please give me some info on how to install it
    programmatically either using inf file or without (if possible)?
    Thanks again
     
    Isajanyan, Jun 4, 2005
    #3
  4. look at the sources for devcon, which basically is a cmd line device
    manager-like tool. from there you can update the device's drivers.

    d

    --
    Please do not send e-mail directly to this alias. this alias is for
    newsgroup purposes only.
    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Doron Holan [MS], Jun 4, 2005
    #4
  5. Isajanyan

    Isajanyan Guest

    Thank you very much.



     
    Isajanyan, Jun 4, 2005
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.