Right to say, the bug is in windows_transfer_callback, just easy if (io_size > 
0) will help.
case ERROR_OPERATION_ABORTED:
-       istatus = priv->apib->copy_transfer_data(SUB_API_NOTSET, itransfer, 
io_size);
-       if (istatus != LIBUSB_TRANSFER_COMPLETED) {
-       usbi_dbg("Failed to copy partial data in aborted operation: %d", 
istatus);
+       if (io_size > 0) {
+               istatus = priv->apib->copy_transfer_data(SUB_API_NOTSET, 
itransfer, io_size);
+               if (istatus != LIBUSB_TRANSFER_COMPLETED) {
+                       usbi_dbg("Failed to copy partial data in aborted 
operation: %d", istatus);
+               }
        }
        if (itransfer->flags & USBI_TRANSFER_TIMED_OUT) {
                usbi_dbg("detected timeout");
                status = LIBUSB_TRANSFER_TIMED_OUT;
        } else {
                usbi_dbg("detected operation aborted");
                status = LIBUSB_TRANSFER_CANCELLED;
        }
        break;

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/issues/160#issuecomment-29013239
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to