From: Rémi Bernon rbernon@codeweavers.com
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 | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 5ff152fbe05..f42470d4806 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -1177,13 +1177,23 @@ 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)) + { + if (desc->version) continue; 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)) + { + if (desc->version) continue; + sscanf(ptr, "PRODUCT=%x/%x/%x\n", &desc->vid, &desc->pid, &desc->version); + } } } }