ucrtbase: Added _register_thread_local_exe_atexit_callback implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-09-20 16:06:13 +02:00 committed by Alexandre Julliard
parent 21f78807a0
commit 32c38dc4b2
3 changed files with 15 additions and 2 deletions

View File

@ -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

View File

@ -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)
{
@ -449,6 +453,15 @@ int CDECL MSVCRT__execute_onexit_table(MSVCRT__onexit_table_t *table)
return 0;
}
/*********************************************************************
* _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.@)
*/

View File

@ -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