From 771ae37c2f518a6078f1383e3964deb3b6b11f26 Mon Sep 17 00:00:00 2001 From: davidg Date: Tue, 18 Jul 2000 02:31:06 +0000 Subject: Just added comments about a Win2K OS bug with GetStdHandle(STD_OUTPUT_HANDLE). No change was made to the code. --- generic/tkConsole.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/generic/tkConsole.c b/generic/tkConsole.c index 5892df5..3e91f62 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkConsole.c,v 1.11 1999/11/19 22:00:03 hobbs Exp $ + * RCS: @(#) $Id: tkConsole.c,v 1.12 2000/07/18 02:31:06 davidg Exp $ */ #include "tk.h" @@ -151,6 +151,23 @@ static int ShouldUseConsoleChannel(type) if ((handle == INVALID_HANDLE_VALUE) || (handle == 0)) { return 1; } + + /* + * Win2K BUG: GetStdHandle(STD_OUTPUT_HANDLE) can return what appears + * to be a valid handle. See TclpGetDefaultStdChannel() for this change + * implemented. We didn't change it here because GetFileType() [below] + * will catch this with FILE_TYPE_UNKNOWN and appropriately return a + * value of 1, anyways. + * + * char dummyBuff[1]; + * DWORD dummyWritten; + * + * if ((type == TCL_STDOUT) + * && !WriteFile(handle, dummyBuff, 0, &dummyWritten, NULL)) { + * return 1; + * } + */ + fileType = GetFileType(handle); /* -- cgit v0.12