[PATCH] dlls/kernelbase, programs/conhost: don't delay the TTY input thread for PE executables

Jacek Caban jacek at codeweavers.com
Mon Dec 6 09:13:20 CST 2021


Hi Eric,

On 12/6/21 3:59 PM, Eric Pouech wrote:
> currently, conhost delays the start of the input thread until the first
> console read operation
>
> some PE executables (like mingw's gdb port) just do something like:
> - WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), INFINITE) and hang
>    for ever (the read operations are done*after*  the wait operation
>    succeeds)
> (of course, the real wait operation is more complex, but the problematic
> part boils down to that)
>
> I understand that the delay has been introduced so that executables still
> reading directly from the unix fd will continue to work.
>
> But I could miss some other use cases.


The idea is that it's better to not change console parameters 
(IOCTL_CONDRV_SETUP_INPUT) unless we need to. Majority of applications 
never read from console and this avoids changing current console mode 
every time you run Wine.


> This patch forces the start the tty input thread in conhost if current
> executable is a PE executable.


Maybe we could detect the problem in server somewhere around 
console_input_add_queue and send an ioctl to conhost process to 
initialize input thread.


> This lets mingw's gdb work a bit further (at least allowing some user input
> <g>) under wine. (x86_64 seems to be quite ok, i686 still needs come
> cudling)


Nice :)


Thanks,

Jacek




More information about the wine-devel mailing list