Commit b7f51783 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

windows.gaming.input: Implement IForceFeedbackEffect_get_State.

parent b2b1e6a4
...@@ -6020,9 +6020,7 @@ static void test_windows_gaming_input(void) ...@@ -6020,9 +6020,7 @@ static void test_windows_gaming_input(void)
ok( hr == S_FALSE, "put_Gain returned %#lx\n", hr ); ok( hr == S_FALSE, "put_Gain returned %#lx\n", hr );
state = 0xdeadbeef; state = 0xdeadbeef;
hr = IForceFeedbackEffect_get_State( effect, &state ); hr = IForceFeedbackEffect_get_State( effect, &state );
todo_wine
ok( hr == S_OK, "get_State returned %#lx\n", hr ); ok( hr == S_OK, "get_State returned %#lx\n", hr );
todo_wine
ok( state == ForceFeedbackEffectState_Stopped, "got state %#x\n", state ); ok( state == ForceFeedbackEffectState_Stopped, "got state %#x\n", state );
hr = IForceFeedbackEffect_Start( effect ); hr = IForceFeedbackEffect_Start( effect );
todo_wine todo_wine
...@@ -6260,9 +6258,7 @@ static void test_windows_gaming_input(void) ...@@ -6260,9 +6258,7 @@ static void test_windows_gaming_input(void)
ok( hr == S_FALSE, "put_Gain returned %#lx\n", hr ); ok( hr == S_FALSE, "put_Gain returned %#lx\n", hr );
state = 0xdeadbeef; state = 0xdeadbeef;
hr = IForceFeedbackEffect_get_State( effect, &state ); hr = IForceFeedbackEffect_get_State( effect, &state );
todo_wine
ok( hr == S_OK, "get_State returned %#lx\n", hr ); ok( hr == S_OK, "get_State returned %#lx\n", hr );
todo_wine
ok( state == ForceFeedbackEffectState_Stopped, "get_State returned %#lx\n", hr ); ok( state == ForceFeedbackEffectState_Stopped, "get_State returned %#lx\n", hr );
hr = IForceFeedbackEffect_Start( effect ); hr = IForceFeedbackEffect_Start( effect );
todo_wine todo_wine
......
...@@ -236,8 +236,25 @@ static HRESULT WINAPI effect_put_Gain( IForceFeedbackEffect *iface, DOUBLE value ...@@ -236,8 +236,25 @@ static HRESULT WINAPI effect_put_Gain( IForceFeedbackEffect *iface, DOUBLE value
static HRESULT WINAPI effect_get_State( IForceFeedbackEffect *iface, ForceFeedbackEffectState *value ) static HRESULT WINAPI effect_get_State( IForceFeedbackEffect *iface, ForceFeedbackEffectState *value )
{ {
FIXME( "iface %p, value %p stub!\n", iface, value ); struct effect *impl = impl_from_IForceFeedbackEffect( iface );
return E_NOTIMPL; 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 ) static HRESULT WINAPI effect_Start( IForceFeedbackEffect *iface )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment