Windows: Avoid potential mismatch in transfer error reporting
authorMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 1 Oct 2013 12:10:48 +0000 (14:10 +0200)
committerPete Batard <pete@akeo.ie>
Tue, 1 Oct 2013 22:59:42 +0000 (23:59 +0100)
commita9cd54f24d566062a461d27f615365f41a3d11e8
tree4aba35ef8504cc2a2880e9406d87fcddc7e437ae
parent16692c825e6f55548b28738dcf2f9b6157b9daf1
Windows: Avoid potential mismatch in transfer error reporting

The default case in windows_transfer_callback() calls windows_error_str(0)
which will convert the error code returned by GetLastError() to a string.
This currently works because windows_transfer_callback() is either called
with io_result set to NO_ERROR or io_result set to GetLastError().

If windows_transfer_callback() will ever be called with io_result set
differently then the default case might report the wrong error message.

Call windows_error_str(io_result) instead to avoid this.

Closes #151
libusb/os/windows_usb.c
libusb/version_nano.h