From 9ea72fecc06922a6d80401176de338946aba1567 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Tue, 5 Mar 2024 17:04:22 +0000 Subject: [PATCH] Only request the BOS descriptor when bcdUSB > 0x0200 See https://techcommunity.microsoft.com/t5/microsoft-usb-blog/usb-2-1-2-0-1-1-device-enumeration-changes-in-windows-8/ba-p/270775 --- gusb/gusb-device.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gusb/gusb-device.c b/gusb/gusb-device.c index d52c402..223e482 100644 --- a/gusb/gusb-device.c +++ b/gusb/gusb-device.c @@ -1319,6 +1319,14 @@ g_usb_device_get_bos_descriptors(GUsbDevice *self, GError **error) g_usb_device_not_open_error(self, error); return NULL; } + if (g_usb_device_get_spec(self) <= 0x0200) { + g_set_error(error, + G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + "not available as bcdUSB 0x%04x <= 0x0200", + g_usb_device_get_spec(self)); + return NULL; + } rc = libusb_get_bos_descriptor(priv->handle, &bos); if (!g_usb_device_libusb_error_to_gerror(self, rc, error))