windows.gaming.input: Implement IForceFeedbackEffect_get_State.

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:02:03 +02:00 committed by Alexandre Julliard
parent b2b1e6a438
commit b7f51783bb
2 changed files with 19 additions and 6 deletions

View File

@ -6020,9 +6020,7 @@ static void test_windows_gaming_input(void)
ok( hr == S_FALSE, "put_Gain returned %#lx\n", hr );
state = 0xdeadbeef;
hr = IForceFeedbackEffect_get_State( effect, &state );
todo_wine
ok( hr == S_OK, "get_State returned %#lx\n", hr );
todo_wine
ok( state == ForceFeedbackEffectState_Stopped, "got state %#x\n", state );
hr = IForceFeedbackEffect_Start( effect );
todo_wine
@ -6260,9 +6258,7 @@ static void test_windows_gaming_input(void)
ok( hr == S_FALSE, "put_Gain returned %#lx\n", hr );
state = 0xdeadbeef;
hr = IForceFeedbackEffect_get_State( effect, &state );
todo_wine
ok( hr == S_OK, "get_State returned %#lx\n", hr );
todo_wine
ok( state == ForceFeedbackEffectState_Stopped, "get_State returned %#lx\n", hr );
hr = IForceFeedbackEffect_Start( effect );
todo_wine

View File

@ -236,8 +236,25 @@ static HRESULT WINAPI effect_put_Gain( IForceFeedbackEffect *iface, DOUBLE value
static HRESULT WINAPI effect_get_State( IForceFeedbackEffect *iface, ForceFeedbackEffectState *value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
struct effect *impl = impl_from_IForceFeedbackEffect( iface );
DWORD status;
HRESULT hr;
TRACE( "iface %p, value %p.\n", iface, value );
EnterCriticalSection( &impl->cs );
if (!impl->effect)
*value = ForceFeedbackEffectState_Stopped;
else if (FAILED(hr = IDirectInputEffect_GetEffectStatus( impl->effect, &status )))
*value = ForceFeedbackEffectState_Faulted;
else
{
if (status == DIEGES_PLAYING) *value = ForceFeedbackEffectState_Running;
else *value = ForceFeedbackEffectState_Stopped;
}
LeaveCriticalSection( &impl->cs );
return S_OK;
}
static HRESULT WINAPI effect_Start( IForceFeedbackEffect *iface )