From: Zebediah Figura <zfigura(a)codeweavers.com> Recent consensus seems to be that this isn't worth the effort. --- dlls/objsel/factory.c | 20 ++------------------ dlls/objsel/objsel.c | 24 +----------------------- dlls/objsel/objsel_private.h | 6 ------ 3 files changed, 3 insertions(+), 47 deletions(-) diff --git a/dlls/objsel/factory.c b/dlls/objsel/factory.c index cb0fb491cb4..c3e64f0568a 100644 --- a/dlls/objsel/factory.c +++ b/dlls/objsel/factory.c @@ -66,20 +66,12 @@ static HRESULT WINAPI OBJSEL_IClassFactory_QueryInterface( static ULONG WINAPI OBJSEL_IClassFactory_AddRef(LPCLASSFACTORY iface) { ClassFactoryImpl *This = impl_from_IClassFactory(iface); - ULONG ref; TRACE("\n"); if (This == NULL) return E_POINTER; - ref = InterlockedIncrement(&This->ref); - - if (ref == 1) - { - InterlockedIncrement(&dll_refs); - } - - return ref; + return InterlockedIncrement(&This->ref); } @@ -89,20 +81,12 @@ static ULONG WINAPI OBJSEL_IClassFactory_AddRef(LPCLASSFACTORY iface) static ULONG WINAPI OBJSEL_IClassFactory_Release(LPCLASSFACTORY iface) { ClassFactoryImpl *This = impl_from_IClassFactory(iface); - ULONG ref; TRACE("\n"); if (This == NULL) return E_POINTER; - ref = InterlockedDecrement(&This->ref); - - if (ref == 0) - { - InterlockedDecrement(&dll_refs); - } - - return ref; + return InterlockedDecrement(&This->ref); } diff --git a/dlls/objsel/objsel.c b/dlls/objsel/objsel.c index 90873191691..026a6d594af 100644 --- a/dlls/objsel/objsel.c +++ b/dlls/objsel/objsel.c @@ -24,8 +24,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(objsel); -LONG dll_refs = 0; - /*********************************************************************** * DllGetClassObject (OBJSEL.@) */ @@ -43,15 +41,6 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) } -/*********************************************************************** - * DllCanUnloadNow (OBJSEL.@) - */ -HRESULT WINAPI DllCanUnloadNow(void) -{ - return dll_refs != 0 ? S_FALSE : S_OK; -} - - /********************************************************************** * OBJSEL_IDsObjectPicker_Destroy (also IUnknown) */ @@ -74,20 +63,12 @@ static inline IDsObjectPickerImpl *impl_from_IDsObjectPicker(IDsObjectPicker *if static ULONG WINAPI OBJSEL_IDsObjectPicker_AddRef(IDsObjectPicker * iface) { IDsObjectPickerImpl *This = impl_from_IDsObjectPicker(iface); - ULONG ref; TRACE("\n"); if (This == NULL) return E_POINTER; - ref = InterlockedIncrement(&This->ref); - - if (ref == 1) - { - InterlockedIncrement(&dll_refs); - } - - return ref; + return InterlockedIncrement(&This->ref); } @@ -106,10 +87,7 @@ static ULONG WINAPI OBJSEL_IDsObjectPicker_Release(IDsObjectPicker * iface) ref = InterlockedDecrement(&This->ref); if (ref == 0) - { - InterlockedDecrement(&dll_refs); OBJSEL_IDsObjectPicker_Destroy(This); - } return ref; } diff --git a/dlls/objsel/objsel_private.h b/dlls/objsel/objsel_private.h index b0a2e956733..86ea129089b 100644 --- a/dlls/objsel/objsel_private.h +++ b/dlls/objsel/objsel_private.h @@ -23,12 +23,6 @@ #include "objidl.h" #include "objsel.h" -/********************************************************************** - * Dll lifetime tracking declaration for objsel.dll - */ - -extern LONG dll_refs DECLSPEC_HIDDEN; - /********************************************************************** * ClassFactory declaration for objsel.dll */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4028