From: Pat Thoyts Date: Thu, 29 Jan 2009 22:23:30 +0000 (+0000) Subject: import: tcom-3.10b10 X-Git-Url: http://privyetmir.co.uk/gitweb?a=commitdiff_plain;h=0303ee67e26145345b337e0c9d9e23980ffe7770;p=tcom import: tcom-3.10b10 --- diff --git a/CHANGES b/CHANGES index 99dedce..07a887a 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,7 @@ Version 3.10 - Fixed invalid pointer error when returned EXCEPINFO contains null description. - Fixed passing SAFEARRAY(short) parameters. +- Fixed passing input parameters by reference. Version 3.9 - Fixed defect where eval may trigger premature destruction of handle internal diff --git a/lib/TclScript/TclScript.dll b/lib/TclScript/TclScript.dll index db25d4d..e386a6e 100644 Binary files a/lib/TclScript/TclScript.dll and b/lib/TclScript/TclScript.dll differ diff --git a/lib/tcom/tcom.dll b/lib/tcom/tcom.dll index 9f60aa0..23d9542 100644 Binary files a/lib/tcom/tcom.dll and b/lib/tcom/tcom.dll differ diff --git a/lib/tcom/tcominproc.dll b/lib/tcom/tcominproc.dll index 95fcfca..cbe8b13 100644 Binary files a/lib/tcom/tcominproc.dll and b/lib/tcom/tcominproc.dll differ diff --git a/lib/tcom/tcomlocal.exe b/lib/tcom/tcomlocal.exe index e83568b..e8b8fe3 100644 Binary files a/lib/tcom/tcomlocal.exe and b/lib/tcom/tcomlocal.exe differ diff --git a/src/Arguments.cpp b/src/Arguments.cpp index 73a055b..6631d4a 100644 --- a/src/Arguments.cpp +++ b/src/Arguments.cpp @@ -1,4 +1,4 @@ -// $Id: Arguments.cpp 5 2005-02-16 14:57:24Z cthuang $ +// $Id: Arguments.cpp 20 2005-05-04 16:53:05Z cthuang $ #include "Arguments.h" #include "Extension.h" #include "TclObject.h" @@ -41,9 +41,8 @@ TypedArguments::initArgument ( // This variant indicates a missing optional argument. m_args[argIndex] = vtMissing; - } else if (parameter.flags() & PARAMFLAG_FOUT) { - // For out parameters, set a pointer to where the out value - // will be stored. + } else if (parameter.type().pointerCount() > 0) { + // The argument is passed by reference. switch (vt) { case VT_INT: @@ -80,19 +79,28 @@ TypedArguments::initArgument ( } if (parameter.flags() & PARAMFLAG_FIN) { - // Set the value for an in/out parameter. - Tcl_Obj *pValue = Tcl_ObjGetVar2( - interp, pObj, NULL, TCL_LEAVE_ERR_MSG); - if (pValue == 0) { - return TCL_ERROR; + if (parameter.flags() & PARAMFLAG_FOUT) { + // Set the value for an in/out parameter. + Tcl_Obj *pValue = Tcl_ObjGetVar2( + interp, pObj, NULL, TCL_LEAVE_ERR_MSG); + if (pValue == 0) { + return TCL_ERROR; + } + + TclObject value(pValue); + + // If the argument is an interface pointer, increment its + // reference count because the _variant_t destructor will + // release it. + value.toNativeValue( + &m_outValues[argIndex], parameter.type(), interp, true); + } else { + // If the argument is an interface pointer, increment its + // reference count because the _variant_t destructor will + // release it. + argument.toNativeValue( + &m_outValues[argIndex], parameter.type(), interp, true); } - - TclObject value(pValue); - - // If the argument is an interface pointer, increment its reference - // count because the _variant_t destructor will release it. - value.toNativeValue( - &m_outValues[argIndex], parameter.type(), interp, true); } else { if (vt == VT_UNKNOWN) { m_outValues[argIndex].vt = vt;