xinput: Check for NULL argument in XInputGetState.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b03a4b8902
commit
b84a4aa53b
|
@ -126,6 +126,9 @@ static void test_get_state(void)
|
|||
}
|
||||
}
|
||||
|
||||
result = pXInputGetState(0, NULL);
|
||||
ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned (%d)\n", result);
|
||||
|
||||
result = pXInputGetState(XUSER_MAX_COUNT, &state);
|
||||
ok(result == ERROR_BAD_ARGUMENTS, "XInputGetState returned (%d)\n", result);
|
||||
|
||||
|
|
|
@ -88,6 +88,9 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputSetState(DWORD index, XINPUT_VIBRATION* vib
|
|||
* XInputGetState() in the hook, so we need a wrapper. */
|
||||
static DWORD xinput_get_state(DWORD index, XINPUT_STATE *state)
|
||||
{
|
||||
if (!state)
|
||||
return ERROR_BAD_ARGUMENTS;
|
||||
|
||||
HID_find_gamepads(controllers);
|
||||
|
||||
if (index >= XUSER_MAX_COUNT)
|
||||
|
|
Loading…
Reference in New Issue