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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 3cb86da8401..58a6c90bf1c 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; @@ -2174,10 +2175,11 @@ 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 ))) { info->hstdin = wine_server_obj_handle( params->hStdInput ); info->hstdout = wine_server_obj_handle( params->hStdOutput );