Commit 70a1ce99 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

wiaservc: COM cleanup for the IClassFactory iface.

parent c3d28bae
......@@ -32,6 +32,11 @@
WINE_DEFAULT_DEBUG_CHANNEL(wia);
static inline ClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
{
return CONTAINING_RECORD(iface, ClassFactoryImpl, IClassFactory_iface);
}
static ULONG WINAPI
WIASERVC_IClassFactory_AddRef(LPCLASSFACTORY iface)
{
......@@ -42,11 +47,11 @@ static HRESULT WINAPI
WIASERVC_IClassFactory_QueryInterface(LPCLASSFACTORY iface, REFIID riid,
LPVOID *ppvObj)
{
ClassFactoryImpl *This = (ClassFactoryImpl *) iface;
ClassFactoryImpl *This = impl_from_IClassFactory(iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IClassFactory))
{
*ppvObj = &This->lpVtbl;
*ppvObj = &This->IClassFactory_iface;
return S_OK;
}
......@@ -99,5 +104,5 @@ static const IClassFactoryVtbl WIASERVC_IClassFactory_Vtbl =
ClassFactoryImpl WIASERVC_ClassFactory =
{
&WIASERVC_IClassFactory_Vtbl
{ &WIASERVC_IClassFactory_Vtbl }
};
......@@ -95,9 +95,8 @@ StartCount(void)
return FALSE;
hr = CoRegisterClassObject(&CLSID_WiaDevMgr,
(IUnknown *) &WIASERVC_ClassFactory,
CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE,
&dwReg);
(IUnknown *) &WIASERVC_ClassFactory.IClassFactory_iface,
CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &dwReg);
if (FAILED(hr))
return FALSE;
......
......@@ -23,7 +23,7 @@
typedef struct
{
const IClassFactoryVtbl *lpVtbl;
IClassFactory IClassFactory_iface;
} ClassFactoryImpl;
extern ClassFactoryImpl WIASERVC_ClassFactory;
......
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