qedit: Pass an IUnknown pointer to the object creation functions.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-03-11 21:10:09 -05:00 committed by Alexandre Julliard
parent ed0f2909ff
commit 98143898db
6 changed files with 17 additions and 16 deletions

View File

@ -42,7 +42,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
typedef struct { typedef struct {
IClassFactory IClassFactory_iface; IClassFactory IClassFactory_iface;
LONG ref; LONG ref;
HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj); HRESULT (*create_instance)(IUnknown *outer, IUnknown **out);
} IClassFactoryImpl; } IClassFactoryImpl;
static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
@ -53,15 +53,15 @@ static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
struct object_creation_info struct object_creation_info
{ {
const CLSID *clsid; const CLSID *clsid;
HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj); HRESULT (*create_instance)(IUnknown *outer, IUnknown **out);
}; };
static const struct object_creation_info object_creation[] = static const struct object_creation_info object_creation[] =
{ {
{ &CLSID_AMTimeline, AMTimeline_create }, {&CLSID_AMTimeline, timeline_create},
{ &CLSID_MediaDet, MediaDet_create }, {&CLSID_MediaDet, media_detector_create},
{ &CLSID_NullRenderer, NullRenderer_create }, {&CLSID_NullRenderer, null_renderer_create},
{ &CLSID_SampleGrabber, SampleGrabber_create }, {&CLSID_SampleGrabber, sample_grabber_create},
}; };
static HRESULT WINAPI DSCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj) static HRESULT WINAPI DSCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj)
@ -109,7 +109,7 @@ static HRESULT WINAPI DSCF_CreateInstance(IClassFactory *iface, IUnknown *pOuter
if (pOuter && !IsEqualGUID(&IID_IUnknown, riid)) if (pOuter && !IsEqualGUID(&IID_IUnknown, riid))
return E_NOINTERFACE; return E_NOINTERFACE;
hres = This->pfnCreateInstance(pOuter, (LPVOID *) &punk); hres = This->create_instance(pOuter, &punk);
if (SUCCEEDED(hres)) { if (SUCCEEDED(hres)) {
hres = IUnknown_QueryInterface(punk, riid, ppobj); hres = IUnknown_QueryInterface(punk, riid, ppobj);
IUnknown_Release(punk); IUnknown_Release(punk);
@ -186,7 +186,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
factory->IClassFactory_iface.lpVtbl = &DSCF_Vtbl; factory->IClassFactory_iface.lpVtbl = &DSCF_Vtbl;
factory->ref = 1; factory->ref = 1;
factory->pfnCreateInstance = object_creation[i].pfnCreateInstance; factory->create_instance = object_creation[i].create_instance;
*ppv = &factory->IClassFactory_iface; *ppv = &factory->IClassFactory_iface;
return S_OK; return S_OK;

View File

@ -637,7 +637,8 @@ static const IMediaDetVtbl IMediaDet_VTable =
MediaDet_EnterBitmapGrabMode, MediaDet_EnterBitmapGrabMode,
}; };
HRESULT MediaDet_create(IUnknown * pUnkOuter, LPVOID * ppv) { HRESULT media_detector_create(IUnknown *pUnkOuter, IUnknown **ppv)
{
MediaDetImpl* obj = NULL; MediaDetImpl* obj = NULL;
TRACE("(%p,%p)\n", pUnkOuter, ppv); TRACE("(%p,%p)\n", pUnkOuter, ppv);

View File

@ -62,7 +62,7 @@ static const struct strmbase_renderer_ops renderer_ops =
.renderer_destroy = null_renderer_destroy, .renderer_destroy = null_renderer_destroy,
}; };
HRESULT NullRenderer_create(IUnknown *outer, void **out) HRESULT null_renderer_create(IUnknown *outer, IUnknown **out)
{ {
HRESULT hr; HRESULT hr;
NullRendererImpl *pNullRenderer; NullRendererImpl *pNullRenderer;

View File

@ -33,9 +33,9 @@
#include "dshow.h" #include "dshow.h"
#include "qedit.h" #include "qedit.h"
HRESULT AMTimeline_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; HRESULT timeline_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT MediaDet_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; HRESULT media_detector_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT NullRenderer_create(IUnknown *outer, void **out) DECLSPEC_HIDDEN; HRESULT null_renderer_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT SampleGrabber_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; HRESULT sample_grabber_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
#endif /* __QEDIT_PRIVATE_INCLUDED__ */ #endif /* __QEDIT_PRIVATE_INCLUDED__ */

View File

@ -634,7 +634,7 @@ static const struct strmbase_source_ops source_ops =
.pfnDecideAllocator = sample_grabber_source_DecideAllocator, .pfnDecideAllocator = sample_grabber_source_DecideAllocator,
}; };
HRESULT SampleGrabber_create(IUnknown *outer, void **out) HRESULT sample_grabber_create(IUnknown *outer, IUnknown **out)
{ {
SG_Impl* obj = NULL; SG_Impl* obj = NULL;
ISeekingPassThru *passthru; ISeekingPassThru *passthru;

View File

@ -421,7 +421,7 @@ static const IAMTimelineVtbl IAMTimeline_VTable =
Timeline_IAMTimeline_GetDefaultEffectB, Timeline_IAMTimeline_GetDefaultEffectB,
}; };
HRESULT AMTimeline_create(IUnknown *pUnkOuter, LPVOID *ppv) HRESULT timeline_create(IUnknown *pUnkOuter, IUnknown **ppv)
{ {
TimelineImpl* obj = NULL; TimelineImpl* obj = NULL;