Artifacts Associated With Ticket 618852ffffffffff
Ticket change [fd8c910d7e] (rid 108425) by nobody on 2002-10-05 05:09:03:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
While cruising through the Tcl source code, i found this code. tclWinChan.c starting at line #1023: default: /* * The handle is of an unknown type. Test the validity of this OS * handle by duplicating it, then closing the dupe. The Win32 API * doesn't provide an IsValidHandle() function, so we have to emulate * it here. This test will not work on a console handle reliably, * which is why we can't test every handle that comes into this * function in this way. */ result = DuplicateHandle (GetCurrentProcess(), handle, GetCurrentProcess(), &dupedHandle, 0, FALSE, DUPLICATE_SAME_ACCESS); if (result != 0) { /* * Unable to make a duplicate. It's definately invalid at this * point. */ return NULL; } ------------------------ The above code does not appear to be correct. The DuplicateHandle function returns non-zero to indicate SUCCESS, not failure. If the intent (??) of the above code is to bail out in case of error, then it is definately not correct. I believe the correct if statement would check for (result == 0). I think somebody should take a close look at this logic to make sure I am not confused. A cursory search of the Tcl/Tk source trees reveals no other places where DuplicateHandle is being called AND where the caller relies upon it's return code. ------------------------ From the SDK: Return Values If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. ------------------------ JJM - foundin initialized to: "obsolete: 8.4.0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "None"
- title initialized to: "possibly logic error in tclWinChan.c"
- type initialized to: "Bug"
Ticket change [b920fba0e6] (rid 129082) by dkf on 2002-10-08 19:35:38:
- assignee changed to: "davygrvy"
- subsystem changed to: "27. Channel Types"
Ticket change [0cc934afb5] (rid 114239) by davygrvy on 2002-11-28 05:55:33:
- icomment:
Logged In: YES user_id=7549 whoops... fixed...
- login: "davygrvy"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- username: "davygrvy"
- icomment:
Ticket change [84d04e8d0d] (rid 117629) by davygrvy on 2002-11-28 05:55:52:
- closedate changed to: "2002-11-27T22:55:52"
- closer changed to: "davygrvy"
- status changed to: "Closed"