Commit c698ba86 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

msvcrt: Display message box in abort() for specific CRT versions only.

parent f943d449
...@@ -51,7 +51,10 @@ static CRITICAL_SECTION MSVCRT_onexit_cs = { &MSVCRT_onexit_cs_debug, -1, 0, 0, ...@@ -51,7 +51,10 @@ static CRITICAL_SECTION MSVCRT_onexit_cs = { &MSVCRT_onexit_cs_debug, -1, 0, 0,
extern int MSVCRT_app_type; extern int MSVCRT_app_type;
extern wchar_t *MSVCRT__wpgmptr; extern wchar_t *MSVCRT__wpgmptr;
#if _MSVCR_VER > 0 || defined(_DEBUG)
static unsigned int MSVCRT_abort_behavior = _WRITE_ABORT_MSG | _CALL_REPORTFAULT; static unsigned int MSVCRT_abort_behavior = _WRITE_ABORT_MSG | _CALL_REPORTFAULT;
#endif
static int MSVCRT_error_mode = _OUT_TO_DEFAULT; static int MSVCRT_error_mode = _OUT_TO_DEFAULT;
void (*CDECL _aexit_rtn)(int) = _exit; void (*CDECL _aexit_rtn)(int) = _exit;
...@@ -250,6 +253,7 @@ void CDECL abort(void) ...@@ -250,6 +253,7 @@ void CDECL abort(void)
{ {
TRACE("()\n"); TRACE("()\n");
#if (_MSVCR_VER > 0 && _MSVCR_VER < 100) || _MSVCR_VER == 120 || defined(_DEBUG)
if (MSVCRT_abort_behavior & _WRITE_ABORT_MSG) if (MSVCRT_abort_behavior & _WRITE_ABORT_MSG)
{ {
if ((MSVCRT_error_mode == _OUT_TO_MSGBOX) || if ((MSVCRT_error_mode == _OUT_TO_MSGBOX) ||
...@@ -260,6 +264,7 @@ void CDECL abort(void) ...@@ -260,6 +264,7 @@ void CDECL abort(void)
else else
_cputs("\nabnormal program termination\n"); _cputs("\nabnormal program termination\n");
} }
#endif
raise(SIGABRT); raise(SIGABRT);
/* in case raise() returns */ /* in case raise() returns */
_exit(3); _exit(3);
......
EXTRADEFS = -D_CRTIMP= EXTRADEFS = -D_CRTIMP= -D_DEBUG=
MODULE = msvcrtd.dll MODULE = msvcrtd.dll
IMPORTLIB = msvcrtd IMPORTLIB = msvcrtd
IMPORTS = ntdll IMPORTS = ntdll
......
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