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

dmscript: Always return S_FALSE from DllCanUnloadNow.

parent da8a8bbf
......@@ -38,8 +38,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmscript);
LONG DMSCRIPT_refCount = 0;
typedef struct {
IClassFactory IClassFactory_iface;
HRESULT (*fnCreateInstance)(REFIID riid, void **ppv, IUnknown *pUnkOuter);
......@@ -82,15 +80,11 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID r
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
{
DMSCRIPT_LockModule();
return 2; /* non-heap based object */
}
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
{
DMSCRIPT_UnlockModule();
return 1; /* non-heap based object */
}
......@@ -107,12 +101,6 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
{
TRACE("(%d)\n", dolock);
if (dolock)
DMSCRIPT_LockModule();
else
DMSCRIPT_UnlockModule();
return S_OK;
}
......@@ -140,16 +128,6 @@ static IClassFactoryImpl ScriptAutoImplAudioPath_CF = {{&classfactory_vtbl},
create_unimpl_instance};
static IClassFactoryImpl ScriptAutoImplSong_CF = {{&classfactory_vtbl}, create_unimpl_instance};
/******************************************************************
* DllCanUnloadNow (DMSCRIPT.@)
*
*
*/
HRESULT WINAPI DllCanUnloadNow(void)
{
return DMSCRIPT_refCount != 0 ? S_FALSE : S_OK;
}
/******************************************************************
* DllGetClassObject (DMSCRIPT.@)
......
......@@ -48,13 +48,6 @@ extern HRESULT DMUSIC_CreateDirectMusicScriptImpl(REFIID riid, void **ppobj, IUn
extern HRESULT DMUSIC_CreateDirectMusicScriptTrack(REFIID riid, void **ppobj, IUnknown *pUnkOuter);
/**********************************************************************
* Dll lifetime tracking declaration for dmscript.dll
*/
extern LONG DMSCRIPT_refCount;
static inline void DMSCRIPT_LockModule(void) { InterlockedIncrement( &DMSCRIPT_refCount ); }
static inline void DMSCRIPT_UnlockModule(void) { InterlockedDecrement( &DMSCRIPT_refCount ); }
/*****************************************************************************
* Misc.
*/
......
......@@ -94,7 +94,6 @@ static ULONG WINAPI IDirectMusicScriptImpl_Release(IDirectMusicScript *iface)
HeapFree(GetProcessHeap(), 0, This->pwzLanguage);
HeapFree(GetProcessHeap(), 0, This->pwzSource);
HeapFree(GetProcessHeap(), 0, This);
DMSCRIPT_UnlockModule();
}
return ref;
......@@ -508,7 +507,6 @@ HRESULT DMUSIC_CreateDirectMusicScriptImpl(REFIID lpcGUID, void **ppobj, IUnknow
obj->dmobj.IDirectMusicObject_iface.lpVtbl = &dmobject_vtbl;
obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
DMSCRIPT_LockModule();
hr = IDirectMusicScript_QueryInterface(&obj->IDirectMusicScript_iface, lpcGUID, ppobj);
IDirectMusicScript_Release(&obj->IDirectMusicScript_iface);
......
......@@ -86,7 +86,6 @@ static ULONG WINAPI script_track_Release(IDirectMusicTrack8 *iface)
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
DMSCRIPT_UnlockModule();
}
return ref;
......@@ -338,7 +337,6 @@ HRESULT DMUSIC_CreateDirectMusicScriptTrack(REFIID riid, void **ret_iface, IUnkn
track->desc.guidClass = CLSID_DirectMusicScriptTrack;
track->ref = 1;
DMSCRIPT_LockModule();
hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, riid, ret_iface);
IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface);
......
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