43#ifdef _UCRT_ENCLAVE_BUILD
123 size_t const narrow_buffer_count = 500;
124 char narrow_buffer[narrow_buffer_count];
126 char*
const narrow_first = narrow_buffer;
127 char*
const narrow_last = narrow_first + narrow_buffer_count;
131 char* narrow_it = narrow_first;
132 wchar_t const* wide_it = wide_string;
135 *narrow_it =
static_cast<char>(*wide_it);
137 while (++narrow_it != narrow_last && *wide_it++ !=
'\0');
141 *(narrow_last - 1) =
'\0';
143 DWORD const bytes_to_write =
static_cast<DWORD>(narrow_it - narrow_first - 1);
144 DWORD bytes_written = 0;
145 WriteFile(
handle, narrow_buffer, bytes_to_write, &bytes_written,
nullptr);
165 #define MSGTEXTPREFIX L"Runtime Error!\n\nProgram: "
180 #define MAXLINELEN 60
195 L"Microsoft Visual C++ Runtime Library",
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
static const char * progname
int __cdecl __acrt_show_wide_message_box(_In_opt_z_ wchar_t const *text, _In_opt_z_ wchar_t const *caption, _In_ unsigned type)
EXTERN_C int __cdecl _CrtDbgReportW(int reportType, const wchar_t *filename, int linenumber, const wchar_t *moduleName, const wchar_t *format,...)
result_buffer_count char *const _In_ int const _In_ bool const _In_ unsigned const _In_ STRFLT const _In_ bool const _Inout_ __crt_cached_ptd_host &ptd throw()
#define INVALID_HANDLE_VALUE
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
_Check_return_opt_ _CRTIMP int __cdecl _set_error_mode(_In_ int _Mode)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define wcscpy_s(d, l, s)
#define wcsncpy_s(d, l, s, n)
#define UNREFERENCED_PARAMETER(P)
static bool __cdecl should_write_error_to_console()
void __cdecl __acrt_report_runtime_error(wchar_t const *const message)
static _crt_app_type __acrt_app_type
_crt_app_type __cdecl _query_app_type()
static void write_string_to_console(wchar_t const *const wide_string)
static bool __cdecl issue_debug_notification(wchar_t const *const message)
void __cdecl _set_app_type(_crt_app_type const new_app_type)
INT CDECL wcscat_s(wchar_t *dst, size_t elem, const wchar_t *src)