From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/acmwrapper.c | 2 +- dlls/quartz/avidec.c | 2 +- dlls/quartz/dsoundrender.c | 5 ++--- dlls/quartz/filesource.c | 2 +- dlls/quartz/filtergraph.c | 10 +++------ dlls/quartz/filtermapper.c | 26 +++------------------- dlls/quartz/main.c | 42 ++++++++++++++++++------------------ dlls/quartz/memallocator.c | 6 ++---- dlls/quartz/quartz_private.h | 27 +++++++++++------------ dlls/quartz/systemclock.c | 2 +- dlls/quartz/videorenderer.c | 6 +++--- dlls/quartz/vmr9.c | 10 ++++----- 12 files changed, 56 insertions(+), 84 deletions(-)
diff --git a/dlls/quartz/acmwrapper.c b/dlls/quartz/acmwrapper.c index df55f094d57..b354ae4009a 100644 --- a/dlls/quartz/acmwrapper.c +++ b/dlls/quartz/acmwrapper.c @@ -519,7 +519,7 @@ static const struct strmbase_filter_ops filter_ops = .filter_cleanup_stream = acm_wrapper_cleanup_stream, };
-HRESULT ACMWrapper_create(IUnknown *outer, void **out) +HRESULT acm_wrapper_create(IUnknown *outer, IUnknown **out) { ISeekingPassThru *passthrough; ACMWrapperImpl *object; diff --git a/dlls/quartz/avidec.c b/dlls/quartz/avidec.c index 4abc715be12..7b6838e466d 100644 --- a/dlls/quartz/avidec.c +++ b/dlls/quartz/avidec.c @@ -531,7 +531,7 @@ static const struct strmbase_filter_ops filter_ops = .filter_cleanup_stream = avi_decompressor_cleanup_stream, };
-HRESULT AVIDec_create(IUnknown *outer, void **out) +HRESULT avi_dec_create(IUnknown *outer, IUnknown **out) { AVIDecImpl *object; ISeekingPassThru *passthrough; diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 2aa9d7ca249..8dc93abd628 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -805,7 +805,7 @@ static const IAMDirectSoundVtbl IAMDirectSound_Vtbl = AMDirectSound_GetFocusWindow };
-HRESULT dsound_render_create(IUnknown *outer, void **out) +HRESULT dsound_render_create(IUnknown *outer, IUnknown **out) { static const DSBUFFERDESC buffer_desc = { .dwSize = sizeof(DSBUFFERDESC), @@ -827,8 +827,7 @@ HRESULT dsound_render_create(IUnknown *outer, void **out) return hr; }
- if (FAILED(hr = QUARTZ_CreateSystemClock(&object->renderer.filter.IUnknown_inner, - (void **)&object->system_clock))) + if (FAILED(hr = system_clock_create(&object->renderer.filter.IUnknown_inner, &object->system_clock))) { strmbase_renderer_cleanup(&object->renderer); CoTaskMemFree(object); diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 53d9528d26a..09ab5e51fea 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -412,7 +412,7 @@ static DWORD CALLBACK io_thread(void *arg) return 0; }
-HRESULT AsyncReader_create(IUnknown *outer, void **out) +HRESULT async_reader_create(IUnknown *outer, IUnknown **out) { AsyncReader *object;
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 5acd0729527..dfda734d8a9 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -5675,7 +5675,7 @@ static const IUnknownVtbl IInner_VTable = FilterGraphInner_Release };
-static HRESULT filter_graph_common_create(IUnknown *outer, void **out, BOOL threaded) +static HRESULT filter_graph_common_create(IUnknown *outer, IUnknown **out, BOOL threaded) { IFilterGraphImpl *fimpl; HRESULT hr; @@ -5755,16 +5755,12 @@ static HRESULT filter_graph_common_create(IUnknown *outer, void **out, BOOL thre return S_OK; }
-HRESULT filter_graph_create(IUnknown *outer, void **out) +HRESULT filter_graph_create(IUnknown *outer, IUnknown **out) { - TRACE("outer %p, out %p.\n", outer, out); - return filter_graph_common_create(outer, out, TRUE); }
-HRESULT filter_graph_no_thread_create(IUnknown *outer, void **out) +HRESULT filter_graph_no_thread_create(IUnknown *outer, IUnknown **out) { - TRACE("outer %p, out %p.\n", outer, out); - return filter_graph_common_create(outer, out, FALSE); } diff --git a/dlls/quartz/filtermapper.c b/dlls/quartz/filtermapper.c index 67576268070..0d1403b5168 100644 --- a/dlls/quartz/filtermapper.c +++ b/dlls/quartz/filtermapper.c @@ -1386,12 +1386,10 @@ static const IAMFilterDataVtbl AMFilterDataVtbl = { AMFilterData_CreateFilterData };
-HRESULT FilterMapper2_create(IUnknown *pUnkOuter, LPVOID *ppObj) +HRESULT filter_mapper_create(IUnknown *pUnkOuter, IUnknown **out) { FilterMapper3Impl * pFM2impl;
- TRACE("(%p, %p)\n", pUnkOuter, ppObj); - pFM2impl = CoTaskMemAlloc(sizeof(*pFM2impl)); if (!pFM2impl) return E_OUTOFMEMORY; @@ -1407,25 +1405,7 @@ HRESULT FilterMapper2_create(IUnknown *pUnkOuter, LPVOID *ppObj) else pFM2impl->outer_unk = &pFM2impl->IUnknown_inner;
- *ppObj = &pFM2impl->IUnknown_inner; - - TRACE("-- created at %p\n", pFM2impl); - + TRACE("Created filter mapper %p.\n", pFM2impl); + *out = &pFM2impl->IUnknown_inner; return S_OK; } - -HRESULT FilterMapper_create(IUnknown *pUnkOuter, LPVOID *ppObj) -{ - FilterMapper3Impl *pFM2impl; - HRESULT hr; - - TRACE("(%p, %p)\n", pUnkOuter, ppObj); - - hr = FilterMapper2_create(pUnkOuter, (LPVOID*)&pFM2impl); - if (FAILED(hr)) - return hr; - - *ppObj = &pFM2impl->IFilterMapper_iface; - - return hr; -} diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index 678bc0f9633..9c61dd50d76 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -35,9 +35,9 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) return QUARTZ_DllMain( hInstDLL, fdwReason, lpv ); }
-static HRESULT SeekingPassThru_create(IUnknown *pUnkOuter, LPVOID *ppObj) +static HRESULT seeking_passthrough_create(IUnknown *outer, IUnknown **out) { - return PosPassThru_Construct(pUnkOuter,ppObj); /* from strmbase */ + return PosPassThru_Construct(outer, (void **)out); }
/****************************************************************************** @@ -46,7 +46,7 @@ static HRESULT SeekingPassThru_create(IUnknown *pUnkOuter, LPVOID *ppObj) typedef struct { IClassFactory IClassFactory_iface; LONG ref; - HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj); + HRESULT (*create_instance)(IUnknown *outer, IUnknown **out); } IClassFactoryImpl;
static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) @@ -57,27 +57,27 @@ static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) struct object_creation_info { const CLSID *clsid; - HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj); + HRESULT (*create_instance)(IUnknown *outer, IUnknown **out); };
static const struct object_creation_info object_creation[] = { - { &CLSID_SeekingPassThru, SeekingPassThru_create }, + { &CLSID_ACMWrapper, acm_wrapper_create }, + { &CLSID_AsyncReader, async_reader_create }, + { &CLSID_AudioRender, dsound_render_create }, + { &CLSID_AVIDec, avi_dec_create }, + { &CLSID_DSoundRender, dsound_render_create }, { &CLSID_FilterGraph, filter_graph_create }, { &CLSID_FilterGraphNoThread, filter_graph_no_thread_create }, - { &CLSID_FilterMapper, FilterMapper_create }, - { &CLSID_FilterMapper2, FilterMapper2_create }, - { &CLSID_AsyncReader, AsyncReader_create }, - { &CLSID_MemoryAllocator, StdMemAllocator_create }, - { &CLSID_VideoRenderer, VideoRenderer_create }, - { &CLSID_VideoMixingRenderer, VMR7Impl_create }, - { &CLSID_VideoMixingRenderer9, VMR9Impl_create }, - { &CLSID_VideoRendererDefault, VideoRendererDefault_create }, - { &CLSID_DSoundRender, dsound_render_create }, - { &CLSID_AudioRender, dsound_render_create }, - { &CLSID_AVIDec, AVIDec_create }, - { &CLSID_SystemClock, QUARTZ_CreateSystemClock }, - { &CLSID_ACMWrapper, ACMWrapper_create }, + { &CLSID_FilterMapper, filter_mapper_create }, + { &CLSID_FilterMapper2, filter_mapper_create }, + { &CLSID_MemoryAllocator, mem_allocator_create }, + { &CLSID_SeekingPassThru, seeking_passthrough_create }, + { &CLSID_SystemClock, system_clock_create }, + { &CLSID_VideoRenderer, video_renderer_create }, + { &CLSID_VideoMixingRenderer, vmr7_create }, + { &CLSID_VideoMixingRenderer9, vmr9_create }, + { &CLSID_VideoRendererDefault, video_renderer_default_create }, };
static HRESULT WINAPI DSCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj) @@ -126,8 +126,8 @@ static HRESULT WINAPI DSCF_CreateInstance(IClassFactory *iface, IUnknown *pOuter if(pOuter && !IsEqualGUID(&IID_IUnknown, riid)) return E_NOINTERFACE;
- hres = This->pfnCreateInstance(pOuter, (LPVOID *) &punk); - if (SUCCEEDED(hres)) { + if (SUCCEEDED(hres = This->create_instance(pOuter, &punk))) + { hres = IUnknown_QueryInterface(punk, riid, ppobj); IUnknown_Release(punk); } @@ -189,7 +189,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) factory->IClassFactory_iface.lpVtbl = &DSCF_Vtbl; factory->ref = 1;
- factory->pfnCreateInstance = object_creation[i].pfnCreateInstance; + factory->create_instance = object_creation[i].create_instance;
*ppv = &factory->IClassFactory_iface; return S_OK; diff --git a/dlls/quartz/memallocator.c b/dlls/quartz/memallocator.c index fab0f2d1c44..531fbe874cf 100644 --- a/dlls/quartz/memallocator.c +++ b/dlls/quartz/memallocator.c @@ -913,13 +913,11 @@ static void StdMemAllocator_Destroy(IMemAllocator *iface) CoTaskMemFree(This); }
-HRESULT StdMemAllocator_create(LPUNKNOWN lpUnkOuter, LPVOID * ppv) +HRESULT mem_allocator_create(IUnknown *lpUnkOuter, IUnknown **out) { StdMemAllocator * pMemAlloc; HRESULT hr;
- *ppv = NULL; - if (lpUnkOuter) return CLASS_E_NOAGGREGATION;
@@ -932,7 +930,7 @@ HRESULT StdMemAllocator_create(LPUNKNOWN lpUnkOuter, LPVOID * ppv) pMemAlloc->pMemory = NULL;
if (SUCCEEDED(hr = BaseMemAllocator_Init(StdMemAllocator_Alloc, StdMemAllocator_Free, NULL, NULL, NULL, StdMemAllocator_Destroy, &pMemAlloc->csState, &pMemAlloc->base))) - *ppv = pMemAlloc; + *out = (IUnknown *)&pMemAlloc->base.IMemAllocator_iface; else CoTaskMemFree(pMemAlloc);
diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index 3431a5836ff..98ca63d858e 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -60,20 +60,19 @@ static inline const char *debugstr_time(REFERENCE_TIME time) #define MEDIATIME_FROM_BYTES(x) ((LONGLONG)(x) * 10000000) #define BYTES_FROM_MEDIATIME(time) ((time) / 10000000)
-HRESULT dsound_render_create(IUnknown *outer, void **out) DECLSPEC_HIDDEN; -HRESULT filter_graph_create(IUnknown *outer, void **out) DECLSPEC_HIDDEN; -HRESULT filter_graph_no_thread_create(IUnknown *outer, void **out) DECLSPEC_HIDDEN; -HRESULT FilterMapper2_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; -HRESULT FilterMapper_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; -HRESULT AsyncReader_create(IUnknown * pUnkOuter, LPVOID * ppv) DECLSPEC_HIDDEN; -HRESULT StdMemAllocator_create(IUnknown * pUnkOuter, LPVOID * ppv) DECLSPEC_HIDDEN; -HRESULT AVIDec_create(IUnknown * pUnkOuter, LPVOID * ppv) DECLSPEC_HIDDEN; -HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv) DECLSPEC_HIDDEN; -HRESULT VideoRendererDefault_create(IUnknown * pUnkOuter, LPVOID * ppv) DECLSPEC_HIDDEN; -HRESULT QUARTZ_CreateSystemClock(IUnknown * pUnkOuter, LPVOID * ppv) DECLSPEC_HIDDEN; -HRESULT ACMWrapper_create(IUnknown * pUnkOuter, LPVOID * ppv) DECLSPEC_HIDDEN; -HRESULT VMR7Impl_create(IUnknown *pUnkOuter, LPVOID *ppv) DECLSPEC_HIDDEN; -HRESULT VMR9Impl_create(IUnknown *pUnkOuter, LPVOID *ppv) DECLSPEC_HIDDEN; +HRESULT acm_wrapper_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +HRESULT avi_dec_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +HRESULT async_reader_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +HRESULT dsound_render_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +HRESULT filter_graph_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +HRESULT filter_graph_no_thread_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +HRESULT filter_mapper_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +HRESULT mem_allocator_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +HRESULT system_clock_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +HRESULT video_renderer_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +HRESULT video_renderer_default_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +HRESULT vmr7_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +HRESULT vmr9_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT EnumMonikerImpl_Create(IMoniker ** ppMoniker, ULONG nMonikerCount, IEnumMoniker ** ppEnum) DECLSPEC_HIDDEN;
diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c index 51e96c82e68..8ccd6df47ce 100644 --- a/dlls/quartz/systemclock.c +++ b/dlls/quartz/systemclock.c @@ -327,7 +327,7 @@ static const IReferenceClockVtbl SystemClock_vtbl = SystemClockImpl_Unadvise };
-HRESULT QUARTZ_CreateSystemClock(IUnknown *outer, void **out) +HRESULT system_clock_create(IUnknown *outer, IUnknown **out) { struct system_clock *object;
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 4383f66e443..3bd93dbb864 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -697,7 +697,7 @@ static const IOverlayVtbl overlay_vtbl = overlay_Unadvise, };
-HRESULT VideoRenderer_create(IUnknown *outer, void **out) +HRESULT video_renderer_create(IUnknown *outer, IUnknown **out) { HRESULT hr; VideoRendererImpl * pVideoRenderer; @@ -745,8 +745,8 @@ fail: return hr; }
-HRESULT VideoRendererDefault_create(IUnknown * pUnkOuter, LPVOID * ppv) +HRESULT video_renderer_default_create(IUnknown *outer, IUnknown **out) { /* TODO: Attempt to use the VMR-7 renderer instead when possible */ - return VideoRenderer_create(pUnkOuter, ppv); + return video_renderer_create(outer, out); } diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index bc2a905650c..8503a7b2806 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -2208,7 +2208,7 @@ static const IOverlayVtbl overlay_vtbl = overlay_Unadvise, };
-static HRESULT vmr_create(IUnknown *outer, void **out, const CLSID *clsid) +static HRESULT vmr_create(IUnknown *outer, IUnknown **out, const CLSID *clsid) { HRESULT hr; struct quartz_vmr* pVMR; @@ -2278,14 +2278,14 @@ fail: return hr; }
-HRESULT VMR7Impl_create(IUnknown *outer_unk, LPVOID *ppv) +HRESULT vmr7_create(IUnknown *outer, IUnknown **out) { - return vmr_create(outer_unk, ppv, &CLSID_VideoMixingRenderer); + return vmr_create(outer, out, &CLSID_VideoMixingRenderer); }
-HRESULT VMR9Impl_create(IUnknown *outer_unk, LPVOID *ppv) +HRESULT vmr9_create(IUnknown *outer, IUnknown **out) { - return vmr_create(outer_unk, ppv, &CLSID_VideoMixingRenderer9); + return vmr_create(outer, out, &CLSID_VideoMixingRenderer9); }