From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/dispatch.c | 49 +++++++++++++++++++++++++++++++ dlls/strmbase/video.c | 63 +++++++++++++++++++++++----------------- include/wine/strmbase.h | 14 ++++++++- 3 files changed, 98 insertions(+), 28 deletions(-)
diff --git a/dlls/strmbase/dispatch.c b/dlls/strmbase/dispatch.c index e91b65a94a..1521471889 100644 --- a/dlls/strmbase/dispatch.c +++ b/dlls/strmbase/dispatch.c @@ -20,6 +20,55 @@
#include "strmbase_private.h"
+WINE_DEFAULT_DEBUG_CHANNEL(strmbase); + +static ITypeLib *control_typelib; +static ITypeInfo *control_typeinfo[last_tid]; + +static REFIID control_tid_id[] = +{ + &IID_IBasicAudio, + &IID_IBasicVideo, + &IID_IMediaControl, + &IID_IMediaEvent, + &IID_IMediaPosition, + &IID_IVideoWindow, +}; + +HRESULT strmbase_get_typeinfo(enum strmbase_type_id tid, ITypeInfo **ret) +{ + HRESULT hr; + + if (!control_typelib) + { + ITypeLib *typelib; + + hr = LoadRegTypeLib(&LIBID_QuartzTypeLib, 1, 0, LOCALE_SYSTEM_DEFAULT, &typelib); + if (FAILED(hr)) + { + ERR("Failed to load typelib, hr %#x.\n", hr); + return hr; + } + if (InterlockedCompareExchangePointer((void **)&control_typelib, typelib, NULL)) + ITypeLib_Release(typelib); + } + if (!control_typeinfo[tid]) + { + ITypeInfo *typeinfo; + + hr = ITypeLib_GetTypeInfoOfGuid(control_typelib, control_tid_id[tid], &typeinfo); + if (FAILED(hr)) + { + ERR("Failed to get type info for %s, hr %#x.\n", debugstr_guid(control_tid_id[tid]), hr); + return hr; + } + if (InterlockedCompareExchangePointer((void **)(control_typeinfo + tid), typeinfo, NULL)) + ITypeInfo_Release(typeinfo); + } + ITypeInfo_AddRef(*ret = control_typeinfo[tid]); + return S_OK; +} + HRESULT WINAPI BaseDispatch_Init(BaseDispatch *This, REFIID riid) { ITypeLib *pTypeLib; diff --git a/dlls/strmbase/video.c b/dlls/strmbase/video.c index 2857932a05..440adc43a8 100644 --- a/dlls/strmbase/video.c +++ b/dlls/strmbase/video.c @@ -35,14 +35,12 @@ HRESULT WINAPI BaseControlVideo_Init(BaseControlVideo *pControlVideo, const IBas pControlVideo->pPin = pPin; pControlVideo->pFuncsTable = pFuncsTable;
- BaseDispatch_Init(&pControlVideo->baseDispatch, &IID_IBasicVideo); - return S_OK; }
HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo) { - return BaseDispatch_Destroy(&pControlVideo->baseDispatch); + return S_OK; }
static HRESULT BaseControlVideoImpl_CheckSourceRect(BaseControlVideo *This, RECT *pSourceRect) @@ -72,40 +70,51 @@ static HRESULT BaseControlVideoImpl_CheckTargetRect(BaseControlVideo *This, RECT return S_OK; }
-HRESULT WINAPI BaseControlVideoImpl_GetTypeInfoCount(IBasicVideo *iface, UINT *pctinfo) +HRESULT WINAPI BaseControlVideoImpl_GetTypeInfoCount(IBasicVideo *iface, UINT *count) { - BaseControlVideo *This = impl_from_IBasicVideo(iface); - - return BaseDispatchImpl_GetTypeInfoCount(&This->baseDispatch, pctinfo); + TRACE("iface %p, count %p.\n", iface, count); + *count = 1; + return S_OK; }
-HRESULT WINAPI BaseControlVideoImpl_GetTypeInfo(IBasicVideo *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +HRESULT WINAPI BaseControlVideoImpl_GetTypeInfo(IBasicVideo *iface, UINT index, + LCID lcid, ITypeInfo **typeinfo) { - BaseControlVideo *This = impl_from_IBasicVideo(iface); - - return BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, &IID_NULL, iTInfo, lcid, ppTInfo); + TRACE("iface %p, index %u, lcid %#x, typeinfo %p.\n", iface, index, lcid, typeinfo); + return strmbase_get_typeinfo(IBasicVideo_tid, typeinfo); }
-HRESULT WINAPI BaseControlVideoImpl_GetIDsOfNames(IBasicVideo *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +HRESULT WINAPI BaseControlVideoImpl_GetIDsOfNames(IBasicVideo *iface, REFIID iid, + LPOLESTR *names, UINT count, LCID lcid, DISPID *ids) { - BaseControlVideo *This = impl_from_IBasicVideo(iface); - - return BaseDispatchImpl_GetIDsOfNames(&This->baseDispatch, riid, rgszNames, cNames, lcid, rgDispId); -} - -HRESULT WINAPI BaseControlVideoImpl_Invoke(IBasicVideo *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr) -{ - BaseControlVideo *This = impl_from_IBasicVideo(iface); - ITypeInfo *pTypeInfo; + ITypeInfo *typeinfo; HRESULT hr;
- hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo); - if (SUCCEEDED(hr)) - { - hr = ITypeInfo_Invoke(pTypeInfo, &This->IBasicVideo_iface, dispIdMember, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr); - ITypeInfo_Release(pTypeInfo); - } + TRACE("iface %p, iid %s, names %p, count %u, lcid %#x, ids %p.\n", + iface, debugstr_guid(iid), names, count, lcid, ids);
+ if (SUCCEEDED(hr = strmbase_get_typeinfo(IBasicVideo_tid, &typeinfo))) + { + hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, ids); + ITypeInfo_Release(typeinfo); + } + return hr; +} + +HRESULT WINAPI BaseControlVideoImpl_Invoke(IBasicVideo *iface, DISPID id, REFIID iid, LCID lcid, + WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg) +{ + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("iface %p, id %d, iid %s, lcid %#x, flags %#x, params %p, result %p, excepinfo %p, error_arg %p.\n", + iface, id, debugstr_guid(iid), lcid, flags, params, result, excepinfo, error_arg); + + if (SUCCEEDED(hr = strmbase_get_typeinfo(IBasicVideo_tid, &typeinfo))) + { + hr = ITypeInfo_Invoke(typeinfo, iface, id, flags, params, result, excepinfo, error_arg); + ITypeInfo_Release(typeinfo); + } return hr; }
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 56560ed02b..0cbb7c3b78 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -399,6 +399,19 @@ RECT WINAPI BaseWindowImpl_GetDefaultRect(BaseWindow *This); LRESULT WINAPI BaseWindowImpl_OnReceiveMessage(BaseWindow *This, HWND hwnd, INT uMsg, WPARAM wParam, LPARAM lParam); BOOL WINAPI BaseWindowImpl_OnSize(BaseWindow *This, LONG Height, LONG Width);
+enum strmbase_type_id +{ + IBasicAudio_tid, + IBasicVideo_tid, + IMediaControl_tid, + IMediaEvent_tid, + IMediaPosition_tid, + IVideoWindow_tid, + last_tid +}; + +HRESULT strmbase_get_typeinfo(enum strmbase_type_id tid, ITypeInfo **typeinfo); + typedef struct{ ITypeInfo *pTypeInfo; } BaseDispatch; @@ -473,7 +486,6 @@ HRESULT WINAPI BaseControlWindowImpl_IsCursorHidden(IVideoWindow *iface, LONG *C typedef struct tagBaseControlVideo { IBasicVideo IBasicVideo_iface; - BaseDispatch baseDispatch;
BaseFilter* pFilter; CRITICAL_SECTION* pInterfaceLock;
From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/window.c | 62 ++++++++++++++++++++++++----------------- include/wine/strmbase.h | 1 - 2 files changed, 36 insertions(+), 27 deletions(-)
diff --git a/dlls/strmbase/window.c b/dlls/strmbase/window.c index d0105bdfbd..eea45aa23d 100644 --- a/dlls/strmbase/window.c +++ b/dlls/strmbase/window.c @@ -200,7 +200,6 @@ HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow, const I hr = BaseWindow_Init(&pControlWindow->baseWindow, pFuncsTable); if (SUCCEEDED(hr)) { - BaseDispatch_Init(&pControlWindow->baseDispatch, &IID_IVideoWindow); pControlWindow->IVideoWindow_iface.lpVtbl = lpVtbl; pControlWindow->AutoShow = TRUE; pControlWindow->hwndDrain = NULL; @@ -215,43 +214,54 @@ HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow, const I HRESULT WINAPI BaseControlWindow_Destroy(BaseControlWindow *pControlWindow) { BaseWindowImpl_DoneWithWindow(&pControlWindow->baseWindow); - return BaseDispatch_Destroy(&pControlWindow->baseDispatch); + return S_OK; }
-HRESULT WINAPI BaseControlWindowImpl_GetTypeInfoCount(IVideoWindow *iface, UINT *pctinfo) +HRESULT WINAPI BaseControlWindowImpl_GetTypeInfoCount(IVideoWindow *iface, UINT *count) { - BaseControlWindow* This = impl_from_IVideoWindow(iface); - - return BaseDispatchImpl_GetTypeInfoCount(&This->baseDispatch, pctinfo); + TRACE("iface %p, count %p.\n", iface, count); + *count = 1; + return S_OK; }
-HRESULT WINAPI BaseControlWindowImpl_GetTypeInfo(IVideoWindow *iface, UINT iTInfo, LCID lcid, ITypeInfo**ppTInfo) +HRESULT WINAPI BaseControlWindowImpl_GetTypeInfo(IVideoWindow *iface, UINT index, + LCID lcid, ITypeInfo **typeinfo) { - BaseControlWindow* This = impl_from_IVideoWindow(iface); - - return BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, &IID_NULL, iTInfo, lcid, ppTInfo); + TRACE("iface %p, index %u, lcid %#x, typeinfo %p.\n", iface, index, lcid, typeinfo); + return strmbase_get_typeinfo(IVideoWindow_tid, typeinfo); }
-HRESULT WINAPI BaseControlWindowImpl_GetIDsOfNames(IVideoWindow *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) - { - BaseControlWindow* This = impl_from_IVideoWindow(iface); - - return BaseDispatchImpl_GetIDsOfNames(&This->baseDispatch, riid, rgszNames, cNames, lcid, rgDispId); -} - -HRESULT WINAPI BaseControlWindowImpl_Invoke(IVideoWindow *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr) +HRESULT WINAPI BaseControlWindowImpl_GetIDsOfNames(IVideoWindow *iface, REFIID iid, + LPOLESTR *names, UINT count, LCID lcid, DISPID *ids) { - BaseControlWindow* This = impl_from_IVideoWindow(iface); - ITypeInfo *pTypeInfo; + ITypeInfo *typeinfo; HRESULT hr;
- hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo); - if (SUCCEEDED(hr)) - { - hr = ITypeInfo_Invoke(pTypeInfo, &This->IVideoWindow_iface, dispIdMember, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr); - ITypeInfo_Release(pTypeInfo); - } + TRACE("iface %p, iid %s, names %p, count %u, lcid %#x, ids %p.\n", + iface, debugstr_guid(iid), names, count, lcid, ids);
+ if (SUCCEEDED(hr = strmbase_get_typeinfo(IVideoWindow_tid, &typeinfo))) + { + hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, ids); + ITypeInfo_Release(typeinfo); + } + return hr; +} + +HRESULT WINAPI BaseControlWindowImpl_Invoke(IVideoWindow *iface, DISPID id, REFIID iid, LCID lcid, + WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg) +{ + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("iface %p, id %d, iid %s, lcid %#x, flags %#x, params %p, result %p, excepinfo %p, error_arg %p.\n", + iface, id, debugstr_guid(iid), lcid, flags, params, result, excepinfo, error_arg); + + if (SUCCEEDED(hr = strmbase_get_typeinfo(IVideoWindow_tid, &typeinfo))) + { + hr = ITypeInfo_Invoke(typeinfo, iface, id, flags, params, result, excepinfo, error_arg); + ITypeInfo_Release(typeinfo); + } return hr; }
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 0cbb7c3b78..e762f44c51 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -421,7 +421,6 @@ typedef struct tagBaseControlWindow { BaseWindow baseWindow; IVideoWindow IVideoWindow_iface; - BaseDispatch baseDispatch;
BOOL AutoShow; HWND hwndDrain;
From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/pospass.c | 58 +++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 25 deletions(-)
diff --git a/dlls/strmbase/pospass.c b/dlls/strmbase/pospass.c index f8321324a8..2c5c274bba 100644 --- a/dlls/strmbase/pospass.c +++ b/dlls/strmbase/pospass.c @@ -32,7 +32,6 @@ typedef struct PassThruImpl { ISeekingPassThru ISeekingPassThru_iface; IMediaSeeking IMediaSeeking_iface; IMediaPosition IMediaPosition_iface; - BaseDispatch baseDispatch;
LONG ref; IUnknown * outer_unk; @@ -114,7 +113,6 @@ static ULONG WINAPI SeekInner_Release(IUnknown * iface) {
if (ref == 0) { - BaseDispatch_Destroy(&This->baseDispatch); This->time_cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->time_cs); CoTaskMemFree(This); @@ -260,7 +258,6 @@ HRESULT WINAPI PosPassThru_Construct(IUnknown *pUnkOuter, LPVOID *ppPassThru) fimpl->timevalid = FALSE; InitializeCriticalSection(&fimpl->time_cs); fimpl->time_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PassThruImpl.time_cs"); - BaseDispatch_Init(&fimpl->baseDispatch, &IID_IMediaPosition); return S_OK; }
@@ -674,40 +671,51 @@ static ULONG WINAPI MediaPositionPassThru_Release(IMediaPosition *iface) return SeekOuter_Release(This); }
-static HRESULT WINAPI MediaPositionPassThru_GetTypeInfoCount(IMediaPosition *iface, UINT*pctinfo) +static HRESULT WINAPI MediaPositionPassThru_GetTypeInfoCount(IMediaPosition *iface, UINT *count) { - PassThruImpl *This = impl_from_IMediaPosition(iface); - - return BaseDispatchImpl_GetTypeInfoCount(&This->baseDispatch, pctinfo); + TRACE("iface %p, count %p.\n", iface, count); + *count = 1; + return S_OK; }
-static HRESULT WINAPI MediaPositionPassThru_GetTypeInfo(IMediaPosition *iface, UINT iTInfo, LCID lcid, ITypeInfo**ppTInfo) +static HRESULT WINAPI MediaPositionPassThru_GetTypeInfo(IMediaPosition *iface, UINT index, + LCID lcid, ITypeInfo **typeinfo) { - PassThruImpl *This = impl_from_IMediaPosition(iface); - - return BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, &IID_NULL, iTInfo, lcid, ppTInfo); + TRACE("iface %p, index %u, lcid %#x, typeinfo %p.\n", iface, index, lcid, typeinfo); + return strmbase_get_typeinfo(IMediaPosition_tid, typeinfo); }
-static HRESULT WINAPI MediaPositionPassThru_GetIDsOfNames(IMediaPosition *iface, REFIID riid, LPOLESTR*rgszNames, UINT cNames, LCID lcid, DISPID*rgDispId) +static HRESULT WINAPI MediaPositionPassThru_GetIDsOfNames(IMediaPosition *iface, REFIID iid, + LPOLESTR *names, UINT count, LCID lcid, DISPID *ids) { - PassThruImpl *This = impl_from_IMediaPosition(iface); + ITypeInfo *typeinfo; + HRESULT hr;
- return BaseDispatchImpl_GetIDsOfNames(&This->baseDispatch, riid, rgszNames, cNames, lcid, rgDispId); -} + TRACE("iface %p, iid %s, names %p, count %u, lcid %#x, ids %p.\n", + iface, debugstr_guid(iid), names, count, lcid, ids);
-static HRESULT WINAPI MediaPositionPassThru_Invoke(IMediaPosition *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS*pDispParams, VARIANT*pVarResult, EXCEPINFO*pExepInfo, UINT*puArgErr) -{ - PassThruImpl *This = impl_from_IMediaPosition(iface); - HRESULT hr = S_OK; - ITypeInfo *pTypeInfo; - - hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo); - if (SUCCEEDED(hr)) + if (SUCCEEDED(hr = strmbase_get_typeinfo(IMediaPosition_tid, &typeinfo))) { - hr = ITypeInfo_Invoke(pTypeInfo, &This->IMediaPosition_iface, dispIdMember, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr); - ITypeInfo_Release(pTypeInfo); + hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, ids); + ITypeInfo_Release(typeinfo); } + return hr; +}
+static HRESULT WINAPI MediaPositionPassThru_Invoke(IMediaPosition *iface, DISPID id, REFIID iid, LCID lcid, + WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg) +{ + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("iface %p, id %d, iid %s, lcid %#x, flags %#x, params %p, result %p, excepinfo %p, error_arg %p.\n", + iface, id, debugstr_guid(iid), lcid, flags, params, result, excepinfo, error_arg); + + if (SUCCEEDED(hr = strmbase_get_typeinfo(IMediaPosition_tid, &typeinfo))) + { + hr = ITypeInfo_Invoke(typeinfo, iface, id, flags, params, result, excepinfo, error_arg); + ITypeInfo_Release(typeinfo); + } return hr; }
From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/dsoundrender.c | 66 ++++++++++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 10 deletions(-)
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 15452099e2..49de73fe3c 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -51,8 +51,8 @@ static const IAMDirectSoundVtbl IAMDirectSound_Vtbl; typedef struct DSoundRenderImpl { BaseRenderer renderer; - BasicAudio basicAudio;
+ IBasicAudio IBasicAudio_iface; IReferenceClock IReferenceClock_iface; IAMDirectSound IAMDirectSound_iface;
@@ -85,7 +85,7 @@ static inline DSoundRenderImpl *impl_from_IBaseFilter(IBaseFilter *iface)
static inline DSoundRenderImpl *impl_from_IBasicAudio(IBasicAudio *iface) { - return CONTAINING_RECORD(iface, DSoundRenderImpl, basicAudio.IBasicAudio_iface); + return CONTAINING_RECORD(iface, DSoundRenderImpl, IBasicAudio_iface); }
static inline DSoundRenderImpl *impl_from_IReferenceClock(IReferenceClock *iface) @@ -604,7 +604,6 @@ static void dsound_render_destroy(BaseRenderer *iface) IDirectSound8_Release(filter->dsound); filter->dsound = NULL;
- BasicAudio_Destroy(&filter->basicAudio); CloseHandle(filter->blocked);
strmbase_renderer_cleanup(&filter->renderer); @@ -616,7 +615,7 @@ static HRESULT dsound_render_query_interface(BaseRenderer *iface, REFIID iid, vo DSoundRenderImpl *filter = impl_from_BaseRenderer(iface);
if (IsEqualGUID(iid, &IID_IBasicAudio)) - *out = &filter->basicAudio.IBasicAudio_iface; + *out = &filter->IBasicAudio_iface; else if (IsEqualGUID(iid, &IID_IReferenceClock)) *out = &filter->IReferenceClock_iface; else if (IsEqualGUID(iid, &IID_IAMDirectSound)) @@ -670,7 +669,7 @@ HRESULT DSoundRender_create(IUnknown *outer, void **out) outer, &CLSID_DSoundRender, sink_name, (DWORD_PTR)(__FILE__ ": DSoundRenderImpl.csFilter"), &BaseFuncTable);
- BasicAudio_Init(&pDSoundRender->basicAudio,&IBasicAudio_Vtbl); + pDSoundRender->IBasicAudio_iface.lpVtbl = &IBasicAudio_Vtbl; pDSoundRender->IReferenceClock_iface.lpVtbl = &IReferenceClock_Vtbl; pDSoundRender->IAMDirectSound_iface.lpVtbl = &IAMDirectSound_Vtbl;
@@ -793,7 +792,54 @@ static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) { return BaseFilterImpl_Release(&This->renderer.filter.IBaseFilter_iface); }
-/*** IBasicAudio methods ***/ +HRESULT WINAPI basic_audio_GetTypeInfoCount(IBasicAudio *iface, UINT *count) +{ + TRACE("iface %p, count %p.\n", iface, count); + *count = 1; + return S_OK; +} + +HRESULT WINAPI basic_audio_GetTypeInfo(IBasicAudio *iface, UINT index, + LCID lcid, ITypeInfo **typeinfo) +{ + TRACE("iface %p, index %u, lcid %#x, typeinfo %p.\n", iface, index, lcid, typeinfo); + return strmbase_get_typeinfo(IBasicAudio_tid, typeinfo); +} + +HRESULT WINAPI basic_audio_GetIDsOfNames(IBasicAudio *iface, REFIID iid, + LPOLESTR *names, UINT count, LCID lcid, DISPID *ids) +{ + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("iface %p, iid %s, names %p, count %u, lcid %#x, ids %p.\n", + iface, debugstr_guid(iid), names, count, lcid, ids); + + if (SUCCEEDED(hr = strmbase_get_typeinfo(IBasicAudio_tid, &typeinfo))) + { + hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, ids); + ITypeInfo_Release(typeinfo); + } + return hr; +} + +static HRESULT WINAPI basic_audio_Invoke(IBasicAudio *iface, DISPID id, REFIID iid, LCID lcid, + WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg) +{ + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("iface %p, id %d, iid %s, lcid %#x, flags %#x, params %p, result %p, excepinfo %p, error_arg %p.\n", + iface, id, debugstr_guid(iid), lcid, flags, params, result, excepinfo, error_arg); + + if (SUCCEEDED(hr = strmbase_get_typeinfo(IBasicAudio_tid, &typeinfo))) + { + hr = ITypeInfo_Invoke(typeinfo, iface, id, flags, params, result, excepinfo, error_arg); + ITypeInfo_Release(typeinfo); + } + return hr; +} + static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface, LONG lVolume) { DSoundRenderImpl *This = impl_from_IBasicAudio(iface); @@ -861,10 +907,10 @@ static const IBasicAudioVtbl IBasicAudio_Vtbl = Basicaudio_QueryInterface, Basicaudio_AddRef, Basicaudio_Release, - BasicAudioImpl_GetTypeInfoCount, - BasicAudioImpl_GetTypeInfo, - BasicAudioImpl_GetIDsOfNames, - BasicAudioImpl_Invoke, + basic_audio_GetTypeInfoCount, + basic_audio_GetTypeInfo, + basic_audio_GetIDsOfNames, + basic_audio_Invoke, Basicaudio_put_Volume, Basicaudio_get_Volume, Basicaudio_put_Balance,
From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/Makefile.in | 1 - dlls/strmbase/audio.c | 76 --------------------------------------- include/wine/strmbase.h | 16 --------- 3 files changed, 93 deletions(-) delete mode 100644 dlls/strmbase/audio.c
diff --git a/dlls/strmbase/Makefile.in b/dlls/strmbase/Makefile.in index a51691b1ba..c58a359173 100644 --- a/dlls/strmbase/Makefile.in +++ b/dlls/strmbase/Makefile.in @@ -1,7 +1,6 @@ MODULE = libstrmbase.a
C_SRCS = \ - audio.c \ dispatch.c \ dllfunc.c \ enumpins.c \ diff --git a/dlls/strmbase/audio.c b/dlls/strmbase/audio.c deleted file mode 100644 index 6ad64610f0..0000000000 --- a/dlls/strmbase/audio.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Generic Implementation of strmbase audio classes - * - * Copyright 2012 Aric Stewart, CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "strmbase_private.h" - -static inline BasicAudio *impl_from_IBasicAudio(IBasicAudio *iface) -{ - return CONTAINING_RECORD(iface, BasicAudio, IBasicAudio_iface); -} - -HRESULT WINAPI BasicAudio_Init(BasicAudio *pBasicAudio, const IBasicAudioVtbl *lpVtbl) -{ - pBasicAudio->IBasicAudio_iface.lpVtbl = lpVtbl; - BaseDispatch_Init(&pBasicAudio->baseDispatch, &IID_IBasicAudio); - - return S_OK; -} - -HRESULT WINAPI BasicAudio_Destroy(BasicAudio *pBasicAudio) -{ - return BaseDispatch_Destroy(&pBasicAudio->baseDispatch); -} - -HRESULT WINAPI BasicAudioImpl_GetTypeInfoCount(IBasicAudio *iface, UINT *pctinfo) -{ - BasicAudio *This = impl_from_IBasicAudio(iface); - - return BaseDispatchImpl_GetTypeInfoCount(&This->baseDispatch, pctinfo); -} - -HRESULT WINAPI BasicAudioImpl_GetTypeInfo(IBasicAudio *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) -{ - BasicAudio *This = impl_from_IBasicAudio(iface); - - return BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, &IID_NULL, iTInfo, lcid, ppTInfo); -} - -HRESULT WINAPI BasicAudioImpl_GetIDsOfNames(IBasicAudio *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) -{ - BasicAudio *This = impl_from_IBasicAudio(iface); - - return BaseDispatchImpl_GetIDsOfNames(&This->baseDispatch, riid, rgszNames, cNames, lcid, rgDispId); -} - -HRESULT WINAPI BasicAudioImpl_Invoke(IBasicAudio *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr) -{ - BasicAudio *This = impl_from_IBasicAudio(iface); - ITypeInfo *pTypeInfo; - HRESULT hr; - - hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo); - if (SUCCEEDED(hr)) - { - hr = ITypeInfo_Invoke(pTypeInfo, &This->IBasicAudio_iface, dispIdMember, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr); - ITypeInfo_Release(pTypeInfo); - } - - return hr; -} diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index e762f44c51..62dcf741e1 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -638,22 +638,6 @@ HRESULT WINAPI strmbase_renderer_init(BaseRenderer *filter, const IBaseFilterVtb const BaseRendererFuncTable *func_table); void strmbase_renderer_cleanup(BaseRenderer *filter);
-#ifdef __IBasicAudio_FWD_DEFINED__ -typedef struct tagBasicAudio -{ - IBasicAudio IBasicAudio_iface; - BaseDispatch baseDispatch; -} BasicAudio; - -HRESULT WINAPI BasicAudio_Init(BasicAudio *This, const IBasicAudioVtbl *Vtbl); -HRESULT WINAPI BasicAudio_Destroy(BasicAudio *pBasicAudio); - -HRESULT WINAPI BasicAudioImpl_GetTypeInfoCount(IBasicAudio *iface, UINT*pctinfo); -HRESULT WINAPI BasicAudioImpl_GetTypeInfo(IBasicAudio *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); -HRESULT WINAPI BasicAudioImpl_GetIDsOfNames(IBasicAudio *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); -HRESULT WINAPI BasicAudioImpl_Invoke(IBasicAudio *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr); -#endif - /* Dll Functions */ BOOL WINAPI STRMBASE_DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv); HRESULT WINAPI STRMBASE_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=53388
Your paranoid android.
=== debian9 (32 bit WoW report) ===
quartz: systemclock: Timeout
From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/dispatch.c | 53 ++------------------------------ dlls/strmbase/strmbase_private.h | 8 ----- include/wine/strmbase.h | 4 --- 3 files changed, 2 insertions(+), 63 deletions(-)
diff --git a/dlls/strmbase/dispatch.c b/dlls/strmbase/dispatch.c index 1521471889..25573fa1a2 100644 --- a/dlls/strmbase/dispatch.c +++ b/dlls/strmbase/dispatch.c @@ -1,7 +1,7 @@ /* - * Generic Implementation of IDispatch for strmbase classes + * ITypeInfo cache for IDispatch * - * Copyright 2012 Aric Stewart, CodeWeavers + * Copyright 2019 Zebediah Figura * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -68,52 +68,3 @@ HRESULT strmbase_get_typeinfo(enum strmbase_type_id tid, ITypeInfo **ret) ITypeInfo_AddRef(*ret = control_typeinfo[tid]); return S_OK; } - -HRESULT WINAPI BaseDispatch_Init(BaseDispatch *This, REFIID riid) -{ - ITypeLib *pTypeLib; - HRESULT hr; - - This->pTypeInfo = NULL; - hr = LoadRegTypeLib(&LIBID_QuartzTypeLib, 1, 0, LOCALE_SYSTEM_DEFAULT, &pTypeLib); - if (SUCCEEDED(hr)) - { - hr = ITypeLib_GetTypeInfoOfGuid(pTypeLib, riid, &This->pTypeInfo); - ITypeLib_Release(pTypeLib); - } - return hr; -} - -HRESULT WINAPI BaseDispatch_Destroy(BaseDispatch *This) -{ - if (This->pTypeInfo) - ITypeInfo_Release(This->pTypeInfo); - return S_OK; -} - -HRESULT WINAPI BaseDispatchImpl_GetIDsOfNames(BaseDispatch *This, REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid) -{ - if (This->pTypeInfo) - return ITypeInfo_GetIDsOfNames(This->pTypeInfo, rgszNames, cNames, rgdispid); - return E_NOTIMPL; -} - -HRESULT WINAPI BaseDispatchImpl_GetTypeInfo(BaseDispatch *This, REFIID riid, UINT itinfo, LCID lcid, ITypeInfo **pptinfo) -{ - if (This->pTypeInfo) - { - ITypeInfo_AddRef(This->pTypeInfo); - *pptinfo = This->pTypeInfo; - return S_OK; - } - return E_NOTIMPL; -} - -HRESULT WINAPI BaseDispatchImpl_GetTypeInfoCount(BaseDispatch *This, UINT *pctinfo) -{ - if (This->pTypeInfo) - *pctinfo = 1; - else - *pctinfo = 0; - return S_OK; -} diff --git a/dlls/strmbase/strmbase_private.h b/dlls/strmbase/strmbase_private.h index fc1e27dd72..769c8f2086 100644 --- a/dlls/strmbase/strmbase_private.h +++ b/dlls/strmbase/strmbase_private.h @@ -70,12 +70,4 @@ HRESULT WINAPI RendererPosPassThru_RegisterMediaTime(IUnknown *iface, REFERENCE_ HRESULT WINAPI RendererPosPassThru_ResetMediaTime(IUnknown *iface); HRESULT WINAPI RendererPosPassThru_EOS(IUnknown *iface);
-HRESULT WINAPI BaseDispatch_Init(BaseDispatch *disp, REFIID iid); -HRESULT WINAPI BaseDispatch_Destroy(BaseDispatch *disp); -HRESULT WINAPI BaseDispatchImpl_GetIDsOfNames(BaseDispatch *disp, REFIID iid, - WCHAR **names, UINT count, LCID lcid, DISPID *ids); -HRESULT WINAPI BaseDispatchImpl_GetTypeInfo(BaseDispatch *disp, REFIID iid, - UINT index, LCID lcid, ITypeInfo **typeinfo); -HRESULT WINAPI BaseDispatchImpl_GetTypeInfoCount(BaseDispatch *disp, UINT *count); - #endif /* __WINE_STRMBASE_PRIVATE_H */ diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 62dcf741e1..9f686dc4cf 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -412,10 +412,6 @@ enum strmbase_type_id
HRESULT strmbase_get_typeinfo(enum strmbase_type_id tid, ITypeInfo **typeinfo);
-typedef struct{ - ITypeInfo *pTypeInfo; -} BaseDispatch; - #ifdef __IVideoWindow_FWD_DEFINED__ typedef struct tagBaseControlWindow {