Windows: Add check for ERROR_FILE_NOT_FOUND, which means device removed

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
This commit is contained in:
Chris Dickens
2018-01-06 21:32:23 -08:00
parent f3b387fe37
commit 0865774fe9
2 changed files with 5 additions and 1 deletions

View 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;

View File

@@ -1 +1 @@
#define LIBUSB_NANO 11272
#define LIBUSB_NANO 11273