ReactOS 0.4.16-dev-2104-gb84fa49
OutputDebugStringA.cpp File Reference
Include dependency graph for OutputDebugStringA.cpp:

Go to the source code of this file.

Functions

void WINAPI __acrt_OutputDebugStringA (LPCSTR const text)
 

Function Documentation

◆ __acrt_OutputDebugStringA()

void WINAPI __acrt_OutputDebugStringA ( LPCSTR const  text)

Definition at line 11 of file OutputDebugStringA.cpp.

14{
15 if (text == nullptr)
16 {
17 return;
18 }
19 size_t const text_size = strlen(text) + 1;
20 if (text_size == 0)
21 {
22 return;
23 }
24 // Use alloca instead of heap, since this code is executed during asserts
25 auto text_wide = (wchar_t*)_alloca(text_size * sizeof(wchar_t));
26 size_t converted;
27 if (mbstowcs_s(&converted, text_wide, text_size, text, text_size - 1) == 0)
28 {
29 OutputDebugStringW(text_wide);
30 }
31}
const WCHAR * text
Definition: package.c:1794
_ACRTIMP errno_t __cdecl mbstowcs_s(size_t *, wchar_t *, size_t, const char *, size_t)
Definition: mbstowcs.cpp:316
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23