[pywin32-checkins] pywin32/com/win32com/src PythonCOM.cpp,1.18,1.19
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <mha...@us...> - 2003-07-03 03:47:56
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1:/tmp/cvs-serv28596 Modified Files: PythonCOM.cpp Log Message: Fix MkPArseDisplayName error I introduced in r1.16 Index: PythonCOM.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PythonCOM.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** PythonCOM.cpp 10 Mar 2003 01:26:42 -0000 1.18 --- PythonCOM.cpp 3 Jul 2003 03:47:53 -0000 1.19 *************** *** 762,766 **** static PyObject *pythoncom_MkParseDisplayName(PyObject *self, PyObject *args) { ! WCHAR *displayName; PyObject *obBindCtx = NULL; --- 762,767 ---- static PyObject *pythoncom_MkParseDisplayName(PyObject *self, PyObject *args) { ! WCHAR *displayName = NULL; ! PyObject *obDisplayName; PyObject *obBindCtx = NULL; *************** *** 770,778 **** // Any binding context created or passed in will be returned to the // caller. ! if ( !PyArg_ParseTuple(args, "et|O:MkParseDisplayName", ! Py_FileSystemDefaultEncoding, &displayName, &obBindCtx) ) return NULL; HRESULT hr; IBindCtx *pBC; --- 771,782 ---- // Any binding context created or passed in will be returned to the // caller. ! if ( !PyArg_ParseTuple(args, "O|O:MkParseDisplayName", ! &obDisplayName, &obBindCtx) ) return NULL; + if (!PyWinObject_AsWCHAR(obDisplayName, &displayName, FALSE)) + return NULL; + HRESULT hr; IBindCtx *pBC; *************** *** 781,785 **** hr = CreateBindCtx(0, &pBC); if ( FAILED(hr) ) { ! PyMem_Free(displayName); return PyCom_BuildPyException(hr); } --- 785,789 ---- hr = CreateBindCtx(0, &pBC); if ( FAILED(hr) ) { ! PyWinObject_FreeWCHAR(displayName); return PyCom_BuildPyException(hr); } *************** *** 791,795 **** { if ( !PyCom_InterfaceFromPyObject(obBindCtx, IID_IBindCtx, (LPVOID*)&pBC, FALSE) ) { ! PyMem_Free(displayName); return NULL; } --- 795,799 ---- { if ( !PyCom_InterfaceFromPyObject(obBindCtx, IID_IBindCtx, (LPVOID*)&pBC, FALSE) ) { ! PyWinObject_FreeWCHAR(displayName); return NULL; } *************** *** 805,809 **** hr = MkParseDisplayName(pBC, displayName, &chEaten, &pmk); PY_INTERFACE_POSTCALL; ! PyMem_Free(displayName); if ( FAILED(hr) ) { --- 809,813 ---- hr = MkParseDisplayName(pBC, displayName, &chEaten, &pmk); PY_INTERFACE_POSTCALL; ! PyWinObject_FreeWCHAR(displayName); if ( FAILED(hr) ) { |