[PATCH] winebus: Don't override real VID/PID for controllers
Brendan McGrath
brendan at redmandi.com
Wed Nov 21 17:56:01 CST 2018
From: Andrew Eikum <aeikum at codeweavers.com>
It's unclear what this was useful for, possibly native xinput requires
it. Our built-in xinput is good enough now, though, so let's keep the
real VID/PID. This lets applications match setupapi devices with dinput
devices, see:
"XInput and DirectInput"
https://docs.microsoft.com/en-us/windows/desktop/xinput/xinput-and-directinput
Signed-off-by: Brendan McGrath <brendan at redmandi.com>
---
This is the patch from Proton that removed the VID/PID override for controllers.
If there is demand for the overrides - I can always add the registry hacks in a later commit
(but with the improved XInput functionality I don't expect there to be).
I wasn't sure if you needed my Signed-off tag but I added it just in case.
dlls/winebus.sys/bus_sdl.c | 24 ++++++++----------------
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c
index 6b2b28e8c90..a17f11e0457 100644
--- a/dlls/winebus.sys/bus_sdl.c
+++ b/dlls/winebus.sys/bus_sdl.c
@@ -818,25 +818,17 @@ static void try_add_device(SDL_JoystickID index)
controller = pSDL_GameControllerOpen(index);
id = pSDL_JoystickInstanceID(joystick);
- if (controller)
- {
- vid = VID_MICROSOFT;
- pid = PID_XBOX_CONTROLLERS[3];
- version = 0x01;
+
+ if (pSDL_JoystickGetProductVersion != NULL) {
+ vid = pSDL_JoystickGetVendor(joystick);
+ pid = pSDL_JoystickGetProduct(joystick);
+ version = pSDL_JoystickGetProductVersion(joystick);
}
else
{
- if (pSDL_JoystickGetProductVersion != NULL) {
- vid = pSDL_JoystickGetVendor(joystick);
- pid = pSDL_JoystickGetProduct(joystick);
- version = pSDL_JoystickGetProductVersion(joystick);
- }
- else
- {
- vid = 0x01;
- pid = pSDL_JoystickInstanceID(joystick) + 1;
- version = 0;
- }
+ vid = 0x01;
+ pid = pSDL_JoystickInstanceID(joystick) + 1;
+ version = 0;
}
guid = pSDL_JoystickGetGUID(joystick);
--
2.17.1
More information about the wine-devel
mailing list