Commit aea79184 authored by Etaash Mathamsetty's avatar Etaash Mathamsetty Committed by Alexandre Julliard

xinput: Implement XInputGetCapabilitiesEx.

parent 39304daf
......@@ -1129,3 +1129,33 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputGetBatteryInformation(DWORD index, BYTE typ
return ERROR_NOT_SUPPORTED;
}
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetCapabilitiesEx(DWORD unk, DWORD index, DWORD flags, XINPUT_CAPABILITIES_EX *caps)
{
HIDD_ATTRIBUTES attr;
DWORD ret = ERROR_SUCCESS;
TRACE("unk %lu, index %lu, flags %#lx, capabilities %p.\n", unk, index, flags, caps);
start_update_thread();
if (index >= XUSER_MAX_COUNT) return ERROR_BAD_ARGUMENTS;
if (!controller_lock(&controllers[index])) return ERROR_DEVICE_NOT_CONNECTED;
if (flags & XINPUT_FLAG_GAMEPAD && controllers[index].caps.SubType != XINPUT_DEVSUBTYPE_GAMEPAD)
ret = ERROR_DEVICE_NOT_CONNECTED;
else if (!HidD_GetAttributes(controllers[index].device, &attr))
ret = ERROR_DEVICE_NOT_CONNECTED;
else
{
caps->Capabilities = controllers[index].caps;
caps->VendorId = attr.VendorID;
caps->ProductId = attr.ProductID;
caps->VersionNumber = attr.VersionNumber;
}
controller_unlock(&controllers[index]);
return ret;
}
......@@ -7,3 +7,4 @@
8 stdcall XInputGetKeystroke(long long ptr)
10 stub XInputGetAudioDeviceIds(long ptr ptr ptr ptr)
100 stdcall XInputGetStateEx(long ptr)
108 stdcall XInputGetCapabilitiesEx(long long long ptr)
......@@ -210,6 +210,16 @@ typedef struct _XINPUT_CAPABILITIES {
XINPUT_VIBRATION Vibration;
} XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES;
typedef struct _XINPUT_CAPABILITIES_EX
{
XINPUT_CAPABILITIES Capabilities;
WORD VendorId;
WORD ProductId;
WORD VersionNumber;
WORD unk1;
DWORD unk2;
} XINPUT_CAPABILITIES_EX, *PXINPUT_CAPABILITIES_EX;
/*
* Defines the structure for a joystick input event which is
* retrieved using the function XInputGetKeystroke
......@@ -237,6 +247,7 @@ DWORD WINAPI XInputSetState(DWORD, XINPUT_VIBRATION*);
DWORD WINAPI XInputGetState(DWORD, XINPUT_STATE*);
DWORD WINAPI XInputGetKeystroke(DWORD, DWORD, PXINPUT_KEYSTROKE);
DWORD WINAPI XInputGetCapabilities(DWORD, DWORD, XINPUT_CAPABILITIES*);
DWORD WINAPI XInputGetCapabilitiesEx(DWORD, DWORD, DWORD, XINPUT_CAPABILITIES_EX*);
DWORD WINAPI XInputGetDSoundAudioDeviceGuids(DWORD, GUID*, GUID*);
DWORD WINAPI XInputGetBatteryInformation(DWORD, BYTE, XINPUT_BATTERY_INFORMATION*);
......
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