conhost crashes on SetConsoleWindowInfo #8069

Open
opened 2026-01-31 01:20:00 +00:00 by claunia · 0 comments
Owner

Originally created by @PhMajerus on GitHub (May 11, 2020).

Found a new issue with conhost in Windows 10 20H1/2004 as pushed to the release preview ring.
Windows 10 build 19041.208 (up to date release preview ring) on a Surface Book 2 15", conhost.exe file version 10.0.19041.153.

The following code, compiled as CUI and launched from a cmd.exe prompt, will crash conhost, closing the window.

int main()
{
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
SMALL_RECT srNewWinSize;
srNewWinSize.Top = 1;
srNewWinSize.Left = 1;
srNewWinSize.Right = 40;
srNewWinSize.Bottom = 20;
SetConsoleWindowInfo(hStdOut, TRUE, &srNewWinSize);
}

This used to work fine in previous versions of Windows 10, it seems to be a new issue with 20H1/2004.

Originally created by @PhMajerus on GitHub (May 11, 2020). Found a new issue with conhost in Windows 10 20H1/2004 as pushed to the release preview ring. Windows 10 build 19041.208 (up to date release preview ring) on a Surface Book 2 15", conhost.exe file version 10.0.19041.153. The following code, compiled as CUI and launched from a cmd.exe prompt, will crash conhost, closing the window. int main() { HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); SMALL_RECT srNewWinSize; srNewWinSize.Top = 1; srNewWinSize.Left = 1; srNewWinSize.Right = 40; srNewWinSize.Bottom = 20; SetConsoleWindowInfo(hStdOut, TRUE, &srNewWinSize); } This used to work fine in previous versions of Windows 10, it seems to be a new issue with 20H1/2004.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8069