none
The order of callback call when setting a device as WdfDeviceSetFailed(device, WdfDeviceFailedAttemptRestart) RRS feed

  • Question

  • Hi,

    In my driver there is a case I set the device as YB with attempt to restart the device: WdfDeviceSetFailed(device, WdfDeviceFailedAttemptRestart).

    As documented, this will cause the SurpriseRemoval callback to be called. right? Does the WdfDeviceFailedAttemptRestart flag will cause the EVT_WDF_DRIVER_DEVICE_ADD to be called? If so, how these two callbacks are called? in parallel? or can I assume that SurpriseRemove will be called first and only after it finish to run the EVT_DEVICE_ADD callback could be called? 

    Thanks,

    Shosho


    • Edited by Shosho Gold Thursday, March 31, 2016 5:00 AM
    Thursday, March 31, 2016 4:59 AM

Answers

  • the original device will power down, so you will see the normal power down callbacks. if there are no open handles, the original WDFDEVICE will be destroyed. If the underlying bus driver supports restart, you will then see a new EvtDriverDeviceAdd() call. If there are open handles, EvtDriverDeviceAdd will be called before the original WDFDEVICE is destroyed

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

    Thursday, March 31, 2016 7:14 AM

All replies

  • the original device will power down, so you will see the normal power down callbacks. if there are no open handles, the original WDFDEVICE will be destroyed. If the underlying bus driver supports restart, you will then see a new EvtDriverDeviceAdd() call. If there are open handles, EvtDriverDeviceAdd will be called before the original WDFDEVICE is destroyed

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

    Thursday, March 31, 2016 7:14 AM
  • if there are open handles, does the EvtDeviceAdd() could be called before EvtDeviceSurpriseRemoval() is called or the order will be like this: EvtDeviceSurpriseRemoval(), D0Exit(), EvtDeviceAdd(), Destroy() for the previous device?  

    Friday, April 1, 2016 8:07 AM