When my UMDF 1.11 USB driver’s OnPrepareHardware routine fails (for whatever reason), OnReleaseHardware gets called (from the same thread). Inside OnReleaseHardware I try to DeleteWdfObject IWDFUsbTargetDevice:
if (m_UsbTargetDevice != NULL)
m_UsbTargetDevice->DeleteWdfObject();
Now the problem is it gets stuck at m_UsbTargetDevice->DeleteWdfObject().
When OnReleaseHardware is called from an other thread it works as intended and doesn’t get stuck. What is going on here?