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

dmstyle: Awlays return S_FALSE from DllCanUnloadNow.

parent b27a036e
......@@ -79,7 +79,6 @@ static ULONG WINAPI audition_track_Release(IDirectMusicTrack8 *iface)
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
DMSTYLE_UnlockModule();
}
return ref;
......@@ -332,7 +331,6 @@ HRESULT create_dmauditiontrack(REFIID lpcGUID, void **ppobj)
(IUnknown *)&track->IDirectMusicTrack8_iface);
track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
DMSTYLE_LockModule();
hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj);
IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface);
......
......@@ -82,7 +82,6 @@ static ULONG WINAPI chord_track_Release(IDirectMusicTrack8 *iface)
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
DMSTYLE_UnlockModule();
}
return ref;
......@@ -431,7 +430,6 @@ HRESULT create_dmchordtrack(REFIID lpcGUID, void **ppobj)
(IUnknown *)&track->IDirectMusicTrack8_iface);
track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
DMSTYLE_LockModule();
hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj);
IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface);
......
......@@ -81,7 +81,6 @@ static ULONG WINAPI command_track_Release(IDirectMusicTrack8 *iface)
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
DMSTYLE_UnlockModule();
}
return ref;
......@@ -385,7 +384,6 @@ HRESULT create_dmcommandtrack(REFIID lpcGUID, void **ppobj)
track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
list_init (&track->Commands);
DMSTYLE_LockModule();
hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface,
lpcGUID, ppobj);
IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface);
......
......@@ -37,8 +37,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
LONG DMSTYLE_refCount = 0;
typedef struct {
IClassFactory IClassFactory_iface;
HRESULT (*fnCreateInstance)(REFIID riid, void **ret_iface);
......@@ -81,15 +79,11 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID r
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
{
DMSTYLE_LockModule();
return 2; /* non-heap based object */
}
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
{
DMSTYLE_UnlockModule();
return 1; /* non-heap based object */
}
......@@ -111,12 +105,6 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
{
TRACE("(%d)\n", dolock);
if (dolock)
DMSTYLE_LockModule();
else
DMSTYLE_UnlockModule();
return S_OK;
}
......@@ -137,15 +125,6 @@ static IClassFactoryImpl MotifTrack_CF = {{&classfactory_vtbl}, create_dmmotiftr
static IClassFactoryImpl AuditionTrack_CF = {{&classfactory_vtbl}, create_dmauditiontrack};
static IClassFactoryImpl MuteTrack_CF = {{&classfactory_vtbl}, create_dmmutetrack};
/******************************************************************
* DllCanUnloadNow (DMSTYLE.1)
*
*
*/
HRESULT WINAPI DllCanUnloadNow(void) {
return DMSTYLE_refCount != 0 ? S_FALSE : S_OK;
}
/******************************************************************
* DllGetClassObject (DMSTYLE.@)
......
......@@ -61,13 +61,6 @@ typedef struct _DMUS_PRIVATE_COMMAND {
IDirectMusicCollection* ppReferenceCollection;
} DMUS_PRIVATE_COMMAND, *LPDMUS_PRIVATE_COMMAND;
/**********************************************************************
* Dll lifetime tracking declaration for dmstyle.dll
*/
extern LONG DMSTYLE_refCount;
static inline void DMSTYLE_LockModule(void) { InterlockedIncrement( &DMSTYLE_refCount ); }
static inline void DMSTYLE_UnlockModule(void) { InterlockedDecrement( &DMSTYLE_refCount ); }
/*****************************************************************************
* Misc.
*/
......
......@@ -79,7 +79,6 @@ static ULONG WINAPI motif_track_Release(IDirectMusicTrack8 *iface)
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
DMSTYLE_UnlockModule();
}
return ref;
......@@ -304,7 +303,6 @@ HRESULT create_dmmotiftrack(REFIID lpcGUID, void **ppobj)
(IUnknown *)&track->IDirectMusicTrack8_iface);
track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
DMSTYLE_LockModule();
hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj);
IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface);
......
......@@ -79,7 +79,6 @@ static ULONG WINAPI mute_track_Release(IDirectMusicTrack8 *iface)
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
DMSTYLE_UnlockModule();
}
return ref;
......@@ -313,7 +312,6 @@ HRESULT create_dmmutetrack(REFIID lpcGUID, void **ppobj)
(IUnknown *)&track->IDirectMusicTrack8_iface);
track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
DMSTYLE_LockModule();
hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj);
IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface);
......
......@@ -127,7 +127,6 @@ static ULONG WINAPI IDirectMusicStyle8Impl_Release(IDirectMusicStyle8 *iface)
heap_free(motif);
}
heap_free(This);
DMSTYLE_UnlockModule();
}
return ref;
......@@ -991,7 +990,6 @@ HRESULT create_dmstyle(REFIID lpcGUID, void **ppobj)
list_init(&obj->bands);
list_init(&obj->motifs);
DMSTYLE_LockModule();
hr = IDirectMusicStyle8_QueryInterface(&obj->IDirectMusicStyle8_iface, lpcGUID, ppobj);
IDirectMusicStyle8_Release(&obj->IDirectMusicStyle8_iface);
......
......@@ -96,7 +96,6 @@ static ULONG WINAPI style_track_Release(IDirectMusicTrack8 *iface)
}
heap_free(This);
DMSTYLE_UnlockModule();
}
return ref;
......@@ -403,7 +402,6 @@ HRESULT create_dmstyletrack(REFIID lpcGUID, void **ppobj)
track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
list_init (&track->Items);
DMSTYLE_LockModule();
hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj);
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