Module: wine Branch: master Commit: 994bcb48421c94949eed9f931aeae965dad2a9a9 URL: https://gitlab.winehq.org/wine/wine/-/commit/994bcb48421c94949eed9f931aeae96...
Author: Rémi Bernon rbernon@codeweavers.com Date: Tue Aug 22 17:43:30 2023 +0200
dmstyle: Awlays return S_FALSE from DllCanUnloadNow.
---
dlls/dmstyle/auditiontrack.c | 2 -- dlls/dmstyle/chordtrack.c | 2 -- dlls/dmstyle/commandtrack.c | 2 -- dlls/dmstyle/dmstyle_main.c | 21 --------------------- dlls/dmstyle/dmstyle_private.h | 7 ------- dlls/dmstyle/motiftrack.c | 2 -- dlls/dmstyle/mutetrack.c | 2 -- dlls/dmstyle/style.c | 2 -- dlls/dmstyle/styletrack.c | 2 -- 9 files changed, 42 deletions(-)
diff --git a/dlls/dmstyle/auditiontrack.c b/dlls/dmstyle/auditiontrack.c index 0bf1c818f6c..f324d18cecc 100644 --- a/dlls/dmstyle/auditiontrack.c +++ b/dlls/dmstyle/auditiontrack.c @@ -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);
diff --git a/dlls/dmstyle/chordtrack.c b/dlls/dmstyle/chordtrack.c index fdaecac1240..01511963a40 100644 --- a/dlls/dmstyle/chordtrack.c +++ b/dlls/dmstyle/chordtrack.c @@ -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);
diff --git a/dlls/dmstyle/commandtrack.c b/dlls/dmstyle/commandtrack.c index 32e0bbe8c0d..02b32bc41e6 100644 --- a/dlls/dmstyle/commandtrack.c +++ b/dlls/dmstyle/commandtrack.c @@ -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); diff --git a/dlls/dmstyle/dmstyle_main.c b/dlls/dmstyle/dmstyle_main.c index 8f951ece5ae..9d96ab3930e 100644 --- a/dlls/dmstyle/dmstyle_main.c +++ b/dlls/dmstyle/dmstyle_main.c @@ -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.@) diff --git a/dlls/dmstyle/dmstyle_private.h b/dlls/dmstyle/dmstyle_private.h index 2807e98fe61..5237368b44e 100644 --- a/dlls/dmstyle/dmstyle_private.h +++ b/dlls/dmstyle/dmstyle_private.h @@ -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. */ diff --git a/dlls/dmstyle/motiftrack.c b/dlls/dmstyle/motiftrack.c index 5efe90706e0..93bfd821e56 100644 --- a/dlls/dmstyle/motiftrack.c +++ b/dlls/dmstyle/motiftrack.c @@ -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);
diff --git a/dlls/dmstyle/mutetrack.c b/dlls/dmstyle/mutetrack.c index 2248d7151dd..3f632709397 100644 --- a/dlls/dmstyle/mutetrack.c +++ b/dlls/dmstyle/mutetrack.c @@ -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);
diff --git a/dlls/dmstyle/style.c b/dlls/dmstyle/style.c index 23e32a75fd0..57350470e81 100644 --- a/dlls/dmstyle/style.c +++ b/dlls/dmstyle/style.c @@ -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);
diff --git a/dlls/dmstyle/styletrack.c b/dlls/dmstyle/styletrack.c index 83b03807ddf..3618483749c 100644 --- a/dlls/dmstyle/styletrack.c +++ b/dlls/dmstyle/styletrack.c @@ -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);