none
EvtIoQueryRemove not firing when IOTarget of interface is surprise removed RRS feed

  • Question

  • Hello experts.  I have written 2 drivers - one is a  software-only driver that registers for notifications from another pnp driver on the PCIe bus, the other is well, a PnP PCIe (Thunderbolt) device driver .  Upon reception of the GUID_DEVICE_INTERFACE_ARRIVAL (triggered from the PnP driver exposing a basically unused device interface) the sw driver calls WdfIoTargetCreate() and opens the IoTarget using the symbolic name of the PnP device that triggered the arrival notification.  When opening the IoTarget, the sw-driver, populates the callbacks, EvtIoTargetQueryRemove, EvtIoTargetRemoveCancelled etc.  The sw-driver's QueryRemove callback is fired when the PnP driver is disabled in device manager but does not fire when the PnP device driver is surprise removed (actually a thunderbolt device).  I have overridden the surprise removal callback in the PCIe driver but have found no API like "WdfRemoveQueryInterface() and am not sure what action to take to to trigger a relatively graceful teardown of the query interface.  The drivers are not layered or otherwise related in any way exceptt for the query interface. 

    Any suggestions are greatly appreciated...

    -wade

    Tuesday, October 28, 2014 4:53 PM

Answers

  • EvtIoTargetQueryRemove will only be called on a graceful remove which gives you the change to reject the query. a surprise remove has no query, no chance for veto, EvtIoTargetRemoveComplete  will be called without EvtIoTargetQueryRemove  beforehand.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, October 28, 2014 5:17 PM