Changing Irp->IoStatus.Status in a completion routine

Discussion in 'Windows Vista Drivers' started by Jeff, Feb 14, 2008.

  1. Jeff

    Jeff Guest

    Hi again,

    I have one more question. Is it ok to change Irp->IoStatus.Status from
    STATUS_SUCCESS to an error code in a completion routine? I've found lots of
    information about completion routines, marking Irps pending and returning
    STATUS_CONTINUE_COMPLETION or STATUS_MORE_PROCESSING_REQUIRED but so far
    nothing that tells me if I can legally change the Irp->IoStatus.Status
    value.

    If we can do this, do we need to do anything else like complete the request
    again, or changing the status value ok.

    TIA,

    Jeff.
     
    Jeff, Feb 14, 2008
    #1
    1. Advertisements

  2. yes, it is valid to change the status.

    d
     
    Doron Holan [MSFT], Feb 14, 2008
    #2
    1. Advertisements

  3. As long as the dispatch routine returns the same status OR STATUS_PENDING.

    So if you think you may change the IRP status in your completion routine you
    should return STATUS_PENDING in your dispatch routine (and mark the IRP
    pending, etc...)

    The verifier will get pissy if the dispatch routine and the IO status block
    contain different values on completion (except for the pending case)

    -p
     
    Peter Wieland [MSFT], Feb 14, 2008
    #3
  4. Jeff

    Jeff Guest

    Just what I needed! Thank you both for your answers.

    Carl
     
    Jeff, Feb 15, 2008
    #4
    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.