From: Rémi Bernon rbernon@codeweavers.com
--- dlls/windows.gaming.input/controller.c | 12 ++++-------- include/wine/comimpl.h | 10 ++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/dlls/windows.gaming.input/controller.c b/dlls/windows.gaming.input/controller.c index 11dd4d31921..880752ee9e8 100644 --- a/dlls/windows.gaming.input/controller.c +++ b/dlls/windows.gaming.input/controller.c @@ -70,8 +70,6 @@ struct controller };
INTERFACE_IMPL_FROM( controller, IGameControllerImpl ); -IUNKNOWN_IMPL_QUERY_INTERFACE( controller, IGameControllerImpl, IGameControllerInputSink, - IRawGameController, IRawGameController2, END );
static void controller_destroy( struct controller *impl ) { @@ -80,8 +78,8 @@ static void controller_destroy( struct controller *impl ) free( impl ); }
-IUNKNOWN_IMPL_ADDREF( controller, IGameControllerImpl ); -IUNKNOWN_IMPL_RELEASE( controller, IGameControllerImpl ); +IUNKNOWN_IMPL( controller, IGameControllerImpl, IGameControllerInputSink, + IRawGameController, IRawGameController2, END );
static HRESULT WINAPI controller_GetIids( IGameControllerImpl *iface, ULONG *iid_count, IID **iids ) { @@ -294,10 +292,8 @@ struct controller_statics };
INTERFACE_IMPL_FROM( controller_statics, IActivationFactory ); -IUNKNOWN_IMPL_QUERY_INTERFACE( controller_statics, IActivationFactory, IRawGameControllerStatics, - ICustomGameControllerFactory, IAgileObject, END ); -IUNKNOWN_IMPL_STATIC_ADDREF( controller_statics, IActivationFactory ); -IUNKNOWN_IMPL_STATIC_RELEASE( controller_statics, IActivationFactory ); +IUNKNOWN_IMPL_STATIC( controller_statics, IActivationFactory, IRawGameControllerStatics, + ICustomGameControllerFactory, IAgileObject, END );
static HRESULT WINAPI controller_statics_GetIids( IActivationFactory *iface, ULONG *iid_count, IID **iids ) { diff --git a/include/wine/comimpl.h b/include/wine/comimpl.h index 41691d21ef3..2631f2d97ac 100644 --- a/include/wine/comimpl.h +++ b/include/wine/comimpl.h @@ -88,6 +88,16 @@ return 1; \ }
+#define IUNKNOWN_IMPL( type, name, ... ) \ + IUNKNOWN_IMPL_QUERY_INTERFACE_( type, name, type ## _from_ ## name, __VA_ARGS__ ) \ + IUNKNOWN_IMPL_ADDREF_( type, name, type ## _from_ ## name ) \ + IUNKNOWN_IMPL_RELEASE_( type, name, type ## _from_ ## name ) + +#define IUNKNOWN_IMPL_STATIC( type, name, ... ) \ + IUNKNOWN_IMPL_QUERY_INTERFACE_( type, name, type ## _from_ ## name, __VA_ARGS__ ) \ + IUNKNOWN_IMPL_STATIC_ADDREF( type, name ) \ + IUNKNOWN_IMPL_STATIC_RELEASE( type, name ) + #define IUNKNOWN_FWD( type, name, base, expr ) IUNKNOWN_FWD_( type, name, base, expr, type ## _from_ ## name, type ## _ ## name ) #define IUNKNOWN_FWD_( type, name, base, expr, impl_from, prefix ) \ static HRESULT WINAPI prefix ## _QueryInterface( name *iface, REFIID iid, void **out ) \