Commit 7b4b48a7 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

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: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 06ab0d54
...@@ -242,16 +242,24 @@ static WCHAR *get_hardware_ids(DEVICE_OBJECT *device) ...@@ -242,16 +242,24 @@ static WCHAR *get_hardware_ids(DEVICE_OBJECT *device)
static WCHAR *get_compatible_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[] = static const WCHAR hid_compat[] =
{ {
'W','I','N','E','B','U','S','\\','W','I','N','E','_','C','O','M','P','_','H','I','D',0 '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); DWORD size = sizeof(hid_compat);
WCHAR *dst; WCHAR *dst;
if (ext->is_gamepad) size += sizeof(xinput_compat);
if ((dst = ExAllocatePool(PagedPool, size + sizeof(WCHAR)))) 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; dst[size / sizeof(WCHAR)] = 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment