diff options
author | Pete Batard <pbatard@gmail.com> | 2011-05-10 18:05:43 +0100 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2011-05-10 18:05:43 +0100 |
commit | 40f36912a1296548a306a406353d261204c8a5b4 (patch) | |
tree | 4d27c6c41fccbb57936e5d9942b0b6db26c4831f | |
parent | 993c17da45c9e59785803e1c47b506e1d94aad2d (diff) | |
download | libusb-40f36912a1296548a306a406353d261204c8a5b4.tar.gz |
[enum] fixed initialization of interfaces for WinUSB hub access
* also removed unneeded winusb_handle assignation
* issue reported by René Haunstrup
-rw-r--r-- | libusb/os/windows_usb.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c index 3a56fbe..8c9c0d0 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c @@ -1462,6 +1462,7 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered priv->depth = UINT8_MAX; // Overflow to 0 for HCD Hubs priv->path = dev_interface_path; dev_interface_path = NULL; break; + case HUB_PASS: case DEV_PASS: // If the device has already been setup, don't do it again if (priv->path != NULL) @@ -1471,6 +1472,7 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered priv->apib = &usb_api_backend[api]; switch(api) { case USB_API_COMPOSITE: + case USB_API_HUB: break; default: // For other devices, the first interface is the same as the device @@ -1486,10 +1488,6 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered break; } break; - case HUB_PASS: - priv->apib = &usb_api_backend[api]; - priv->path = dev_interface_path; dev_interface_path = NULL; - break; case GEN_PASS: r = init_device(dev, parent_dev, (uint8_t)port_nr, dev_id_path, dev_info_data.DevInst); if (r == LIBUSB_SUCCESS) { @@ -2477,7 +2475,6 @@ static int winusb_claim_interface(struct libusb_device_handle *dev_handle, int i // or if it's the first WinUSB interface, we get a handle through WinUsb_Initialize(). if ((is_using_usbccgp) || (iface == 0)) { // composite device (independent interfaces) or interface 0 - winusb_handle = handle_priv->interface_handle[iface].api_handle; file_handle = handle_priv->interface_handle[iface].dev_handle; if ((file_handle == 0) || (file_handle == INVALID_HANDLE_VALUE)) { return LIBUSB_ERROR_NOT_FOUND; |