22{
26 DWORD RecordIndex = 0;
27 DWORD BufferIndex = 0;
29 DWORD ConsoleInputMode = 0;
30
31
33 {
36 }
37
39
41 {
43 return 1;
44 }
45
47
48
50
52
53
55 {
57 return 0;
58 }
59
60 if (!EventsRead)
61 {
63 return 0;
64 }
65
67 {
69 return 0;
70 }
71
73 {
76 return 0;
77 }
78
79 for (RecordIndex = 0; RecordIndex < NumberRead; RecordIndex++)
80 {
82 InputRecord[RecordIndex].
Event.KeyEvent.bKeyDown)
83 {
84 BufferIndex = 1;
85 break;
86 }
87 }
88
90
91
93
95
96 return BufferIndex;
97}
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
BOOL WINAPI GetConsoleMode(HANDLE hConsoleHandle, LPDWORD lpMode)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleMode(HANDLE hConsoleHandle, DWORD dwMode)
BOOL WINAPI GetNumberOfConsoleInputEvents(HANDLE hConsoleInput, LPDWORD lpNumberOfEvents)
volatile BOOL CriticalSectionInitialized
static CRITICAL_SECTION CriticalSection
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ EVENT_TYPE EventType
BOOL WINAPI InitializeCriticalSectionAndSpinCount(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define ENABLE_PROCESSED_INPUT