From: Rémi Bernon rbernon@codeweavers.com
Letting the usb subsystem override what the input/hid subsystems have parsed previously, unless it's on the bluetooth bus where the usb device is the bluetooth dongle.
Fixes an issue with the device revision (bcdDevice) not being extracted from the usb subsystem, causing the bcdHID to be extracted in error.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54838 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56987 --- dlls/winebus.sys/bus_udev.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 5ff152fbe05..e00f9b38741 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -1177,14 +1177,18 @@ static void get_device_subsystem_info(struct udev_device *dev, const char *subsy if (*bus || desc->vid || desc->pid) continue; sscanf(ptr, "HID_ID=%x:%x:%x\n", bus, &desc->vid, &desc->pid); } - if (!strncmp(ptr, "PRODUCT=", 8) && *bus != BUS_BLUETOOTH) + + if (!strcmp(subsystem, "input")) { - if (desc->version) continue; - if (!strcmp(subsystem, "usb")) - sscanf(ptr, "PRODUCT=%x/%x/%x\n", &desc->vid, &desc->pid, &desc->version); - else + if (!strncmp(ptr, "PRODUCT=", 8)) sscanf(ptr, "PRODUCT=%x/%x/%x/%x\n", bus, &desc->vid, &desc->pid, &desc->version); } + + if (!strcmp(subsystem, "usb") && *bus != BUS_BLUETOOTH) + { + if (!strncmp(ptr, "PRODUCT=", 8)) + sscanf(ptr, "PRODUCT=%x/%x/%x\n", &desc->vid, &desc->pid, &desc->version); + } } }