windows.gaming.input: Implement IForceFeedbackEffect_(Start|Stop).

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-29 14:01:32 +02:00 committed by Alexandre Julliard
parent 4860e52924
commit b2b1e6a438
2 changed files with 21 additions and 22 deletions

View File

@ -5596,7 +5596,6 @@ static void test_windows_gaming_input(void)
.report_id = 2,
.report_len = 4,
.report_buf = {2,0x01,0x01,0x01},
.todo = TRUE,
};
struct hid_expect expect_effect_stop =
{
@ -5604,7 +5603,6 @@ static void test_windows_gaming_input(void)
.report_id = 2,
.report_len = 4,
.report_buf = {2,0x01,0x03,0x00},
.todo = TRUE,
};
struct hid_expect expect_unload[] =
{
@ -6103,20 +6101,16 @@ static void test_windows_gaming_input(void)
set_hid_expect( file, &expect_effect_start, sizeof(expect_effect_start) );
hr = IForceFeedbackEffect_Start( effect );
todo_wine
ok( hr == S_OK, "Start returned %#lx\n", hr );
set_hid_expect( file, &expect_effect_start, sizeof(expect_effect_start) );
hr = IForceFeedbackEffect_Start( effect );
todo_wine
ok( hr == S_OK, "Start returned %#lx\n", hr );
set_hid_expect( file, &expect_effect_stop, sizeof(expect_effect_stop) );
hr = IForceFeedbackEffect_Stop( effect );
todo_wine
ok( hr == S_OK, "Stop returned %#lx\n", hr );
set_hid_expect( file, &expect_effect_stop, sizeof(expect_effect_stop) );
hr = IForceFeedbackEffect_Stop( effect );
todo_wine
ok( hr == S_OK, "Stop returned %#lx\n", hr );
set_hid_expect( file, expect_unload, sizeof(expect_unload) );
@ -6200,20 +6194,16 @@ static void test_windows_gaming_input(void)
set_hid_expect( file, &expect_effect_start, sizeof(expect_effect_start) );
hr = IForceFeedbackEffect_Start( effect );
todo_wine
ok( hr == S_OK, "Start returned %#lx\n", hr );
set_hid_expect( file, &expect_effect_start, sizeof(expect_effect_start) );
hr = IForceFeedbackEffect_Start( effect );
todo_wine
ok( hr == S_OK, "Start returned %#lx\n", hr );
set_hid_expect( file, &expect_effect_stop, sizeof(expect_effect_stop) );
hr = IForceFeedbackEffect_Stop( effect );
todo_wine
ok( hr == S_OK, "Stop returned %#lx\n", hr );
set_hid_expect( file, &expect_effect_stop, sizeof(expect_effect_stop) );
hr = IForceFeedbackEffect_Stop( effect );
todo_wine
ok( hr == S_OK, "Stop returned %#lx\n", hr );
set_hid_expect( file, expect_unload, sizeof(expect_unload) );
@ -6299,20 +6289,16 @@ static void test_windows_gaming_input(void)
set_hid_expect( file, &expect_effect_start, sizeof(expect_effect_start) );
hr = IForceFeedbackEffect_Start( effect );
todo_wine
ok( hr == S_OK, "Start returned %#lx\n", hr );
set_hid_expect( file, &expect_effect_start, sizeof(expect_effect_start) );
hr = IForceFeedbackEffect_Start( effect );
todo_wine
ok( hr == S_OK, "Start returned %#lx\n", hr );
set_hid_expect( file, &expect_effect_stop, sizeof(expect_effect_stop) );
hr = IForceFeedbackEffect_Stop( effect );
todo_wine
ok( hr == S_OK, "Stop returned %#lx\n", hr );
set_hid_expect( file, &expect_effect_stop, sizeof(expect_effect_stop) );
hr = IForceFeedbackEffect_Stop( effect );
todo_wine
ok( hr == S_OK, "Stop returned %#lx\n", hr );
set_hid_expect( file, expect_unload, sizeof(expect_unload) );
@ -6377,20 +6363,16 @@ static void test_windows_gaming_input(void)
set_hid_expect( file, &expect_effect_start, sizeof(expect_effect_start) );
hr = IForceFeedbackEffect_Start( effect );
todo_wine
ok( hr == S_OK, "Start returned %#lx\n", hr );
set_hid_expect( file, &expect_effect_start, sizeof(expect_effect_start) );
hr = IForceFeedbackEffect_Start( effect );
todo_wine
ok( hr == S_OK, "Start returned %#lx\n", hr );
set_hid_expect( file, &expect_effect_stop, sizeof(expect_effect_stop) );
hr = IForceFeedbackEffect_Stop( effect );
todo_wine
ok( hr == S_OK, "Stop returned %#lx\n", hr );
set_hid_expect( file, &expect_effect_stop, sizeof(expect_effect_stop) );
hr = IForceFeedbackEffect_Stop( effect );
todo_wine
ok( hr == S_OK, "Stop returned %#lx\n", hr );
set_hid_expect( file, expect_unload, sizeof(expect_unload) );

View File

@ -242,14 +242,31 @@ static HRESULT WINAPI effect_get_State( IForceFeedbackEffect *iface, ForceFeedba
static HRESULT WINAPI effect_Start( IForceFeedbackEffect *iface )
{
FIXME( "iface %p stub!\n", iface );
return E_NOTIMPL;
struct effect *impl = impl_from_IForceFeedbackEffect( iface );
HRESULT hr = E_UNEXPECTED;
DWORD flags = 0;
TRACE( "iface %p.\n", iface );
EnterCriticalSection( &impl->cs );
if (impl->effect) hr = IDirectInputEffect_Start( impl->effect, impl->repeat_count, flags );
LeaveCriticalSection( &impl->cs );
return hr;
}
static HRESULT WINAPI effect_Stop( IForceFeedbackEffect *iface )
{
FIXME( "iface %p stub!\n", iface );
return E_NOTIMPL;
struct effect *impl = impl_from_IForceFeedbackEffect( iface );
HRESULT hr = E_UNEXPECTED;
TRACE( "iface %p.\n", iface );
EnterCriticalSection( &impl->cs );
if (impl->effect) hr = IDirectInputEffect_Stop( impl->effect );
LeaveCriticalSection( &impl->cs );
return hr;
}
static const struct IForceFeedbackEffectVtbl effect_vtbl =