From: Rémi Bernon rbernon@codeweavers.com
It is prone to spurious failures and we don't really care about it being precise yet. --- dlls/dinput/tests/device8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dinput/tests/device8.c b/dlls/dinput/tests/device8.c index 0f586c69f6a..d6d3a03b7bd 100644 --- a/dlls/dinput/tests/device8.c +++ b/dlls/dinput/tests/device8.c @@ -1744,7 +1744,7 @@ static void test_hid_mouse(void) ok( !res, "MsgWaitForMultipleObjects returned %#lx\n", res ); msg_wait_for_events( 0, NULL, 5 ); /* process pending messages */ todo_wine - ok( mouse_move_count == 1, "got mouse_move_count %u\n", mouse_move_count ); + ok( mouse_move_count >= 1, "got mouse_move_count %u\n", mouse_move_count );
GetCursorPos( &pos ); todo_wine
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dinput/tests/joystick8.c | 36 ++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c index b4cd4a771de..34c3f94e07c 100644 --- a/dlls/dinput/tests/joystick8.c +++ b/dlls/dinput/tests/joystick8.c @@ -4973,6 +4973,7 @@ static void test_windows_gaming_input(void) static const WCHAR *racing_wheel_class_name = RuntimeClass_Windows_Gaming_Input_RacingWheel; static const WCHAR *gamepad_class_name = RuntimeClass_Windows_Gaming_Input_Gamepad;
+ IVectorView_SimpleHapticsController *haptics_controllers; IRawGameController *raw_controller, *tmp_raw_controller; IVectorView_RawGameController *controllers_view; IRawGameControllerStatics *controller_statics; @@ -4980,11 +4981,13 @@ static void test_windows_gaming_input(void) IVectorView_RacingWheel *racing_wheels_view; IRacingWheelStatics2 *racing_wheel_statics2; IRacingWheelStatics *racing_wheel_statics; + IRawGameController2 *raw_controller2; IVectorView_Gamepad *gamepads_view; IGamepadStatics *gamepad_statics; IGameController *game_controller; IRacingWheel *racing_wheel; - UINT32 size; + UINT32 size, length; + const WCHAR *buffer; HSTRING str; HRESULT hr; DWORD res; @@ -5095,6 +5098,37 @@ static void test_windows_gaming_input(void) IRawGameController_Release( tmp_raw_controller );
IGameController_Release( game_controller ); + + hr = IRawGameController_QueryInterface( raw_controller, &IID_IRawGameController2, (void **)&raw_controller2 ); + todo_wine + ok( hr == S_OK, "QueryInterface returned %#lx\n", hr ); + if (hr != S_OK) goto skip_tests; + + hr = IRawGameController2_get_DisplayName( raw_controller2, &str ); + ok( hr == S_OK, "get_DisplayName returned %#lx\n", hr ); + buffer = pWindowsGetStringRawBuffer( str, &length ); + ok( !wcscmp( buffer, L"HID-compliant game controller" ), + "get_DisplayName returned %s\n", debugstr_wn( buffer, length ) ); + pWindowsDeleteString( str ); + + hr = IRawGameController2_get_NonRoamableId( raw_controller2, &str ); + ok( hr == S_OK, "get_NonRoamableId returned %#lx\n", hr ); + buffer = pWindowsGetStringRawBuffer( str, &length ); + ok( !wcsncmp( buffer, L"{wgi/nrid/", 10 ), + "get_NonRoamableId returned %s\n", debugstr_wn( buffer, length ) ); + pWindowsDeleteString( str ); + + /* FIXME: What kind of HID reports are needed to make this work? */ + hr = IRawGameController2_get_SimpleHapticsControllers( raw_controller2, &haptics_controllers ); + ok( hr == S_OK, "get_SimpleHapticsControllers returned %#lx\n", hr ); + hr = IVectorView_SimpleHapticsController_get_Size( haptics_controllers, &length ); + ok( hr == S_OK, "get_Size returned %#lx\n", hr ); + ok( length == 0, "got length %u\n", length ); + IVectorView_SimpleHapticsController_Release( haptics_controllers ); + + IRawGameController2_Release( raw_controller2 ); + +skip_tests: IRawGameController_Release( raw_controller );
hr = IRawGameControllerStatics_remove_RawGameControllerAdded( controller_statics, controller_added_token );
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dinput/tests/joystick8.c | 32 ++++++++------ dlls/windows.gaming.input/controller.c | 60 ++++++++++++++++++++++++++ include/windows.devices.haptics.idl | 3 ++ 3 files changed, 81 insertions(+), 14 deletions(-)
diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c index 34c3f94e07c..38e20072962 100644 --- a/dlls/dinput/tests/joystick8.c +++ b/dlls/dinput/tests/joystick8.c @@ -5069,7 +5069,6 @@ static void test_windows_gaming_input(void) check_interface( raw_controller, &IID_IInspectable, TRUE ); check_interface( raw_controller, &IID_IAgileObject, TRUE ); check_interface( raw_controller, &IID_IRawGameController, TRUE ); - todo_wine check_interface( raw_controller, &IID_IRawGameController2, TRUE ); check_interface( raw_controller, &IID_IGameController, TRUE ); check_interface( raw_controller, &IID_IGamepad, FALSE ); @@ -5082,7 +5081,6 @@ static void test_windows_gaming_input(void) check_interface( game_controller, &IID_IInspectable, TRUE ); check_interface( game_controller, &IID_IAgileObject, TRUE ); check_interface( game_controller, &IID_IRawGameController, TRUE ); - todo_wine check_interface( game_controller, &IID_IRawGameController2, TRUE ); check_interface( game_controller, &IID_IGameController, TRUE ); check_interface( game_controller, &IID_IGamepad, FALSE ); @@ -5100,23 +5098,31 @@ static void test_windows_gaming_input(void) IGameController_Release( game_controller );
hr = IRawGameController_QueryInterface( raw_controller, &IID_IRawGameController2, (void **)&raw_controller2 ); - todo_wine ok( hr == S_OK, "QueryInterface returned %#lx\n", hr ); - if (hr != S_OK) goto skip_tests;
hr = IRawGameController2_get_DisplayName( raw_controller2, &str ); + todo_wine ok( hr == S_OK, "get_DisplayName returned %#lx\n", hr ); - buffer = pWindowsGetStringRawBuffer( str, &length ); - ok( !wcscmp( buffer, L"HID-compliant game controller" ), - "get_DisplayName returned %s\n", debugstr_wn( buffer, length ) ); - pWindowsDeleteString( str ); + if (hr == S_OK) + { + buffer = pWindowsGetStringRawBuffer( str, &length ); + todo_wine + ok( !wcscmp( buffer, L"HID-compliant game controller" ), + "get_DisplayName returned %s\n", debugstr_wn( buffer, length ) ); + pWindowsDeleteString( str ); + }
hr = IRawGameController2_get_NonRoamableId( raw_controller2, &str ); + todo_wine ok( hr == S_OK, "get_NonRoamableId returned %#lx\n", hr ); - buffer = pWindowsGetStringRawBuffer( str, &length ); - ok( !wcsncmp( buffer, L"{wgi/nrid/", 10 ), - "get_NonRoamableId returned %s\n", debugstr_wn( buffer, length ) ); - pWindowsDeleteString( str ); + if (hr == S_OK) + { + buffer = pWindowsGetStringRawBuffer( str, &length ); + todo_wine + ok( !wcsncmp( buffer, L"{wgi/nrid/", 10 ), + "get_NonRoamableId returned %s\n", debugstr_wn( buffer, length ) ); + pWindowsDeleteString( str ); + }
/* FIXME: What kind of HID reports are needed to make this work? */ hr = IRawGameController2_get_SimpleHapticsControllers( raw_controller2, &haptics_controllers ); @@ -5127,8 +5133,6 @@ static void test_windows_gaming_input(void) IVectorView_SimpleHapticsController_Release( haptics_controllers );
IRawGameController2_Release( raw_controller2 ); - -skip_tests: IRawGameController_Release( raw_controller );
hr = IRawGameControllerStatics_remove_RawGameControllerAdded( controller_statics, controller_added_token ); diff --git a/dlls/windows.gaming.input/controller.c b/dlls/windows.gaming.input/controller.c index bd3d441c445..e1749a3032d 100644 --- a/dlls/windows.gaming.input/controller.c +++ b/dlls/windows.gaming.input/controller.c @@ -61,6 +61,7 @@ struct controller IGameControllerImpl IGameControllerImpl_iface; IGameControllerInputSink IGameControllerInputSink_iface; IRawGameController IRawGameController_iface; + IRawGameController2 IRawGameController2_iface; IGameController *IGameController_outer; LONG ref;
@@ -99,6 +100,12 @@ static HRESULT WINAPI controller_QueryInterface( IGameControllerImpl *iface, REF return S_OK; }
+ if (IsEqualGUID( iid, &IID_IRawGameController2 )) + { + IInspectable_AddRef( (*out = &impl->IRawGameController2_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -330,6 +337,58 @@ static const struct IRawGameControllerVtbl raw_controller_vtbl = raw_controller_GetSwitchKind, };
+DEFINE_IINSPECTABLE_OUTER( raw_controller_2, IRawGameController2, struct controller, IGameController_outer ) + +static HRESULT WINAPI raw_controller_2_get_SimpleHapticsControllers( IRawGameController2 *iface, IVectorView_SimpleHapticsController** value) +{ + static const struct vector_iids iids = + { + .vector = &IID_IVector_SimpleHapticsController, + .view = &IID_IVectorView_SimpleHapticsController, + .iterable = &IID_IIterable_SimpleHapticsController, + .iterator = &IID_IIterator_SimpleHapticsController, + }; + IVector_SimpleHapticsController *vector; + HRESULT hr; + + FIXME( "iface %p, value %p stub!\n", iface, value ); + + if (SUCCEEDED(hr = vector_create( &iids, (void **)&vector ))) + { + hr = IVector_SimpleHapticsController_GetView( vector, value ); + IVector_SimpleHapticsController_Release( vector ); + } + + return hr; +} + +static HRESULT WINAPI raw_controller_2_get_NonRoamableId( IRawGameController2 *iface, HSTRING* value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI raw_controller_2_get_DisplayName( IRawGameController2 *iface, HSTRING* value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static const struct IRawGameController2Vtbl raw_controller_2_vtbl = +{ + raw_controller_2_QueryInterface, + raw_controller_2_AddRef, + raw_controller_2_Release, + /* IInspectable methods */ + raw_controller_2_GetIids, + raw_controller_2_GetRuntimeClassName, + raw_controller_2_GetTrustLevel, + /* IRawGameController2 methods */ + raw_controller_2_get_SimpleHapticsControllers, + raw_controller_2_get_NonRoamableId, + raw_controller_2_get_DisplayName, +}; + struct controller_statics { IActivationFactory IActivationFactory_iface; @@ -525,6 +584,7 @@ static HRESULT WINAPI controller_factory_CreateGameController( ICustomGameContro impl->IGameControllerImpl_iface.lpVtbl = &controller_vtbl; impl->IGameControllerInputSink_iface.lpVtbl = &input_sink_vtbl; impl->IRawGameController_iface.lpVtbl = &raw_controller_vtbl; + impl->IRawGameController2_iface.lpVtbl = &raw_controller_2_vtbl; impl->ref = 1;
TRACE( "created RawGameController %p\n", impl ); diff --git a/include/windows.devices.haptics.idl b/include/windows.devices.haptics.idl index c056ab4941c..506525a6d3c 100644 --- a/include/windows.devices.haptics.idl +++ b/include/windows.devices.haptics.idl @@ -30,7 +30,10 @@ namespace Windows.Devices.Haptics { runtimeclass SimpleHapticsController;
declare { + interface Windows.Foundation.Collections.IIterator<Windows.Devices.Haptics.SimpleHapticsController *>; + interface Windows.Foundation.Collections.IIterable<Windows.Devices.Haptics.SimpleHapticsController *>; interface Windows.Foundation.Collections.IVectorView<Windows.Devices.Haptics.SimpleHapticsController *>; + interface Windows.Foundation.Collections.IVector<Windows.Devices.Haptics.SimpleHapticsController *>; interface Windows.Foundation.Collections.IVectorView<Windows.Devices.Haptics.SimpleHapticsControllerFeedback *>; }