ReactOS 0.4.16-dev-927-g467dec4
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)
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
const WCHAR * text
Definition: package.c:1794
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
errno_t mbstowcs_s(size_t *cchConverted, wchar_t *widechar, size_t charoutct, const char *multibyte, size_t count)
Definition: mbstowcs.cpp:316
#define WINAPI
Definition: msvc.h:6
const char * LPCSTR
Definition: xmlstorage.h:183