ReactOS
0.4.16-dev-1028-g8602629
putwch.cpp
Go to the documentation of this file.
1
//
2
// putwch.cpp
3
//
4
// Copyright (c) Microsoft Corporation. All rights reserved.
5
//
6
// Defines _putwch(), which writes a wide character to the console.
7
//
8
#include <conio.h>
9
#include <
corecrt_internal_lowio.h
>
10
#include <
corecrt_internal_ptd_propagation.h
>
11
12
// Writes a wide character to the console. Returns the character on success,
13
// WEOF on failure.
14
extern
"C"
wint_t
__cdecl
_putwch
(
wchar_t
const
c
)
15
{
16
return
__acrt_lock_and_call(
__acrt_conio_lock
, [&]
17
{
18
return
_putwch_nolock
(
c
);
19
});
20
}
21
22
extern
"C"
wint_t
__cdecl
_putwch_nolock
(
wchar_t
const
c
)
23
{
24
if
(
__dcrt_lowio_ensure_console_output_initialized
() ==
FALSE
)
25
return
WEOF
;
26
27
// Write character to console:
28
DWORD
charsWritten;
29
if
(
__dcrt_write_console
(&
c
, 1, &charsWritten) ==
FALSE
)
30
return
WEOF
;
31
32
return
c
;
33
}
34
35
extern
"C"
wint_t
__cdecl
_putwch_nolock_internal
(
wchar_t
const
c
, __crt_cached_ptd_host&)
36
{
37
// Currently _putwch_nolock does not require any PTD access. Do not need to propagate __crt_cached_ptd_host&.
38
return
_putwch_nolock
(
c
);
39
}
wint_t
int wint_t
Definition:
_apple.h:38
__cdecl
#define __cdecl
Definition:
accygwin.h:79
__acrt_conio_lock
@ __acrt_conio_lock
Definition:
corecrt_internal.h:947
corecrt_internal_lowio.h
corecrt_internal_ptd_propagation.h
FALSE
#define FALSE
Definition:
types.h:117
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
c
const GLubyte * c
Definition:
glext.h:8905
__dcrt_lowio_ensure_console_output_initialized
BOOL __cdecl __dcrt_lowio_ensure_console_output_initialized()
Definition:
initcon.cpp:31
__dcrt_write_console
BOOL __cdecl __dcrt_write_console(_In_ void const *lpBuffer, _In_ DWORD nNumberOfCharsToWrite, _Out_ LPDWORD lpNumberOfCharsWritten)
Definition:
initcon.cpp:67
c
#define c
Definition:
ke_i.h:80
_putwch_nolock_internal
wint_t __cdecl _putwch_nolock_internal(wchar_t const c, __crt_cached_ptd_host &)
Definition:
putwch.cpp:35
_putwch_nolock
wint_t __cdecl _putwch_nolock(wchar_t const c)
Definition:
putwch.cpp:22
WEOF
#define WEOF
Definition:
conio.h:185
_putwch
#define _putwch()
Definition:
conio.h:338
sdk
lib
ucrt
conio
putwch.cpp
Generated on Thu Apr 24 2025 06:15:49 for ReactOS by
1.9.6