Skip to content
Tcl Source Code History Of Ticket 618852ffffffffff
Login

History Of Ticket 618852ffffffffff

Artifacts Associated With Ticket 618852ffffffffff

  1. Ticket change [fd8c910d7e] (rid 108425) by nobody on 2002-10-05 05:09:03:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
      
    4. foundin initialized to: "obsolete: 8.4.0"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "None"
    10. title initialized to: "possibly logic error in tclWinChan.c"
    11. type initialized to: "Bug"
  2. Ticket change [b920fba0e6] (rid 129082) by dkf on 2002-10-08 19:35:38:

    1. assignee changed to: "davygrvy"
    2. subsystem changed to: "27. Channel Types"
  3. Ticket change [0cc934afb5] (rid 114239) by davygrvy on 2002-11-28 05:55:33:

    1. icomment:
      Logged In: YES 
      user_id=7549
      
      whoops...  fixed...
      
      
    2. login: "davygrvy"
    3. mimetype: "text/plain"
    4. resolution changed to: "Fixed"
    5. username: "davygrvy"
  4. Ticket change [84d04e8d0d] (rid 117629) by davygrvy on 2002-11-28 05:55:52:

    1. closedate changed to: "2002-11-27T22:55:52"
    2. closer changed to: "davygrvy"
    3. status changed to: "Closed"