Commit 44cd385a authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

xinput1_3: Implement XInputGetState using XInputGetStateEx.

parent 0fe75804
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
#include "xinput.h" #include "xinput.h"
/* Not defined in the headers, used only by XInputGetStateEx */
#define XINPUT_GAMEPAD_GUIDE 0x0400
WINE_DEFAULT_DEBUG_CHANNEL(xinput); WINE_DEFAULT_DEBUG_CHANNEL(xinput);
struct struct
...@@ -72,17 +75,26 @@ DWORD WINAPI XInputSetState(DWORD index, XINPUT_VIBRATION* vibration) ...@@ -72,17 +75,26 @@ DWORD WINAPI XInputSetState(DWORD index, XINPUT_VIBRATION* vibration)
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetState(DWORD index, XINPUT_STATE* state) DWORD WINAPI DECLSPEC_HOTPATCH XInputGetState(DWORD index, XINPUT_STATE* state)
{ {
union
{
XINPUT_STATE state;
XINPUT_STATE_EX state_ex;
} xinput;
DWORD ret;
static int warn_once; static int warn_once;
if (!warn_once++) if (!warn_once++)
FIXME("(index %u, state %p) Stub!\n", index, state); FIXME("(index %u, state %p) Stub!\n", index, state);
if (index >= XUSER_MAX_COUNT) ret = XInputGetStateEx(index, &xinput.state_ex);
return ERROR_BAD_ARGUMENTS; if (ret != ERROR_SUCCESS)
if (!controllers[index].connected) return ret;
return ERROR_DEVICE_NOT_CONNECTED;
return ERROR_NOT_SUPPORTED; /* The main difference between this and the Ex version is the media guide button */
xinput.state.Gamepad.wButtons &= ~XINPUT_GAMEPAD_GUIDE;
*state = xinput.state;
return ERROR_SUCCESS;
} }
DWORD WINAPI DECLSPEC_HOTPATCH XInputGetStateEx(DWORD index, XINPUT_STATE_EX* state_ex) DWORD WINAPI DECLSPEC_HOTPATCH XInputGetStateEx(DWORD index, XINPUT_STATE_EX* state_ex)
......
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