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