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

windows.gaming.input: Implement IForceFeedbackMotor_(Pause|Resume|StopAll)Effects.

And IForceFeedbackMotor_get_AreEffectsPaused. Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent fec8aae2
......@@ -5070,7 +5070,6 @@ static void test_windows_gaming_input(void)
.report_id = 1,
.report_len = 2,
.report_buf = {1, 0x02},
.todo = TRUE,
};
static struct hid_expect expect_resume =
{
......@@ -5078,7 +5077,6 @@ static void test_windows_gaming_input(void)
.report_id = 1,
.report_len = 2,
.report_buf = {1, 0x03},
.todo = TRUE,
};
static struct hid_expect expect_stop =
{
......@@ -5086,7 +5084,6 @@ static void test_windows_gaming_input(void)
.report_id = 1,
.report_len = 2,
.report_buf = {1, 0x06},
.todo = TRUE,
};
static struct hid_expect expect_disable =
{
......@@ -5298,9 +5295,7 @@ static void test_windows_gaming_input(void)
paused = TRUE;
hr = IForceFeedbackMotor_get_AreEffectsPaused( motor, &paused );
todo_wine
ok( hr == S_OK, "get_AreEffectsPaused returned %#lx\n", hr );
todo_wine
ok( paused == FALSE, "got paused %u\n", paused );
gain = 12345.6;
......@@ -5328,15 +5323,12 @@ static void test_windows_gaming_input(void)
set_hid_expect( file, &expect_pause, sizeof(expect_pause) );
hr = IForceFeedbackMotor_PauseAllEffects( motor );
todo_wine
ok( hr == S_OK, "PauseAllEffects returned %#lx\n", hr );
set_hid_expect( file, &expect_resume, sizeof(expect_resume) );
hr = IForceFeedbackMotor_ResumeAllEffects( motor );
todo_wine
ok( hr == S_OK, "ResumeAllEffects returned %#lx\n", hr );
set_hid_expect( file, &expect_stop, sizeof(expect_stop) );
hr = IForceFeedbackMotor_StopAllEffects( motor );
todo_wine
ok( hr == S_OK, "StopAllEffects returned %#lx\n", hr );
set_hid_expect( file, NULL, 0 );
......
......@@ -105,8 +105,17 @@ static HRESULT WINAPI motor_GetTrustLevel( IForceFeedbackMotor *iface, TrustLeve
static HRESULT WINAPI motor_get_AreEffectsPaused( IForceFeedbackMotor *iface, BOOLEAN *value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
struct motor *impl = impl_from_IForceFeedbackMotor( iface );
DWORD state;
HRESULT hr;
TRACE( "iface %p, value %p.\n", iface, value );
if (FAILED(hr = IDirectInputDevice8_GetForceFeedbackState( impl->device, &state )))
return hr;
*value = (state & DIGFFS_PAUSED);
return S_OK;
}
static HRESULT WINAPI motor_get_MasterGain( IForceFeedbackMotor *iface, double *value )
......@@ -171,20 +180,29 @@ static HRESULT WINAPI motor_LoadEffectAsync( IForceFeedbackMotor *iface, IForceF
static HRESULT WINAPI motor_PauseAllEffects( IForceFeedbackMotor *iface )
{
FIXME( "iface %p stub!\n", iface );
return E_NOTIMPL;
struct motor *impl = impl_from_IForceFeedbackMotor( iface );
TRACE( "iface %p.\n", iface );
return IDirectInputDevice8_SendForceFeedbackCommand( impl->device, DISFFC_PAUSE );
}
static HRESULT WINAPI motor_ResumeAllEffects( IForceFeedbackMotor *iface )
{
FIXME( "iface %p stub!\n", iface );
return E_NOTIMPL;
struct motor *impl = impl_from_IForceFeedbackMotor( iface );
TRACE( "iface %p.\n", iface );
return IDirectInputDevice8_SendForceFeedbackCommand( impl->device, DISFFC_CONTINUE );
}
static HRESULT WINAPI motor_StopAllEffects( IForceFeedbackMotor *iface )
{
FIXME( "iface %p stub!\n", iface );
return E_NOTIMPL;
struct motor *impl = impl_from_IForceFeedbackMotor( iface );
TRACE( "iface %p.\n", iface );
return IDirectInputDevice8_SendForceFeedbackCommand( impl->device, DISFFC_STOPALL );
}
static HRESULT WINAPI motor_TryDisableAsync( IForceFeedbackMotor *iface, IAsyncOperation_boolean **async_op )
......
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