Module: wine Branch: master Commit: 30e5892c98cc3b7aa0754b542cb19e14d28ac5c2 URL: https://gitlab.winehq.org/wine/wine/-/commit/30e5892c98cc3b7aa0754b542cb19e1...
Author: Rémi Bernon rbernon@codeweavers.com Date: Tue Aug 22 17:41:58 2023 +0200
dmloader: Always return S_FALSE from DllCanUnloadNow.
---
dlls/dmloader/container.c | 3 --- dlls/dmloader/dmloader_main.c | 21 --------------------- dlls/dmloader/dmloader_private.h | 5 ----- dlls/dmloader/loader.c | 3 --- 4 files changed, 32 deletions(-)
diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c index f2b284e1cb3..747c2a07341 100644 --- a/dlls/dmloader/container.c +++ b/dlls/dmloader/container.c @@ -137,7 +137,6 @@ static ULONG WINAPI IDirectMusicContainerImpl_Release(IDirectMusicContainer *ifa if (This->pStream) destroy_dmcontainer(This); HeapFree(GetProcessHeap(), 0, This); - unlock_module(); }
return ref; @@ -666,8 +665,6 @@ HRESULT create_dmcontainer(REFIID lpcGUID, void **ppobj) obj->pContainedObjects = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(struct list)); list_init (obj->pContainedObjects);
- lock_module(); - hr = IDirectMusicContainer_QueryInterface(&obj->IDirectMusicContainer_iface, lpcGUID, ppobj); IDirectMusicContainer_Release(&obj->IDirectMusicContainer_iface);
diff --git a/dlls/dmloader/dmloader_main.c b/dlls/dmloader/dmloader_main.c index 512e6102d86..96d841e2b2d 100644 --- a/dlls/dmloader/dmloader_main.c +++ b/dlls/dmloader/dmloader_main.c @@ -36,8 +36,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
-LONG module_ref = 0; - typedef struct { IClassFactory IClassFactory_iface; HRESULT (*fnCreateInstance)(REFIID riid, void **ppv); @@ -73,15 +71,11 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID r
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) { - lock_module(); - return 2; /* non-heap based object */ }
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) { - unlock_module(); - return 1; /* non-heap based object */ }
@@ -103,12 +97,6 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock) { TRACE("(%d)\n", dolock); - - if (dolock) - lock_module(); - else - unlock_module(); - return S_OK; }
@@ -123,15 +111,6 @@ static const IClassFactoryVtbl classfactory_vtbl = { static IClassFactoryImpl dm_loader_CF = {{&classfactory_vtbl}, create_dmloader}; static IClassFactoryImpl dm_container_CF = {{&classfactory_vtbl}, create_dmcontainer};
-/****************************************************************** - * DllCanUnloadNow (DMLOADER.@) - */ -HRESULT WINAPI DllCanUnloadNow (void) -{ - TRACE("() ref=%ld\n", module_ref); - - return module_ref ? S_FALSE : S_OK; -}
/****************************************************************** * DllGetClassObject (DMLOADER.@) diff --git a/dlls/dmloader/dmloader_private.h b/dlls/dmloader/dmloader_private.h index 204c9689ffb..0aea1ba8499 100644 --- a/dlls/dmloader/dmloader_private.h +++ b/dlls/dmloader/dmloader_private.h @@ -44,11 +44,6 @@
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
-/* dmloader.dll global (for DllCanUnloadNow) */ -extern LONG module_ref; -static inline void lock_module(void) { InterlockedIncrement( &module_ref ); } -static inline void unlock_module(void) { InterlockedDecrement( &module_ref ); } - /***************************************************************************** * Interfaces */ diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index 6c4b29ab5ea..f303f93baaa 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -157,7 +157,6 @@ static ULONG WINAPI IDirectMusicLoaderImpl_Release(IDirectMusicLoader8 *iface) for (i = 0; i < ARRAY_SIZE(classes); i++) HeapFree(GetProcessHeap(), 0, This->search_paths[i]); HeapFree(GetProcessHeap(), 0, This); - unlock_module(); }
return ref; @@ -940,7 +939,5 @@ HRESULT create_dmloader(REFIID lpcGUID, void **ppobj) dls->bInvalidDefaultDLS = TRUE; }
- lock_module(); - return IDirectMusicLoader_QueryInterface(&obj->IDirectMusicLoader8_iface, lpcGUID, ppobj); }