Commit 5f8f6c34 authored by Ivo Ivanov's avatar Ivo Ivanov Committed by Alexandre Julliard

windows.gaming.input: Implement IForceFeedbackMotor_get_SupportedAxes.

parent cd75ed18
......@@ -5735,10 +5735,10 @@ static void test_windows_gaming_input(void)
EventRegistrationToken controller_added_token;
IPeriodicForceEffectFactory *periodic_factory;
struct bool_async_handler bool_async_handler;
ForceFeedbackEffectAxes supported_axes, axes;
IVectorView_ForceFeedbackMotor *motors_view;
IConditionForceEffect *condition_effect;
ConditionForceEffectKind condition_kind;
ForceFeedbackEffectAxes supported_axes;
IActivationFactory *activation_factory;
IPeriodicForceEffect *periodic_effect;
IConstantForceEffect *constant_effect;
......@@ -5856,12 +5856,17 @@ static void test_windows_gaming_input(void)
ok( hr == S_OK, "get_IsEnabled returned %#lx\n", hr );
ok( enabled == TRUE, "got enabled %u\n", enabled );
/* SupportedAxes always returns ForceFeedbackEffectAxes_X on Windows,
* no matter which axis is available for FFB in the Set Effects report,
* or whether a X axis is declared at all.
*/
supported_axes = 0xdeadbeef;
hr = IForceFeedbackMotor_get_SupportedAxes( motor, &supported_axes );
todo_wine
ok( hr == S_OK, "get_SupportedAxes returned %#lx\n", hr );
todo_wine
ok( supported_axes == ForceFeedbackEffectAxes_X, "got axes %#x\n", supported_axes );
axes = ForceFeedbackEffectAxes_X | ForceFeedbackEffectAxes_Y | ForceFeedbackEffectAxes_Z;
ok( supported_axes == axes || broken( supported_axes == ForceFeedbackEffectAxes_X ),
"got axes %#x\n", supported_axes );
set_hid_expect( file, &expect_pause, sizeof(expect_pause) );
hr = IForceFeedbackMotor_PauseAllEffects( motor );
......
......@@ -532,10 +532,32 @@ static HRESULT WINAPI motor_get_IsEnabled( IForceFeedbackMotor *iface, BOOLEAN *
return hr;
}
static BOOL CALLBACK check_ffb_axes( const DIDEVICEOBJECTINSTANCEW *obj, void *args )
{
ForceFeedbackEffectAxes *value = args;
if (obj->dwType & DIDFT_FFACTUATOR)
{
if (IsEqualIID( &obj->guidType, &GUID_XAxis )) *value |= ForceFeedbackEffectAxes_X;
else if (IsEqualIID( &obj->guidType, &GUID_YAxis )) *value |= ForceFeedbackEffectAxes_Y;
else if (IsEqualIID( &obj->guidType, &GUID_ZAxis )) *value |= ForceFeedbackEffectAxes_Z;
}
return DIENUM_CONTINUE;
}
static HRESULT WINAPI motor_get_SupportedAxes( IForceFeedbackMotor *iface, enum ForceFeedbackEffectAxes *value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
struct motor *impl = impl_from_IForceFeedbackMotor( iface );
HRESULT hr;
TRACE( "iface %p, value %p.\n", iface, value );
*value = ForceFeedbackEffectAxes_None;
if (FAILED(hr = IDirectInputDevice8_EnumObjects( impl->device, check_ffb_axes, value, DIDFT_AXIS )))
*value = ForceFeedbackEffectAxes_None;
return hr;
}
static HRESULT WINAPI motor_load_effect_async( IUnknown *invoker, IUnknown *param, PROPVARIANT *result )
......
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