Aric Stewart : winebus.sys: Implement get_string for linux event devices.

Alexandre Julliard julliard at winehq.org
Wed Feb 7 15:24:27 CST 2018


Module: wine
Branch: master
Commit: f6cb73856df7b8f391040cb193c6e7ca0237ffea
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f6cb73856df7b8f391040cb193c6e7ca0237ffea

Author: Aric Stewart <aric at codeweavers.com>
Date:   Thu Feb  1 11:36:25 2018 -0600

winebus.sys: Implement get_string for linux event devices.

Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winebus.sys/bus_udev.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
index 52f5c4f..4e5f80c 100644
--- a/dlls/winebus.sys/bus_udev.c
+++ b/dlls/winebus.sys/bus_udev.c
@@ -862,7 +862,27 @@ static NTSTATUS lnxev_get_reportdescriptor(DEVICE_OBJECT *device, BYTE *buffer,
 
 static NTSTATUS lnxev_get_string(DEVICE_OBJECT *device, DWORD index, WCHAR *buffer, DWORD length)
 {
-    return STATUS_NOT_IMPLEMENTED;
+    struct wine_input_private *ext = input_impl_from_DEVICE_OBJECT(device);
+    char str[255];
+
+    str[0] = 0;
+    switch (index)
+    {
+        case HID_STRING_ID_IPRODUCT:
+            ioctl(ext->base.device_fd, EVIOCGNAME(sizeof(str)), str);
+            break;
+        case HID_STRING_ID_IMANUFACTURER:
+            strcpy(str,"evdev");
+            break;
+        case HID_STRING_ID_ISERIALNUMBER:
+            ioctl(ext->base.device_fd, EVIOCGUNIQ(sizeof(str)), str);
+            break;
+        default:
+            ERR("Unhandled string index %i\n", index);
+    }
+
+    MultiByteToWideChar(CP_ACP, 0, str, -1, buffer, length);
+    return STATUS_SUCCESS;
 }
 
 static NTSTATUS lnxev_begin_report_processing(DEVICE_OBJECT *device)




More information about the wine-cvs mailing list