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

dmcompos: Always return S_FALSE from DllCanUnloadNow.

parent 81c05589
......@@ -81,7 +81,6 @@ static ULONG WINAPI IDirectMusicChordMapImpl_Release(IDirectMusicChordMap *iface
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
DMCOMPOS_UnlockModule();
}
return ref;
......@@ -326,7 +325,6 @@ HRESULT create_dmchordmap(REFIID lpcGUID, void **ppobj)
obj->dmobj.IDirectMusicObject_iface.lpVtbl = &dmobject_vtbl;
obj->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
DMCOMPOS_LockModule();
hr = IDirectMusicChordMap_QueryInterface(&obj->IDirectMusicChordMap_iface, lpcGUID, ppobj);
IDirectMusicChordMap_Release(&obj->IDirectMusicChordMap_iface);
......
......@@ -79,7 +79,6 @@ static ULONG WINAPI chordmap_track_Release(IDirectMusicTrack8 *iface)
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
DMCOMPOS_UnlockModule();
}
return ref;
......@@ -301,7 +300,6 @@ HRESULT create_dmchordmaptrack(REFIID lpcGUID, void **ppobj)
(IUnknown *)&track->IDirectMusicTrack8_iface);
track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
DMCOMPOS_LockModule();
hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj);
IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface);
......
......@@ -69,7 +69,6 @@ static ULONG WINAPI IDirectMusicComposerImpl_Release(IDirectMusicComposer *iface
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
DMCOMPOS_UnlockModule();
}
return ref;
......@@ -183,7 +182,6 @@ HRESULT create_dmcomposer(REFIID riid, void **ret_iface)
obj->IDirectMusicComposer_iface.lpVtbl = &dmcomposer_vtbl;
obj->ref = 1;
DMCOMPOS_LockModule();
hr = IDirectMusicComposer_QueryInterface(&obj->IDirectMusicComposer_iface, riid, ret_iface);
IDirectMusicComposer_Release(&obj->IDirectMusicComposer_iface);
......
......@@ -38,8 +38,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
LONG DMCOMPOS_refCount = 0;
typedef struct {
IClassFactory IClassFactory_iface;
HRESULT (*fnCreateInstance)(REFIID riid, void **ret_iface);
......@@ -82,15 +80,11 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID r
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
{
DMCOMPOS_LockModule();
return 2; /* non-heap based object */
}
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
{
DMCOMPOS_UnlockModule();
return 1; /* non-heap based object */
}
......@@ -112,12 +106,6 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
{
TRACE("(%d)\n", dolock);
if (dolock)
DMCOMPOS_LockModule();
else
DMCOMPOS_UnlockModule();
return S_OK;
}
......@@ -135,15 +123,6 @@ static IClassFactoryImpl ChordMapTrack_CF = {{&classfactory_vtbl}, create_dmchor
static IClassFactoryImpl Template_CF = {{&classfactory_vtbl}, create_direct_music_template};
static IClassFactoryImpl SignPostTrack_CF = {{&classfactory_vtbl}, create_dmsignposttrack};
/******************************************************************
* DllCanUnloadNow (DMCOMPOS.@)
*
*
*/
HRESULT WINAPI DllCanUnloadNow(void) {
return DMCOMPOS_refCount != 0 ? S_FALSE : S_OK;
}
/******************************************************************
* DllGetClassObject (DMCOMPOS.@)
......
......@@ -49,11 +49,4 @@ extern HRESULT create_dmcomposer(REFIID riid, void **ret_iface);
extern HRESULT create_dmchordmaptrack(REFIID riid, void **ret_iface);
extern HRESULT create_dmsignposttrack(REFIID riid, void **ret_iface);
/**********************************************************************
* Dll lifetime tracking declaration for dmcompos.dll
*/
extern LONG DMCOMPOS_refCount;
static inline void DMCOMPOS_LockModule(void) { InterlockedIncrement( &DMCOMPOS_refCount ); }
static inline void DMCOMPOS_UnlockModule(void) { InterlockedDecrement( &DMCOMPOS_refCount ); }
#endif /* __WINE_DMCOMPOS_PRIVATE_H */
......@@ -79,7 +79,6 @@ static ULONG WINAPI signpost_track_Release(IDirectMusicTrack8 *iface)
if (!ref) {
HeapFree(GetProcessHeap(), 0, This);
DMCOMPOS_UnlockModule();
}
return ref;
......@@ -289,7 +288,6 @@ HRESULT create_dmsignposttrack(REFIID lpcGUID, void **ppobj)
(IUnknown *)&track->IDirectMusicTrack8_iface);
track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
DMCOMPOS_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