Rémi Bernon : winebus.sys: Report WINEBUS\WINE_COMP_XINPUT compatible id for gamepads.

Alexandre Julliard julliard at winehq.org
Thu Sep 2 15:45:30 CDT 2021


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Wed Sep  1 07:47:26 2021 +0200

winebus.sys: Report WINEBUS\WINE_COMP_XINPUT compatible id for gamepads.

In addition, and before WINEBUS\WINE_COMP_HID, so that winexinput.sys
will match first as soon as it is introduced.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winebus.sys/main.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
index 49385576d62..e58bf873eac 100644
--- a/dlls/winebus.sys/main.c
+++ b/dlls/winebus.sys/main.c
@@ -242,16 +242,24 @@ static WCHAR *get_hardware_ids(DEVICE_OBJECT *device)
 
 static WCHAR *get_compatible_ids(DEVICE_OBJECT *device)
 {
+    static const WCHAR xinput_compat[] =
+    {
+        'W','I','N','E','B','U','S','\\','W','I','N','E','_','C','O','M','P','_','X','I','N','P','U','T',0
+    };
     static const WCHAR hid_compat[] =
     {
         'W','I','N','E','B','U','S','\\','W','I','N','E','_','C','O','M','P','_','H','I','D',0
     };
+    struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
     DWORD size = sizeof(hid_compat);
     WCHAR *dst;
 
+    if (ext->is_gamepad) size += sizeof(xinput_compat);
+
     if ((dst = ExAllocatePool(PagedPool, size + sizeof(WCHAR))))
     {
-        memcpy(dst, hid_compat, sizeof(hid_compat));
+        if (ext->is_gamepad) memcpy(dst, xinput_compat, sizeof(xinput_compat));
+        memcpy((char *)dst + size - sizeof(hid_compat), hid_compat, sizeof(hid_compat));
         dst[size / sizeof(WCHAR)] = 0;
     }
 




More information about the wine-cvs mailing list