WdfUsbTargetCreateDevice fails with 0x800070B1
I am working on to fix a kernel-pnp error 411 with code 0x0A for a WBF driver. After investigation, I can see the wdfUsbTargetDeviceCreate( ) api call failing with NTSTATUS=0x800070B1 from EvtPrepareHardware_Callback( ) This failure is reproducible whenever I do upgrade the driver. The sequence of events is given below D0PowerState Entry - Start D0PowerState Entry - Exit EvtDeviceQueryRemove Entry EvtDeviceQueryRemove exit with success EvtDeviceD0Exit Entry EvtDeviceD0Exit Exit with success EvtDeviceReleaseHardware Entry EvtDeviceReleaseHardware Exit EvtDriverContextCleanup Entry EvtDriverContextCleanup Exit with success -----unload completes here------------------------- -----driver load starts again----------------- DriverEntry Entry DriverEntry Exit EvtDeviceAdd Entry EvtDeviceAdd Exit with success EvtDevicePrepareHardware Entry wdfUsbTargetDeviceCreate( ) --- Fails EvtDevicePrepareHardware Exit with failure status.