Dyno Fu
Dyno Fu

Reputation: 9044

How to simulate a USB unplug/replug after the device is safely removed?

If I send IOCTL_INTERNAL_USB_CYCLE_PORT I/O request to the USB device, it works as unplug and replug. but if I safely removed it from the system tray, then send the same request, I get 0xC000000E error code, which is STATUS_NO_SUCH_DEVICE, and the device won't reappear. Is there a way to simulate a replug of this USB device in a "safely removed but physically connected" state?


From Microsoft's USB Reference:

The IOCTL_INTERNAL_USB_CYCLE_PORT I/O request simulates a device unplug and replug on the port associated with the PDO.

Upvotes: 2

Views: 3868

Answers (1)

John
John

Reputation: 5635

You should send IOCTL this to the parent of the device - not to the device itself.

Upvotes: 1

Related Questions