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.
You can merge this Pull Request by running:
git pull https://github.com/photron/libusbx windows-fix-1
Or you can view, comment on it, or merge it online at:
https://github.com/libusbx/libusbx/pull/151
-- Commit Summary --
* Windows: Avoid potential mismatch in transfer error reporting
-- File Changes --
M libusb/os/windows_usb.c (2)
-- Patch Links --
https://github.com/libusbx/libusbx/pull/151.patch
https://github.com/libusbx/libusbx/pull/151.diff
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel