windows.gaming.input: Return an empty vector from RawGameController_get_ForceFeedbackMotors.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2022-04-25 14:56:16 +02:00 committed by Alexandre Julliard
parent b01760e734
commit 5c88fea5e7
3 changed files with 21 additions and 4 deletions

View file

@ -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 );

View file

@ -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 )

View file

@ -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 *>;
}
[