From: Aida JonikienÄ— aidas957@gmail.com
I know this breaks Windows behavior but having apps print out special debug messages to the terminal provides a good look into the applications' development (for example I know that NFS Underground has some "done" messages likely used for debugging).
I also don't want to keep another revert in my Wine tree just for this one feature either so that's why I'm MR'ing this.
I considered adding a registry/winecfg entry for this behavior but it would make this change much larger (and there's no good place in winecfg to put this behavior in).
To enable this behavior, you can set WINEDEBUG=+unixcon variable before launching an application.
Xkcd-Entry: https://xkcd.com/1172/ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55435 --- dlls/ntdll/unix/env.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index ad9ab0dc220..843ae05932b 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -59,6 +59,7 @@ #include "error.h"
WINE_DEFAULT_DEBUG_CHANNEL(environ); +WINE_DECLARE_DEBUG_CHANNEL(unixcon);
PEB *peb = NULL; WOW_PEB *wow_peb = NULL; @@ -2183,16 +2184,20 @@ void *create_startup_info( const UNICODE_STRING *nt_image, ULONG process_flags,
info->debug_flags = params->DebugFlags; info->console_flags = params->ConsoleFlags; - if (pe_info->subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI) + if (pe_info->subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI || TRACE_ON( unixcon )) info->console = wine_server_obj_handle( params->ConsoleHandle ); if ((process_flags & PROCESS_CREATE_FLAGS_INHERIT_HANDLES) || - (pe_info->subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI && !(params->dwFlags & STARTF_USESTDHANDLES))) + (pe_info->subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI && !(params->dwFlags & STARTF_USESTDHANDLES)) + || TRACE_ON( unixcon )) { - if (pe_info->subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI || !is_console_handle( params->hStdInput )) + if (pe_info->subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI || !is_console_handle( params->hStdInput ) + || TRACE_ON( unixcon )) info->hstdin = wine_server_obj_handle( params->hStdInput ); - if (pe_info->subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI || !is_console_handle( params->hStdOutput )) + if (pe_info->subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI || !is_console_handle( params->hStdOutput ) + || TRACE_ON( unixcon )) info->hstdout = wine_server_obj_handle( params->hStdOutput ); - if (pe_info->subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI || !is_console_handle( params->hStdError )) + if (pe_info->subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI || !is_console_handle( params->hStdError ) + || TRACE_ON( unixcon )) info->hstderr = wine_server_obj_handle( params->hStdError ); } info->x = params->dwX;