Commit c3ebc387 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dmband: Always return S_FALSE from DllCanUnloadNow.

parent f41ac64a
...@@ -83,7 +83,6 @@ static ULONG WINAPI IDirectMusicBandImpl_Release(IDirectMusicBand *iface) ...@@ -83,7 +83,6 @@ static ULONG WINAPI IDirectMusicBandImpl_Release(IDirectMusicBand *iface)
if (!ref) { if (!ref) {
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
DMBAND_UnlockModule();
} }
return ref; return ref;
...@@ -527,7 +526,6 @@ HRESULT create_dmband(REFIID lpcGUID, void **ppobj) ...@@ -527,7 +526,6 @@ HRESULT create_dmband(REFIID lpcGUID, void **ppobj)
obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl; obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
list_init (&obj->Instruments); list_init (&obj->Instruments);
DMBAND_LockModule();
hr = IDirectMusicBand_QueryInterface(&obj->IDirectMusicBand_iface, lpcGUID, ppobj); hr = IDirectMusicBand_QueryInterface(&obj->IDirectMusicBand_iface, lpcGUID, ppobj);
IDirectMusicBand_Release(&obj->IDirectMusicBand_iface); IDirectMusicBand_Release(&obj->IDirectMusicBand_iface);
......
...@@ -82,7 +82,6 @@ static ULONG WINAPI band_track_Release(IDirectMusicTrack8 *iface) ...@@ -82,7 +82,6 @@ static ULONG WINAPI band_track_Release(IDirectMusicTrack8 *iface)
if (!ref) { if (!ref) {
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
DMBAND_UnlockModule();
} }
return ref; return ref;
...@@ -650,7 +649,6 @@ HRESULT create_dmbandtrack(REFIID lpcGUID, void **ppobj) ...@@ -650,7 +649,6 @@ HRESULT create_dmbandtrack(REFIID lpcGUID, void **ppobj)
track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl; track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
list_init (&track->Bands); list_init (&track->Bands);
DMBAND_LockModule();
hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj); hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj);
IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface); IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface);
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmband); WINE_DEFAULT_DEBUG_CHANNEL(dmband);
LONG DMBAND_refCount = 0;
typedef struct { typedef struct {
IClassFactory IClassFactory_iface; IClassFactory IClassFactory_iface;
HRESULT (*fnCreateInstance)(REFIID riid, void **ret_iface); HRESULT (*fnCreateInstance)(REFIID riid, void **ret_iface);
...@@ -60,15 +58,11 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID r ...@@ -60,15 +58,11 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID r
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
{ {
DMBAND_LockModule();
return 2; /* non-heap based object */ return 2; /* non-heap based object */
} }
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
{ {
DMBAND_UnlockModule();
return 1; /* non-heap based object */ return 1; /* non-heap based object */
} }
...@@ -90,12 +84,6 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown ...@@ -90,12 +84,6 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock) static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
{ {
TRACE("(%d)\n", dolock); TRACE("(%d)\n", dolock);
if (dolock)
DMBAND_LockModule();
else
DMBAND_UnlockModule();
return S_OK; return S_OK;
} }
...@@ -110,16 +98,6 @@ static const IClassFactoryVtbl classfactory_vtbl = { ...@@ -110,16 +98,6 @@ static const IClassFactoryVtbl classfactory_vtbl = {
static IClassFactoryImpl Band_CF = {{&classfactory_vtbl}, create_dmband}; static IClassFactoryImpl Band_CF = {{&classfactory_vtbl}, create_dmband};
static IClassFactoryImpl BandTrack_CF = {{&classfactory_vtbl}, create_dmbandtrack}; static IClassFactoryImpl BandTrack_CF = {{&classfactory_vtbl}, create_dmbandtrack};
/******************************************************************
* DllCanUnloadNow (DMBAND.@)
*
*
*/
HRESULT WINAPI DllCanUnloadNow(void)
{
return DMBAND_refCount != 0 ? S_FALSE : S_OK;
}
/****************************************************************** /******************************************************************
* DllGetClassObject (DMBAND.@) * DllGetClassObject (DMBAND.@)
......
...@@ -73,14 +73,6 @@ typedef struct _DMUS_PRIVATE_BAND { ...@@ -73,14 +73,6 @@ typedef struct _DMUS_PRIVATE_BAND {
IDirectMusicBand *band; IDirectMusicBand *band;
} DMUS_PRIVATE_BAND, *LPDMUS_PRIVATE_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. * Misc.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment