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

2

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.

windows-7
windows-vista
usb
device-driver
asked on Stack Overflow Mar 14, 2011 by Dyno Fu • edited Mar 15, 2011 by Ilya

1 Answer

1

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

answered on Stack Overflow Apr 20, 2011 by John

User contributions licensed under CC BY-SA 3.0