On Windows 10 version 1903 and later Windows blocks attempts to open
HID devices with a U2F usage unless running as administrator. This
patch makes the composite_open function ignore when opening the HID
part of a composite device fails.
Closes #603
Signed-off-by: Axel Gembe <derago@gmail.com>
Signed-off-by: Nathan Hjelm <hjelmn@google.com>
}
}
- if (available[SUB_API_MAX]) // HID driver
+ if (available[SUB_API_MAX]) { // HID driver
r = hid_open(SUB_API_NOTSET, dev_handle);
+ // On Windows 10 version 1903 (OS Build 18362) and later Windows blocks attempts to
+ // open HID devices with a U2F usage unless running as administrator. We ignore this
+ // failure and proceed without the HID device opened.
+ if (r == LIBUSB_ERROR_ACCESS) {
+ usbi_dbg("ignoring access denied error while opening HID interface of composite device");
+ r = LIBUSB_SUCCESS;
+ }
+ }
+
return r;
}
-#define LIBUSB_NANO 11380
+#define LIBUSB_NANO 11381