bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CreateConsoleScreenBuffer problem on Win10


From: Thomas Dickey
Subject: Re: CreateConsoleScreenBuffer problem on Win10
Date: Mon, 6 Feb 2023 17:08:48 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

On Mon, Feb 06, 2023 at 04:28:26PM +0000, Hannes Domani wrote:
> Hello
> 
> Starting with Win10, there is a problem when creating a process while ncurses
> is active, and you just get an error dialog that says:
> 
>   The application was unable to start correctly (0xc0000142)
>   Click OK to close the application.
> 
> It's mainly visible when trying to start a process when using gdb -tui.
> See [1] [2] [3] for some of the problem reports.
> 
> I finally figured out that the root of this problem is
> CreateConsoleScreenBuffer, and created a small reproducer:
...
> If you allow sharing like this:
> 
>   HANDLE out = CreateConsoleScreenBuffer(
>       GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
>       NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
> 
> The following process starts without problem.
> 
> The difference between Win10 and earlier versions seems to be that on Win10
> the new process gets the currently active screen buffer as stdout, but on Win7
> it still got the original screen buffer as stdout (where sharing is not
> restricted).
> 
> In all, I suggest this patch:

thanks - I can see that there's some overlap with the suggestion here

https://lists.gnu.org/archive/html/bug-ncurses/2023-01/msg00025.html

(which I haven't gotten to yet - have been busy with other fixes)

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]