[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    [PATCH] winebus.sys: Retrieve hidraw device strings from the parent USB device.
From:       Zebediah Figura <z.figura12 () gmail ! com>
Date:       2019-03-29 21:18:32
Message-ID: 20190329211832.11341-2-z.figura12 () gmail ! com
[Download RAW message or body]

This partially reverts 164517fe575564daa44f74cc3bc4a6bbdd7d3f3d. The
manufacturer, product, and serial string attributes are not exposed by the
HID device on Linux, but by its parent USB device.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46711
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
---
 dlls/winebus.sys/bus_udev.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
index 1f671cf568..99753d603e 100644
--- a/dlls/winebus.sys/bus_udev.c
+++ b/dlls/winebus.sys/bus_udev.c
@@ -674,23 +674,23 @@ static NTSTATUS hidraw_get_reportdescriptor(DEVICE_OBJECT *device, BYTE *buffer,
 
 static NTSTATUS hidraw_get_string(DEVICE_OBJECT *device, DWORD index, WCHAR *buffer, DWORD length)
 {
-    struct udev_device *hiddev;
+    struct udev_device *usbdev;
     struct platform_private *private = impl_from_DEVICE_OBJECT(device);
     WCHAR *str = NULL;
 
-    hiddev = udev_device_get_parent_with_subsystem_devtype(private->udev_device, "hid", NULL);
-    if (hiddev)
+    usbdev = udev_device_get_parent_with_subsystem_devtype(private->udev_device, "usb", "usb_device");
+    if (usbdev)
     {
         switch (index)
         {
             case HID_STRING_ID_IPRODUCT:
-                str = get_sysattr_string(hiddev, "product");
+                str = get_sysattr_string(usbdev, "product");
                 break;
             case HID_STRING_ID_IMANUFACTURER:
-                str = get_sysattr_string(hiddev, "manufacturer");
+                str = get_sysattr_string(usbdev, "manufacturer");
                 break;
             case HID_STRING_ID_ISERIALNUMBER:
-                str = get_sysattr_string(hiddev, "serial");
+                str = get_sysattr_string(usbdev, "serial");
                 break;
             default:
                 ERR("Unhandled string index %08x\n", index);
-- 
2.17.1




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic