[PATCH] dinput: Use the same GUID for Instance and Product

Brendan McGrath brendan at redmandi.com
Sun Oct 28 05:36:18 CDT 2018


This matches the behaviour of DirectInput8 native and appears to be
required for some games to recognise the mouse and keyboard as
a mouse and keyboard.
---

I had a game that worked correctly with dinput native but not with built-in.

I wrote a simple program that ran the IDirectInput8::EnumDevices method
and found that dinput8=b vs dinput8=n gave different results.

One of the differences was that the Instance and Product GUID were the same in
native.

After applying this patch - the game started working correctly with built-in.


 dlls/dinput/keyboard.c | 2 +-
 dlls/dinput/mouse.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
index a64c59c6036..fcc85a90c9c 100644
--- a/dlls/dinput/keyboard.c
+++ b/dlls/dinput/keyboard.c
@@ -179,7 +179,7 @@ static void fill_keyboard_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD ver
 
     ddi.dwSize = dwSize;
     ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */
-    ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */
+    ddi.guidProduct = GUID_SysKeyboard;
     if (version >= 0x0800)
         ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (subtype << 8);
     else
diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c
index 6d3eff5d525..1d5309ee73c 100644
--- a/dlls/dinput/mouse.c
+++ b/dlls/dinput/mouse.c
@@ -121,7 +121,7 @@ static void fill_mouse_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD versio
 
     ddi.dwSize = dwSize;
     ddi.guidInstance = GUID_SysMouse;/* DInput's GUID */
-    ddi.guidProduct = DInput_Wine_Mouse_GUID; /* Vendor's GUID */
+    ddi.guidProduct = GUID_SysMouse;
     if (version >= 0x0800)
         ddi.dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8);
     else
-- 
2.17.1




More information about the wine-devel mailing list