question from IRP Cheat Sheet 1 ==> Scenario 2 ) Forward and Wait

Discussion in 'Windows Vista Drivers' started by M Taha Masood, Aug 17, 2004.

  1. Hello,
    I have questions regarding the IRP cheat sheet's Scenario 2 , Forward
    and Wait.
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;320275

    could somebody pls clarify these

    thanks
    Taha

    Question 1 )
    ------------

    in DispatchRoutine_2 ( ...
    if (status == STATUS_PENDING) {

    does this return value of STATUS_PENDING mean that the completion
    routine of some lower level driver
    would have returned STATUS_MORE_PROCESSING_REQUIRED?



    Question 2)
    -----------

    in DispatchRoutine_2 ( ...
    IoCompleteRequest (Irp, IO_NO_INCREMENT);
    return status;

    i) What control flow will the call to IoCompleteRequest initiate?
    ii) To whom will the "return status;" statement give control

    How are i) and ii) above inter-related?
     
    M Taha Masood, Aug 17, 2004
    #1
    1. Advertisements

  2. M Taha Masood

    Calvin Guan Guest

    in DispatchRoutine_2 ( ...
    It means the lower driver had returned STATUS_PENDING from its dispatch
    routine.
    It just resumes the IRP completion since the completion routine has returned
    SMPR. I'd recommend Walter's WDM book which has a detailed description on
    how this works. Before his book, I have to reverse engineer the
    IoCompleteRequest to get my filter driver right.
    Return to the guy who called IoCallDriver to the driver.

    HTH,
    Calvin
    -
    Calvin Guan Software Engineer
    ATI Technologies Inc. www.ati.com
     
    Calvin Guan, Aug 17, 2004
    #2
    1. Advertisements

  3. No, it means the dispatch routine returned STATUS_PENDING.
    This will return to the caller; it could be the IO manager or it could
    (indirectly) be a higher-level driver.

    STATUS_MORE_PROCESSING_REQUIRED is a value that is returned by
    completion routines, not dispatch routines. Typically, if a driver must
    pass an IRP down to another driver via IoCallDriver(), it will set a
    completion routine so it can do any post-processing it needs to do.

    That completion routine can return either
    STATUS_MORE_PROCESSING_REQUIRED, meaning that you are not yet ready to
    call IoCompleteRequest(), or STATUS_CONTINUE_COMPLETION, meaning that
    you are done with the IRP and the IO manager can continue calling
    completion routines above you. Note that if you return MORE_PROCESSING,
    you have to manually re-initiate completion at some point.

    Walter Oney's WDM book has as good of a reference on IRP completion as
    I've seen; re-read it until it makes sense. Also, read the DDK docs on
    completing an IRP, and look at some samples. Finally, if you can find a
    powerpoint presentation by Adrian Oney in the WinHEC docs from a couple
    of years ago about IRP completion, that has a really fantastic
    description of the IoMarkIrpPending() protocol.


































    -sd
     
    Steve Dispensa [MVP], Aug 17, 2004
    #3
    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.