ReactOS 0.4.16-dev-1067-ge98bba2
crtmbox.cpp File Reference
Include dependency graph for crtmbox.cpp:

Go to the source code of this file.

Classes

struct  anonymous_namespace{crtmbox.cpp}::message_box_arguments< Character >
 

Namespaces

namespace  anonymous_namespace{crtmbox.cpp}
 

Functions

template<typename Character >
static int __cdecl common_show_message_box (Character const *const text, Character const *const caption, unsigned const type) throw ()
 
int __cdecl __acrt_show_narrow_message_box (char const *const text, char const *const caption, unsigned const type)
 
int __cdecl __acrt_show_wide_message_box (wchar_t const *const text, wchar_t const *const caption, unsigned const type)
 

Function Documentation

◆ __acrt_show_narrow_message_box()

int __cdecl __acrt_show_narrow_message_box ( char const *const  text,
char const *const  caption,
unsigned const  type 
)

Definition at line 78 of file crtmbox.cpp.

83{
84 return common_show_message_box(text, caption, type);
85}
static int __cdecl common_show_message_box(Character const *const text, Character const *const caption, unsigned const type)
Definition: crtmbox.cpp:29
const WCHAR * text
Definition: package.c:1794
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

◆ __acrt_show_wide_message_box()

int __cdecl __acrt_show_wide_message_box ( wchar_t const *const  text,
wchar_t const *const  caption,
unsigned const  type 
)

Definition at line 87 of file crtmbox.cpp.

92{
93 return common_show_message_box(text, caption, type);
94}

◆ common_show_message_box()

template<typename Character >
static int __cdecl common_show_message_box ( Character const *const  text,
Character const *const  caption,
unsigned const  type 
)
throw (
)
static

Definition at line 29 of file crtmbox.cpp.

34{
35 using traits = __crt_char_traits<Character>;
36
37 bool const debugger_attached = IsDebuggerPresent();
38 if (debugger_attached)
39 {
40 // Output the message to the attached debugger. This is useful when
41 // remotely debugging.
42 if (text)
43 {
44 traits::output_debug_string(text);
45 }
46
47 // We do not want to display a message box if a debugger
48 // is already attached, unless it's a desktop app.
49 // Instead, let the caller know that we want to
50 // directly break into the debugger:
52 if (!is_desktop_app)
53 {
54 return IDRETRY; // Retry = Break into the debugger
55 }
56 }
57
59 if (!show_ui || !__acrt_can_show_message_box())
60 {
61 // If we can't get the message box pointers (perhaps because running on CoreSys),
62 // just abort, unless a debugger is attached--then break into the debugger instead.
63 // The message string was already output to the debugger above.
64 return debugger_attached ? IDRETRY : IDABORT;
65 }
66
67 // If the current process isn't attached to a visible window station (e.g.
68 // a non-interactive service), then we need to set the MB_SERVICE_NOTIFICATION
69 // flag, otherwise the message box will be invisible, stalling the program.
71 {
72 return traits::message_box(nullptr, text, caption, type | MB_SERVICE_NOTIFICATION);
73 }
74
75 return traits::message_box(__acrt_get_parent_window(), text, caption, type);
76}
@ developer_information_policy_ui
bool __cdecl __acrt_is_interactive(void)
HWND __cdecl __acrt_get_parent_window(void)
@ windowing_model_policy_hwnd
bool __cdecl __acrt_can_show_message_box(void)
windowing_model_policy __cdecl __acrt_get_windowing_model_policy(void)
developer_information_policy __cdecl __acrt_get_developer_information_policy(void)
BOOL WINAPI IsDebuggerPresent(void)
Definition: debugger.c:580
#define IDABORT
Definition: winuser.h:843
#define IDRETRY
Definition: winuser.h:844

Referenced by __acrt_show_narrow_message_box(), and __acrt_show_wide_message_box().