Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f5be136c
Commit
f5be136c
authored
Mar 15, 2003
by
Jon Griffiths
Committed by
Alexandre Julliard
Mar 15, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display abnormal exit text in a message box for GUI apps.
parent
b7258b2c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
8 deletions
+48
-8
Makefile.in
dlls/msvcrt/Makefile.in
+1
-0
exit.c
dlls/msvcrt/exit.c
+47
-8
No files found.
dlls/msvcrt/Makefile.in
View file @
f5be136c
...
...
@@ -5,6 +5,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
msvcrt.dll
IMPORTS
=
kernel32 ntdll
DELAYIMPORTS
=
user32
EXTRALIBS
=
$(LIBUNICODE)
LDDLLFLAGS
=
@LDDLLFLAGS@
...
...
dlls/msvcrt/exit.c
View file @
f5be136c
...
...
@@ -17,11 +17,13 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include "msvcrt.h"
#include "msvcrt/conio.h"
#include "msvcrt/stdlib.h"
#include "mtdll.h"
#include "winuser.h"
#include "wine/debug.h"
...
...
@@ -35,7 +37,10 @@ static _onexit_t *MSVCRT_atexit_table = NULL;
static
int
MSVCRT_atexit_table_size
=
0
;
static
int
MSVCRT_atexit_registered
=
0
;
/* Points to free slot */
static
LPCSTR
szMsgBoxTitle
=
"Wine C++ Runtime Library"
;
extern
int
MSVCRT_app_type
;
extern
char
*
MSVCRT__pgmptr
;
/* INTERNAL: call atexit functions */
void
__MSVCRT__call_atexit
(
void
)
...
...
@@ -95,6 +100,33 @@ void MSVCRT__exit(int exitcode)
ExitProcess
(
exitcode
);
}
/* Print out an error message with an option to debug */
static
void
DoMessageBox
(
LPCSTR
lead
,
LPCSTR
message
)
{
MSGBOXPARAMSA
msgbox
;
char
text
[
2048
];
INT
ret
;
snprintf
(
text
,
sizeof
(
text
),
"%s
\n\n
Program: %s
\n
%s
\n\n
"
"Press OK to exit the program, or Cancel to start the Wine debugger.
\n
"
,
lead
,
MSVCRT__pgmptr
,
message
);
msgbox
.
cbSize
=
sizeof
(
msgbox
);
msgbox
.
hwndOwner
=
GetActiveWindow
();
msgbox
.
hInstance
=
0
;
msgbox
.
lpszText
=
text
;
msgbox
.
lpszCaption
=
szMsgBoxTitle
;
msgbox
.
dwStyle
=
MB_OKCANCEL
|
MB_ICONERROR
;
msgbox
.
lpszIcon
=
NULL
;
msgbox
.
dwContextHelpId
=
0
;
msgbox
.
lpfnMsgBoxCallback
=
NULL
;
msgbox
.
dwLanguageId
=
LANG_NEUTRAL
;
ret
=
MessageBoxIndirectA
(
&
msgbox
);
if
(
ret
==
IDCANCEL
)
DebugBreak
();
}
/*********************************************************************
* _amsg_exit (MSVCRT.@)
*/
...
...
@@ -104,9 +136,12 @@ void MSVCRT__amsg_exit(int errnum)
/* FIXME: text for the error number. */
if
(
MSVCRT_app_type
==
2
)
{
/* FIXME: MsgBox */
char
text
[
32
];
sprintf
(
text
,
"Error: R60%d"
,
errnum
);
DoMessageBox
(
"Runtime error!"
,
text
);
}
_cprintf
(
"
\n
runtime error R60%d
\n
"
,
errnum
);
else
_cprintf
(
"
\n
runtime error R60%d
\n
"
,
errnum
);
MSVCRT__exit
(
255
);
}
...
...
@@ -115,12 +150,13 @@ void MSVCRT__amsg_exit(int errnum)
*/
void
MSVCRT_abort
(
void
)
{
TRACE
(
"(
void
)
\n
"
);
TRACE
(
"()
\n
"
);
if
(
MSVCRT_app_type
==
2
)
{
/* FIXME: MsgBox */
DoMessageBox
(
"Runtime error!"
,
"abnormal program termination"
);
}
_cputs
(
"
\n
abnormal program termination
\n
"
);
else
_cputs
(
"
\n
abnormal program termination
\n
"
);
MSVCRT__exit
(
3
);
}
...
...
@@ -132,10 +168,13 @@ void MSVCRT__assert(const char* str, const char* file, unsigned int line)
TRACE
(
"(%s,%s,%d)
\n
"
,
str
,
file
,
line
);
if
(
MSVCRT_app_type
==
2
)
{
/* FIXME: MsgBox */
char
text
[
2048
];
snprintf
(
text
,
sizeof
(
text
),
"File: %s
\n
Line: %d
\n\n
Epression:
\"
%s
\"
"
,
file
,
line
,
str
);
DoMessageBox
(
"Assertion failed!"
,
text
);
}
_cprintf
(
"Assertion failed: %s, file %s, line %d
\n\n
"
,
str
,
file
,
line
);
MSVCRT_abort
();
else
_cprintf
(
"Assertion failed: %s, file %s, line %d
\n\n
"
,
str
,
file
,
line
);
MSVCRT__exit
(
3
);
}
/*********************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment