I have an USB device based on FTDI chip. Sometimes, its driver get stuck.
Under linux, there no problem -- device get automatically disconnected, and reconnected by default kernel, and only problem is device name changed -- that can be fixed by udev rules.
Under windows, when it stuck, application's thread that does read()
or write()
at that moment are completely hangs. It can't be killed nor by TerminateThread
, nor by KillProcess
.
The only way to kill app -- is disconnect USB device physically.
Any way to issue programmatically device reconnection, that will remove driver's deadlock and allow to re-open port and continue working after?
Administrative rights application can have, if that required.