wiaservc: Return pointer to vtbl instead of implementation in wiadevmgr_Constructor.

This commit is contained in:
Sebastian Lackner 2015-03-27 09:14:37 +01:00 committed by Alexandre Julliard
parent 05757794a0
commit f630fb4f6a
3 changed files with 7 additions and 7 deletions

View File

@ -70,19 +70,19 @@ WIASERVC_IClassFactory_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter,
REFIID riid, LPVOID *ppvObj)
{
HRESULT res;
IUnknown *punk = NULL;
IWiaDevMgr *devmgr = NULL;
TRACE("IID: %s\n", debugstr_guid(riid));
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
res = wiadevmgr_Constructor((LPVOID*) &punk);
res = wiadevmgr_Constructor(&devmgr);
if (FAILED(res))
return res;
res = IUnknown_QueryInterface(punk, riid, ppvObj);
IUnknown_Release(punk);
res = IWiaDevMgr_QueryInterface(devmgr, riid, ppvObj);
IWiaDevMgr_Release(devmgr);
return res;
}

View File

@ -164,7 +164,7 @@ static const IWiaDevMgrVtbl WIASERVC_IWiaDevMgr_Vtbl =
wiadevmgr_AddDeviceDlg
};
HRESULT wiadevmgr_Constructor(LPVOID *ppObj)
HRESULT wiadevmgr_Constructor(IWiaDevMgr **ppObj)
{
wiadevmgr *This;
TRACE("(%p)\n", ppObj);
@ -173,7 +173,7 @@ HRESULT wiadevmgr_Constructor(LPVOID *ppObj)
{
This->IWiaDevMgr_iface.lpVtbl = &WIASERVC_IWiaDevMgr_Vtbl;
This->ref = 1;
*ppObj = This;
*ppObj = &This->IWiaDevMgr_iface;
return S_OK;
}
*ppObj = NULL;

View File

@ -34,7 +34,7 @@ typedef struct
LONG ref;
} wiadevmgr;
HRESULT wiadevmgr_Constructor(LPVOID *ppObj) DECLSPEC_HIDDEN;
HRESULT wiadevmgr_Constructor(IWiaDevMgr **ppObj) DECLSPEC_HIDDEN;
/* Little helper functions */
static inline char *