Skip to content
Tcl Source Code Artifact [fd8c910d7e]
Login

Artifact [fd8c910d7e]

Artifact fd8c910d7e509b7f4d69a07bc2067bc55a74b83f:

Ticket change [fd8c910d7e] - New ticket [618852ffffffffff|618852ffff] <i>possibly logic error in tclWinChan.c</i>. by nobody on 2002-10-05 05:09:03.
D 2002-10-05T05:09:03
J assignee nobody
J cmimetype text/plain
J comment While\scruising\sthrough\sthe\sTcl\ssource\scode,\si\sfound\s\nthis\scode.\n\ntclWinChan.c\sstarting\sat\sline\s#1023:\n\n\s\s\s\sdefault:\n/*\n\s*\sThe\shandle\sis\sof\san\sunknown\stype.\s\s\nTest\sthe\svalidity\sof\sthis\sOS\n\s*\shandle\sby\sduplicating\sit,\sthen\sclosing\s\nthe\sdupe.\s\sThe\sWin32\sAPI\n\s*\sdoesn't\sprovide\san\sIsValidHandle()\s\nfunction,\sso\swe\shave\sto\semulate\n\s*\sit\shere.\s\sThis\stest\swill\snot\swork\son\sa\s\nconsole\shandle\sreliably,\n\s*\swhich\sis\swhy\swe\scan't\stest\severy\shandle\s\nthat\scomes\sinto\sthis\n\s*\sfunction\sin\sthis\sway.\n\s*/\n\nresult\s=\sDuplicateHandle\n(GetCurrentProcess(),\shandle,\nGetCurrentProcess(),\s\n&dupedHandle,\s0,\sFALSE,\nDUPLICATE_SAME_ACCESS);\n\nif\s(result\s!=\s0)\s{\n\s\s\s\s/*\s\n\s\s\s\s\s*\sUnable\sto\smake\sa\sduplicate.\sIt's\s\ndefinately\sinvalid\sat\sthis\n\s\s\s\s\s*\spoint.\n\s\s\s\s\s*/\n\n\s\s\s\sreturn\sNULL;\n}\n\n------------------------\n\nThe\sabove\scode\sdoes\snot\sappear\sto\sbe\scorrect.\s\sThe\s\nDuplicateHandle\sfunction\sreturns\snon-zero\sto\s\nindicate\sSUCCESS,\snot\sfailure.\s\sIf\sthe\sintent\s(??)\sof\s\nthe\sabove\scode\sis\sto\sbail\sout\sin\scase\sof\serror,\sthen\s\nit\sis\sdefinately\snot\scorrect.\s\sI\sbelieve\sthe\scorrect\sif\s\nstatement\swould\scheck\sfor\s(result\s==\s0).\n\nI\sthink\ssomebody\sshould\stake\sa\sclose\slook\sat\sthis\s\nlogic\sto\smake\ssure\sI\sam\snot\sconfused.\s\s\n\nA\scursory\ssearch\sof\sthe\sTcl/Tk\ssource\strees\sreveals\s\nno\sother\splaces\swhere\sDuplicateHandle\sis\sbeing\s\ncalled\sAND\swhere\sthe\scaller\srelies\supon\sit's\sreturn\s\ncode.\n\n------------------------\n\nFrom\sthe\sSDK:\n\nReturn\sValues\nIf\sthe\sfunction\ssucceeds,\sthe\sreturn\svalue\sis\s\nnonzero.\n\nIf\sthe\sfunction\sfails,\sthe\sreturn\svalue\sis\szero.\sTo\sget\s\nextended\serror\sinformation,\scall\sGetLastError.\s\n\n------------------------\n\nJJM\n
J foundin obsolete:\s8.4.0
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem None
J title possibly\slogic\serror\sin\stclWinChan.c
J type Bug
K 618852ffffffffffffffffffffffffffffffffff
U nobody
Z 9e29a37f632fa736a8f391cd490ed35f