From 22ff3d43f7c039327eb0a305e402cd214a443e7b Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Thu, 15 Apr 2004 04:58:09 +0000 Subject: [PATCH] Have winedbg send its output to stderr when invoked with the --auto option. --- programs/winedbg/winedbg.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/programs/winedbg/winedbg.c b/programs/winedbg/winedbg.c index 4724cac400d..78bea5ab24e 100644 --- a/programs/winedbg/winedbg.c +++ b/programs/winedbg/winedbg.c @@ -57,9 +57,10 @@ static enum {none_mode = 0, winedbg_mode, automatic_mode, gdb_mode} local_mode; DBG_INTVAR DEBUG_IntVars[DBG_IV_LAST]; +static HANDLE hOutput; void DEBUG_OutputA(const char* buffer, int len) { - WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), buffer, len, NULL, NULL); + WriteFile(hOutput, buffer, len, NULL, NULL); } void DEBUG_OutputW(const WCHAR* buffer, int len) @@ -1067,6 +1068,9 @@ int main(int argc, char** argv) DWORD retv = 0; unsigned gdb_flags = 0; + /* Initialize the output */ + hOutput=GetStdHandle(STD_OUTPUT_HANDLE); + /* Initialize the type handling stuff. */ DEBUG_InitTypes(); DEBUG_InitCVDataTypes(); @@ -1081,6 +1085,7 @@ int main(int argc, char** argv) { if (local_mode != none_mode) return DEBUG_Usage(); local_mode = automatic_mode; + hOutput=GetStdHandle(STD_ERROR_HANDLE); /* force some internal variables */ DBG_IVAR(BreakOnDllLoad) = 0; argc--; argv++;