mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 16:47:17 +00:00
dmband: Always return S_FALSE from DllCanUnloadNow.
This commit is contained in:
parent
f41ac64a73
commit
c3ebc387f3
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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.@)
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue