winusb: setting a non-default config not supported
authorMartin Thierer <mthierer@gmail.com>
Wed, 8 Jul 2020 18:47:57 +0000 (20:47 +0200)
committerChris Dickens <christopher.a.dickens@gmail.com>
Thu, 16 Jul 2020 20:28:48 +0000 (13:28 -0700)
Just because winusb doesn't seem to support setting a different
configuration, that doesn't mean it's an invalid parameter.

It's generally supported by libusb, just not on this platform.

So return LIBUSB_ERROR_NOT_SUPPORTED instead of
LIBUSB_ERROR_INVALID_PARAM.

Closes #743
Closes #752

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/windows_winusb.c
libusb/version_nano.h

index 8ea9697..7ed9de5 100644 (file)
@@ -2457,7 +2457,7 @@ static int winusbx_submit_control_transfer(int sub_api, struct usbi_transfer *it
                        && (setup->Request == LIBUSB_REQUEST_SET_CONFIGURATION)) {
                if (setup->Value != priv->active_config) {
                        usbi_warn(TRANSFER_CTX(transfer), "cannot set configuration other than the default one");
-                       return LIBUSB_ERROR_INVALID_PARAM;
+                       return LIBUSB_ERROR_NOT_SUPPORTED;
                }
                windows_force_sync_completion(overlapped, 0);
        } else {
index f1ac20f..9f10b11 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11522
+#define LIBUSB_NANO 11523