Zebediah Figura : winebus.sys: Make the device and instance IDs consistent.

Alexandre Julliard julliard at winehq.org
Tue Jun 4 16:28:13 CDT 2019


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Tue Jun  4 12:45:21 2019 -0500

winebus.sys: Make the device and instance IDs consistent.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winebus.sys/main.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
index 73e3154..291ec74 100644
--- a/dlls/winebus.sys/main.c
+++ b/dlls/winebus.sys/main.c
@@ -168,13 +168,26 @@ static WCHAR *get_instance_id(DEVICE_OBJECT *device)
 
 static WCHAR *get_device_id(DEVICE_OBJECT *device)
 {
-    static const WCHAR formatW[] =  {'%','s','\\','V','i','d','_','%','0','4','x','&','P','i','d','_','%','0','4','x',0};
+    static const WCHAR formatW[] = {'%','s','\\','v','i','d','_','%','0','4','x',
+            '&','p','i','d','_','%','0','4','x',0};
+    static const WCHAR format_inputW[] = {'%','s','\\','v','i','d','_','%','0','4','x',
+            '&','p','i','d','_','%','0','4','x','&','%','s','_','%','i',0};
     struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
-    DWORD len = strlenW(ext->busid) + 19;
+    DWORD len = strlenW(ext->busid) + 34;
     WCHAR *dst;
 
     if ((dst = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
-        sprintfW(dst, formatW, ext->busid, ext->vid, ext->pid);
+    {
+        if (ext->input == (WORD)-1)
+        {
+            sprintfW(dst, formatW, ext->busid, ext->vid, ext->pid);
+        }
+        else
+        {
+            sprintfW(dst, format_inputW, ext->busid, ext->vid, ext->pid,
+                    ext->is_gamepad ? igW : miW, ext->input);
+        }
+    }
 
     return dst;
 }




More information about the wine-cvs mailing list