Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/windows.gaming.input/main.c | 12 ++++++++---- dlls/windows.gaming.input/tests/input.c | 15 +++++++++------ 2 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/dlls/windows.gaming.input/main.c b/dlls/windows.gaming.input/main.c index 56c5ad20ab0..c71374e34a3 100644 --- a/dlls/windows.gaming.input/main.c +++ b/dlls/windows.gaming.input/main.c @@ -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( diff --git a/dlls/windows.gaming.input/tests/input.c b/dlls/windows.gaming.input/tests/input.c index a359f225728..62822b30c28 100644 --- a/dlls/windows.gaming.input/tests/input.c +++ b/dlls/windows.gaming.input/tests/input.c @@ -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);