Commit 3728a813 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

windows.gaming.input: Fake IEventHandler_Gamepad support.

parent ae690924
......@@ -321,28 +321,32 @@ static HRESULT STDMETHODCALLTYPE gamepad_statics_add_GamepadAdded(
IGamepadStatics *iface, IEventHandler_Gamepad *value, EventRegistrationToken* token)
{
FIXME("iface %p, value %p, token %p stub!\n", iface, value, token);
return E_NOTIMPL;
if (!value) return E_INVALIDARG;
token->value = 0;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE gamepad_statics_remove_GamepadAdded(
IGamepadStatics *iface, EventRegistrationToken token)
{
FIXME("iface %p, token %#I64x stub!\n", iface, token.value);
return E_NOTIMPL;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE gamepad_statics_add_GamepadRemoved(
IGamepadStatics *iface, IEventHandler_Gamepad *value, EventRegistrationToken* token)
{
FIXME("iface %p, value %p, token %p stub!\n", iface, value, token);
return E_NOTIMPL;
if (!value) return E_INVALIDARG;
token->value = 0;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE gamepad_statics_remove_GamepadRemoved(
IGamepadStatics *iface, EventRegistrationToken token)
{
FIXME("iface %p, token %#I64x stub!\n", iface, token.value);
return E_NOTIMPL;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE gamepad_statics_get_Gamepads(
......
......@@ -186,19 +186,22 @@ static void test_Gamepad(void)
token.value = 0xdeadbeef;
hr = IGamepadStatics_add_GamepadAdded(gamepad_statics, &gamepad_event_handler.IEventHandler_Gamepad_iface, &token);
todo_wine ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr);
todo_wine ok(token.value != 0xdeadbeef, "IGamepadStatics_add_GamepadAdded returned token %#I64x\n", token.value);
ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr);
ok(token.value != 0xdeadbeef, "IGamepadStatics_add_GamepadAdded returned token %#I64x\n", token.value);
hr = IGamepadStatics_remove_GamepadAdded(gamepad_statics, token);
todo_wine ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr);
ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr);
token.value = 0xdeadbeef;
IGamepadStatics_add_GamepadRemoved(gamepad_statics, &gamepad_event_handler.IEventHandler_Gamepad_iface, &token);
todo_wine ok(hr == S_OK, "IGamepadStatics_add_GamepadRemoved failed, hr %#x\n", hr);
todo_wine ok(token.value != 0xdeadbeef, "IGamepadStatics_add_GamepadRemoved returned token %#I64x\n", token.value);
ok(hr == S_OK, "IGamepadStatics_add_GamepadRemoved failed, hr %#x\n", hr);
ok(token.value != 0xdeadbeef, "IGamepadStatics_add_GamepadRemoved returned token %#I64x\n", token.value);
hr = IGamepadStatics_remove_GamepadRemoved(gamepad_statics, token);
todo_wine ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr);
ok(hr == S_OK, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr);
hr = IGamepadStatics_add_GamepadAdded(gamepad_statics, NULL, &token);
ok(hr == E_INVALIDARG, "IGamepadStatics_add_GamepadAdded failed, hr %#x\n", hr);
IGamepadStatics_Release(gamepad_statics);
......
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