From c3ebc387f38815748bbc1b01199baa9ea44eb04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 22 Aug 2023 17:51:00 +0200 Subject: [PATCH] dmband: Always return S_FALSE from DllCanUnloadNow. --- dlls/dmband/band.c | 2 -- dlls/dmband/bandtrack.c | 2 -- dlls/dmband/dmband_main.c | 22 ---------------------- dlls/dmband/dmband_private.h | 8 -------- 4 files changed, 34 deletions(-) diff --git a/dlls/dmband/band.c b/dlls/dmband/band.c index d71863a1f9d..907377ebed5 100644 --- a/dlls/dmband/band.c +++ b/dlls/dmband/band.c @@ -83,7 +83,6 @@ static ULONG WINAPI IDirectMusicBandImpl_Release(IDirectMusicBand *iface) if (!ref) { HeapFree(GetProcessHeap(), 0, This); - DMBAND_UnlockModule(); } return ref; @@ -527,7 +526,6 @@ HRESULT create_dmband(REFIID lpcGUID, void **ppobj) obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl; list_init (&obj->Instruments); - DMBAND_LockModule(); hr = IDirectMusicBand_QueryInterface(&obj->IDirectMusicBand_iface, lpcGUID, ppobj); IDirectMusicBand_Release(&obj->IDirectMusicBand_iface); diff --git a/dlls/dmband/bandtrack.c b/dlls/dmband/bandtrack.c index 0142b5b5188..25aca207612 100644 --- a/dlls/dmband/bandtrack.c +++ b/dlls/dmband/bandtrack.c @@ -82,7 +82,6 @@ static ULONG WINAPI band_track_Release(IDirectMusicTrack8 *iface) if (!ref) { HeapFree(GetProcessHeap(), 0, This); - DMBAND_UnlockModule(); } return ref; @@ -650,7 +649,6 @@ HRESULT create_dmbandtrack(REFIID lpcGUID, void **ppobj) track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl; list_init (&track->Bands); - DMBAND_LockModule(); hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj); IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface); diff --git a/dlls/dmband/dmband_main.c b/dlls/dmband/dmband_main.c index c08f8b0a087..c032a931f31 100644 --- a/dlls/dmband/dmband_main.c +++ b/dlls/dmband/dmband_main.c @@ -23,8 +23,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmband); -LONG DMBAND_refCount = 0; - typedef struct { IClassFactory IClassFactory_iface; HRESULT (*fnCreateInstance)(REFIID riid, void **ret_iface); @@ -60,15 +58,11 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID r static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) { - DMBAND_LockModule(); - return 2; /* non-heap based object */ } static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) { - DMBAND_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) - DMBAND_LockModule(); - else - DMBAND_UnlockModule(); - return S_OK; } @@ -110,16 +98,6 @@ static const IClassFactoryVtbl classfactory_vtbl = { static IClassFactoryImpl Band_CF = {{&classfactory_vtbl}, create_dmband}; static IClassFactoryImpl BandTrack_CF = {{&classfactory_vtbl}, create_dmbandtrack}; -/****************************************************************** - * DllCanUnloadNow (DMBAND.@) - * - * - */ -HRESULT WINAPI DllCanUnloadNow(void) -{ - return DMBAND_refCount != 0 ? S_FALSE : S_OK; -} - /****************************************************************** * DllGetClassObject (DMBAND.@) diff --git a/dlls/dmband/dmband_private.h b/dlls/dmband/dmband_private.h index b89dd08dd83..0b1807eaf93 100644 --- a/dlls/dmband/dmband_private.h +++ b/dlls/dmband/dmband_private.h @@ -73,14 +73,6 @@ typedef struct _DMUS_PRIVATE_BAND { IDirectMusicBand *band; } DMUS_PRIVATE_BAND, *LPDMUS_PRIVATE_BAND; - -/********************************************************************** - * Dll lifetime tracking declaration for dmband.dll - */ -extern LONG DMBAND_refCount; -static inline void DMBAND_LockModule(void) { InterlockedIncrement( &DMBAND_refCount ); } -static inline void DMBAND_UnlockModule(void) { InterlockedDecrement( &DMBAND_refCount ); } - /***************************************************************************** * Misc. */