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

xinput: Reimplement XInputGetCapabilities.

parent aea79184
......@@ -1086,25 +1086,14 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputGetKeystroke(DWORD index, DWORD reserved, P
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetCapabilities(DWORD index, DWORD flags, XINPUT_CAPABILITIES *capabilities)
{
TRACE("index %lu, flags %#lx, capabilities %p.\n", index, flags, capabilities);
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)
{
controller_unlock(&controllers[index]);
return ERROR_DEVICE_NOT_CONNECTED;
}
XINPUT_CAPABILITIES_EX caps_ex;
DWORD ret;
memcpy(capabilities, &controllers[index].caps, sizeof(*capabilities));
ret = XInputGetCapabilitiesEx(1, index, flags, &caps_ex);
controller_unlock(&controllers[index]);
if (!ret) *capabilities = caps_ex.Capabilities;
return ERROR_SUCCESS;
return ret;
}
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetDSoundAudioDeviceGuids(DWORD index, GUID *render_guid, GUID *capture_guid)
......
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