[pywin32-checkins] pywin32/win32/src PyWinTypes.h,1.26,1.27
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-04-18 13:42:38
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18677 Modified Files: PyWinTypes.h Log Message: PyWinObject_AsAutoFreeBstr ignored bNoneOK param. Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** PyWinTypes.h 6 Mar 2005 23:27:01 -0000 1.26 --- PyWinTypes.h 18 Apr 2005 13:42:30 -0000 1.27 *************** *** 414,418 **** // PyWin_AutoFreeBstr arg; // PyArg_ParseTuple("O", &obStr); ! // PyWin_PyObjectAsAutoFreeBstr(obStr, &arg); // CallTheFunction(arg); // Will correctly pass BSTR/OLECHAR // -- when the function goes out of scope, the string owned by "arg" will --- 414,418 ---- // PyWin_AutoFreeBstr arg; // PyArg_ParseTuple("O", &obStr); ! // PyWinObject_AsAutoFreeBstr(obStr, &arg); // CallTheFunction(arg); // Will correctly pass BSTR/OLECHAR // -- when the function goes out of scope, the string owned by "arg" will *************** *** 431,434 **** --- 431,438 ---- inline BOOL PyWinObject_AsAutoFreeBstr(PyObject *stringObject, PyWin_AutoFreeBstr *pResult, BOOL bNoneOK = FALSE) { + if (bNoneOK && stringObject == Py_None) { + pResult->SetBstr(NULL); + return TRUE; + } BSTR bs; if (!PyWinObject_AsBstr(stringObject, &bs, bNoneOK)) |