windows.gaming.input: Fake IEventHandler_RawGameController support.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-03-22 11:17:35 +01:00 committed by Alexandre Julliard
parent 5f4c28ea4b
commit e2189f588f
2 changed files with 17 additions and 10 deletions

View File

@ -558,28 +558,32 @@ static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_add_RawGameControll
IRawGameControllerStatics *iface, IEventHandler_RawGameController *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 raw_game_controller_statics_remove_RawGameControllerAdded(
IRawGameControllerStatics *iface, EventRegistrationToken token)
{
FIXME("iface %p, token %#I64x stub!\n", iface, token.value);
return E_NOTIMPL;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_add_RawGameControllerRemoved(
IRawGameControllerStatics *iface, IEventHandler_RawGameController *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 raw_game_controller_statics_remove_RawGameControllerRemoved(
IRawGameControllerStatics *iface, EventRegistrationToken token)
{
FIXME("iface %p, token %#I64x stub!\n", iface, token.value);
return E_NOTIMPL;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_get_RawGameControllers(

View File

@ -359,19 +359,22 @@ static void test_RawGameController(void)
token.value = 0xdeadbeef;
hr = IRawGameControllerStatics_add_RawGameControllerAdded(controller_statics, &controller_event_handler.IEventHandler_RawGameController_iface, &token);
todo_wine ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr);
todo_wine ok(token.value != 0xdeadbeef, "IRawGameControllerStatics_add_RawGameControllerAdded returned token %#I64x\n", token.value);
ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr);
ok(token.value != 0xdeadbeef, "IRawGameControllerStatics_add_RawGameControllerAdded returned token %#I64x\n", token.value);
hr = IRawGameControllerStatics_remove_RawGameControllerAdded(controller_statics, token);
todo_wine ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr);
ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr);
token.value = 0xdeadbeef;
IRawGameControllerStatics_add_RawGameControllerRemoved(controller_statics, &controller_event_handler.IEventHandler_RawGameController_iface, &token);
todo_wine ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerRemoved failed, hr %#x\n", hr);
todo_wine ok(token.value != 0xdeadbeef, "IRawGameControllerStatics_add_RawGameControllerRemoved returned token %#I64x\n", token.value);
ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerRemoved failed, hr %#x\n", hr);
ok(token.value != 0xdeadbeef, "IRawGameControllerStatics_add_RawGameControllerRemoved returned token %#I64x\n", token.value);
hr = IRawGameControllerStatics_remove_RawGameControllerRemoved(controller_statics, token);
todo_wine ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr);
ok(hr == S_OK, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr);
hr = IRawGameControllerStatics_add_RawGameControllerAdded(controller_statics, NULL, &token);
ok(hr == E_INVALIDARG, "IRawGameControllerStatics_add_RawGameControllerAdded failed, hr %#x\n", hr);
IRawGameControllerStatics_Release(controller_statics);