From 67cb8da5cb8f8ee0d9cf770d567f20f4e0238ab5 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Mon, 2 Jul 2012 01:03:21 +0200 Subject: [PATCH] quartz: Move NullRenderer_create() to avoid forward declarations. --- dlls/quartz/nullrenderer.c | 70 ++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/dlls/quartz/nullrenderer.c b/dlls/quartz/nullrenderer.c index 6d93dca3708..16a24ac7a54 100644 --- a/dlls/quartz/nullrenderer.c +++ b/dlls/quartz/nullrenderer.c @@ -41,10 +41,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz); -static const IBaseFilterVtbl NullRenderer_Vtbl; -static const IUnknownVtbl IInner_VTable; -static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl; - typedef struct NullRendererImpl { BaseRenderer renderer; @@ -86,39 +82,6 @@ static const BaseRendererFuncTable RendererFuncTable = { NULL, }; -HRESULT NullRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv) -{ - HRESULT hr; - NullRendererImpl * pNullRenderer; - - TRACE("(%p, %p)\n", pUnkOuter, ppv); - - *ppv = NULL; - - pNullRenderer = CoTaskMemAlloc(sizeof(NullRendererImpl)); - pNullRenderer->IUnknown_inner.lpVtbl = &IInner_VTable; - pNullRenderer->IAMFilterMiscFlags_iface.lpVtbl = &IAMFilterMiscFlags_Vtbl; - - if (pUnkOuter) - pNullRenderer->outer_unk = pUnkOuter; - else - pNullRenderer->outer_unk = &pNullRenderer->IUnknown_inner; - - hr = BaseRenderer_Init(&pNullRenderer->renderer, &NullRenderer_Vtbl, pUnkOuter, - &CLSID_NullRenderer, (DWORD_PTR)(__FILE__ ": NullRendererImpl.csFilter"), - &RendererFuncTable); - - if (FAILED(hr)) - { - BaseRendererImpl_Release(&pNullRenderer->renderer.filter.IBaseFilter_iface); - CoTaskMemFree(pNullRenderer); - } - else - *ppv = &pNullRenderer->IUnknown_inner; - - return S_OK; -} - static inline NullRendererImpl *impl_from_IUnknown(IUnknown *iface) { return CONTAINING_RECORD(iface, NullRendererImpl, IUnknown_inner); @@ -260,3 +223,36 @@ static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl = { AMFilterMiscFlags_Release, AMFilterMiscFlags_GetMiscFlags }; + +HRESULT NullRenderer_create(IUnknown *pUnkOuter, void **ppv) +{ + HRESULT hr; + NullRendererImpl *pNullRenderer; + + TRACE("(%p, %p)\n", pUnkOuter, ppv); + + *ppv = NULL; + + pNullRenderer = CoTaskMemAlloc(sizeof(NullRendererImpl)); + pNullRenderer->IUnknown_inner.lpVtbl = &IInner_VTable; + pNullRenderer->IAMFilterMiscFlags_iface.lpVtbl = &IAMFilterMiscFlags_Vtbl; + + if (pUnkOuter) + pNullRenderer->outer_unk = pUnkOuter; + else + pNullRenderer->outer_unk = &pNullRenderer->IUnknown_inner; + + hr = BaseRenderer_Init(&pNullRenderer->renderer, &NullRenderer_Vtbl, pUnkOuter, + &CLSID_NullRenderer, (DWORD_PTR)(__FILE__ ": NullRendererImpl.csFilter"), + &RendererFuncTable); + + if (FAILED(hr)) + { + BaseRendererImpl_Release(&pNullRenderer->renderer.filter.IBaseFilter_iface); + CoTaskMemFree(pNullRenderer); + } + else + *ppv = &pNullRenderer->IUnknown_inner; + + return S_OK; +}