When does IRP cancel routines get called? Will not EvtDeviceReleaseHardware() get called if one of

Discussion in 'Windows Vista Drivers' started by Praveen Kumar Amritaluru, Nov 15, 2006.

  1. Hi,

    When I disable my driver, my event callback routines registered with KMDF
    get invoked.
    The driver receives IRP_MN_QUERY_REMOVE and once the callback routine
    processes this IRP
    and returns (is completed), the cancel routine that my driver registered
    for IRPs that were received by
    driver earlier get called for a no. of times.


    Question:
    1. Who calls this cancel routine? Is it some application shipped along with
    my driver package or the PnP/IO manager
    takes care of calling cancellation routines for all my IRPs that my
    driver had not completed earlier?

    Does PnP/IO manager know that my driver is getting disabled(removed) and
    hence invokes cancel routines for all
    the IRPs that was not completed earlier by the driver?
    Does OS keep track of all these IRPs not completed? Or is the framework?



    2. Once these cancel routines are executed, I dont see
    EvtDeviceReleaseHardware() getting executed.
    Is my driver EvtDeviceReleaseHardware() not getting executed because the
    driver did not complete all the IRPs when the
    cancel routine got called?

    Is this the reason why disable of driver did not go through throwing out a
    message:
    "Hardware settings have changed. System needs to be restarted".


    Regards,
    -Praveen
     
    Praveen Kumar Amritaluru, Nov 15, 2006
    #1
    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.