On Mon, Jun 18, 2012 at 4:07 PM, Peter Stuge <[email protected]> wrote:
> Pete Batard wrote:
> > > What does GetLastError() return in the relevant cases after the
> > > WinUsb functions return FALSE?
> >
> > I'd expect "[22] The device does not recognize the command".
>
> Do you know all possible reasons are for that error code?
>
>
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.
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. 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.
*I say may as I have only tested with one device.
Orin.
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/libusbx-devel