From: Rémi Bernon rbernon@codeweavers.com
--- dlls/windows.gaming.input/async.c | 13 ++++++-- dlls/windows.gaming.input/condition_effect.c | 12 +++++-- dlls/windows.gaming.input/constant_effect.c | 12 +++++-- dlls/windows.gaming.input/controller.c | 11 ++++++- dlls/windows.gaming.input/force_feedback.c | 22 +++++++++++-- dlls/windows.gaming.input/gamepad.c | 11 ++++++- dlls/windows.gaming.input/manager.c | 22 +++++++++++-- dlls/windows.gaming.input/periodic_effect.c | 12 +++++-- dlls/windows.gaming.input/private.h | 23 ++++++++++++++ dlls/windows.gaming.input/provider.c | 11 ++++++- dlls/windows.gaming.input/racing_wheel.c | 11 ++++++- dlls/windows.gaming.input/ramp_effect.c | 12 +++++-- dlls/windows.gaming.input/vector.c | 33 ++++++++++++++++++-- 13 files changed, 183 insertions(+), 22 deletions(-)
diff --git a/dlls/windows.gaming.input/async.c b/dlls/windows.gaming.input/async.c index d70994289f1..c2b1efe3eba 100644 --- a/dlls/windows.gaming.input/async.c +++ b/dlls/windows.gaming.input/async.c @@ -32,6 +32,7 @@ struct async_info { IWineAsyncInfoImpl IWineAsyncInfoImpl_iface; IAsyncInfo IAsyncInfo_iface; + IAgileObject IAgileObject_iface; IInspectable *IInspectable_outer; LONG ref;
@@ -60,7 +61,6 @@ static HRESULT WINAPI async_impl_QueryInterface( IWineAsyncInfoImpl *iface, REFI
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IWineAsyncInfoImpl )) { IInspectable_AddRef( (*out = &impl->IWineAsyncInfoImpl_iface) ); @@ -73,6 +73,12 @@ static HRESULT WINAPI async_impl_QueryInterface( IWineAsyncInfoImpl *iface, REFI return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -299,6 +305,8 @@ static const struct IAsyncInfoVtbl async_info_vtbl = async_info_Close, };
+DEFINE_IAGILEOBJECT( async_info, IInspectable, object->IInspectable_outer ); + static void CALLBACK async_info_callback( TP_CALLBACK_INSTANCE *instance, void *iface, TP_WORK *work ) { struct async_info *impl = impl_from_IWineAsyncInfoImpl( iface ); @@ -340,6 +348,7 @@ static HRESULT async_info_create( IUnknown *invoker, IUnknown *param, async_oper if (!(impl = calloc( 1, sizeof(struct async_info) ))) return E_OUTOFMEMORY; impl->IWineAsyncInfoImpl_iface.lpVtbl = &async_impl_vtbl; impl->IAsyncInfo_iface.lpVtbl = &async_info_vtbl; + impl->IAgileObject_iface.lpVtbl = &async_info_IAgileObject_vtbl; impl->IInspectable_outer = outer; impl->ref = 1;
@@ -383,7 +392,6 @@ static HRESULT WINAPI async_bool_QueryInterface( IAsyncOperation_boolean *iface,
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IAsyncOperation_boolean )) { IInspectable_AddRef( (*out = &impl->IAsyncOperation_boolean_iface) ); @@ -528,7 +536,6 @@ static HRESULT WINAPI async_result_QueryInterface( IAsyncOperation_ForceFeedback
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IAsyncOperation_ForceFeedbackLoadEffectResult )) { IInspectable_AddRef( (*out = &impl->IAsyncOperation_ForceFeedbackLoadEffectResult_iface) ); diff --git a/dlls/windows.gaming.input/condition_effect.c b/dlls/windows.gaming.input/condition_effect.c index c3a5a1fcd8b..e5bd7d439e1 100644 --- a/dlls/windows.gaming.input/condition_effect.c +++ b/dlls/windows.gaming.input/condition_effect.c @@ -44,7 +44,6 @@ static HRESULT WINAPI effect_QueryInterface( IConditionForceEffect *iface, REFII
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IConditionForceEffect )) { IInspectable_AddRef( (*out = &impl->IConditionForceEffect_iface) ); @@ -150,6 +149,7 @@ struct condition_factory { IActivationFactory IActivationFactory_iface; IConditionForceEffectFactory IConditionForceEffectFactory_iface; + IAgileObject IAgileObject_iface; LONG ref; };
@@ -166,7 +166,6 @@ static HRESULT WINAPI activation_QueryInterface( IActivationFactory *iface, REFI
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IActivationFactory )) { IInspectable_AddRef( (*out = &impl->IActivationFactory_iface) ); @@ -179,6 +178,12 @@ static HRESULT WINAPI activation_QueryInterface( IActivationFactory *iface, REFI return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -278,10 +283,13 @@ static const struct IConditionForceEffectFactoryVtbl factory_vtbl = factory_CreateInstance, };
+DEFINE_IAGILEOBJECT( condition_factory, IActivationFactory, &object->IActivationFactory_iface ); + static struct condition_factory condition_statics = { {&activation_vtbl}, {&factory_vtbl}, + {&condition_factory_IAgileObject_vtbl}, 1, };
diff --git a/dlls/windows.gaming.input/constant_effect.c b/dlls/windows.gaming.input/constant_effect.c index 15763b30d67..3e0a8cb0295 100644 --- a/dlls/windows.gaming.input/constant_effect.c +++ b/dlls/windows.gaming.input/constant_effect.c @@ -42,7 +42,6 @@ static HRESULT WINAPI effect_QueryInterface( IConstantForceEffect *iface, REFIID
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IConstantForceEffect )) { IInspectable_AddRef( (*out = &impl->IConstantForceEffect_iface) ); @@ -168,6 +167,7 @@ static const struct IConstantForceEffectVtbl effect_vtbl = struct constant_factory { IActivationFactory IActivationFactory_iface; + IAgileObject IAgileObject_iface; LONG ref; };
@@ -184,13 +184,18 @@ static HRESULT WINAPI activation_QueryInterface( IActivationFactory *iface, REFI
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IActivationFactory )) { IInspectable_AddRef( (*out = &impl->IActivationFactory_iface) ); return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -266,9 +271,12 @@ static const struct IActivationFactoryVtbl activation_vtbl = activation_ActivateInstance, };
+DEFINE_IAGILEOBJECT( constant_factory, IActivationFactory, &object->IActivationFactory_iface ); + static struct constant_factory constant_statics = { {&activation_vtbl}, + {&constant_factory_IAgileObject_vtbl}, 1, };
diff --git a/dlls/windows.gaming.input/controller.c b/dlls/windows.gaming.input/controller.c index e1749a3032d..62a10bc887c 100644 --- a/dlls/windows.gaming.input/controller.c +++ b/dlls/windows.gaming.input/controller.c @@ -394,6 +394,7 @@ struct controller_statics IActivationFactory IActivationFactory_iface; IRawGameControllerStatics IRawGameControllerStatics_iface; ICustomGameControllerFactory ICustomGameControllerFactory_iface; + IAgileObject IAgileObject_iface; LONG ref; };
@@ -410,7 +411,6 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IActivationFactory )) { IInspectable_AddRef( (*out = &impl->IActivationFactory_iface) ); @@ -429,6 +429,12 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -657,11 +663,14 @@ static const struct ICustomGameControllerFactoryVtbl controller_factory_vtbl = controller_factory_OnGameControllerRemoved, };
+DEFINE_IAGILEOBJECT( controller_statics, IActivationFactory, &object->IActivationFactory_iface ); + static struct controller_statics controller_statics = { {&factory_vtbl}, {&statics_vtbl}, {&controller_factory_vtbl}, + {&controller_statics_IAgileObject_vtbl}, 1, };
diff --git a/dlls/windows.gaming.input/force_feedback.c b/dlls/windows.gaming.input/force_feedback.c index a272daee25f..941bde2ce80 100644 --- a/dlls/windows.gaming.input/force_feedback.c +++ b/dlls/windows.gaming.input/force_feedback.c @@ -34,6 +34,7 @@ struct effect { IWineForceFeedbackEffectImpl IWineForceFeedbackEffectImpl_iface; IForceFeedbackEffect IForceFeedbackEffect_iface; + IAgileObject IAgileObject_iface; IInspectable *IInspectable_outer; LONG ref;
@@ -65,7 +66,6 @@ static HRESULT WINAPI effect_impl_QueryInterface( IWineForceFeedbackEffectImpl *
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IWineForceFeedbackEffectImpl )) { IWineForceFeedbackEffectImpl_AddRef( (*out = &impl->IWineForceFeedbackEffectImpl_iface) ); @@ -78,6 +78,12 @@ static HRESULT WINAPI effect_impl_QueryInterface( IWineForceFeedbackEffectImpl * return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -344,6 +350,8 @@ static const struct IForceFeedbackEffectVtbl effect_vtbl = effect_Stop, };
+DEFINE_IAGILEOBJECT( effect, IInspectable, object->IInspectable_outer ); + HRESULT force_feedback_effect_create( enum WineForceFeedbackEffectType type, IInspectable *outer, IWineForceFeedbackEffectImpl **out ) { struct effect *impl; @@ -353,6 +361,7 @@ HRESULT force_feedback_effect_create( enum WineForceFeedbackEffectType type, IIn if (!(impl = calloc( 1, sizeof(*impl) ))) return E_OUTOFMEMORY; impl->IWineForceFeedbackEffectImpl_iface.lpVtbl = &effect_impl_vtbl; impl->IForceFeedbackEffect_iface.lpVtbl = &effect_vtbl; + impl->IAgileObject_iface.lpVtbl = &effect_IAgileObject_vtbl; impl->IInspectable_outer = outer; impl->ref = 1;
@@ -431,6 +440,7 @@ HRESULT force_feedback_effect_create( enum WineForceFeedbackEffectType type, IIn struct motor { IForceFeedbackMotor IForceFeedbackMotor_iface; + IAgileObject IAgileObject_iface; LONG ref;
IDirectInputDevice8W *device; @@ -449,13 +459,18 @@ static HRESULT WINAPI motor_QueryInterface( IForceFeedbackMotor *iface, REFIID i
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IForceFeedbackMotor )) { IInspectable_AddRef( (*out = &impl->IForceFeedbackMotor_iface) ); return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -810,6 +825,8 @@ static const struct IForceFeedbackMotorVtbl motor_vtbl = motor_TryUnloadEffectAsync, };
+DEFINE_IAGILEOBJECT( motor, IForceFeedbackMotor, &object->IForceFeedbackMotor_iface ); + HRESULT force_feedback_motor_create( IDirectInputDevice8W *device, IForceFeedbackMotor **out ) { struct motor *impl; @@ -823,6 +840,7 @@ HRESULT force_feedback_motor_create( IDirectInputDevice8W *device, IForceFeedbac
if (!(impl = calloc( 1, sizeof(*impl) ))) return E_OUTOFMEMORY; impl->IForceFeedbackMotor_iface.lpVtbl = &motor_vtbl; + impl->IAgileObject_iface.lpVtbl = &motor_IAgileObject_vtbl; impl->ref = 1;
IDirectInputDevice_AddRef( device ); diff --git a/dlls/windows.gaming.input/gamepad.c b/dlls/windows.gaming.input/gamepad.c index 0d7cd690821..434d369bc90 100644 --- a/dlls/windows.gaming.input/gamepad.c +++ b/dlls/windows.gaming.input/gamepad.c @@ -365,6 +365,7 @@ struct gamepad_statics IGamepadStatics IGamepadStatics_iface; IGamepadStatics2 IGamepadStatics2_iface; ICustomGameControllerFactory ICustomGameControllerFactory_iface; + IAgileObject IAgileObject_iface; LONG ref; };
@@ -381,7 +382,6 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IActivationFactory )) { IInspectable_AddRef( (*out = &impl->IActivationFactory_iface) ); @@ -406,6 +406,12 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -644,12 +650,15 @@ static const struct ICustomGameControllerFactoryVtbl controller_factory_vtbl = controller_factory_OnGameControllerRemoved, };
+DEFINE_IAGILEOBJECT( gamepad_statics, IActivationFactory, &object->IActivationFactory_iface ); + static struct gamepad_statics gamepad_statics = { {&factory_vtbl}, {&statics_vtbl}, {&statics2_vtbl}, {&controller_factory_vtbl}, + {&gamepad_statics_IAgileObject_vtbl}, 1, };
diff --git a/dlls/windows.gaming.input/manager.c b/dlls/windows.gaming.input/manager.c index d54b01d92e3..4bc16c78844 100644 --- a/dlls/windows.gaming.input/manager.c +++ b/dlls/windows.gaming.input/manager.c @@ -39,6 +39,7 @@ struct controller { IGameController IGameController_iface; IGameControllerBatteryInfo IGameControllerBatteryInfo_iface; + IAgileObject IAgileObject_iface; IInspectable *IInspectable_inner; LONG ref;
@@ -60,7 +61,6 @@ static HRESULT WINAPI controller_QueryInterface( IGameController *iface, REFIID
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IGameController )) { IInspectable_AddRef( (*out = &impl->IGameController_iface) ); @@ -73,6 +73,12 @@ static HRESULT WINAPI controller_QueryInterface( IGameController *iface, REFIID return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + return IInspectable_QueryInterface( impl->IInspectable_inner, iid, out ); }
@@ -222,11 +228,14 @@ static const struct IGameControllerBatteryInfoVtbl battery_vtbl = battery_TryGetBatteryReport, };
+DEFINE_IAGILEOBJECT( controller, IGameController, &object->IGameController_iface ); + struct manager_statics { IActivationFactory IActivationFactory_iface; IGameControllerFactoryManagerStatics IGameControllerFactoryManagerStatics_iface; IGameControllerFactoryManagerStatics2 IGameControllerFactoryManagerStatics2_iface; + IAgileObject IAgileObject_iface; LONG ref; };
@@ -243,7 +252,6 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IActivationFactory )) { IInspectable_AddRef( (*out = &impl->IActivationFactory_iface) ); @@ -262,6 +270,12 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -416,11 +430,14 @@ static const struct IGameControllerFactoryManagerStatics2Vtbl statics2_vtbl = statics2_TryGetFactoryControllerFromGameController, };
+DEFINE_IAGILEOBJECT( manager_statics, IActivationFactory, &object->IActivationFactory_iface ); + static struct manager_statics manager_statics = { {&factory_vtbl}, {&statics_vtbl}, {&statics2_vtbl}, + {&manager_statics_IAgileObject_vtbl}, 1, };
@@ -436,6 +453,7 @@ static HRESULT controller_create( ICustomGameControllerFactory *factory, IGameCo if (!(impl = malloc(sizeof(*impl)))) return E_OUTOFMEMORY; impl->IGameController_iface.lpVtbl = &controller_vtbl; impl->IGameControllerBatteryInfo_iface.lpVtbl = &battery_vtbl; + impl->IAgileObject_iface.lpVtbl = &controller_IAgileObject_vtbl; impl->ref = 1;
if (FAILED(hr = ICustomGameControllerFactory_CreateGameController( factory, provider, &impl->IInspectable_inner ))) diff --git a/dlls/windows.gaming.input/periodic_effect.c b/dlls/windows.gaming.input/periodic_effect.c index 8633a8fb9b9..f05aba36f94 100644 --- a/dlls/windows.gaming.input/periodic_effect.c +++ b/dlls/windows.gaming.input/periodic_effect.c @@ -44,7 +44,6 @@ static HRESULT WINAPI effect_QueryInterface( IPeriodicForceEffect *iface, REFIID
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IPeriodicForceEffect )) { IInspectable_AddRef( (*out = &impl->IPeriodicForceEffect_iface) ); @@ -188,6 +187,7 @@ struct periodic_factory { IActivationFactory IActivationFactory_iface; IPeriodicForceEffectFactory IPeriodicForceEffectFactory_iface; + IAgileObject IAgileObject_iface; LONG ref; };
@@ -204,7 +204,6 @@ static HRESULT WINAPI activation_QueryInterface( IActivationFactory *iface, REFI
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IActivationFactory )) { IInspectable_AddRef( (*out = &impl->IActivationFactory_iface) ); @@ -217,6 +216,12 @@ static HRESULT WINAPI activation_QueryInterface( IActivationFactory *iface, REFI return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -316,10 +321,13 @@ static const struct IPeriodicForceEffectFactoryVtbl factory_vtbl = factory_CreateInstance, };
+DEFINE_IAGILEOBJECT( periodic_factory, IActivationFactory, &object->IActivationFactory_iface ); + static struct periodic_factory periodic_statics = { {&activation_vtbl}, {&factory_vtbl}, + {&periodic_factory_IAgileObject_vtbl}, 1, };
diff --git a/dlls/windows.gaming.input/private.h b/dlls/windows.gaming.input/private.h index f53d5b5bc37..c0fdac02198 100644 --- a/dlls/windows.gaming.input/private.h +++ b/dlls/windows.gaming.input/private.h @@ -122,6 +122,29 @@ extern HRESULT async_operation_effect_result_create( IUnknown *invoker, IUnknown #define DEFINE_IINSPECTABLE_OUTER( pfx, iface_type, impl_type, outer_iface ) \ DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, impl->outer_iface )
+#define DEFINE_IAGILEOBJECT( type, base, expr ) \ + static HRESULT WINAPI type##_IAgileObject_QueryInterface( IAgileObject *iface, REFIID iid, void **out ) \ + { \ + struct type *object = CONTAINING_RECORD( iface, struct type, IAgileObject_iface ); \ + return base##_QueryInterface( (expr), iid, out ); \ + } \ + static ULONG WINAPI type##_IAgileObject_AddRef( IAgileObject *iface ) \ + { \ + struct type *object = CONTAINING_RECORD( iface, struct type, IAgileObject_iface ); \ + return base##_AddRef( (expr) ); \ + } \ + static ULONG WINAPI type##_IAgileObject_Release( IAgileObject *iface ) \ + { \ + struct type *object = CONTAINING_RECORD( iface, struct type, IAgileObject_iface ); \ + return base##_Release( (expr) ); \ + } \ + static const IAgileObjectVtbl type##_IAgileObject_vtbl = \ + { \ + type##_IAgileObject_QueryInterface, \ + type##_IAgileObject_AddRef, \ + type##_IAgileObject_Release, \ + }; + static inline const char *debugstr_vector3( const Vector3 *vector ) { if (!vector) return "(null)"; diff --git a/dlls/windows.gaming.input/provider.c b/dlls/windows.gaming.input/provider.c index 6908d733a53..ecd14f866b7 100644 --- a/dlls/windows.gaming.input/provider.c +++ b/dlls/windows.gaming.input/provider.c @@ -46,6 +46,7 @@ struct provider { IWineGameControllerProvider IWineGameControllerProvider_iface; IGameControllerProvider IGameControllerProvider_iface; + IAgileObject IAgileObject_iface; LONG ref;
IDirectInputDevice8W *dinput_device; @@ -78,7 +79,6 @@ static HRESULT WINAPI wine_provider_QueryInterface( IWineGameControllerProvider
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IWineGameControllerProvider )) { IInspectable_AddRef( (*out = &impl->IWineGameControllerProvider_iface) ); @@ -91,6 +91,12 @@ static HRESULT WINAPI wine_provider_QueryInterface( IWineGameControllerProvider return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -427,6 +433,8 @@ static const struct IGameControllerProviderVtbl game_provider_vtbl = game_provider_get_IsConnected, };
+DEFINE_IAGILEOBJECT( provider, IWineGameControllerProvider, &object->IWineGameControllerProvider_iface ); + static void check_haptics_caps( struct provider *provider, HANDLE device, PHIDP_PREPARSED_DATA preparsed, HIDP_LINK_COLLECTION_NODE *collections, HIDP_VALUE_CAPS *caps ) { @@ -573,6 +581,7 @@ void provider_create( const WCHAR *device_path ) if (!(impl = calloc( 1, sizeof(*impl) ))) goto done; impl->IWineGameControllerProvider_iface.lpVtbl = &wine_provider_vtbl; impl->IGameControllerProvider_iface.lpVtbl = &game_provider_vtbl; + impl->IAgileObject_iface.lpVtbl = &provider_IAgileObject_vtbl; IDirectInputDevice_AddRef( dinput_device ); impl->dinput_device = dinput_device; impl->ref = 1; diff --git a/dlls/windows.gaming.input/racing_wheel.c b/dlls/windows.gaming.input/racing_wheel.c index d646ca26c03..c39a5c45c42 100644 --- a/dlls/windows.gaming.input/racing_wheel.c +++ b/dlls/windows.gaming.input/racing_wheel.c @@ -291,6 +291,7 @@ struct racing_wheel_statics IRacingWheelStatics IRacingWheelStatics_iface; IRacingWheelStatics2 IRacingWheelStatics2_iface; ICustomGameControllerFactory ICustomGameControllerFactory_iface; + IAgileObject IAgileObject_iface; LONG ref; };
@@ -307,7 +308,6 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IActivationFactory )) { IInspectable_AddRef( (*out = &impl->IActivationFactory_iface) ); @@ -332,6 +332,12 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -568,12 +574,15 @@ static const struct ICustomGameControllerFactoryVtbl controller_factory_vtbl = controller_factory_OnGameControllerRemoved, };
+DEFINE_IAGILEOBJECT( racing_wheel_statics, IActivationFactory, &object->IActivationFactory_iface ); + static struct racing_wheel_statics racing_wheel_statics = { {&factory_vtbl}, {&statics_vtbl}, {&statics2_vtbl}, {&controller_factory_vtbl}, + {&racing_wheel_statics_IAgileObject_vtbl}, 1, };
diff --git a/dlls/windows.gaming.input/ramp_effect.c b/dlls/windows.gaming.input/ramp_effect.c index fadcf151c04..f0eb4efaa31 100644 --- a/dlls/windows.gaming.input/ramp_effect.c +++ b/dlls/windows.gaming.input/ramp_effect.c @@ -42,7 +42,6 @@ static HRESULT WINAPI effect_QueryInterface( IRampForceEffect *iface, REFIID iid
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IRampForceEffect )) { IInspectable_AddRef( (*out = &impl->IRampForceEffect_iface) ); @@ -171,6 +170,7 @@ static const struct IRampForceEffectVtbl effect_vtbl = struct ramp_factory { IActivationFactory IActivationFactory_iface; + IAgileObject IAgileObject_iface; LONG ref; };
@@ -187,13 +187,18 @@ static HRESULT WINAPI activation_QueryInterface( IActivationFactory *iface, REFI
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, &IID_IActivationFactory )) { IInspectable_AddRef( (*out = &impl->IActivationFactory_iface) ); return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -269,9 +274,12 @@ static const struct IActivationFactoryVtbl activation_vtbl = activation_ActivateInstance, };
+DEFINE_IAGILEOBJECT( ramp_factory, IActivationFactory, &object->IActivationFactory_iface ); + static struct ramp_factory ramp_statics = { {&activation_vtbl}, + {&ramp_factory_IAgileObject_vtbl}, 1, };
diff --git a/dlls/windows.gaming.input/vector.c b/dlls/windows.gaming.input/vector.c index 954d7df3552..a96662ea99f 100644 --- a/dlls/windows.gaming.input/vector.c +++ b/dlls/windows.gaming.input/vector.c @@ -26,6 +26,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(combase); struct iterator { IIterator_IInspectable IIterator_IInspectable_iface; + IAgileObject IAgileObject_iface; const GUID *iid; LONG ref;
@@ -47,13 +48,18 @@ static HRESULT WINAPI iterator_QueryInterface( IIterator_IInspectable *iface, RE
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, impl->iid )) { IInspectable_AddRef( (*out = &impl->IIterator_IInspectable_iface) ); return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -152,10 +158,13 @@ static const IIterator_IInspectableVtbl iterator_vtbl = iterator_GetMany, };
+DEFINE_IAGILEOBJECT( iterator, IIterator_IInspectable, &object->IIterator_IInspectable_iface ); + struct vector_view { IVectorView_IInspectable IVectorView_IInspectable_iface; IIterable_IInspectable IIterable_IInspectable_iface; + IAgileObject IAgileObject_iface; struct vector_iids iids; LONG ref;
@@ -176,7 +185,6 @@ static HRESULT WINAPI vector_view_QueryInterface( IVectorView_IInspectable *ifac
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, impl->iids.view )) { IInspectable_AddRef( (*out = &impl->IVectorView_IInspectable_iface) ); @@ -189,6 +197,12 @@ static HRESULT WINAPI vector_view_QueryInterface( IVectorView_IInspectable *ifac return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -323,6 +337,7 @@ static HRESULT WINAPI iterable_view_First( IIterable_IInspectable *iface, IItera
if (!(iter = calloc( 1, sizeof(struct iterator) ))) return E_OUTOFMEMORY; iter->IIterator_IInspectable_iface.lpVtbl = &iterator_vtbl; + iter->IAgileObject_iface.lpVtbl = &iterator_IAgileObject_vtbl; iter->iid = impl->iids.iterator; iter->ref = 1;
@@ -346,10 +361,13 @@ static const struct IIterable_IInspectableVtbl iterable_view_vtbl = iterable_view_First, };
+DEFINE_IAGILEOBJECT( vector_view, IVectorView_IInspectable, &object->IVectorView_IInspectable_iface ); + struct vector { IVector_IInspectable IVector_IInspectable_iface; IIterable_IInspectable IIterable_IInspectable_iface; + IAgileObject IAgileObject_iface; struct vector_iids iids; LONG ref;
@@ -371,7 +389,6 @@ static HRESULT WINAPI vector_QueryInterface( IVector_IInspectable *iface, REFIID
if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || - IsEqualGUID( iid, &IID_IAgileObject ) || IsEqualGUID( iid, impl->iids.vector )) { IInspectable_AddRef( (*out = &impl->IVector_IInspectable_iface) ); @@ -384,6 +401,12 @@ static HRESULT WINAPI vector_QueryInterface( IVector_IInspectable *iface, REFIID return S_OK; }
+ if (IsEqualGUID( iid, &IID_IAgileObject )) + { + IInspectable_AddRef( (*out = &impl->IAgileObject_iface) ); + return S_OK; + } + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); *out = NULL; return E_NOINTERFACE; @@ -463,6 +486,7 @@ static HRESULT WINAPI vector_GetView( IVector_IInspectable *iface, IVectorView_I if (!(view = calloc( 1, offsetof( struct vector_view, elements[impl->size] ) ))) return E_OUTOFMEMORY; view->IVectorView_IInspectable_iface.lpVtbl = &vector_view_vtbl; view->IIterable_IInspectable_iface.lpVtbl = &iterable_view_vtbl; + view->IAgileObject_iface.lpVtbl = &vector_view_IAgileObject_vtbl; view->iids = impl->iids; view->ref = 1;
@@ -657,6 +681,8 @@ static const struct IIterable_IInspectableVtbl iterable_vtbl = iterable_First, };
+DEFINE_IAGILEOBJECT( vector, IVector_IInspectable, &object->IVector_IInspectable_iface ); + HRESULT vector_create( const struct vector_iids *iids, void **out ) { struct vector *impl; @@ -666,6 +692,7 @@ HRESULT vector_create( const struct vector_iids *iids, void **out ) if (!(impl = calloc( 1, sizeof(*impl) ))) return E_OUTOFMEMORY; impl->IVector_IInspectable_iface.lpVtbl = &vector_vtbl; impl->IIterable_IInspectable_iface.lpVtbl = &iterable_vtbl; + impl->IAgileObject_iface.lpVtbl = &vector_IAgileObject_vtbl; impl->iids = *iids; impl->ref = 1;