Windows: Suppress unwanted error message on filter driver
authorPete Batard <pete@akeo.ie>
Sun, 26 Aug 2012 23:16:00 +0000 (00:16 +0100)
committerPete Batard <pete@akeo.ie>
Sun, 26 Aug 2012 23:16:00 +0000 (00:16 +0100)
* Interface access error message was unconditional, even if the
  filter driver was found later on.

libusb/os/windows_usb.c
libusb/version_nano.h

index e843bce..d19c732 100644 (file)
@@ -2699,12 +2699,12 @@ static int winusbx_claim_interface(int sub_api, struct libusb_device_handle *dev
                }
 
                if (!WinUSBX[sub_api].Initialize(file_handle, &winusb_handle)) {
-                       usbi_err(ctx, "could not access interface %d: %s", iface, windows_error_str(0));
                        handle_priv->interface_handle[iface].api_handle = INVALID_HANDLE_VALUE;
 
                        switch(GetLastError()) {
                        case ERROR_BAD_COMMAND:
                                // The device was disconnected
+                               usbi_err(ctx, "could not access interface %d: %s", iface, windows_error_str(0));
                                return LIBUSB_ERROR_NO_DEVICE;
                        default:
                                // it may be that we're using the libusb0 filter driver.
@@ -2734,7 +2734,7 @@ static int winusbx_claim_interface(int sub_api, struct libusb_device_handle *dev
                                        }
                                }
                                if (!found_filter) {
-                                       usbi_err(ctx, "could not claim interface %d: %s", iface, windows_error_str(0));
+                                       usbi_err(ctx, "could not access interface %d: %s", iface, windows_error_str(0));
                                        return LIBUSB_ERROR_ACCESS;
                                }
                        }
index aa88cb4..b79f240 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 10556
+#define LIBUSB_NANO 10557