Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/combase/apartment.c | 2 +- dlls/combase/combase.c | 15 +++++++++++++++ dlls/combase/combase.spec | 3 +-- dlls/combase/combase_private.h | 1 + dlls/ole32/compobj.c | 29 ----------------------------- dlls/ole32/compobj_private.h | 1 - dlls/ole32/ole32.spec | 2 +- 7 files changed, 19 insertions(+), 34 deletions(-)
diff --git a/dlls/combase/apartment.c b/dlls/combase/apartment.c index dbf4553fa41..81071563c09 100644 --- a/dlls/combase/apartment.c +++ b/dlls/combase/apartment.c @@ -426,7 +426,7 @@ static struct apartment *apartment_construct(DWORD model) }
/* Frees unused libraries loaded into apartment */ -void WINAPI apartment_freeunusedlibraries(struct apartment *apt, DWORD delay) +void apartment_freeunusedlibraries(struct apartment *apt, DWORD delay) { struct apartment_loaded_dll *entry, *next;
diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index 286b7be8b86..4ce43717fb4 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -2252,6 +2252,21 @@ DWORD WINAPI CoGetCurrentProcess(void) return tlsdata->thread_seqid; }
+/*********************************************************************** + * CoFreeUnusedLibrariesEx (combase.@) + */ +void WINAPI DECLSPEC_HOTPATCH CoFreeUnusedLibrariesEx(DWORD unload_delay, DWORD reserved) +{ + struct apartment *apt = com_get_current_apt(); + if (!apt) + { + ERR("apartment not initialised\n"); + return; + } + + apartment_freeunusedlibraries(apt, unload_delay); +} + /*********************************************************************** * DllMain (combase.@) */ diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec index 980ffa820cd..00aea556d94 100644 --- a/dlls/combase/combase.spec +++ b/dlls/combase/combase.spec @@ -93,7 +93,7 @@ @ stdcall CoEnableCallCancellation(ptr) ole32.CoEnableCallCancellation @ stdcall CoFileTimeNow(ptr) @ stdcall CoFreeUnusedLibraries() -@ stdcall CoFreeUnusedLibrariesEx(long long) ole32.CoFreeUnusedLibrariesEx +@ stdcall CoFreeUnusedLibrariesEx(long long) @ stdcall CoGetActivationState(int128 long ptr) @ stub CoGetApartmentID @ stdcall CoGetApartmentType(ptr ptr) ole32.CoGetApartmentType @@ -357,7 +357,6 @@ @ stdcall enter_apartment(ptr long) @ stdcall leave_apartment(ptr) @ stdcall apartment_get_inproc_class_object(ptr ptr ptr ptr long ptr) -@ stdcall apartment_freeunusedlibraries(ptr long) @ stdcall apartment_get_mta() @ stdcall apartment_decrement_mta_usage(ptr) @ stdcall apartment_increment_mta_usage(ptr) diff --git a/dlls/combase/combase_private.h b/dlls/combase/combase_private.h index 16d926d13b4..7fe548af593 100644 --- a/dlls/combase/combase_private.h +++ b/dlls/combase/combase_private.h @@ -98,6 +98,7 @@ static inline struct apartment* com_get_current_apt(void)
HWND WINAPI apartment_getwindow(const struct apartment *apt) DECLSPEC_HIDDEN; HRESULT WINAPI apartment_createwindowifneeded(struct apartment *apt) DECLSPEC_HIDDEN; +void apartment_freeunusedlibraries(struct apartment *apt, DWORD unload_delay) DECLSPEC_HIDDEN;
/* RpcSs interface */ HRESULT rpcss_get_next_seqid(DWORD *id) DECLSPEC_HIDDEN; diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 8451953baaf..55d06f197f7 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -1449,35 +1449,6 @@ void WINAPI CoFreeAllLibraries(void) /* NOP */ }
-/*********************************************************************** - * CoFreeUnusedLibrariesEx [OLE32.@] - * - * Frees any previously unused libraries whose delay has expired and marks - * currently unused libraries for unloading. Unused are identified as those that - * return S_OK from their DllCanUnloadNow function. - * - * PARAMS - * dwUnloadDelay [I] Unload delay in milliseconds. - * dwReserved [I] Reserved. Set to 0. - * - * RETURNS - * Nothing. - * - * SEE ALSO - * CoLoadLibrary, CoFreeAllLibraries, CoFreeLibrary - */ -void WINAPI DECLSPEC_HOTPATCH CoFreeUnusedLibrariesEx(DWORD dwUnloadDelay, DWORD dwReserved) -{ - struct apartment *apt = COM_CurrentApt(); - if (!apt) - { - ERR("apartment not initialised\n"); - return; - } - - apartment_freeunusedlibraries(apt, dwUnloadDelay); -} - /****************************************************************************** * CoLockObjectExternal [OLE32.@] * diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h index 34fe1e7a381..29e4cac3623 100644 --- a/dlls/ole32/compobj_private.h +++ b/dlls/ole32/compobj_private.h @@ -267,7 +267,6 @@ extern void WINAPI apartment_decrement_mta_usage(CO_MTA_USAGE_COOKIE cookie) DEC extern HRESULT WINAPI apartment_increment_mta_usage(CO_MTA_USAGE_COOKIE *cookie) DECLSPEC_HIDDEN; extern struct apartment * WINAPI apartment_get_mta(void) DECLSPEC_HIDDEN; extern HRESULT WINAPI apartment_get_local_server_stream(struct apartment *apt, IStream **ret) DECLSPEC_HIDDEN; -extern void WINAPI apartment_freeunusedlibraries(struct apartment *apt, DWORD delay) DECLSPEC_HIDDEN; extern void WINAPI apartment_global_cleanup(void) DECLSPEC_HIDDEN;
HRESULT COM_GetRegisteredClassObject(const struct apartment *apt, REFCLSID rclsid, diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index 4a2e6b531ab..4908729d1f0 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -24,7 +24,7 @@ @ stdcall CoFreeAllLibraries() @ stdcall CoFreeLibrary(long) @ stdcall CoFreeUnusedLibraries() combase.CoFreeUnusedLibraries -@ stdcall CoFreeUnusedLibrariesEx(long long) +@ stdcall CoFreeUnusedLibrariesEx(long long) combase.CoFreeUnusedLibrariesEx @ stdcall CoGetActivationState(int128 long ptr) combase.CoGetActivationState @ stdcall CoGetApartmentType(ptr ptr) @ stdcall CoGetCallContext(ptr ptr) combase.CoGetCallContext