Failing of EvtWdfDevicePrepareHardware results in reload attempt of Driver

Hello All,

I am observing wherein upon failing the EvtWdfDevicePrepareHardware callback from OS for a device, results in reloading attempt of the driver
i.e: DriveEntry followed by EvtDriverDeviceAdd, etc. gets called.

Looking up the MSDN pages do not find this being documented anywhere. Is this an action expected and guaranteed from OS?
Under which other scenarios OS might perform a re-enumeration attempt?

Thanks,
Balaji

The behavior is documented here: https://docs.microsoft.com/en-us/windows-hardware/drivers/wdf/reporting-device-failures

If you’re trying to kill the device, you can use WdfDeviceSetFailed.