Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/spelling/expect/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ FGHIJ
fgidx
FGs
FILEDESCRIPTION
filehops
FILESUBTYPE
FILESYSPATH
FILEW
Expand Down
2 changes: 1 addition & 1 deletion src/host/ft_host/API_FileTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ void FileTests::TestReadFileBasicEmpty()
const auto hIn = GetStdInputHandle();
VERIFY_IS_NOT_NULL(hIn, L"Verify we have the standard input handle.");

DWORD dwMode = 0;
DWORD dwMode = ENABLE_PROCESSED_INPUT; // ^Z is only handled when processed input is enabled.
VERIFY_WIN32_BOOL_SUCCEEDED(SetConsoleMode(hIn, dwMode), L"Set input mode for test.");

VERIFY_WIN32_BOOL_SUCCEEDED(FlushConsoleInputBuffer(hIn), L"Flush input buffer in preparation for test.");
Expand Down
10 changes: 10 additions & 0 deletions src/server/ApiDispatchers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,16 @@ constexpr T saturate(auto val)
}
CATCH_RETURN();

if (a->ProcessControlZ)
{
// ProcessControlZ is only set for CONSOLE_IO_RAW_READ. To restore
// the behavior from Windows 7 (see filehops.c:123) we need to honor
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
// ^Z only if PROCESSED_INPUT is enabled.
ULONG InputMode{ 0 };
m->_pApiRoutines->GetConsoleInputModeImpl(*pInputBuffer, InputMode);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably has a [[nodiscard]] hanging out on it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sike, it returns void

a->ProcessControlZ = (InputMode & ENABLE_PROCESSED_INPUT) != 0;
}

TraceConsoleAPICallWithOrigin(
"ReadConsole",
TraceLoggingBoolean(a->Unicode, "Unicode"),
Expand Down
Loading