For most PCs, after windows wake up from hibernation, my app will receive a InstanceDeletionEvent, following by a InstanceCreationEvent for a USB device.

However, on few computers, after windows hibernates and wakes up, I could only receive a InstanceDeletionEvent, but no InstanceCreationEvent for the same device. The USB device is leaved on the USB port untouched.

If I close and restart my app, or unplug/plug the same device, the above code becomes working again.

Is there any problem causing a USB device fire InstanceDeletionEvent but not fire InstanceCreationEvent after hibernation in certain environment?

2 Answers
2

There's a registry entry called ResetOnResume which will force the USB driver stack to reset the device on wake. It's disabled by default which would explain the issue your having after waking from hibernation on some PC's.

ResetOnResume

Indicates whether the USB driver stack must reset the device when the
port resumes from a sleep cycle.

On those problematic PC, if the USB device is plugged at the USB port directly on the motherboard, the InstanceDeletionEvent and InstanceCreationEvent would fire properly after wake from hibernation, at over 95% working chance.

If the USB device is plugged at front panel USB port, there is about 75% chance that InstanceCreationEvent will not fire after wake.