summaryrefslogtreecommitdiff
path: root/libusb
diff options
context:
space:
mode:
authorTormod Volden <debian.tormod@gmail.com>2022-03-28 13:23:37 +0200
committerTormod Volden <debian.tormod@gmail.com>2022-04-04 13:32:23 +0200
commitbfa8b8535a929e939d549d9c3778592abfafe870 (patch)
tree5138527653e1255dff032c4777327fd763d177fd /libusb
parent385eaafba1b79eebcb65087c86744c492262573f (diff)
downloadlibusb-bfa8b8535a929e939d549d9c3778592abfafe870.tar.gz
windows: Fix type mismatch in winusbx_copy_transfer_data
We cannot use the CHECK_WINUSBX_AVAILABLE macro since it may return with the wrong error type/value. Fixes #1100 Closes #1101 Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Diffstat (limited to 'libusb')
-rw-r--r--libusb/os/windows_winusb.c6
-rw-r--r--libusb/version_nano.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/libusb/os/windows_winusb.c b/libusb/os/windows_winusb.c
index 6c0db2a..ab49975 100644
--- a/libusb/os/windows_winusb.c
+++ b/libusb/os/windows_winusb.c
@@ -3234,7 +3234,11 @@ static enum libusb_transfer_status winusbx_copy_transfer_data(int sub_api, struc
if (transfer->type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS) {
struct winusb_device_priv *priv = usbi_get_device_priv(transfer->dev_handle->dev);
- CHECK_WINUSBX_AVAILABLE(sub_api);
+
+ if (sub_api == SUB_API_NOTSET)
+ sub_api = priv->sub_api;
+ if (WinUSBX[sub_api].hDll == NULL)
+ return LIBUSB_TRANSFER_ERROR;
// for isochronous, need to copy the individual iso packet actual_lengths and statuses
if ((sub_api == SUB_API_LIBUSBK) || (sub_api == SUB_API_LIBUSB0)) {
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 1de3b3b..ae65857 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11718
+#define LIBUSB_NANO 11719