From 3a49e26f1337bf70b35d1e5ce0fb09d1da4149cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 6 Mar 2024 12:22:40 +0100 Subject: [PATCH] [KERNEL32][PSDK][NTVDM][CONSRV] Use now-documented ReadConsoleInputEx() flag names. Addendum to commit b8b8819c7 (r60920) ReadConsoleInputEx() and its flags used to be undocumented. In the meantime they became documented on MSDN, see: https://learn.microsoft.com/en-us/windows/console/readconsoleinputex We can therefore adopt these now-documented flag names. --- dll/win32/kernel32/client/console/readwrite.c | 4 ++-- sdk/include/psdk/wincon.h | 4 ++-- subsystems/mvdm/ntvdm/emulator.c | 2 +- win32ss/user/winsrv/consrv/coninput.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dll/win32/kernel32/client/console/readwrite.c b/dll/win32/kernel32/client/console/readwrite.c index 00fbf7761cb..297fb71dc7d 100644 --- a/dll/win32/kernel32/client/console/readwrite.c +++ b/dll/win32/kernel32/client/console/readwrite.c @@ -1222,7 +1222,7 @@ PeekConsoleInputW(IN HANDLE hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead, - CONSOLE_READ_KEEPEVENT | CONSOLE_READ_CONTINUE, + CONSOLE_READ_NOREMOVE | CONSOLE_READ_NOWAIT, TRUE); } @@ -1242,7 +1242,7 @@ PeekConsoleInputA(IN HANDLE hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead, - CONSOLE_READ_KEEPEVENT | CONSOLE_READ_CONTINUE, + CONSOLE_READ_NOREMOVE | CONSOLE_READ_NOWAIT, FALSE); } diff --git a/sdk/include/psdk/wincon.h b/sdk/include/psdk/wincon.h index bb6e1ed8dc5..1af408d0357 100644 --- a/sdk/include/psdk/wincon.h +++ b/sdk/include/psdk/wincon.h @@ -119,8 +119,8 @@ extern "C" { /* * Read input flags */ -#define CONSOLE_READ_KEEPEVENT 0x0001 -#define CONSOLE_READ_CONTINUE 0x0002 +#define CONSOLE_READ_NOREMOVE 0x0001 +#define CONSOLE_READ_NOWAIT 0x0002 /* * Event types diff --git a/subsystems/mvdm/ntvdm/emulator.c b/subsystems/mvdm/ntvdm/emulator.c index 68ff9f3cba8..4f3dfb64e98 100644 --- a/subsystems/mvdm/ntvdm/emulator.c +++ b/subsystems/mvdm/ntvdm/emulator.c @@ -228,7 +228,7 @@ ConsoleEventThread(LPVOID Parameter) InputRecords, ARRAYSIZE(InputRecords), &NumRecords, - CONSOLE_READ_CONTINUE)) + CONSOLE_READ_NOWAIT)) { DWORD LastError = GetLastError(); DPRINT1("Error reading console input (0x%p, %lu) - Error %lu\n", ConsoleInput, NumRecords, LastError); diff --git a/win32ss/user/winsrv/consrv/coninput.c b/win32ss/user/winsrv/consrv/coninput.c index f61cbd3eacb..c2ce602592e 100644 --- a/win32ss/user/winsrv/consrv/coninput.c +++ b/win32ss/user/winsrv/consrv/coninput.c @@ -537,8 +537,8 @@ ReadInputBuffer(IN PGET_INPUT_INFO InputInfo, NumEventsRead = 0; Status = ConDrvGetConsoleInput(InputBuffer->Header.Console, InputBuffer, - (GetInputRequest->Flags & CONSOLE_READ_KEEPEVENT) != 0, - (GetInputRequest->Flags & CONSOLE_READ_CONTINUE ) == 0, + (GetInputRequest->Flags & CONSOLE_READ_NOREMOVE) != 0, + (GetInputRequest->Flags & CONSOLE_READ_NOWAIT ) == 0, InputRecord, GetInputRequest->NumRecords, &NumEventsRead); @@ -656,7 +656,7 @@ CON_API(SrvGetConsoleInput, DPRINT("SrvGetConsoleInput\n"); - if (GetInputRequest->Flags & ~(CONSOLE_READ_KEEPEVENT | CONSOLE_READ_CONTINUE)) + if (GetInputRequest->Flags & ~(CONSOLE_READ_NOREMOVE | CONSOLE_READ_NOWAIT)) { return STATUS_INVALID_PARAMETER; }