[RFC PATCH] conhost: Register as a system process.

Torge Matthies openglfreak at googlemail.com
Wed Nov 4 16:34:19 CST 2020


Hello Jacek, thank you very much for your reply!

On 11/4/20 6:04 PM, Jacek Caban wrote:
> Hi Torge,
> 
> 
> On 11/2/20 10:34 PM, Torge Matthies wrote:
>> I understand that using Wine-internal functions is not supported, however
>> the desired behavior seems hard if not impossible to implement otherwise.
> 
> You should be able to achieve that by implementing your application as a 
> Windows service.
I tried that a long time ago, but it turned out that Wine does not wait for
services to finish starting up before starting the game process, so the proxy
was usually only ready when it was too late, and the game had already given
up on connecting to Discord at that point.
> 
> For a quick workaround would be to call FreeConsole() in your 
> application. This way console will become unused and conhost will exit 
> earlier.
This was also one of the first things I tried when I noticed the change in
behavior. It did not work for some reason, the conhost process stayed around.
The process also daemonizes itself after becoming ready to accept
connections, by CreateProcess'ing its executable and in the child process
signaling the parent process to exit after becoming ready. But I have also
tried with this functionality disabled and got the same conhost process.
> 
> If you wrap execution with a script, you could also make sure that none 
> of std handles (in, out, err) is a terminal. In this case conhost will 
> not be created in the first place.
This works, but it's not ideal since I would like to print log messages to
stdout/stderr. This has also been broken for some time with the daemonize
option enabled, and I've actually been meaning to e-mail you about that.
But I'm bad at initiating conversation, so I never sent that e-mail...
Do you happen to know why I can't write to stdout/stderr in a child process?
> 
> Jacek
> 

I'm also reachable on freenode #winehackers under the name openglfreak, if
you want to reach me there. You can ping me even if I'm not online.

Best regards,
Torge Matthies



More information about the wine-devel mailing list