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
49a8bb0a
Commit
49a8bb0a
authored
Jan 30, 2011
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Jan 31, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use the _set_error_mode value to switch between a dialogbox and stderr…
msvcrt: Use the _set_error_mode value to switch between a dialogbox and stderr for C runtime messages.
parent
c865b3f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
33 deletions
+30
-33
errno.c
dlls/msvcrt/errno.c
+0
-29
exit.c
dlls/msvcrt/exit.c
+30
-4
No files found.
dlls/msvcrt/errno.c
View file @
49a8bb0a
...
...
@@ -407,35 +407,6 @@ MSVCRT_wchar_t* CDECL __wcserror(const MSVCRT_wchar_t* str)
}
/******************************************************************************
* _set_error_mode (MSVCRT.@)
*
* Set the error mode, which describes where the C run-time writes error
* messages.
*
* PARAMS
* mode - the new error mode
*
* RETURNS
* The old error mode.
*
* TODO
* This function does not have a proper implementation; the error mode is
* never used.
*/
int
CDECL
_set_error_mode
(
int
mode
)
{
static
int
current_mode
=
MSVCRT__OUT_TO_DEFAULT
;
const
int
old
=
current_mode
;
if
(
MSVCRT__REPORT_ERRMODE
!=
mode
)
{
current_mode
=
mode
;
FIXME
(
"dummy implementation (old mode: %d, new mode: %d)
\n
"
,
old
,
mode
);
}
return
old
;
}
/******************************************************************************
* _seterrormode (MSVCRT.@)
*/
void
CDECL
_seterrormode
(
int
mode
)
...
...
dlls/msvcrt/exit.c
View file @
49a8bb0a
...
...
@@ -40,6 +40,7 @@ extern int MSVCRT_app_type;
extern
char
*
MSVCRT__pgmptr
;
static
unsigned
int
MSVCRT_abort_behavior
=
MSVCRT__WRITE_ABORT_MSG
|
MSVCRT__CALL_REPORTFAULT
;
static
int
MSVCRT_error_mode
=
MSVCRT__OUT_TO_DEFAULT
;
void
(
*
CDECL
_aexit_rtn
)(
int
)
=
MSVCRT__exit
;
...
...
@@ -134,8 +135,9 @@ static void DoMessageBox(LPCSTR lead, LPCSTR message)
void
CDECL
_amsg_exit
(
int
errnum
)
{
TRACE
(
"(%d)
\n
"
,
errnum
);
/* FIXME: text for the error number. */
if
(
MSVCRT_app_type
==
2
)
if
((
MSVCRT_error_mode
==
MSVCRT__OUT_TO_MSGBOX
)
||
((
MSVCRT_error_mode
==
MSVCRT__OUT_TO_DEFAULT
)
&&
(
MSVCRT_app_type
==
2
)))
{
char
text
[
32
];
sprintf
(
text
,
"Error: R60%d"
,
errnum
);
...
...
@@ -155,7 +157,8 @@ void CDECL MSVCRT_abort(void)
if
(
MSVCRT_abort_behavior
&
MSVCRT__WRITE_ABORT_MSG
)
{
if
(
MSVCRT_app_type
==
2
)
if
((
MSVCRT_error_mode
==
MSVCRT__OUT_TO_MSGBOX
)
||
((
MSVCRT_error_mode
==
MSVCRT__OUT_TO_DEFAULT
)
&&
(
MSVCRT_app_type
==
2
)))
{
DoMessageBox
(
"Runtime error!"
,
"abnormal program termination"
);
}
...
...
@@ -190,7 +193,8 @@ unsigned int CDECL MSVCRT__set_abort_behavior(unsigned int flags, unsigned int m
void
CDECL
MSVCRT__assert
(
const
char
*
str
,
const
char
*
file
,
unsigned
int
line
)
{
TRACE
(
"(%s,%s,%d)
\n
"
,
str
,
file
,
line
);
if
(
MSVCRT_app_type
==
2
)
if
((
MSVCRT_error_mode
==
MSVCRT__OUT_TO_MSGBOX
)
||
((
MSVCRT_error_mode
==
MSVCRT__OUT_TO_DEFAULT
)
&&
(
MSVCRT_app_type
==
2
)))
{
char
text
[
2048
];
snprintf
(
text
,
sizeof
(
text
),
"File: %s
\n
Line: %d
\n\n
Expression:
\"
%s
\"
"
,
file
,
line
,
str
);
...
...
@@ -296,3 +300,25 @@ void CDECL _purecall(void)
purecall_handler
();
_amsg_exit
(
25
);
}
/******************************************************************************
* _set_error_mode (MSVCRT.@)
*
* Set the error mode, which describes where the C run-time writes error messages.
*
* PARAMS
* mode - the new error mode
*
* RETURNS
* The old error mode.
*
*/
int
CDECL
_set_error_mode
(
int
mode
)
{
const
int
old
=
MSVCRT_error_mode
;
if
(
MSVCRT__REPORT_ERRMODE
!=
mode
)
{
MSVCRT_error_mode
=
mode
;
}
return
old
;
}
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