2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/msvcrt/conio/getch.c
5 * PURPOSE: Writes a character to stdout
18 DWORD NumberOfCharsRead
= 0;
29 * _getch() is documented to NOT echo characters. Testing shows it
30 * doesn't wait for a CR either. So we need to switch off
31 * ENABLE_ECHO_INPUT and ENABLE_LINE_INPUT if they're currently
34 ConsoleHandle
= (HANDLE
) _get_osfhandle(stdin
->_file
);
35 RestoreMode
= GetConsoleMode(ConsoleHandle
, &ConsoleMode
) &&
37 (ENABLE_ECHO_INPUT
| ENABLE_LINE_INPUT
)));
39 SetConsoleMode(ConsoleHandle
,
40 ConsoleMode
& (~ (ENABLE_ECHO_INPUT
| ENABLE_LINE_INPUT
)));
42 ReadConsoleA((HANDLE
)_get_osfhandle(stdin
->_file
),
48 SetConsoleMode(ConsoleHandle
, ConsoleMode
);