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@codeweavers.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
06ab0d5405
commit
7b4b48a774
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue