Skip to content

conhost crashes on SetConsoleWindowInfo #5843

@PhMajerus

Description

@PhMajerus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-ServerDown in the muck of API call servicing, interprocess communication, eventing, etc.Issue-BugIt either shouldn't be doing this or needs an investigation.Needs-AttentionThe core contributors need to come back around and look at this ASAP.Needs-Tag-FixDoesn't match tag requirementsPriority-1A description (P1)Product-ConhostFor issues in the Console codebaseSeverity-CrashCrashes are real bad news.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions