From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dmsynth/synth.c | 4 ---- dlls/dmsynth/synthsink.c | 3 --- 2 files changed, 7 deletions(-)
diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index b579c15c66e..2c46abf661b 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -33,7 +33,6 @@ static inline IDirectMusicSynth8Impl *impl_from_IDirectMusicSynth8(IDirectMusicS return CONTAINING_RECORD(iface, IDirectMusicSynth8Impl, IDirectMusicSynth8_iface); }
-/* IDirectMusicSynth8Impl IUnknown part: */ static HRESULT WINAPI IDirectMusicSynth8Impl_QueryInterface(IDirectMusicSynth8 *iface, REFIID riid, void **ret_iface) { @@ -90,7 +89,6 @@ static ULONG WINAPI IDirectMusicSynth8Impl_Release(IDirectMusicSynth8 *iface) return ref; }
-/* IDirectMusicSynth8Impl IDirectMusicSynth part: */ static HRESULT WINAPI IDirectMusicSynth8Impl_Open(IDirectMusicSynth8 *iface, DMUS_PORTPARAMS *params) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -539,7 +537,6 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_GetAppend(IDirectMusicSynth8 *iface return S_OK; }
-/* IDirectMusicSynth8Impl IDirectMusicSynth8 part: */ static HRESULT WINAPI IDirectMusicSynth8Impl_PlayVoice(IDirectMusicSynth8 *iface, REFERENCE_TIME ref_time, DWORD voice_id, DWORD channel_group, DWORD channel, DWORD dwDLId, LONG prPitch, LONG vrVolume, SAMPLE_TIME stVoiceStart, SAMPLE_TIME stLoopStart, @@ -725,7 +722,6 @@ static const IKsControlVtbl DMSynthImpl_IKsControl_Vtbl = { DMSynthImpl_IKsControl_KsEvent };
-/* for ClassFactory */ HRESULT DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj) { IDirectMusicSynth8Impl *obj; diff --git a/dlls/dmsynth/synthsink.c b/dlls/dmsynth/synthsink.c index 825ad86013c..abc422f2b10 100644 --- a/dlls/dmsynth/synthsink.c +++ b/dlls/dmsynth/synthsink.c @@ -30,7 +30,6 @@ static inline IDirectMusicSynthSinkImpl *impl_from_IDirectMusicSynthSink(IDirect return CONTAINING_RECORD(iface, IDirectMusicSynthSinkImpl, IDirectMusicSynthSink_iface); }
-/* IDirectMusicSynthSinkImpl IUnknown part: */ static HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface(IDirectMusicSynthSink *iface, REFIID riid, void **ret_iface) { @@ -88,7 +87,6 @@ static ULONG WINAPI IDirectMusicSynthSinkImpl_Release(IDirectMusicSynthSink *ifa return ref; }
-/* IDirectMusicSynthSinkImpl IDirectMusicSynthSink part: */ static HRESULT WINAPI IDirectMusicSynthSinkImpl_Init(IDirectMusicSynthSink *iface, IDirectMusicSynth *synth) { @@ -295,7 +293,6 @@ static const IKsControlVtbl DMSynthSinkImpl_IKsControl_Vtbl = { DMSynthSinkImpl_IKsControl_KsEvent };
-/* for ClassFactory */ HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ret_iface) { IDirectMusicSynthSinkImpl *obj;
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dmsynth/dmsynth_main.c | 22 ---------------------- dlls/dmsynth/dmsynth_private.h | 7 ------- dlls/dmsynth/synth.c | 2 -- dlls/dmsynth/synthsink.c | 2 -- 4 files changed, 33 deletions(-)
diff --git a/dlls/dmsynth/dmsynth_main.c b/dlls/dmsynth/dmsynth_main.c index a5e2e605419..edeaab8474e 100644 --- a/dlls/dmsynth/dmsynth_main.c +++ b/dlls/dmsynth/dmsynth_main.c @@ -25,8 +25,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
-LONG DMSYNTH_refCount = 0; - typedef struct { IClassFactory IClassFactory_iface; HRESULT (*fnCreateInstance)(REFIID riid, void **ppv); @@ -62,15 +60,11 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID r
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) { - DMSYNTH_LockModule(); - return 2; /* non-heap based object */ }
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) { - DMSYNTH_UnlockModule(); - return 1; /* non-heap based object */ }
@@ -90,12 +84,6 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock) { TRACE("(%d)\n", dolock); - - if (dolock) - DMSYNTH_LockModule(); - else - DMSYNTH_UnlockModule(); - return S_OK; }
@@ -111,16 +99,6 @@ static IClassFactoryImpl Synth_CF = {{&classfactory_vtbl}, DMUSIC_CreateDirectMu static IClassFactoryImpl SynthSink_CF = {{&classfactory_vtbl}, DMUSIC_CreateDirectMusicSynthSinkImpl};
-/****************************************************************** - * DllCanUnloadNow (DMSYNTH.@) - * - * - */ -HRESULT WINAPI DllCanUnloadNow(void) -{ - return DMSYNTH_refCount != 0 ? S_FALSE : S_OK; -} -
/****************************************************************** * DllGetClassObject (DMSYNTH.@) diff --git a/dlls/dmsynth/dmsynth_private.h b/dlls/dmsynth/dmsynth_private.h index c21a9e84a84..3a3e76dfaf4 100644 --- a/dlls/dmsynth/dmsynth_private.h +++ b/dlls/dmsynth/dmsynth_private.h @@ -80,13 +80,6 @@ struct IDirectMusicSynthSinkImpl { BOOL active; };
-/********************************************************************** - * Dll lifetime tracking declaration for dmsynth.dll - */ -extern LONG DMSYNTH_refCount; -static inline void DMSYNTH_LockModule(void) { InterlockedIncrement( &DMSYNTH_refCount ); } -static inline void DMSYNTH_UnlockModule(void) { InterlockedDecrement( &DMSYNTH_refCount ); } - /***************************************************************************** * Misc. */ diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 2c46abf661b..bcfc6e0ab37 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -83,7 +83,6 @@ static ULONG WINAPI IDirectMusicSynth8Impl_Release(IDirectMusicSynth8 *iface) if (This->latency_clock) IReferenceClock_Release(This->latency_clock); HeapFree(GetProcessHeap(), 0, This); - DMSYNTH_UnlockModule(); }
return ref; @@ -750,7 +749,6 @@ HRESULT DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj) obj->caps.dwEffectFlags = DMUS_EFFECT_REVERB; lstrcpyW(obj->caps.wszDescription, L"Microsoft Synthesizer");
- DMSYNTH_LockModule(); hr = IDirectMusicSynth8_QueryInterface(&obj->IDirectMusicSynth8_iface, riid, ppobj); IDirectMusicSynth8_Release(&obj->IDirectMusicSynth8_iface);
diff --git a/dlls/dmsynth/synthsink.c b/dlls/dmsynth/synthsink.c index abc422f2b10..b9d9a31012c 100644 --- a/dlls/dmsynth/synthsink.c +++ b/dlls/dmsynth/synthsink.c @@ -81,7 +81,6 @@ static ULONG WINAPI IDirectMusicSynthSinkImpl_Release(IDirectMusicSynthSink *ifa if (This->master_clock) IReferenceClock_Release(This->master_clock); HeapFree(GetProcessHeap(), 0, This); - DMSYNTH_UnlockModule(); }
return ref; @@ -317,7 +316,6 @@ HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ret_iface) return hr; }
- DMSYNTH_LockModule(); hr = IDirectMusicSynthSink_QueryInterface(&obj->IDirectMusicSynthSink_iface, riid, ret_iface); IDirectMusicSynthSink_Release(&obj->IDirectMusicSynthSink_iface);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dmsynth/dmsynth_private.h | 14 -------------- dlls/dmsynth/synthsink.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/dmsynth/dmsynth_private.h b/dlls/dmsynth/dmsynth_private.h index 3a3e76dfaf4..b9f160f000d 100644 --- a/dlls/dmsynth/dmsynth_private.h +++ b/dlls/dmsynth/dmsynth_private.h @@ -44,7 +44,6 @@ * Interfaces */ typedef struct IDirectMusicSynth8Impl IDirectMusicSynth8Impl; -typedef struct IDirectMusicSynthSinkImpl IDirectMusicSynthSinkImpl;
/***************************************************************************** * ClassFactory @@ -67,19 +66,6 @@ struct IDirectMusicSynth8Impl { IDirectMusicSynthSink *sink; };
-/***************************************************************************** - * IDirectMusicSynthSinkImpl implementation structure - */ -struct IDirectMusicSynthSinkImpl { - IDirectMusicSynthSink IDirectMusicSynthSink_iface; - IKsControl IKsControl_iface; - LONG ref; - IReferenceClock *latency_clock; - IReferenceClock *master_clock; - IDirectMusicSynth *synth; /* No reference hold! */ - BOOL active; -}; - /***************************************************************************** * Misc. */ diff --git a/dlls/dmsynth/synthsink.c b/dlls/dmsynth/synthsink.c index b9d9a31012c..94d5463bc20 100644 --- a/dlls/dmsynth/synthsink.c +++ b/dlls/dmsynth/synthsink.c @@ -25,6 +25,20 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
+typedef struct IDirectMusicSynthSinkImpl IDirectMusicSynthSinkImpl; + +struct IDirectMusicSynthSinkImpl +{ + IDirectMusicSynthSink IDirectMusicSynthSink_iface; + IKsControl IKsControl_iface; + LONG ref; + + IReferenceClock *latency_clock; + IReferenceClock *master_clock; + IDirectMusicSynth *synth; /* No reference hold! */ + BOOL active; +}; + static inline IDirectMusicSynthSinkImpl *impl_from_IDirectMusicSynthSink(IDirectMusicSynthSink *iface) { return CONTAINING_RECORD(iface, IDirectMusicSynthSinkImpl, IDirectMusicSynthSink_iface);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dmsynth/synthsink.c | 90 ++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 44 deletions(-)
diff --git a/dlls/dmsynth/synthsink.c b/dlls/dmsynth/synthsink.c index 94d5463bc20..8d6e648d4b5 100644 --- a/dlls/dmsynth/synthsink.c +++ b/dlls/dmsynth/synthsink.c @@ -44,7 +44,7 @@ static inline IDirectMusicSynthSinkImpl *impl_from_IDirectMusicSynthSink(IDirect return CONTAINING_RECORD(iface, IDirectMusicSynthSinkImpl, IDirectMusicSynthSink_iface); }
-static HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface(IDirectMusicSynthSink *iface, +static HRESULT WINAPI synth_sink_QueryInterface(IDirectMusicSynthSink *iface, REFIID riid, void **ret_iface) { IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); @@ -72,7 +72,7 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface(IDirectMusicSynth return E_NOINTERFACE; }
-static ULONG WINAPI IDirectMusicSynthSinkImpl_AddRef(IDirectMusicSynthSink *iface) +static ULONG WINAPI synth_sink_AddRef(IDirectMusicSynthSink *iface) { IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); ULONG ref = InterlockedIncrement(&This->ref); @@ -82,7 +82,7 @@ static ULONG WINAPI IDirectMusicSynthSinkImpl_AddRef(IDirectMusicSynthSink *ifac return ref; }
-static ULONG WINAPI IDirectMusicSynthSinkImpl_Release(IDirectMusicSynthSink *iface) +static ULONG WINAPI synth_sink_Release(IDirectMusicSynthSink *iface) { IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); ULONG ref = InterlockedDecrement(&This->ref); @@ -100,7 +100,7 @@ static ULONG WINAPI IDirectMusicSynthSinkImpl_Release(IDirectMusicSynthSink *ifa return ref; }
-static HRESULT WINAPI IDirectMusicSynthSinkImpl_Init(IDirectMusicSynthSink *iface, +static HRESULT WINAPI synth_sink_Init(IDirectMusicSynthSink *iface, IDirectMusicSynth *synth) { IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); @@ -114,7 +114,7 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_Init(IDirectMusicSynthSink *ifac return S_OK; }
-static HRESULT WINAPI IDirectMusicSynthSinkImpl_SetMasterClock(IDirectMusicSynthSink *iface, +static HRESULT WINAPI synth_sink_SetMasterClock(IDirectMusicSynthSink *iface, IReferenceClock *clock) { IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); @@ -132,7 +132,7 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_SetMasterClock(IDirectMusicSynth return S_OK; }
-static HRESULT WINAPI IDirectMusicSynthSinkImpl_GetLatencyClock(IDirectMusicSynthSink *iface, +static HRESULT WINAPI synth_sink_GetLatencyClock(IDirectMusicSynthSink *iface, IReferenceClock **clock) { IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); @@ -148,7 +148,7 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_GetLatencyClock(IDirectMusicSynt return S_OK; }
-static HRESULT WINAPI IDirectMusicSynthSinkImpl_Activate(IDirectMusicSynthSink *iface, +static HRESULT WINAPI synth_sink_Activate(IDirectMusicSynthSink *iface, BOOL enable) { IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); @@ -158,7 +158,7 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_Activate(IDirectMusicSynthSink * return S_OK; }
-static HRESULT WINAPI IDirectMusicSynthSinkImpl_SampleToRefTime(IDirectMusicSynthSink *iface, +static HRESULT WINAPI synth_sink_SampleToRefTime(IDirectMusicSynthSink *iface, LONGLONG sample_time, REFERENCE_TIME *ref_time) { IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); @@ -168,7 +168,7 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_SampleToRefTime(IDirectMusicSynt return S_OK; }
-static HRESULT WINAPI IDirectMusicSynthSinkImpl_RefTimeToSample(IDirectMusicSynthSink *iface, +static HRESULT WINAPI synth_sink_RefTimeToSample(IDirectMusicSynthSink *iface, REFERENCE_TIME ref_time, LONGLONG *sample_time) { IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); @@ -178,7 +178,7 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_RefTimeToSample(IDirectMusicSynt return S_OK; }
-static HRESULT WINAPI IDirectMusicSynthSinkImpl_SetDirectSound(IDirectMusicSynthSink *iface, +static HRESULT WINAPI synth_sink_SetDirectSound(IDirectMusicSynthSink *iface, IDirectSound *dsound, IDirectSoundBuffer *dsound_buffer) { IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); @@ -188,7 +188,7 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_SetDirectSound(IDirectMusicSynth return S_OK; }
-static HRESULT WINAPI IDirectMusicSynthSinkImpl_GetDesiredBufferSize(IDirectMusicSynthSink *iface, +static HRESULT WINAPI synth_sink_GetDesiredBufferSize(IDirectMusicSynthSink *iface, DWORD *size) { IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); @@ -209,18 +209,19 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_GetDesiredBufferSize(IDirectMusi return S_OK; }
-static const IDirectMusicSynthSinkVtbl DirectMusicSynthSink_Vtbl = { - IDirectMusicSynthSinkImpl_QueryInterface, - IDirectMusicSynthSinkImpl_AddRef, - IDirectMusicSynthSinkImpl_Release, - IDirectMusicSynthSinkImpl_Init, - IDirectMusicSynthSinkImpl_SetMasterClock, - IDirectMusicSynthSinkImpl_GetLatencyClock, - IDirectMusicSynthSinkImpl_Activate, - IDirectMusicSynthSinkImpl_SampleToRefTime, - IDirectMusicSynthSinkImpl_RefTimeToSample, - IDirectMusicSynthSinkImpl_SetDirectSound, - IDirectMusicSynthSinkImpl_GetDesiredBufferSize +static const IDirectMusicSynthSinkVtbl synth_sink_vtbl = +{ + synth_sink_QueryInterface, + synth_sink_AddRef, + synth_sink_Release, + synth_sink_Init, + synth_sink_SetMasterClock, + synth_sink_GetLatencyClock, + synth_sink_Activate, + synth_sink_SampleToRefTime, + synth_sink_RefTimeToSample, + synth_sink_SetDirectSound, + synth_sink_GetDesiredBufferSize, };
static inline IDirectMusicSynthSinkImpl *impl_from_IKsControl(IKsControl *iface) @@ -228,29 +229,29 @@ static inline IDirectMusicSynthSinkImpl *impl_from_IKsControl(IKsControl *iface) return CONTAINING_RECORD(iface, IDirectMusicSynthSinkImpl, IKsControl_iface); }
-static HRESULT WINAPI DMSynthSinkImpl_IKsControl_QueryInterface(IKsControl* iface, REFIID riid, LPVOID *ppobj) +static HRESULT WINAPI synth_sink_control_QueryInterface(IKsControl* iface, REFIID riid, LPVOID *ppobj) { IDirectMusicSynthSinkImpl *This = impl_from_IKsControl(iface);
- return IDirectMusicSynthSinkImpl_QueryInterface(&This->IDirectMusicSynthSink_iface, riid, ppobj); + return synth_sink_QueryInterface(&This->IDirectMusicSynthSink_iface, riid, ppobj); }
-static ULONG WINAPI DMSynthSinkImpl_IKsControl_AddRef(IKsControl* iface) +static ULONG WINAPI synth_sink_control_AddRef(IKsControl* iface) { IDirectMusicSynthSinkImpl *This = impl_from_IKsControl(iface);
- return IDirectMusicSynthSinkImpl_AddRef(&This->IDirectMusicSynthSink_iface); + return synth_sink_AddRef(&This->IDirectMusicSynthSink_iface); }
-static ULONG WINAPI DMSynthSinkImpl_IKsControl_Release(IKsControl* iface) +static ULONG WINAPI synth_sink_control_Release(IKsControl* iface) { IDirectMusicSynthSinkImpl *This = impl_from_IKsControl(iface);
- return IDirectMusicSynthSinkImpl_Release(&This->IDirectMusicSynthSink_iface); + return synth_sink_Release(&This->IDirectMusicSynthSink_iface); }
-static HRESULT WINAPI DMSynthSinkImpl_IKsControl_KsProperty(IKsControl* iface, PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData, - ULONG DataLength, ULONG* BytesReturned) +static HRESULT WINAPI synth_sink_control_KsProperty(IKsControl* iface, PKSPROPERTY Property, + ULONG PropertyLength, LPVOID PropertyData, ULONG DataLength, ULONG* BytesReturned) { TRACE("(%p, %p, %lu, %p, %lu, %p)\n", iface, Property, PropertyLength, PropertyData, DataLength, BytesReturned);
@@ -280,16 +281,16 @@ static HRESULT WINAPI DMSynthSinkImpl_IKsControl_KsProperty(IKsControl* iface, P return S_OK; }
-static HRESULT WINAPI DMSynthSinkImpl_IKsControl_KsMethod(IKsControl* iface, PKSMETHOD Method, ULONG MethodLength, LPVOID MethodData, - ULONG DataLength, ULONG* BytesReturned) +static HRESULT WINAPI synth_sink_control_KsMethod(IKsControl* iface, PKSMETHOD Method, + ULONG MethodLength, LPVOID MethodData, ULONG DataLength, ULONG* BytesReturned) { FIXME("(%p, %p, %lu, %p, %lu, %p): stub\n", iface, Method, MethodLength, MethodData, DataLength, BytesReturned);
return E_NOTIMPL; }
-static HRESULT WINAPI DMSynthSinkImpl_IKsControl_KsEvent(IKsControl* iface, PKSEVENT Event, ULONG EventLength, LPVOID EventData, - ULONG DataLength, ULONG* BytesReturned) +static HRESULT WINAPI synth_sink_control_KsEvent(IKsControl* iface, PKSEVENT Event, + ULONG EventLength, LPVOID EventData, ULONG DataLength, ULONG* BytesReturned) { FIXME("(%p, %p, %lu, %p, %lu, %p): stub\n", iface, Event, EventLength, EventData, DataLength, BytesReturned);
@@ -297,13 +298,14 @@ static HRESULT WINAPI DMSynthSinkImpl_IKsControl_KsEvent(IKsControl* iface, PKSE }
-static const IKsControlVtbl DMSynthSinkImpl_IKsControl_Vtbl = { - DMSynthSinkImpl_IKsControl_QueryInterface, - DMSynthSinkImpl_IKsControl_AddRef, - DMSynthSinkImpl_IKsControl_Release, - DMSynthSinkImpl_IKsControl_KsProperty, - DMSynthSinkImpl_IKsControl_KsMethod, - DMSynthSinkImpl_IKsControl_KsEvent +static const IKsControlVtbl synth_sink_control = +{ + synth_sink_control_QueryInterface, + synth_sink_control_AddRef, + synth_sink_control_Release, + synth_sink_control_KsProperty, + synth_sink_control_KsMethod, + synth_sink_control_KsEvent, };
HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ret_iface) @@ -319,8 +321,8 @@ HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ret_iface) if (!obj) return E_OUTOFMEMORY;
- obj->IDirectMusicSynthSink_iface.lpVtbl = &DirectMusicSynthSink_Vtbl; - obj->IKsControl_iface.lpVtbl = &DMSynthSinkImpl_IKsControl_Vtbl; + obj->IDirectMusicSynthSink_iface.lpVtbl = &synth_sink_vtbl; + obj->IKsControl_iface.lpVtbl = &synth_sink_control; obj->ref = 1;
hr = CoCreateInstance(&CLSID_SystemClock, NULL, CLSCTX_INPROC_SERVER, &IID_IReferenceClock, (LPVOID*)&obj->latency_clock);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dmsynth/synthsink.c | 44 +++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 23 deletions(-)
diff --git a/dlls/dmsynth/synthsink.c b/dlls/dmsynth/synthsink.c index 8d6e648d4b5..73c623585be 100644 --- a/dlls/dmsynth/synthsink.c +++ b/dlls/dmsynth/synthsink.c @@ -25,9 +25,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
-typedef struct IDirectMusicSynthSinkImpl IDirectMusicSynthSinkImpl; - -struct IDirectMusicSynthSinkImpl +struct synth_sink { IDirectMusicSynthSink IDirectMusicSynthSink_iface; IKsControl IKsControl_iface; @@ -39,15 +37,15 @@ struct IDirectMusicSynthSinkImpl BOOL active; };
-static inline IDirectMusicSynthSinkImpl *impl_from_IDirectMusicSynthSink(IDirectMusicSynthSink *iface) +static inline struct synth_sink *impl_from_IDirectMusicSynthSink(IDirectMusicSynthSink *iface) { - return CONTAINING_RECORD(iface, IDirectMusicSynthSinkImpl, IDirectMusicSynthSink_iface); + return CONTAINING_RECORD(iface, struct synth_sink, IDirectMusicSynthSink_iface); }
static HRESULT WINAPI synth_sink_QueryInterface(IDirectMusicSynthSink *iface, REFIID riid, void **ret_iface) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface);
TRACE("(%p)->(%s, %p)\n", iface, debugstr_dmguid(riid), ret_iface);
@@ -74,7 +72,7 @@ static HRESULT WINAPI synth_sink_QueryInterface(IDirectMusicSynthSink *iface,
static ULONG WINAPI synth_sink_AddRef(IDirectMusicSynthSink *iface) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): new ref = %lu\n", This, ref); @@ -84,7 +82,7 @@ static ULONG WINAPI synth_sink_AddRef(IDirectMusicSynthSink *iface)
static ULONG WINAPI synth_sink_Release(IDirectMusicSynthSink *iface) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): new ref = %lu\n", This, ref); @@ -103,7 +101,7 @@ static ULONG WINAPI synth_sink_Release(IDirectMusicSynthSink *iface) static HRESULT WINAPI synth_sink_Init(IDirectMusicSynthSink *iface, IDirectMusicSynth *synth) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface);
TRACE("(%p)->(%p)\n", This, synth);
@@ -117,7 +115,7 @@ static HRESULT WINAPI synth_sink_Init(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_SetMasterClock(IDirectMusicSynthSink *iface, IReferenceClock *clock) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface);
TRACE("(%p)->(%p)\n", This, clock);
@@ -135,7 +133,7 @@ static HRESULT WINAPI synth_sink_SetMasterClock(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_GetLatencyClock(IDirectMusicSynthSink *iface, IReferenceClock **clock) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface);
TRACE("(%p)->(%p)\n", iface, clock);
@@ -151,7 +149,7 @@ static HRESULT WINAPI synth_sink_GetLatencyClock(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_Activate(IDirectMusicSynthSink *iface, BOOL enable) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface);
FIXME("(%p)->(%d): stub\n", This, enable);
@@ -161,7 +159,7 @@ static HRESULT WINAPI synth_sink_Activate(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_SampleToRefTime(IDirectMusicSynthSink *iface, LONGLONG sample_time, REFERENCE_TIME *ref_time) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface);
FIXME("(%p)->(0x%s, %p): stub\n", This, wine_dbgstr_longlong(sample_time), ref_time);
@@ -171,7 +169,7 @@ static HRESULT WINAPI synth_sink_SampleToRefTime(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_RefTimeToSample(IDirectMusicSynthSink *iface, REFERENCE_TIME ref_time, LONGLONG *sample_time) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface);
FIXME("(%p)->(0x%s, %p): stub\n", This, wine_dbgstr_longlong(ref_time), sample_time);
@@ -181,7 +179,7 @@ static HRESULT WINAPI synth_sink_RefTimeToSample(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_SetDirectSound(IDirectMusicSynthSink *iface, IDirectSound *dsound, IDirectSoundBuffer *dsound_buffer) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface);
FIXME("(%p)->(%p, %p): stub\n", This, dsound, dsound_buffer);
@@ -191,7 +189,7 @@ static HRESULT WINAPI synth_sink_SetDirectSound(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_GetDesiredBufferSize(IDirectMusicSynthSink *iface, DWORD *size) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); WAVEFORMATEX format; DWORD fmtsize = sizeof(format);
@@ -224,28 +222,28 @@ static const IDirectMusicSynthSinkVtbl synth_sink_vtbl = synth_sink_GetDesiredBufferSize, };
-static inline IDirectMusicSynthSinkImpl *impl_from_IKsControl(IKsControl *iface) +static inline struct synth_sink *impl_from_IKsControl(IKsControl *iface) { - return CONTAINING_RECORD(iface, IDirectMusicSynthSinkImpl, IKsControl_iface); + return CONTAINING_RECORD(iface, struct synth_sink, IKsControl_iface); }
static HRESULT WINAPI synth_sink_control_QueryInterface(IKsControl* iface, REFIID riid, LPVOID *ppobj) { - IDirectMusicSynthSinkImpl *This = impl_from_IKsControl(iface); + struct synth_sink *This = impl_from_IKsControl(iface);
return synth_sink_QueryInterface(&This->IDirectMusicSynthSink_iface, riid, ppobj); }
static ULONG WINAPI synth_sink_control_AddRef(IKsControl* iface) { - IDirectMusicSynthSinkImpl *This = impl_from_IKsControl(iface); + struct synth_sink *This = impl_from_IKsControl(iface);
return synth_sink_AddRef(&This->IDirectMusicSynthSink_iface); }
static ULONG WINAPI synth_sink_control_Release(IKsControl* iface) { - IDirectMusicSynthSinkImpl *This = impl_from_IKsControl(iface); + struct synth_sink *This = impl_from_IKsControl(iface);
return synth_sink_Release(&This->IDirectMusicSynthSink_iface); } @@ -310,14 +308,14 @@ static const IKsControlVtbl synth_sink_control =
HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ret_iface) { - IDirectMusicSynthSinkImpl *obj; + struct synth_sink *obj; HRESULT hr;
TRACE("(%s, %p)\n", debugstr_guid(riid), ret_iface);
*ret_iface = NULL;
- obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSynthSinkImpl)); + obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct synth_sink)); if (!obj) return E_OUTOFMEMORY;
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dmsynth/dmsynth_private.h | 20 -------------------- dlls/dmsynth/synth.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 20 deletions(-)
diff --git a/dlls/dmsynth/dmsynth_private.h b/dlls/dmsynth/dmsynth_private.h index b9f160f000d..35c87775cf7 100644 --- a/dlls/dmsynth/dmsynth_private.h +++ b/dlls/dmsynth/dmsynth_private.h @@ -40,32 +40,12 @@ #include "dmusics.h" #include "dmksctrl.h"
-/***************************************************************************** - * Interfaces - */ -typedef struct IDirectMusicSynth8Impl IDirectMusicSynth8Impl; - /***************************************************************************** * ClassFactory */ extern HRESULT DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj); extern HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ppobj);
-/***************************************************************************** - * IDirectMusicSynth8Impl implementation structure - */ -struct IDirectMusicSynth8Impl { - IDirectMusicSynth8 IDirectMusicSynth8_iface; - IKsControl IKsControl_iface; - LONG ref; - DMUS_PORTCAPS caps; - DMUS_PORTPARAMS params; - BOOL active; - BOOL open; - IReferenceClock *latency_clock; - IDirectMusicSynthSink *sink; -}; - /***************************************************************************** * Misc. */ diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index bcfc6e0ab37..1855d4d1bc5 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -28,6 +28,22 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
+typedef struct IDirectMusicSynth8Impl IDirectMusicSynth8Impl; + +struct IDirectMusicSynth8Impl +{ + IDirectMusicSynth8 IDirectMusicSynth8_iface; + IKsControl IKsControl_iface; + LONG ref; + + DMUS_PORTCAPS caps; + DMUS_PORTPARAMS params; + BOOL active; + BOOL open; + IReferenceClock *latency_clock; + IDirectMusicSynthSink *sink; +}; + static inline IDirectMusicSynth8Impl *impl_from_IDirectMusicSynth8(IDirectMusicSynth8 *iface) { return CONTAINING_RECORD(iface, IDirectMusicSynth8Impl, IDirectMusicSynth8_iface);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dmsynth/synth.c | 146 ++++++++++++++++++++++--------------------- 1 file changed, 74 insertions(+), 72 deletions(-)
diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 1855d4d1bc5..da60a07c89b 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -49,7 +49,7 @@ static inline IDirectMusicSynth8Impl *impl_from_IDirectMusicSynth8(IDirectMusicS return CONTAINING_RECORD(iface, IDirectMusicSynth8Impl, IDirectMusicSynth8_iface); }
-static HRESULT WINAPI IDirectMusicSynth8Impl_QueryInterface(IDirectMusicSynth8 *iface, REFIID riid, +static HRESULT WINAPI synth_QueryInterface(IDirectMusicSynth8 *iface, REFIID riid, void **ret_iface) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -78,7 +78,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_QueryInterface(IDirectMusicSynth8 * return E_NOINTERFACE; }
-static ULONG WINAPI IDirectMusicSynth8Impl_AddRef(IDirectMusicSynth8 *iface) +static ULONG WINAPI synth_AddRef(IDirectMusicSynth8 *iface) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); ULONG ref = InterlockedIncrement(&This->ref); @@ -88,7 +88,7 @@ static ULONG WINAPI IDirectMusicSynth8Impl_AddRef(IDirectMusicSynth8 *iface) return ref; }
-static ULONG WINAPI IDirectMusicSynth8Impl_Release(IDirectMusicSynth8 *iface) +static ULONG WINAPI synth_Release(IDirectMusicSynth8 *iface) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); ULONG ref = InterlockedDecrement(&This->ref); @@ -104,7 +104,7 @@ static ULONG WINAPI IDirectMusicSynth8Impl_Release(IDirectMusicSynth8 *iface) return ref; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_Open(IDirectMusicSynth8 *iface, DMUS_PORTPARAMS *params) +static HRESULT WINAPI synth_Open(IDirectMusicSynth8 *iface, DMUS_PORTPARAMS *params) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); BOOL modified = FALSE; @@ -190,7 +190,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_Open(IDirectMusicSynth8 *iface, DMU return modified ? S_FALSE : S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_Close(IDirectMusicSynth8 *iface) +static HRESULT WINAPI synth_Close(IDirectMusicSynth8 *iface) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface);
@@ -204,7 +204,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_Close(IDirectMusicSynth8 *iface) return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_SetNumChannelGroups(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_SetNumChannelGroups(IDirectMusicSynth8 *iface, DWORD groups) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -214,7 +214,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_SetNumChannelGroups(IDirectMusicSyn return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_Download(IDirectMusicSynth8 *iface, HANDLE *hDownload, +static HRESULT WINAPI synth_Download(IDirectMusicSynth8 *iface, HANDLE *hDownload, void *data, BOOL *free) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -349,7 +349,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_Download(IDirectMusicSynth8 *iface, return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_Unload(IDirectMusicSynth8 *iface, HANDLE hDownload, +static HRESULT WINAPI synth_Unload(IDirectMusicSynth8 *iface, HANDLE hDownload, HRESULT (CALLBACK *lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -359,7 +359,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_Unload(IDirectMusicSynth8 *iface, H return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_PlayBuffer(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_PlayBuffer(IDirectMusicSynth8 *iface, REFERENCE_TIME rt, BYTE *buffer, DWORD size) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -369,7 +369,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_PlayBuffer(IDirectMusicSynth8 *ifac return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_GetRunningStats(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_GetRunningStats(IDirectMusicSynth8 *iface, DMUS_SYNTHSTATS *stats) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -379,7 +379,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_GetRunningStats(IDirectMusicSynth8 return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_GetPortCaps(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_GetPortCaps(IDirectMusicSynth8 *iface, DMUS_PORTCAPS *caps) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -394,7 +394,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_GetPortCaps(IDirectMusicSynth8 *ifa return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_SetMasterClock(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_SetMasterClock(IDirectMusicSynth8 *iface, IReferenceClock *clock) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -407,7 +407,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_SetMasterClock(IDirectMusicSynth8 * return IDirectMusicSynthSink_SetMasterClock(This->sink, clock); }
-static HRESULT WINAPI IDirectMusicSynth8Impl_GetLatencyClock(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_GetLatencyClock(IDirectMusicSynth8 *iface, IReferenceClock **clock) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -426,7 +426,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_GetLatencyClock(IDirectMusicSynth8 return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_Activate(IDirectMusicSynth8 *iface, BOOL enable) +static HRESULT WINAPI synth_Activate(IDirectMusicSynth8 *iface, BOOL enable) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); HRESULT hr; @@ -455,7 +455,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_Activate(IDirectMusicSynth8 *iface, return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_SetSynthSink(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_SetSynthSink(IDirectMusicSynth8 *iface, IDirectMusicSynthSink *sink) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -483,7 +483,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_SetSynthSink(IDirectMusicSynth8 *if return IDirectMusicSynthSink_GetLatencyClock(sink, &This->latency_clock); }
-static HRESULT WINAPI IDirectMusicSynth8Impl_Render(IDirectMusicSynth8 *iface, short *buffer, +static HRESULT WINAPI synth_Render(IDirectMusicSynth8 *iface, short *buffer, DWORD length, LONGLONG position) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -493,7 +493,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_Render(IDirectMusicSynth8 *iface, s return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_SetChannelPriority(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_SetChannelPriority(IDirectMusicSynth8 *iface, DWORD channel_group, DWORD channel, DWORD priority) { /* IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); */ @@ -504,7 +504,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_SetChannelPriority(IDirectMusicSynt return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_GetChannelPriority(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_GetChannelPriority(IDirectMusicSynth8 *iface, DWORD channel_group, DWORD channel, DWORD *priority) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -514,7 +514,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_GetChannelPriority(IDirectMusicSynt return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_GetFormat(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_GetFormat(IDirectMusicSynth8 *iface, WAVEFORMATEX *format, DWORD *size) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -542,7 +542,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_GetFormat(IDirectMusicSynth8 *iface return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_GetAppend(IDirectMusicSynth8 *iface, DWORD *append) +static HRESULT WINAPI synth_GetAppend(IDirectMusicSynth8 *iface, DWORD *append) { TRACE("(%p)->(%p)\n", iface, append);
@@ -552,7 +552,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_GetAppend(IDirectMusicSynth8 *iface return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_PlayVoice(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_PlayVoice(IDirectMusicSynth8 *iface, REFERENCE_TIME ref_time, DWORD voice_id, DWORD channel_group, DWORD channel, DWORD dwDLId, LONG prPitch, LONG vrVolume, SAMPLE_TIME stVoiceStart, SAMPLE_TIME stLoopStart, SAMPLE_TIME stLoopEnd) @@ -566,7 +566,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_PlayVoice(IDirectMusicSynth8 *iface return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_StopVoice(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_StopVoice(IDirectMusicSynth8 *iface, REFERENCE_TIME ref_time, DWORD voice_id) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -576,7 +576,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_StopVoice(IDirectMusicSynth8 *iface return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_GetVoiceState(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_GetVoiceState(IDirectMusicSynth8 *iface, DWORD dwVoice[], DWORD cbVoice, DMUS_VOICE_STATE dwVoiceState[]) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -586,7 +586,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_GetVoiceState(IDirectMusicSynth8 *i return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_Refresh(IDirectMusicSynth8 *iface, DWORD download_id, +static HRESULT WINAPI synth_Refresh(IDirectMusicSynth8 *iface, DWORD download_id, DWORD flags) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -596,7 +596,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_Refresh(IDirectMusicSynth8 *iface, return S_OK; }
-static HRESULT WINAPI IDirectMusicSynth8Impl_AssignChannelToBuses(IDirectMusicSynth8 *iface, +static HRESULT WINAPI synth_AssignChannelToBuses(IDirectMusicSynth8 *iface, DWORD channel_group, DWORD channel, DWORD *pdwBuses, DWORD cBuses) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); @@ -606,32 +606,33 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_AssignChannelToBuses(IDirectMusicSy return S_OK; }
-static const IDirectMusicSynth8Vtbl DirectMusicSynth8_Vtbl = { - IDirectMusicSynth8Impl_QueryInterface, - IDirectMusicSynth8Impl_AddRef, - IDirectMusicSynth8Impl_Release, - IDirectMusicSynth8Impl_Open, - IDirectMusicSynth8Impl_Close, - IDirectMusicSynth8Impl_SetNumChannelGroups, - IDirectMusicSynth8Impl_Download, - IDirectMusicSynth8Impl_Unload, - IDirectMusicSynth8Impl_PlayBuffer, - IDirectMusicSynth8Impl_GetRunningStats, - IDirectMusicSynth8Impl_GetPortCaps, - IDirectMusicSynth8Impl_SetMasterClock, - IDirectMusicSynth8Impl_GetLatencyClock, - IDirectMusicSynth8Impl_Activate, - IDirectMusicSynth8Impl_SetSynthSink, - IDirectMusicSynth8Impl_Render, - IDirectMusicSynth8Impl_SetChannelPriority, - IDirectMusicSynth8Impl_GetChannelPriority, - IDirectMusicSynth8Impl_GetFormat, - IDirectMusicSynth8Impl_GetAppend, - IDirectMusicSynth8Impl_PlayVoice, - IDirectMusicSynth8Impl_StopVoice, - IDirectMusicSynth8Impl_GetVoiceState, - IDirectMusicSynth8Impl_Refresh, - IDirectMusicSynth8Impl_AssignChannelToBuses +static const IDirectMusicSynth8Vtbl synth_vtbl = +{ + synth_QueryInterface, + synth_AddRef, + synth_Release, + synth_Open, + synth_Close, + synth_SetNumChannelGroups, + synth_Download, + synth_Unload, + synth_PlayBuffer, + synth_GetRunningStats, + synth_GetPortCaps, + synth_SetMasterClock, + synth_GetLatencyClock, + synth_Activate, + synth_SetSynthSink, + synth_Render, + synth_SetChannelPriority, + synth_GetChannelPriority, + synth_GetFormat, + synth_GetAppend, + synth_PlayVoice, + synth_StopVoice, + synth_GetVoiceState, + synth_Refresh, + synth_AssignChannelToBuses, };
static inline IDirectMusicSynth8Impl *impl_from_IKsControl(IKsControl *iface) @@ -639,29 +640,29 @@ static inline IDirectMusicSynth8Impl *impl_from_IKsControl(IKsControl *iface) return CONTAINING_RECORD(iface, IDirectMusicSynth8Impl, IKsControl_iface); }
-static HRESULT WINAPI DMSynthImpl_IKsControl_QueryInterface(IKsControl* iface, REFIID riid, LPVOID *ppobj) +static HRESULT WINAPI synth_control_QueryInterface(IKsControl* iface, REFIID riid, LPVOID *ppobj) { IDirectMusicSynth8Impl *This = impl_from_IKsControl(iface);
- return IDirectMusicSynth8Impl_QueryInterface(&This->IDirectMusicSynth8_iface, riid, ppobj); + return synth_QueryInterface(&This->IDirectMusicSynth8_iface, riid, ppobj); }
-static ULONG WINAPI DMSynthImpl_IKsControl_AddRef(IKsControl* iface) +static ULONG WINAPI synth_control_AddRef(IKsControl* iface) { IDirectMusicSynth8Impl *This = impl_from_IKsControl(iface);
- return IDirectMusicSynth8Impl_AddRef(&This->IDirectMusicSynth8_iface); + return synth_AddRef(&This->IDirectMusicSynth8_iface); }
-static ULONG WINAPI DMSynthImpl_IKsControl_Release(IKsControl* iface) +static ULONG WINAPI synth_control_Release(IKsControl* iface) { IDirectMusicSynth8Impl *This = impl_from_IKsControl(iface);
- return IDirectMusicSynth8Impl_Release(&This->IDirectMusicSynth8_iface); + return synth_Release(&This->IDirectMusicSynth8_iface); }
-static HRESULT WINAPI DMSynthImpl_IKsControl_KsProperty(IKsControl* iface, PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData, - ULONG DataLength, ULONG* BytesReturned) +static HRESULT WINAPI synth_control_KsProperty(IKsControl* iface, PKSPROPERTY Property, + ULONG PropertyLength, LPVOID PropertyData, ULONG DataLength, ULONG* BytesReturned) { TRACE("(%p, %p, %lu, %p, %lu, %p)\n", iface, Property, PropertyLength, PropertyData, DataLength, BytesReturned);
@@ -711,16 +712,16 @@ static HRESULT WINAPI DMSynthImpl_IKsControl_KsProperty(IKsControl* iface, PKSPR return S_OK; }
-static HRESULT WINAPI DMSynthImpl_IKsControl_KsMethod(IKsControl* iface, PKSMETHOD Method, ULONG MethodLength, LPVOID MethodData, - ULONG DataLength, ULONG* BytesReturned) +static HRESULT WINAPI synth_control_KsMethod(IKsControl* iface, PKSMETHOD Method, + ULONG MethodLength, LPVOID MethodData, ULONG DataLength, ULONG* BytesReturned) { FIXME("(%p, %p, %lu, %p, %lu, %p): stub\n", iface, Method, MethodLength, MethodData, DataLength, BytesReturned);
return E_NOTIMPL; }
-static HRESULT WINAPI DMSynthImpl_IKsControl_KsEvent(IKsControl* iface, PKSEVENT Event, ULONG EventLength, LPVOID EventData, - ULONG DataLength, ULONG* BytesReturned) +static HRESULT WINAPI synth_control_KsEvent(IKsControl* iface, PKSEVENT Event, + ULONG EventLength, LPVOID EventData, ULONG DataLength, ULONG* BytesReturned) { FIXME("(%p, %p, %lu, %p, %lu, %p): stub\n", iface, Event, EventLength, EventData, DataLength, BytesReturned);
@@ -728,13 +729,14 @@ static HRESULT WINAPI DMSynthImpl_IKsControl_KsEvent(IKsControl* iface, PKSEVENT }
-static const IKsControlVtbl DMSynthImpl_IKsControl_Vtbl = { - DMSynthImpl_IKsControl_QueryInterface, - DMSynthImpl_IKsControl_AddRef, - DMSynthImpl_IKsControl_Release, - DMSynthImpl_IKsControl_KsProperty, - DMSynthImpl_IKsControl_KsMethod, - DMSynthImpl_IKsControl_KsEvent +static const IKsControlVtbl synth_control_vtbl = +{ + synth_control_QueryInterface, + synth_control_AddRef, + synth_control_Release, + synth_control_KsProperty, + synth_control_KsMethod, + synth_control_KsEvent, };
HRESULT DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj) @@ -749,8 +751,8 @@ HRESULT DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj) *ppobj = NULL; return E_OUTOFMEMORY; } - obj->IDirectMusicSynth8_iface.lpVtbl = &DirectMusicSynth8_Vtbl; - obj->IKsControl_iface.lpVtbl = &DMSynthImpl_IKsControl_Vtbl; + obj->IDirectMusicSynth8_iface.lpVtbl = &synth_vtbl; + obj->IKsControl_iface.lpVtbl = &synth_control_vtbl; obj->ref = 1; /* fill in caps */ obj->caps.dwSize = sizeof(DMUS_PORTCAPS);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dmsynth/synth.c | 68 +++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 35 deletions(-)
diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index da60a07c89b..30b7eee6808 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -28,9 +28,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
-typedef struct IDirectMusicSynth8Impl IDirectMusicSynth8Impl; - -struct IDirectMusicSynth8Impl +struct synth { IDirectMusicSynth8 IDirectMusicSynth8_iface; IKsControl IKsControl_iface; @@ -44,15 +42,15 @@ struct IDirectMusicSynth8Impl IDirectMusicSynthSink *sink; };
-static inline IDirectMusicSynth8Impl *impl_from_IDirectMusicSynth8(IDirectMusicSynth8 *iface) +static inline struct synth *impl_from_IDirectMusicSynth8(IDirectMusicSynth8 *iface) { - return CONTAINING_RECORD(iface, IDirectMusicSynth8Impl, IDirectMusicSynth8_iface); + return CONTAINING_RECORD(iface, struct synth, IDirectMusicSynth8_iface); }
static HRESULT WINAPI synth_QueryInterface(IDirectMusicSynth8 *iface, REFIID riid, void **ret_iface) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
TRACE("(%p)->(%s, %p)\n", iface, debugstr_dmguid(riid), ret_iface);
@@ -80,7 +78,7 @@ static HRESULT WINAPI synth_QueryInterface(IDirectMusicSynth8 *iface, REFIID rii
static ULONG WINAPI synth_AddRef(IDirectMusicSynth8 *iface) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface); ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p): new ref = %lu\n", This, ref); @@ -90,7 +88,7 @@ static ULONG WINAPI synth_AddRef(IDirectMusicSynth8 *iface)
static ULONG WINAPI synth_Release(IDirectMusicSynth8 *iface) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface); ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): new ref = %lu\n", This, ref); @@ -106,7 +104,7 @@ static ULONG WINAPI synth_Release(IDirectMusicSynth8 *iface)
static HRESULT WINAPI synth_Open(IDirectMusicSynth8 *iface, DMUS_PORTPARAMS *params) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface); BOOL modified = FALSE; const DMUS_PORTPARAMS def = { .dwValidParams = DMUS_PORTPARAMS_VOICES|DMUS_PORTPARAMS_CHANNELGROUPS| @@ -192,7 +190,7 @@ static HRESULT WINAPI synth_Open(IDirectMusicSynth8 *iface, DMUS_PORTPARAMS *par
static HRESULT WINAPI synth_Close(IDirectMusicSynth8 *iface) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
TRACE("(%p)\n", This);
@@ -207,7 +205,7 @@ static HRESULT WINAPI synth_Close(IDirectMusicSynth8 *iface) static HRESULT WINAPI synth_SetNumChannelGroups(IDirectMusicSynth8 *iface, DWORD groups) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
FIXME("(%p, %ld): stub\n", This, groups);
@@ -217,7 +215,7 @@ static HRESULT WINAPI synth_SetNumChannelGroups(IDirectMusicSynth8 *iface, static HRESULT WINAPI synth_Download(IDirectMusicSynth8 *iface, HANDLE *hDownload, void *data, BOOL *free) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface); LPBYTE buffer = data; DMUS_DOWNLOADINFO *info = (DMUS_DOWNLOADINFO*)buffer; ULONG *offsets = ((DMUS_OFFSETTABLE*)(buffer + sizeof(DMUS_DOWNLOADINFO)))->ulOffsetTable; @@ -352,7 +350,7 @@ static HRESULT WINAPI synth_Download(IDirectMusicSynth8 *iface, HANDLE *hDownloa static HRESULT WINAPI synth_Unload(IDirectMusicSynth8 *iface, HANDLE hDownload, HRESULT (CALLBACK *lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
FIXME("(%p)->(%p, %p, %p): stub\n", This, hDownload, lpFreeHandle, hUserData);
@@ -362,7 +360,7 @@ static HRESULT WINAPI synth_Unload(IDirectMusicSynth8 *iface, HANDLE hDownload, static HRESULT WINAPI synth_PlayBuffer(IDirectMusicSynth8 *iface, REFERENCE_TIME rt, BYTE *buffer, DWORD size) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
FIXME("(%p, 0x%s, %p, %lu): stub\n", This, wine_dbgstr_longlong(rt), buffer, size);
@@ -372,7 +370,7 @@ static HRESULT WINAPI synth_PlayBuffer(IDirectMusicSynth8 *iface, static HRESULT WINAPI synth_GetRunningStats(IDirectMusicSynth8 *iface, DMUS_SYNTHSTATS *stats) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
FIXME("(%p)->(%p): stub\n", This, stats);
@@ -382,7 +380,7 @@ static HRESULT WINAPI synth_GetRunningStats(IDirectMusicSynth8 *iface, static HRESULT WINAPI synth_GetPortCaps(IDirectMusicSynth8 *iface, DMUS_PORTCAPS *caps) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
TRACE("(%p)->(%p)\n", This, caps);
@@ -397,7 +395,7 @@ static HRESULT WINAPI synth_GetPortCaps(IDirectMusicSynth8 *iface, static HRESULT WINAPI synth_SetMasterClock(IDirectMusicSynth8 *iface, IReferenceClock *clock) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
TRACE("(%p)->(%p)\n", This, clock);
@@ -410,7 +408,7 @@ static HRESULT WINAPI synth_SetMasterClock(IDirectMusicSynth8 *iface, static HRESULT WINAPI synth_GetLatencyClock(IDirectMusicSynth8 *iface, IReferenceClock **clock) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
TRACE("(%p)->(%p)\n", iface, clock);
@@ -428,7 +426,7 @@ static HRESULT WINAPI synth_GetLatencyClock(IDirectMusicSynth8 *iface,
static HRESULT WINAPI synth_Activate(IDirectMusicSynth8 *iface, BOOL enable) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface); HRESULT hr;
TRACE("(%p)->(%d)\n", This, enable); @@ -458,7 +456,7 @@ static HRESULT WINAPI synth_Activate(IDirectMusicSynth8 *iface, BOOL enable) static HRESULT WINAPI synth_SetSynthSink(IDirectMusicSynth8 *iface, IDirectMusicSynthSink *sink) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface); HRESULT hr;
TRACE("(%p)->(%p)\n", iface, sink); @@ -486,7 +484,7 @@ static HRESULT WINAPI synth_SetSynthSink(IDirectMusicSynth8 *iface, static HRESULT WINAPI synth_Render(IDirectMusicSynth8 *iface, short *buffer, DWORD length, LONGLONG position) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
FIXME("(%p, %p, %ld, 0x%s): stub\n", This, buffer, length, wine_dbgstr_longlong(position));
@@ -496,7 +494,7 @@ static HRESULT WINAPI synth_Render(IDirectMusicSynth8 *iface, short *buffer, static HRESULT WINAPI synth_SetChannelPriority(IDirectMusicSynth8 *iface, DWORD channel_group, DWORD channel, DWORD priority) { - /* IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); */ + /* struct synth *This = impl_from_IDirectMusicSynth8(iface); */
/* Silenced because of too many messages - 1000 groups * 16 channels ;=) */ /* FIXME("(%p)->(%ld, %ld, %ld): stub\n", This, channel_group, channel, priority); */ @@ -507,7 +505,7 @@ static HRESULT WINAPI synth_SetChannelPriority(IDirectMusicSynth8 *iface, static HRESULT WINAPI synth_GetChannelPriority(IDirectMusicSynth8 *iface, DWORD channel_group, DWORD channel, DWORD *priority) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, channel_group, channel, priority);
@@ -517,7 +515,7 @@ static HRESULT WINAPI synth_GetChannelPriority(IDirectMusicSynth8 *iface, static HRESULT WINAPI synth_GetFormat(IDirectMusicSynth8 *iface, WAVEFORMATEX *format, DWORD *size) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface); WAVEFORMATEX fmt;
TRACE("(%p, %p, %p)\n", This, format, size); @@ -557,7 +555,7 @@ static HRESULT WINAPI synth_PlayVoice(IDirectMusicSynth8 *iface, LONG prPitch, LONG vrVolume, SAMPLE_TIME stVoiceStart, SAMPLE_TIME stLoopStart, SAMPLE_TIME stLoopEnd) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
FIXME("(%p, 0x%s, %ld, %ld, %ld, %ld, %li, %li, 0x%s, 0x%s, 0x%s): stub\n", This, wine_dbgstr_longlong(ref_time), voice_id, channel_group, channel, dwDLId, prPitch, vrVolume, @@ -569,7 +567,7 @@ static HRESULT WINAPI synth_PlayVoice(IDirectMusicSynth8 *iface, static HRESULT WINAPI synth_StopVoice(IDirectMusicSynth8 *iface, REFERENCE_TIME ref_time, DWORD voice_id) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
FIXME("(%p, 0x%s, %ld): stub\n", This, wine_dbgstr_longlong(ref_time), voice_id);
@@ -579,7 +577,7 @@ static HRESULT WINAPI synth_StopVoice(IDirectMusicSynth8 *iface, static HRESULT WINAPI synth_GetVoiceState(IDirectMusicSynth8 *iface, DWORD dwVoice[], DWORD cbVoice, DMUS_VOICE_STATE dwVoiceState[]) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
FIXME("(%p, %p, %ld, %p): stub\n", This, dwVoice, cbVoice, dwVoiceState);
@@ -589,7 +587,7 @@ static HRESULT WINAPI synth_GetVoiceState(IDirectMusicSynth8 *iface, static HRESULT WINAPI synth_Refresh(IDirectMusicSynth8 *iface, DWORD download_id, DWORD flags) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
FIXME("(%p, %ld, %ld): stub\n", This, download_id, flags);
@@ -599,7 +597,7 @@ static HRESULT WINAPI synth_Refresh(IDirectMusicSynth8 *iface, DWORD download_id static HRESULT WINAPI synth_AssignChannelToBuses(IDirectMusicSynth8 *iface, DWORD channel_group, DWORD channel, DWORD *pdwBuses, DWORD cBuses) { - IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + struct synth *This = impl_from_IDirectMusicSynth8(iface);
FIXME("(%p, %ld, %ld, %p, %ld): stub\n", This, channel_group, channel, pdwBuses, cBuses);
@@ -635,28 +633,28 @@ static const IDirectMusicSynth8Vtbl synth_vtbl = synth_AssignChannelToBuses, };
-static inline IDirectMusicSynth8Impl *impl_from_IKsControl(IKsControl *iface) +static inline struct synth *impl_from_IKsControl(IKsControl *iface) { - return CONTAINING_RECORD(iface, IDirectMusicSynth8Impl, IKsControl_iface); + return CONTAINING_RECORD(iface, struct synth, IKsControl_iface); }
static HRESULT WINAPI synth_control_QueryInterface(IKsControl* iface, REFIID riid, LPVOID *ppobj) { - IDirectMusicSynth8Impl *This = impl_from_IKsControl(iface); + struct synth *This = impl_from_IKsControl(iface);
return synth_QueryInterface(&This->IDirectMusicSynth8_iface, riid, ppobj); }
static ULONG WINAPI synth_control_AddRef(IKsControl* iface) { - IDirectMusicSynth8Impl *This = impl_from_IKsControl(iface); + struct synth *This = impl_from_IKsControl(iface);
return synth_AddRef(&This->IDirectMusicSynth8_iface); }
static ULONG WINAPI synth_control_Release(IKsControl* iface) { - IDirectMusicSynth8Impl *This = impl_from_IKsControl(iface); + struct synth *This = impl_from_IKsControl(iface);
return synth_Release(&This->IDirectMusicSynth8_iface); } @@ -741,7 +739,7 @@ static const IKsControlVtbl synth_control_vtbl =
HRESULT DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj) { - IDirectMusicSynth8Impl *obj; + struct synth *obj; HRESULT hr;
TRACE("(%s, %p)\n", debugstr_guid(riid), ppobj);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dmsynth/synth.c | 9 +++------ dlls/dmsynth/synthsink.c | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 30b7eee6808..00883505377 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -96,7 +96,7 @@ static ULONG WINAPI synth_Release(IDirectMusicSynth8 *iface) if (!ref) { if (This->latency_clock) IReferenceClock_Release(This->latency_clock); - HeapFree(GetProcessHeap(), 0, This); + free(This); }
return ref; @@ -744,11 +744,8 @@ HRESULT DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj)
TRACE("(%s, %p)\n", debugstr_guid(riid), ppobj);
- obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*obj)); - if (NULL == obj) { - *ppobj = NULL; - return E_OUTOFMEMORY; - } + *ppobj = NULL; + if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY; obj->IDirectMusicSynth8_iface.lpVtbl = &synth_vtbl; obj->IKsControl_iface.lpVtbl = &synth_control_vtbl; obj->ref = 1; diff --git a/dlls/dmsynth/synthsink.c b/dlls/dmsynth/synthsink.c index 73c623585be..fce325681ee 100644 --- a/dlls/dmsynth/synthsink.c +++ b/dlls/dmsynth/synthsink.c @@ -92,7 +92,7 @@ static ULONG WINAPI synth_sink_Release(IDirectMusicSynthSink *iface) IReferenceClock_Release(This->latency_clock); if (This->master_clock) IReferenceClock_Release(This->master_clock); - HeapFree(GetProcessHeap(), 0, This); + free(This); }
return ref; @@ -315,10 +315,7 @@ HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ret_iface)
*ret_iface = NULL;
- obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct synth_sink)); - if (!obj) - return E_OUTOFMEMORY; - + if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY; obj->IDirectMusicSynthSink_iface.lpVtbl = &synth_sink_vtbl; obj->IKsControl_iface.lpVtbl = &synth_sink_control; obj->ref = 1; @@ -326,7 +323,7 @@ HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ret_iface) hr = CoCreateInstance(&CLSID_SystemClock, NULL, CLSCTX_INPROC_SERVER, &IID_IReferenceClock, (LPVOID*)&obj->latency_clock); if (FAILED(hr)) { - HeapFree(GetProcessHeap(), 0, obj); + free(obj); return hr; }
This merge request was approved by Michael Stefaniuc.
For the next time can you please fix stuff like this too in the lines you modify? Whitespace placement and LPVOID or other LPJUNK stuff.
--- b/dlls/dmsynth/synthsink.c +++ b/dlls/dmsynth/synthsink.c @@ -229,29 +229,29 @@ return CONTAINING_RECORD(iface, IDirectMusicSynthSinkImpl, IKsControl_iface); }
-static HRESULT WINAPI synth_sink_control_QueryInterface(IKsControl* iface, REFIID riid, LPVOID *ppobj) +static HRESULT WINAPI synth_sink_control_QueryInterface(IKsControl *iface, REFIID riid, void **ppobj)
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=136975
Your paranoid android.
=== debian11 (build log) ===
error: corrupt patch at line 15 Task: Patch failed to apply
=== debian11b (build log) ===
error: corrupt patch at line 15 Task: Patch failed to apply
Sure, in this case it could have probably been merged with the patch but I wanted to keep the changes targeted and such changes could probably be better done coupled with cleaning of the parameters.