msvcrt: Added _set_purecall_handler implementation.

This commit is contained in:
Piotr Caban 2010-08-25 14:46:47 +02:00 committed by Alexandre Julliard
parent 76058b14eb
commit 898e17f2af
7 changed files with 19 additions and 4 deletions

View file

@ -1078,7 +1078,7 @@
@ stub _set_malloc_crt_max_wait
@ stub _set_output_format
@ stub _set_printf_count_output
@ stub _set_purecall_handler
@ cdecl _set_purecall_handler(ptr) msvcrt._set_purecall_handler
@ cdecl _seterrormode(long) msvcrt._seterrormode
@ cdecl -arch=i386,x86_64 -norelay _setjmp(ptr) msvcrt._setjmp
@ cdecl -arch=i386 -norelay _setjmp3(ptr long) msvcrt._setjmp3

View file

@ -510,7 +510,7 @@
@ stdcall -i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind
@ cdecl _set_SSE2_enable(long) msvcrt._set_SSE2_enable
@ cdecl _set_error_mode(long) msvcrt._set_error_mode
@ stub _set_purecall_handler
@ cdecl _set_purecall_handler(ptr) msvcrt._set_purecall_handler
@ cdecl _set_sbh_threshold(long) msvcrt._set_sbh_threshold
@ stub _set_security_error_handler
@ cdecl _seterrormode(long) msvcrt._seterrormode

View file

@ -931,7 +931,7 @@
@ stub _set_malloc_crt_max_wait
@ stub _set_output_format
@ stub _set_printf_count_output
@ stub _set_purecall_handler
@ cdecl _set_purecall_handler(ptr) msvcrt._set_purecall_handler
@ cdecl _set_sbh_threshold(long) msvcrt._set_sbh_threshold
@ cdecl _seterrormode(long) msvcrt._seterrormode
@ cdecl -i386 -norelay _setjmp(ptr) msvcrt._setjmp

View file

@ -917,7 +917,7 @@
@ stub _set_malloc_crt_max_wait
@ stub _set_output_format
@ stub _set_printf_count_output
@ stub _set_purecall_handler
@ cdecl _set_purecall_handler(ptr) msvcrt._set_purecall_handler
@ cdecl _set_sbh_threshold(long) msvcrt._set_sbh_threshold
@ cdecl _seterrormode(long) msvcrt._seterrormode
@ cdecl -i386 -norelay _setjmp(ptr) msvcrt._setjmp

View file

@ -32,6 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
static MSVCRT__onexit_t *MSVCRT_atexit_table = NULL;
static int MSVCRT_atexit_table_size = 0;
static int MSVCRT_atexit_registered = 0; /* Points to free slot */
static MSVCRT_purecall_handler purecall_handler = NULL;
static const char szMsgBoxTitle[] = "Wine C++ Runtime Library";
@ -251,6 +252,15 @@ int CDECL MSVCRT_atexit(void (*func)(void))
return MSVCRT__onexit((MSVCRT__onexit_t)func) == (MSVCRT__onexit_t)func ? 0 : -1;
}
/* _set_purecall_handler - not exported in native msvcrt */
MSVCRT_purecall_handler CDECL _set_purecall_handler(MSVCRT_purecall_handler function)
{
MSVCRT_purecall_handler ret = purecall_handler;
TRACE("(%p)\n", function);
purecall_handler = function;
return ret;
}
/*********************************************************************
* _purecall (MSVCRT.@)
@ -258,5 +268,8 @@ int CDECL MSVCRT_atexit(void (*func)(void))
void CDECL _purecall(void)
{
TRACE("(void)\n");
if(purecall_handler)
purecall_handler();
_amsg_exit( 25 );
}

View file

@ -79,6 +79,7 @@ typedef void (*__cdecl MSVCRT__beginthread_start_routine_t)(void *);
typedef unsigned int (__stdcall *MSVCRT__beginthreadex_start_routine_t)(void *);
typedef int (*__cdecl MSVCRT__onexit_t)(void);
typedef void (__cdecl *MSVCRT_invalid_parameter_handler)(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, unsigned, MSVCRT_uintptr_t);
typedef void (__cdecl *MSVCRT_purecall_handler)(void);
typedef struct {long double x;} MSVCRT__LDOUBLE;

View file

@ -1475,3 +1475,4 @@
@ cdecl _configthreadlocale(long)
@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l
@ cdecl ___mb_cur_max_l_func(ptr)
@ cdecl _set_purecall_handler(ptr)