dmusic: Always return S_FALSE from DllCanUnloadNow.
This commit is contained in:
parent
041b468b23
commit
abc6ecc89d
9 changed files with 0 additions and 47 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue