https://bugs.winehq.org/show_bug.cgi?id=52761
--- Comment #16 from Jacek Caban jacek@codeweavers.com --- STARTF_USESTDHANDLES gives you full control over std handles and when specified, it overrides default handling. When it's not specified, default handling depends on other factors and Windows either inherits handles from parent process or fills them with console handles (or no handles at all). If you want to create a process with no console, but redirected std handles, then a mix of STARTF_USESTDHANDLES and DETACHED_PROCESS should do the trick. This article describes it in great details (and was mostly accurate for cases that I tested): https://github.com/rprichard/win32-console-docs/blob/master/README.md
The problem I described in comment 8 is more general than this test and the problem may affect other CI-alike scenarios as well. I also noticed that mscoree tests additionally use CREATE_NO_WINDOW flag, which is not implemented on Wine. My understanding (I didn't test it) is that this flag should cause console to be created without a visible window (so it's essentially an invisible instance of conhost.exe process). That's another problem that would ideally be fixed as well.