From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dmusic/buffer.c | 2 -- dlls/dmusic/clock.c | 2 -- dlls/dmusic/collection.c | 2 -- dlls/dmusic/dmusic.c | 2 -- dlls/dmusic/dmusic_main.c | 21 --------------------- dlls/dmusic/dmusic_private.h | 8 -------- dlls/dmusic/download.c | 2 -- dlls/dmusic/instrument.c | 2 -- dlls/dmusic/port.c | 6 ------ 9 files changed, 47 deletions(-)
diff --git a/dlls/dmusic/buffer.c b/dlls/dmusic/buffer.c index 9aaa1a074b4..a2ad137fe4b 100644 --- a/dlls/dmusic/buffer.c +++ b/dlls/dmusic/buffer.c @@ -71,7 +71,6 @@ static ULONG WINAPI IDirectMusicBufferImpl_Release(LPDIRECTMUSICBUFFER iface) if (!ref) { free(This->data); free(This); - DMUSIC_UnlockModule(); }
return ref; @@ -319,7 +318,6 @@ HRESULT DMUSIC_CreateDirectMusicBufferImpl(LPDMUS_BUFFERDESC desc, LPVOID* ret_i return E_OUTOFMEMORY; }
- DMUSIC_LockModule(); *ret_iface = &dmbuffer->IDirectMusicBuffer_iface;
return S_OK; diff --git a/dlls/dmusic/clock.c b/dlls/dmusic/clock.c index 15a04c844e5..19441d3d56f 100644 --- a/dlls/dmusic/clock.c +++ b/dlls/dmusic/clock.c @@ -63,7 +63,6 @@ static ULONG WINAPI IReferenceClockImpl_Release(IReferenceClock *iface)
if (!ref) { free(This); - DMUSIC_UnlockModule(); }
return ref; @@ -137,7 +136,6 @@ HRESULT DMUSIC_CreateReferenceClockImpl(LPCGUID riid, LPVOID* ret_iface, LPUNKNO clock->rtTime = 0; clock->pClockInfo.dwSize = sizeof (DMUS_CLOCKINFO);
- DMUSIC_LockModule(); hr = IReferenceClockImpl_QueryInterface(&clock->IReferenceClock_iface, riid, ret_iface); IReferenceClock_Release(&clock->IReferenceClock_iface);
diff --git a/dlls/dmusic/collection.c b/dlls/dmusic/collection.c index 0febf9dfd08..3f1c70b01e3 100644 --- a/dlls/dmusic/collection.c +++ b/dlls/dmusic/collection.c @@ -99,7 +99,6 @@ static ULONG WINAPI IDirectMusicCollectionImpl_Release(IDirectMusicCollection *i
if (!ref) { free(This); - DMUSIC_UnlockModule(); }
return ref; @@ -544,7 +543,6 @@ HRESULT DMUSIC_CreateDirectMusicCollectionImpl(REFIID lpcGUID, void **ppobj, IUn
list_init (&obj->Instruments);
- DMUSIC_LockModule(); hr = IDirectMusicCollection_QueryInterface(&obj->IDirectMusicCollection_iface, lpcGUID, ppobj); IDirectMusicCollection_Release(&obj->IDirectMusicCollection_iface);
diff --git a/dlls/dmusic/dmusic.c b/dlls/dmusic/dmusic.c index 8fb35e65809..d284b32fdd7 100644 --- a/dlls/dmusic/dmusic.c +++ b/dlls/dmusic/dmusic.c @@ -201,7 +201,6 @@ static ULONG WINAPI IDirectMusic8Impl_Release(LPDIRECTMUSIC8 iface) free(This->system_ports); free(This->ports); free(This); - DMUSIC_UnlockModule(); }
return ref; @@ -606,7 +605,6 @@ HRESULT DMUSIC_CreateDirectMusicImpl(REFIID riid, void **ret_iface, IUnknown *un
create_system_ports_list(dmusic);
- DMUSIC_LockModule(); ret = IDirectMusic8Impl_QueryInterface(&dmusic->IDirectMusic8_iface, riid, ret_iface); IDirectMusic8_Release(&dmusic->IDirectMusic8_iface);
diff --git a/dlls/dmusic/dmusic_main.c b/dlls/dmusic/dmusic_main.c index 5d4939937a9..509e80f872b 100644 --- a/dlls/dmusic/dmusic_main.c +++ b/dlls/dmusic/dmusic_main.c @@ -39,8 +39,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
-LONG DMUSIC_refCount = 0; - typedef struct { IClassFactory IClassFactory_iface; HRESULT (*fnCreateInstance)(REFIID riid, void **ppv, IUnknown *pUnkOuter); @@ -76,15 +74,11 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID r
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) { - DMUSIC_LockModule(); - return 2; /* non-heap based object */ }
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) { - DMUSIC_UnlockModule(); - return 1; /* non-heap based object */ }
@@ -101,12 +95,6 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock) { TRACE("(%d)\n", dolock); - - if (dolock) - DMUSIC_LockModule(); - else - DMUSIC_UnlockModule(); - return S_OK; }
@@ -122,15 +110,6 @@ static IClassFactoryImpl DirectMusic_CF = {{&classfactory_vtbl}, DMUSIC_CreateDi static IClassFactoryImpl Collection_CF = {{&classfactory_vtbl}, DMUSIC_CreateDirectMusicCollectionImpl};
-/****************************************************************** - * DllCanUnloadNow (DMUSIC.@) - * - * - */ -HRESULT WINAPI DllCanUnloadNow(void) -{ - return DMUSIC_refCount != 0 ? S_FALSE : S_OK; -}
/****************************************************************** diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h index d6abf1d1f81..b13780e1886 100644 --- a/dlls/dmusic/dmusic_private.h +++ b/dlls/dmusic/dmusic_private.h @@ -214,14 +214,6 @@ static inline IDirectMusicInstrumentImpl *impl_from_IDirectMusicInstrument(IDire /* custom :) */ extern HRESULT IDirectMusicInstrumentImpl_CustomLoad(IDirectMusicInstrument *iface, IStream *stream);
-/********************************************************************** - * Dll lifetime tracking declaration for dmusic.dll - */ -extern LONG DMUSIC_refCount; -static inline void DMUSIC_LockModule(void) { InterlockedIncrement( &DMUSIC_refCount ); } -static inline void DMUSIC_UnlockModule(void) { InterlockedDecrement( &DMUSIC_refCount ); } - - /***************************************************************************** * Misc. */ diff --git a/dlls/dmusic/download.c b/dlls/dmusic/download.c index 48f0efd5f69..095ea23235b 100644 --- a/dlls/dmusic/download.c +++ b/dlls/dmusic/download.c @@ -65,7 +65,6 @@ static ULONG WINAPI IDirectMusicDownloadImpl_Release(IDirectMusicDownload *iface
if (!ref) { free(This); - DMUSIC_UnlockModule(); }
return ref; @@ -102,6 +101,5 @@ HRESULT DMUSIC_CreateDirectMusicDownloadImpl(const GUID *guid, void **ret_iface, download->ref = 1; *ret_iface = download;
- DMUSIC_LockModule(); return S_OK; } diff --git a/dlls/dmusic/instrument.c b/dlls/dmusic/instrument.c index 7b7ee3def64..767c4419225 100644 --- a/dlls/dmusic/instrument.c +++ b/dlls/dmusic/instrument.c @@ -82,7 +82,6 @@ static ULONG WINAPI IDirectMusicInstrumentImpl_Release(LPDIRECTMUSICINSTRUMENT i free(This->articulations->connections); free(This->articulations); free(This); - DMUSIC_UnlockModule(); }
return ref; @@ -133,7 +132,6 @@ HRESULT DMUSIC_CreateDirectMusicInstrumentImpl (LPCGUID lpcGUID, LPVOID* ppobj, dminst->IDirectMusicInstrument_iface.lpVtbl = &DirectMusicInstrument_Vtbl; dminst->ref = 1;
- DMUSIC_LockModule(); hr = IDirectMusicInstrument_QueryInterface(&dminst->IDirectMusicInstrument_iface, lpcGUID, ppobj); IDirectMusicInstrument_Release(&dminst->IDirectMusicInstrument_iface); diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index 752e3e7bc4b..47137c7878c 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -105,7 +105,6 @@ static ULONG WINAPI IDirectMusicDownloadedInstrumentImpl_Release(LPDIRECTMUSICDO { free(This->data); free(This); - DMUSIC_UnlockModule(); }
return ref; @@ -141,7 +140,6 @@ static HRESULT DMUSIC_CreateDirectMusicDownloadedInstrumentImpl(IDirectMusicDown object->ref = 1;
*instrument = &object->IDirectMusicDownloadedInstrument_iface; - DMUSIC_LockModule();
return S_OK; } @@ -178,8 +176,6 @@ static ULONG WINAPI synth_port_AddRef(IDirectMusicPort *iface)
TRACE("(%p): new ref = %lu\n", This, ref);
- DMUSIC_LockModule(); - return ref; }
@@ -204,8 +200,6 @@ static ULONG WINAPI synth_port_Release(IDirectMusicPort *iface) free(This); }
- DMUSIC_UnlockModule(); - return ref; }