Rémi Bernon : windows.gaming.input: Return an empty vector from RawGameController_get_ForceFeedbackMotors.
Alexandre Julliard
julliard at winehq.org
Mon Apr 25 16:30:33 CDT 2022
Module: wine
Branch: master
Commit: 5c88fea5e7263f8e82e59feee3702894f7101f71
URL: https://source.winehq.org/git/wine.git/?a=commit;h=5c88fea5e7263f8e82e59feee3702894f7101f71
Author: Rémi Bernon <rbernon at codeweavers.com>
Date: Mon Apr 25 14:56:16 2022 +0200
windows.gaming.input: Return an empty vector from RawGameController_get_ForceFeedbackMotors.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dinput/tests/force_feedback.c | 3 +--
dlls/windows.gaming.input/controller.c | 19 +++++++++++++++++--
include/windows.gaming.input.forcefeedback.idl | 3 +++
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c
index 068f5bf1a7e..e4d17175c68 100644
--- a/dlls/dinput/tests/force_feedback.c
+++ b/dlls/dinput/tests/force_feedback.c
@@ -5283,10 +5283,8 @@ static void test_windows_gaming_input(void)
set_hid_expect( file, expect_acquire, sizeof(expect_acquire) );
hr = IRawGameController_get_ForceFeedbackMotors( raw_controller, &motors_view );
- todo_wine
ok( hr == S_OK, "get_ForceFeedbackMotors returned %#lx\n", hr );
wait_hid_expect_( __FILE__, __LINE__, file, 100, TRUE ); /* device gain reports are written asynchronously */
- if (!motors_view) goto skip_tests;
hr = IVectorView_ForceFeedbackMotor_get_Size( motors_view, &size );
ok( hr == S_OK, "get_Size returned %#lx\n", hr );
@@ -5296,6 +5294,7 @@ static void test_windows_gaming_input(void)
todo_wine
ok( hr == S_OK, "GetAt returned %#lx\n", hr );
IVectorView_ForceFeedbackMotor_Release( motors_view );
+ if (hr != S_OK) goto skip_tests;
check_interface( motor, &IID_IUnknown, TRUE );
check_interface( motor, &IID_IInspectable, TRUE );
diff --git a/dlls/windows.gaming.input/controller.c b/dlls/windows.gaming.input/controller.c
index 03a3ae398cf..d68da6b3142 100644
--- a/dlls/windows.gaming.input/controller.c
+++ b/dlls/windows.gaming.input/controller.c
@@ -229,8 +229,23 @@ static HRESULT WINAPI raw_controller_get_ButtonCount( IRawGameController *iface,
static HRESULT WINAPI raw_controller_get_ForceFeedbackMotors( IRawGameController *iface, IVectorView_ForceFeedbackMotor **value )
{
- FIXME( "iface %p, value %p stub!\n", iface, value );
- return E_NOTIMPL;
+ static const struct vector_iids iids =
+ {
+ .vector = &IID_IVector_ForceFeedbackMotor,
+ .view = &IID_IVectorView_ForceFeedbackMotor,
+ .iterable = &IID_IIterable_ForceFeedbackMotor,
+ .iterator = &IID_IIterator_ForceFeedbackMotor,
+ };
+ IVector_ForceFeedbackMotor *vector;
+ HRESULT hr;
+
+ TRACE( "iface %p, value %p\n", iface, value );
+
+ if (FAILED(hr = vector_create( &iids, (void **)&vector ))) return hr;
+ hr = IVector_ForceFeedbackMotor_GetView( vector, value );
+ IVector_ForceFeedbackMotor_Release( vector );
+
+ return hr;
}
static HRESULT WINAPI raw_controller_get_HardwareProductId( IRawGameController *iface, UINT16 *value )
diff --git a/include/windows.gaming.input.forcefeedback.idl b/include/windows.gaming.input.forcefeedback.idl
index 432b60a5592..639e0c5cd57 100644
--- a/include/windows.gaming.input.forcefeedback.idl
+++ b/include/windows.gaming.input.forcefeedback.idl
@@ -36,7 +36,10 @@ namespace Windows.Gaming.Input.ForceFeedback {
declare {
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>;
interface Windows.Foundation.IAsyncOperation<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>;
+ interface Windows.Foundation.Collections.IIterator<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor *>;
+ interface Windows.Foundation.Collections.IIterable<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor *>;
interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor *>;
+ interface Windows.Foundation.Collections.IVector<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor *>;
}
[
More information about the wine-cvs
mailing list