mirror of
https://github.com/reactos/reactos.git
synced 2025-07-02 22:41:22 +00:00
[UCRT] Import Microsoft.Windows.SDK.CRTSource version 10.0.22621.3
Imported from https://www.nuget.org/packages/Microsoft.Windows.SDK.CRTSource/10.0.22621.3 License: MIT
This commit is contained in:
parent
f1b60c66f0
commit
04e0dc4a7a
568 changed files with 115483 additions and 0 deletions
31
sdk/lib/ucrt/internal/OutputDebugStringA.cpp
Normal file
31
sdk/lib/ucrt/internal/OutputDebugStringA.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// OutputDebugStringA.cpp
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// Definition of __acrt_OutputDebugStringA.
|
||||
//
|
||||
|
||||
#include <corecrt_internal_win32_buffer.h>
|
||||
|
||||
void WINAPI __acrt_OutputDebugStringA(
|
||||
LPCSTR const text
|
||||
)
|
||||
{
|
||||
if (text == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
size_t const text_size = strlen(text) + 1;
|
||||
if (text_size == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Use alloca instead of heap, since this code is executed during asserts
|
||||
auto text_wide = (wchar_t*)_alloca(text_size * sizeof(wchar_t));
|
||||
size_t converted;
|
||||
if (mbstowcs_s(&converted, text_wide, text_size, text, text_size - 1) == 0)
|
||||
{
|
||||
OutputDebugStringW(text_wide);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue