From 5fb58eae3b9c2ca89d801b9d50ef9843665ca6b5 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 21 Oct 2015 14:31:49 +0300 Subject: [PATCH] quartz: Minor cleanup of returned interface pointers. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/quartz/avisplit.c | 2 +- dlls/quartz/filesource.c | 10 ++++------ dlls/quartz/mpegsplit.c | 2 +- dlls/quartz/parser.c | 10 +++++----- dlls/quartz/systemclock.c | 2 +- dlls/quartz/vmr9.c | 2 +- dlls/quartz/waveparser.c | 2 +- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/dlls/quartz/avisplit.c b/dlls/quartz/avisplit.c index d62ec2b98c0..74529f228af 100644 --- a/dlls/quartz/avisplit.c +++ b/dlls/quartz/avisplit.c @@ -1451,7 +1451,7 @@ HRESULT AVISplitter_create(IUnknown * pUnkOuter, LPVOID * ppv) if (FAILED(hr)) return hr; - *ppv = This; + *ppv = &This->Parser.filter.IBaseFilter_iface; return hr; } diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 877c70667ec..33ac4423ec0 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -810,20 +810,18 @@ static HRESULT WINAPI FileAsyncReaderPin_QueryInterface(IPin * iface, REFIID rii *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = This; - else if (IsEqualIID(riid, &IID_IPin)) - *ppv = This; + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IPin)) + *ppv = &This->pin.pin.IPin_iface; else if (IsEqualIID(riid, &IID_IAsyncReader)) *ppv = &This->IAsyncReader_iface; if (*ppv) { - IUnknown_AddRef((IUnknown *)(*ppv)); + IUnknown_AddRef((IUnknown *)*ppv); return S_OK; } - if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IMediaSeeking)) + if (!IsEqualIID(riid, &IID_IMediaSeeking)) FIXME("No interface for %s!\n", qzdebugstr_guid(riid)); return E_NOINTERFACE; diff --git a/dlls/quartz/mpegsplit.c b/dlls/quartz/mpegsplit.c index 33a93ba9033..60dd82c33fc 100644 --- a/dlls/quartz/mpegsplit.c +++ b/dlls/quartz/mpegsplit.c @@ -797,7 +797,7 @@ HRESULT MPEGSplitter_create(IUnknown * pUnkOuter, LPVOID * ppv) This->seek = TRUE; /* Note: This memory is managed by the parser filter once created */ - *ppv = This; + *ppv = &This->Parser.filter.IBaseFilter_iface; return hr; } diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index cd8d93dd326..fd987872a2c 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -147,11 +147,11 @@ HRESULT WINAPI Parser_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * || IsEqualIID(riid, &IID_IPersist) || IsEqualIID(riid, &IID_IMediaFilter) || IsEqualIID(riid, &IID_IBaseFilter) ) - *ppv = This; + *ppv = &This->filter.IBaseFilter_iface; if (*ppv) { - IUnknown_AddRef((IUnknown *)(*ppv)); + IUnknown_AddRef((IUnknown *)*ppv); return S_OK; } @@ -521,21 +521,21 @@ static HRESULT WINAPI Parser_Seeking_QueryInterface(IMediaSeeking * iface, REFII { ParserImpl *This = impl_from_IMediaSeeking(iface); - return IUnknown_QueryInterface((IUnknown *)This, riid, ppv); + return IBaseFilter_QueryInterface(&This->filter.IBaseFilter_iface, riid, ppv); } static ULONG WINAPI Parser_Seeking_AddRef(IMediaSeeking * iface) { ParserImpl *This = impl_from_IMediaSeeking(iface); - return IUnknown_AddRef((IUnknown *)This); + return IBaseFilter_AddRef(&This->filter.IBaseFilter_iface); } static ULONG WINAPI Parser_Seeking_Release(IMediaSeeking * iface) { ParserImpl *This = impl_from_IMediaSeeking(iface); - return IUnknown_Release((IUnknown *)This); + return IBaseFilter_Release(&This->filter.IBaseFilter_iface); } static const IMediaSeekingVtbl Parser_Seeking_Vtbl = diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c index cdb06f7a0e0..a3e15047683 100644 --- a/dlls/quartz/systemclock.c +++ b/dlls/quartz/systemclock.c @@ -215,7 +215,7 @@ static HRESULT WINAPI SystemClockImpl_QueryInterface(IReferenceClock* iface, REF if (IsEqualIID (riid, &IID_IUnknown) || IsEqualIID (riid, &IID_IReferenceClock)) { SystemClockImpl_AddRef(iface); - *ppobj = This; + *ppobj = &This->IReferenceClock_iface; return S_OK; } diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index c9a330d5fdb..10b9dff572c 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -3111,6 +3111,6 @@ static HRESULT VMR9DefaultAllocatorPresenterImpl_create(struct quartz_vmr *paren This->SurfaceAllocatorNotify = NULL; This->reset = FALSE; - *ppv = This; + *ppv = &This->IVMRImagePresenter9_iface; return S_OK; } diff --git a/dlls/quartz/waveparser.c b/dlls/quartz/waveparser.c index 3f3846cf95d..6e8c6641e5a 100644 --- a/dlls/quartz/waveparser.c +++ b/dlls/quartz/waveparser.c @@ -440,7 +440,7 @@ HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv) if (FAILED(hr)) return hr; - *ppv = This; + *ppv = &This->Parser.filter.IBaseFilter_iface; return hr; }