Commit 32c38dc4 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

ucrtbase: Added _register_thread_local_exe_atexit_callback implementation.

parent 21f78807
......@@ -61,7 +61,7 @@
@ stub _invoke_watson
@ stub _query_app_type
@ cdecl _register_onexit_function(ptr ptr) ucrtbase._register_onexit_function
@ stub _register_thread_local_exe_atexit_callback
@ cdecl _register_thread_local_exe_atexit_callback(ptr) ucrtbase._register_thread_local_exe_atexit_callback
@ cdecl _resetstkoflw() ucrtbase._resetstkoflw
@ cdecl -arch=i386,x86_64,arm,arm64 _seh_filter_dll(long ptr) ucrtbase._seh_filter_dll
@ cdecl _seh_filter_exe(long ptr) ucrtbase._seh_filter_exe
......
......@@ -41,6 +41,9 @@ typedef struct MSVCRT__onexit_table_t
MSVCRT__onexit_t *_end;
} MSVCRT__onexit_table_t;
typedef void (__stdcall *_tls_callback_type)(void*,ULONG,void*);
static _tls_callback_type tls_atexit_callback;
static CRITICAL_SECTION MSVCRT_onexit_cs;
static CRITICAL_SECTION_DEBUG MSVCRT_onexit_cs_debug =
{
......@@ -63,6 +66,7 @@ static void __MSVCRT__call_atexit(void)
{
/* Note: should only be called with the exit lock held */
TRACE("%d atext functions to call\n", MSVCRT_atexit_registered);
if (tls_atexit_callback) tls_atexit_callback(NULL, DLL_PROCESS_DETACH, NULL);
/* Last registered gets executed first */
while (MSVCRT_atexit_registered > 0)
{
......@@ -450,6 +454,15 @@ int CDECL MSVCRT__execute_onexit_table(MSVCRT__onexit_table_t *table)
}
/*********************************************************************
* _register_thread_local_exe_atexit_callback (UCRTBASE.@)
*/
void CDECL _register_thread_local_exe_atexit_callback(_tls_callback_type callback)
{
TRACE("(%p)\n", callback);
tls_atexit_callback = callback;
}
/*********************************************************************
* _set_purecall_handler (MSVCR71.@)
*/
MSVCRT_purecall_handler CDECL _set_purecall_handler(MSVCRT_purecall_handler function)
......
......@@ -1862,7 +1862,7 @@
@ cdecl _realloc_base(ptr long)
@ cdecl _recalloc(ptr long long)
@ cdecl _register_onexit_function(ptr ptr) MSVCRT__register_onexit_function
@ stub _register_thread_local_exe_atexit_callback
@ cdecl _register_thread_local_exe_atexit_callback(ptr)
@ cdecl _resetstkoflw() MSVCRT__resetstkoflw
@ cdecl _rmdir(str) MSVCRT__rmdir
@ cdecl _rmtmp() MSVCRT__rmtmp
......
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