[PATCH] xinput: Don't look for IG_ substring when searching for gamepads.
Andrew Eikum
aeikum at codeweavers.com
Thu May 16 07:24:39 CDT 2019
On Thu, May 16, 2019 at 02:19:12PM +0200, Piotr Caban wrote:
> Only some gamepads have "IG_" substring in DevicePath on Windows.
>
This might cause some games to show duplicate controllers. According
to Microsoft, the correct way to detect when a dinput device also has
an xinput device is to search for the IG_ substring. So if we create
xinput devices for hardware that /doesn't/ have the IG_ string, the
game will also show the dinput device.
https://docs.microsoft.com/en-us/windows/desktop/xinput/xinput-and-directinput
Andrew
> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47209
> Signed-off-by: Piotr Caban <piotr at codeweavers.com>
> ---
> dlls/xinput1_3/hid.c | 4 ----
> 1 file changed, 4 deletions(-)
>
>
> diff --git a/dlls/xinput1_3/hid.c b/dlls/xinput1_3/hid.c
> index 34e4e51285..1912a10a39 100644
> --- a/dlls/xinput1_3/hid.c
> +++ b/dlls/xinput1_3/hid.c
> @@ -233,14 +233,10 @@ void HID_find_gamepads(xinput_controller *devices)
> while (SetupDiEnumDeviceInterfaces(device_info_set, NULL, &hid_guid, idx++,
> &interface_data) && didx < XUSER_MAX_COUNT)
> {
> - static const WCHAR ig[] = {'I','G','_',0};
> if (!SetupDiGetDeviceInterfaceDetailW(device_info_set,
> &interface_data, data, sizeof(*data) + detail_size, NULL, NULL))
> continue;
>
> - if (!strstrW(data->DevicePath, ig))
> - continue;
> -
> for (i = 0; i < XUSER_MAX_COUNT; i++)
> {
> struct hid_platform_private *private = devices[i].platform_private;
>
>
More information about the wine-devel
mailing list