From 3de56aa9a7a3eb1706b222fc6c0c6e347fce36bd Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Wed, 20 Jul 2011 15:43:49 +0200 Subject: [PATCH] qmgr: COM cleanup for the IClassFactory iface. --- dlls/qmgr/factory.c | 23 ++++++++++------------- dlls/qmgr/qmgr.h | 2 +- dlls/qmgr/service.c | 5 ++--- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/dlls/qmgr/factory.c b/dlls/qmgr/factory.c index 34c5ac0c1c2..222f5df091d 100644 --- a/dlls/qmgr/factory.c +++ b/dlls/qmgr/factory.c @@ -26,20 +26,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(qmgr); static ULONG WINAPI -BITS_IClassFactory_AddRef(LPCLASSFACTORY iface) +BITS_IClassFactory_AddRef(IClassFactory *iface) { - return 2; + return 2; /* non-heap based object */ } static HRESULT WINAPI -BITS_IClassFactory_QueryInterface(LPCLASSFACTORY iface, REFIID riid, - LPVOID *ppvObj) +BITS_IClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppvObj) { - ClassFactoryImpl *This = (ClassFactoryImpl *) iface; - if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IClassFactory)) { - *ppvObj = &This->lpVtbl; + *ppvObj = &BITS_ClassFactory.IClassFactory_iface; return S_OK; } @@ -48,14 +45,14 @@ BITS_IClassFactory_QueryInterface(LPCLASSFACTORY iface, REFIID riid, } static ULONG WINAPI -BITS_IClassFactory_Release(LPCLASSFACTORY iface) +BITS_IClassFactory_Release(IClassFactory *iface) { - return 1; + return 1; /* non-heap based object */ } static HRESULT WINAPI -BITS_IClassFactory_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, - REFIID riid, LPVOID *ppvObj) +BITS_IClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, + void **ppvObj) { HRESULT res; IUnknown *punk = NULL; @@ -75,7 +72,7 @@ BITS_IClassFactory_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, } static HRESULT WINAPI -BITS_IClassFactory_LockServer(LPCLASSFACTORY iface, BOOL fLock) +BITS_IClassFactory_LockServer(IClassFactory *iface, BOOL fLock) { FIXME("Not implemented\n"); return E_NOTIMPL; @@ -92,5 +89,5 @@ static const IClassFactoryVtbl BITS_IClassFactory_Vtbl = ClassFactoryImpl BITS_ClassFactory = { - &BITS_IClassFactory_Vtbl + { &BITS_IClassFactory_Vtbl } }; diff --git a/dlls/qmgr/qmgr.h b/dlls/qmgr/qmgr.h index d0255d65f57..c50439623ad 100644 --- a/dlls/qmgr/qmgr.h +++ b/dlls/qmgr/qmgr.h @@ -90,7 +90,7 @@ typedef struct typedef struct { - const IClassFactoryVtbl *lpVtbl; + IClassFactory IClassFactory_iface; } ClassFactoryImpl; extern HANDLE stop_event DECLSPEC_HIDDEN; diff --git a/dlls/qmgr/service.c b/dlls/qmgr/service.c index b7dc7c39566..6abb804b9d1 100644 --- a/dlls/qmgr/service.c +++ b/dlls/qmgr/service.c @@ -95,9 +95,8 @@ StartCount(void) return FALSE; hr = CoRegisterClassObject(&CLSID_BackgroundCopyManager, - (IUnknown *) &BITS_ClassFactory, - CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, - &dwReg); + (IUnknown *) &BITS_ClassFactory.IClassFactory_iface, + CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &dwReg); if (FAILED(hr)) return FALSE;