summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidg <davidg>2000-07-18 02:31:06 (GMT)
committerdavidg <davidg>2000-07-18 02:31:06 (GMT)
commit771ae37c2f518a6078f1383e3964deb3b6b11f26 (patch)
tree74f77964208678e3df54373d4be5b7c5a49bffd1
parentfc0363196283264f821912af807e2507b8f0ab62 (diff)
downloadtk-771ae37c2f518a6078f1383e3964deb3b6b11f26.zip
tk-771ae37c2f518a6078f1383e3964deb3b6b11f26.tar.gz
tk-771ae37c2f518a6078f1383e3964deb3b6b11f26.tar.bz2
Just added comments about a Win2K OS bug with GetStdHandle(STD_OUTPUT_HANDLE).
No change was made to the code.
-rw-r--r--generic/tkConsole.c19
1 files changed, 18 insertions, 1 deletions
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);
/*