Windows: Add check for ERROR_FILE_NOT_FOUND, which means device removed
authorChris Dickens <christopher.a.dickens@gmail.com>
Sun, 7 Jan 2018 05:32:23 +0000 (21:32 -0800)
committerChris Dickens <christopher.a.dickens@gmail.com>
Sun, 7 Jan 2018 05:32:23 +0000 (21:32 -0800)
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/windows_nt_common.c
libusb/version_nano.h

index 94f8770..ceb764a 100644 (file)
@@ -486,6 +486,10 @@ static void windows_transfer_callback(struct usbi_transfer *itransfer, uint32_t
                usbi_dbg("detected operation aborted");
                status = LIBUSB_TRANSFER_CANCELLED;
                break;
+       case ERROR_FILE_NOT_FOUND:
+               usbi_dbg("detected device removed");
+               status = LIBUSB_TRANSFER_NO_DEVICE;
+               break;
        default:
                usbi_err(ITRANSFER_CTX(itransfer), "detected I/O error %u: %s", io_result, windows_error_str(io_result));
                status = LIBUSB_TRANSFER_ERROR;
index 568ff28..fde5f52 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11272
+#define LIBUSB_NANO 11273