Module: wine Branch: master Commit: c698ba86d4d9ff07d72a657c29107196fc971530 URL: https://gitlab.winehq.org/wine/wine/-/commit/c698ba86d4d9ff07d72a657c2910719...
Author: Paul Gofman pgofman@codeweavers.com Date: Thu Oct 20 14:37:02 2022 -0500
msvcrt: Display message box in abort() for specific CRT versions only.
---
dlls/msvcrt/exit.c | 5 +++++ dlls/msvcrtd/Makefile.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcrt/exit.c b/dlls/msvcrt/exit.c index 323d205b1bd..6427b15bece 100644 --- a/dlls/msvcrt/exit.c +++ b/dlls/msvcrt/exit.c @@ -51,7 +51,10 @@ static CRITICAL_SECTION MSVCRT_onexit_cs = { &MSVCRT_onexit_cs_debug, -1, 0, 0, extern int MSVCRT_app_type; extern wchar_t *MSVCRT__wpgmptr;
+#if _MSVCR_VER > 0 || defined(_DEBUG) static unsigned int MSVCRT_abort_behavior = _WRITE_ABORT_MSG | _CALL_REPORTFAULT; +#endif + static int MSVCRT_error_mode = _OUT_TO_DEFAULT;
void (*CDECL _aexit_rtn)(int) = _exit; @@ -250,6 +253,7 @@ void CDECL abort(void) { TRACE("()\n");
+#if (_MSVCR_VER > 0 && _MSVCR_VER < 100) || _MSVCR_VER == 120 || defined(_DEBUG) if (MSVCRT_abort_behavior & _WRITE_ABORT_MSG) { if ((MSVCRT_error_mode == _OUT_TO_MSGBOX) || @@ -260,6 +264,7 @@ void CDECL abort(void) else _cputs("\nabnormal program termination\n"); } +#endif raise(SIGABRT); /* in case raise() returns */ _exit(3); diff --git a/dlls/msvcrtd/Makefile.in b/dlls/msvcrtd/Makefile.in index bd4f78729d0..97743e99062 100644 --- a/dlls/msvcrtd/Makefile.in +++ b/dlls/msvcrtd/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -D_CRTIMP= +EXTRADEFS = -D_CRTIMP= -D_DEBUG= MODULE = msvcrtd.dll IMPORTLIB = msvcrtd IMPORTS = ntdll