Skip to content

Commit

Permalink
[KERNEL32][PSDK][NTVDM][CONSRV] Use now-documented ReadConsoleInputEx…
Browse files Browse the repository at this point in the history
…() flag names.

Addendum to commit b8b8819 (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.
  • Loading branch information
HBelusca committed Mar 6, 2024
1 parent c0dbde0 commit 3a49e26
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dll/win32/kernel32/client/console/readwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ PeekConsoleInputW(IN HANDLE hConsoleInput,
lpBuffer,
nLength,
lpNumberOfEventsRead,
CONSOLE_READ_KEEPEVENT | CONSOLE_READ_CONTINUE,
CONSOLE_READ_NOREMOVE | CONSOLE_READ_NOWAIT,
TRUE);
}

Expand All @@ -1242,7 +1242,7 @@ PeekConsoleInputA(IN HANDLE hConsoleInput,
lpBuffer,
nLength,
lpNumberOfEventsRead,
CONSOLE_READ_KEEPEVENT | CONSOLE_READ_CONTINUE,
CONSOLE_READ_NOREMOVE | CONSOLE_READ_NOWAIT,
FALSE);
}

Expand Down
4 changes: 2 additions & 2 deletions sdk/include/psdk/wincon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion subsystems/mvdm/ntvdm/emulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions win32ss/user/winsrv/consrv/coninput.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 3a49e26

Please sign in to comment.