ReactOS 0.4.16-dev-2104-gb84fa49
OutputDebugStringA.cpp
Go to the documentation of this file.
1//
2// OutputDebugStringA.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// Definition of __acrt_OutputDebugStringA.
7//
8
10
12 LPCSTR const text
13 )
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}
void WINAPI __acrt_OutputDebugStringA(LPCSTR const text)
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
#define WINAPI
Definition: msvc.h:6
const char * LPCSTR
Definition: xmlstorage.h:183