Update mojo sdk to rev 1dc8a9a5db73d3718d99917fadf31f5fb2ebad4f
[chromium-blink-merge.git] / third_party / libusb / composite-hid-close.patch
blobd6749cf931ae3a984132fc3fd8fff356840242d1
1 diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
2 index 9ae11b1..259897e 100644
3 --- a/libusb/os/windows_usb.c
4 +++ b/libusb/os/windows_usb.c
5 @@ -4236,6 +4236,7 @@ static void composite_close(int sub_api, struct libusb_device_handle *dev_handle
6 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
7 uint8_t i;
8 bool available[SUB_API_MAX];
9 + bool has_hid = false;
11 for (i = 0; i<SUB_API_MAX; i++) {
12 available[i] = false;
13 @@ -4245,6 +4246,8 @@ static void composite_close(int sub_api, struct libusb_device_handle *dev_handle
14 if ( (priv->usb_interface[i].apib->id == USB_API_WINUSBX)
15 && (priv->usb_interface[i].sub_api != SUB_API_NOTSET) ) {
16 available[priv->usb_interface[i].sub_api] = true;
17 + } else if (priv->usb_interface[i].apib->id == USB_API_HID) {
18 + has_hid = true;
22 @@ -4253,6 +4256,10 @@ static void composite_close(int sub_api, struct libusb_device_handle *dev_handle
23 usb_api_backend[USB_API_WINUSBX].close(i, dev_handle);
27 + if (has_hid) {
28 + usb_api_backend[USB_API_HID].close(sub_api, dev_handle);
29 + }
32 static int composite_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)