1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

dmsynth: Always return S_FALSE from DllCanUnloadNow.

This commit is contained in:
Rémi Bernon 2023-08-22 17:44:17 +02:00 committed by Alexandre Julliard
parent 23b8988464
commit 3b5160c975
4 changed files with 0 additions and 33 deletions

View file

@ -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.@)

View file

@ -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.
*/

View file

@ -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);

View file

@ -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);