From: Mark H. <mha...@us...> - 2007-05-07 02:30:34
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17768 Modified Files: ErrorUtils.cpp PyComHelpers.cpp Log Message: Index: ErrorUtils.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/ErrorUtils.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ErrorUtils.cpp 11 Nov 2005 02:35:29 -0000 1.27 --- ErrorUtils.cpp 7 May 2007 02:30:33 -0000 1.28 *************** *** 770,776 **** // ### should these by PyUnicode values? Still strings for compatibility. ! PyObject *obSource = PyString_FromUnicode(pexcepInfo->bstrSource); ! PyObject *obDescription = PyString_FromUnicode(pexcepInfo->bstrDescription); ! PyObject *obHelpFile = PyString_FromUnicode(pexcepInfo->bstrHelpFile); PyObject *rc = Py_BuildValue("iOOOii", (int)pexcepInfo->wCode, --- 770,776 ---- // ### should these by PyUnicode values? Still strings for compatibility. ! PyObject *obSource = PyWinObject_FromBstr(pexcepInfo->bstrSource); ! PyObject *obDescription = PyWinObject_FromBstr(pexcepInfo->bstrDescription); ! PyObject *obHelpFile = PyWinObject_FromBstr(pexcepInfo->bstrHelpFile); PyObject *rc = Py_BuildValue("iOOOii", (int)pexcepInfo->wCode, Index: PyComHelpers.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyComHelpers.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyComHelpers.cpp 7 Feb 2007 03:45:05 -0000 1.11 --- PyComHelpers.cpp 7 May 2007 02:30:33 -0000 1.12 *************** *** 27,43 **** PyObject *MakeBstrToObj(const BSTR bstr) { ! if (bstr==NULL) { ! Py_INCREF(Py_None); ! return Py_None; ! } ! ! int numChars = SysStringLen(bstr); ! int numBytes = numChars * 2; ! LPSTR str = (LPSTR)malloc(numBytes); ! numChars = WideCharToMultiByte(CP_ACP, 0, bstr, numChars, str, numBytes, NULL, NULL); ! ! PyObject *ret = PyString_FromStringAndSize(str, numChars); ! free(str); ! return ret; } --- 27,31 ---- PyObject *MakeBstrToObj(const BSTR bstr) { ! return PyWinObject_FromBstr(bstr, FALSE); } *************** *** 45,58 **** PyObject *MakeOLECHARToObj(const OLECHAR * str, int numChars) { ! if (str==NULL) { ! Py_INCREF(Py_None); ! return Py_None; ! } ! int numBytes = numChars * 2; ! LPSTR ascstr = (LPSTR)malloc(numBytes); ! numChars = WideCharToMultiByte(CP_ACP, 0, str, numChars, ascstr, numBytes, NULL, NULL); ! PyObject *rc = PyString_FromStringAndSize(ascstr, numChars); ! free(ascstr); ! return rc; } --- 33,37 ---- PyObject *MakeOLECHARToObj(const OLECHAR * str, int numChars) { ! return PyWinObject_FromOLECHAR(str, numChars); } *************** *** 60,68 **** PyObject *MakeOLECHARToObj(const OLECHAR * str) { ! if (str==NULL) { ! Py_INCREF(Py_None); ! return Py_None; ! } ! return PyString_FromUnicode(str); } --- 39,43 ---- PyObject *MakeOLECHARToObj(const OLECHAR * str) { ! return PyWinObject_FromOLECHAR(str); } |