From d24e87fdafcf4f1b57a56829f5dd8158cf25bf18 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Wed, 8 Dec 2010 22:59:32 +0100 Subject: [PATCH] msimtf: Use an iface instead of a vtbl pointer in ActiveIMMApp. --- dlls/msimtf/activeimmapp.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/msimtf/activeimmapp.c b/dlls/msimtf/activeimmapp.c index 73ce0758c7..41789927ff 100644 --- a/dlls/msimtf/activeimmapp.c +++ b/dlls/msimtf/activeimmapp.c @@ -42,10 +42,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(msimtf); typedef struct tagActiveIMMApp { - const IActiveIMMAppVtbl *vtbl; + IActiveIMMApp IActiveIMMApp_iface; LONG refCount; } ActiveIMMApp; +static inline ActiveIMMApp *impl_from_IActiveIMMApp(IActiveIMMApp *iface) +{ + return CONTAINING_RECORD(iface, ActiveIMMApp, IActiveIMMApp_iface); +} + static void ActiveIMMApp_Destructor(ActiveIMMApp* This) { TRACE("\n"); @@ -55,7 +60,7 @@ static void ActiveIMMApp_Destructor(ActiveIMMApp* This) static HRESULT WINAPI ActiveIMMApp_QueryInterface (IActiveIMMApp* iface, REFIID iid, LPVOID *ppvOut) { - ActiveIMMApp *This = (ActiveIMMApp*)iface; + ActiveIMMApp *This = impl_from_IActiveIMMApp(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IActiveIMMApp)) @@ -75,13 +80,13 @@ static HRESULT WINAPI ActiveIMMApp_QueryInterface (IActiveIMMApp* iface, static ULONG WINAPI ActiveIMMApp_AddRef(IActiveIMMApp* iface) { - ActiveIMMApp *This = (ActiveIMMApp*)iface; + ActiveIMMApp *This = impl_from_IActiveIMMApp(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI ActiveIMMApp_Release(IActiveIMMApp* iface) { - ActiveIMMApp *This = (ActiveIMMApp*)iface; + ActiveIMMApp *This = impl_from_IActiveIMMApp(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -818,7 +823,7 @@ HRESULT ActiveIMMApp_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) if (This == NULL) return E_OUTOFMEMORY; - This->vtbl = &ActiveIMMAppVtbl; + This->IActiveIMMApp_iface.lpVtbl = &ActiveIMMAppVtbl; This->refCount = 1; TRACE("returning %p\n",This); -- 2.32.0.93.g670b81a890