How to programmatically unplug & replug an arbitrary USB device?

后端 未结 13 1699
南笙
南笙 2020-12-07 19:22

I\'m trying to fix a non-responsive USB device that\'s masquerading as a virtual COM port. Manual replugging works, but there may be up to 12 of these units. Is there an API

13条回答
  •  一生所求
    2020-12-07 19:31

    In Eject USB disks using C# (The Code Project) look for this:

    CM_Request_Device_Eject function

    This is the SetupApi function that ejects a device (any device that can be ejected). It takes a device instance handle (or devInst) as input...

提交回复
热议问题