ReactOS 0.4.16-dev-1044-ga6558c0
initconin.cpp File Reference
Include dependency graph for initconin.cpp:

Go to the source code of this file.

Functions

 _CRT_LINKER_FORCE_INCLUDE (__dcrt_console_input_terminator)
 
static void __dcrt_lowio_initialize_console_input ()
 
BOOL __cdecl __dcrt_lowio_ensure_console_input_initialized ()
 
void __cdecl __dcrt_terminate_console_input ()
 
template<typename Func >
static BOOL console_input_reopen_and_retry (Func const &fp) throw ()
 
BOOL __cdecl __dcrt_read_console_input (_Out_ PINPUT_RECORD lpBuffer, _In_ DWORD nLength, _Out_ LPDWORD lpNumberOfEventsRead)
 
BOOL __cdecl __dcrt_read_console (_Out_ LPVOID lpBuffer, _In_ DWORD nNumberOfCharsToRead, _Out_ LPDWORD lpNumberOfCharsRead)
 
BOOL __cdecl __dcrt_get_number_of_console_input_events (_Out_ LPDWORD lpcNumberOfEvents)
 
BOOL __cdecl __dcrt_peek_console_input_a (_Out_ PINPUT_RECORD lpBuffer, _In_ DWORD nLength, _Out_ LPDWORD lpNumberOfEventsRead)
 
BOOL __cdecl __dcrt_get_input_console_mode (_Out_ LPDWORD lpMode)
 
BOOL __cdecl __dcrt_set_input_console_mode (_In_ DWORD dwMode)
 

Variables

static HANDLE __dcrt_lowio_console_input_handle = _console_uninitialized_handle
 

Function Documentation

◆ __dcrt_get_input_console_mode()

BOOL __cdecl __dcrt_get_input_console_mode ( _Out_ LPDWORD  lpMode)

Definition at line 136 of file initconin.cpp.

139{
141 [lpMode]()
142 {
143 return ::GetConsoleMode(
145 lpMode
146 );
147 });
148}
static BOOL console_input_reopen_and_retry(Func const &fp)
Definition: initconin.cpp:56
static HANDLE __dcrt_lowio_console_input_handle
Definition: initconin.cpp:16

Referenced by _cgetws_s(), _getch_nolock(), and _getwch_nolock().

◆ __dcrt_get_number_of_console_input_events()

BOOL __cdecl __dcrt_get_number_of_console_input_events ( _Out_ LPDWORD  lpcNumberOfEvents)

Definition at line 104 of file initconin.cpp.

107{
109 [lpcNumberOfEvents]()
110 {
111 return ::GetNumberOfConsoleInputEvents(
113 lpcNumberOfEvents
114 );
115 });
116}

Referenced by _kbhit_nolock().

◆ __dcrt_lowio_ensure_console_input_initialized()

BOOL __cdecl __dcrt_lowio_ensure_console_input_initialized ( void  )

Definition at line 31 of file initconin.cpp.

32{
34 {
36 }
37
39 {
40 return FALSE;
41 }
42 return TRUE;
43}
const HANDLE _console_invalid_handle
const HANDLE _console_uninitialized_handle
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static void __dcrt_lowio_initialize_console_input()
Definition: initconin.cpp:19

Referenced by _cgetws_s(), _getch_nolock(), _getwch_nolock(), and _kbhit_nolock().

◆ __dcrt_lowio_initialize_console_input()

static void __dcrt_lowio_initialize_console_input ( )
static

Definition at line 19 of file initconin.cpp.

20{
22 L"CONIN$",
25 nullptr,
27 0,
28 nullptr);
29}
#define OPEN_EXISTING
Definition: compat.h:775
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
#define FILE_SHARE_READ
Definition: compat.h:136
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define GENERIC_WRITE
Definition: nt_native.h:90
#define L(x)
Definition: ntvdm.h:50

Referenced by __dcrt_lowio_ensure_console_input_initialized(), and console_input_reopen_and_retry().

◆ __dcrt_peek_console_input_a()

BOOL __cdecl __dcrt_peek_console_input_a ( _Out_ PINPUT_RECORD  lpBuffer,
_In_ DWORD  nLength,
_Out_ LPDWORD  lpNumberOfEventsRead 
)

Definition at line 118 of file initconin.cpp.

123{
126 {
127 return ::PeekConsoleInputA(
129 lpBuffer,
130 nLength,
132 );
133 });
134}
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
_In_ DWORD _Out_ LPDWORD lpNumberOfEventsRead
Definition: wincon.h:474
_In_ DWORD nLength
Definition: wincon.h:473

Referenced by _kbhit_nolock().

◆ __dcrt_read_console()

BOOL __cdecl __dcrt_read_console ( _Out_ LPVOID  lpBuffer,
_In_ DWORD  nNumberOfCharsToRead,
_Out_ LPDWORD  lpNumberOfCharsRead 
)

Definition at line 85 of file initconin.cpp.

90{
92 [lpBuffer, nNumberOfCharsToRead, lpNumberOfCharsRead]()
93 {
94 return ::ReadConsoleW(
98 lpNumberOfCharsRead,
99 nullptr
100 );
101 });
102}
_In_ DWORD nNumberOfCharsToRead
Definition: wincon.h:491

Referenced by _cgetws_s().

◆ __dcrt_read_console_input()

BOOL __cdecl __dcrt_read_console_input ( _Out_ PINPUT_RECORD  lpBuffer,
_In_ DWORD  nLength,
_Out_ LPDWORD  lpNumberOfEventsRead 
)

Definition at line 67 of file initconin.cpp.

72{
75 {
76 return ::ReadConsoleInputW(
79 nLength,
81 );
82 });
83}

Referenced by _getch_nolock(), and _getwch_nolock().

◆ __dcrt_set_input_console_mode()

BOOL __cdecl __dcrt_set_input_console_mode ( _In_ DWORD  dwMode)

Definition at line 150 of file initconin.cpp.

153{
155 [dwMode]()
156 {
157 return ::SetConsoleMode(
159 dwMode
160 );
161 });
162}

Referenced by _cgetws_s(), _getch_nolock(), and _getwch_nolock().

◆ __dcrt_terminate_console_input()

void __cdecl __dcrt_terminate_console_input ( )

◆ _CRT_LINKER_FORCE_INCLUDE()

_CRT_LINKER_FORCE_INCLUDE ( __dcrt_console_input_terminator  )

◆ console_input_reopen_and_retry()

template<typename Func >
static BOOL console_input_reopen_and_retry ( Func const fp)
throw (
)
static

Definition at line 56 of file initconin.cpp.

57{
58 BOOL result = fp();
62 result = fp();
63 }
64 return result;
65}
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint64EXT * result
Definition: glext.h:11304
void __cdecl __dcrt_terminate_console_input()
Definition: initconin.cpp:46
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by __dcrt_get_input_console_mode(), __dcrt_get_number_of_console_input_events(), __dcrt_peek_console_input_a(), __dcrt_read_console(), __dcrt_read_console_input(), and __dcrt_set_input_console_mode().

Variable Documentation

◆ __dcrt_lowio_console_input_handle