Orin Eman wrote: > > > > What does GetLastError() return in the relevant cases after the > > > > WinUsb functions return FALSE? > > FWIW, WinUsb_ReadPipe() will return 22 immediately if the device is > disconnected, BUT a pending overlapped WinUsb_ReadPipe() may* complete > with error 31 - ERROR_GEN_FAILURE if the device is disconnected.
Ok - but maybe we can work with that. > windows_usb.c incorrectly thinks ERROR_GEN_FAILURE is a stall which > should be an impossible occurrence if AUTO_CLEAR_STALL is set > > Both the 22 and 31 return must be handled correctly as they can occur > before any plug and play event is received. Right, thanks for expressing this very clearly. It's the point I tried to make as well. > It does seem that it's impossible to tell the difference between a > device being disconnected and a stall if AUTO_CLEAR_STALL isn't set. Is there a reason why we would ever not want to set AUTO_CLEAR_STALL? It's done unconditionally now, which seems to be the right way to go so that the 31 error happens for one less reason. //Peter ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel