[pywin32-checkins] pywin32/com/win32comext/shell/src PyIShellFolder.cpp, 1.17, 1.18
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-02-07 05:28:45
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16241/src Modified Files: PyIShellFolder.cpp Log Message: Allow None for EnumObjects, which will cause S_FALSE to be returned and allow GetUIObject to just return the interface and not the other unused inout param Index: PyIShellFolder.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellFolder.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PyIShellFolder.cpp 17 Oct 2007 03:49:55 -0000 1.17 --- PyIShellFolder.cpp 7 Feb 2008 05:28:46 -0000 1.18 *************** *** 490,495 **** if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params ! PyCom_InterfaceFromPyInstanceOrObject(result, IID_IEnumIDList, (void **)ppeidl, FALSE /* bNoneOK */); ! hr = PyCom_SetAndLogCOMErrorFromPyException("EnumObjects", IID_IShellFolder); Py_DECREF(result); return hr; --- 490,500 ---- if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params ! if (result==Py_None) { ! hr = S_FALSE; ! *ppeidl = NULL; ! } else { ! PyCom_InterfaceFromPyInstanceOrObject(result, IID_IEnumIDList, (void **)ppeidl, FALSE /* bNoneOK */); ! hr = PyCom_SetAndLogCOMErrorFromPyException("EnumObjects", IID_IShellFolder); ! } Py_DECREF(result); return hr; *************** *** 628,639 **** if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params ! PyObject *obout; ! UINT inout; ! if (!PyArg_ParseTuple(result, "lO" , &inout, &obout)) return PyCom_SetAndLogCOMErrorFromPyException(szMethodName, IID_IShellFolder); ! BOOL bPythonIsHappy = TRUE; ! if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obout, riid, ppRet, FALSE/* bNoneOK */)) ! bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = PyCom_SetAndLogCOMErrorFromPyException(szMethodName, IID_IShellFolder); ! if (rgfInOut) *rgfInOut = inout; Py_DECREF(result); return hr; --- 633,651 ---- if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params ! // the 'inout' param appears unused - allow either. ! if (PyTuple_Check(result)) { ! PyObject *obout; ! UINT inout; ! if (!PyArg_ParseTuple(result, "lO" , &inout, &obout)) ! hr = PyCom_SetAndLogCOMErrorFromPyException(szMethodName, IID_IShellFolder); ! else { ! if (rgfInOut) *rgfInOut = inout; ! if (!PyCom_InterfaceFromPyInstanceOrObject(obout, riid, ppRet, FALSE/* bNoneOK */)) ! hr = PyCom_SetAndLogCOMErrorFromPyException(szMethodName, IID_IShellFolder); ! } ! } else { ! if (!PyCom_InterfaceFromPyInstanceOrObject(result, riid, ppRet, FALSE/* bNoneOK */)) ! hr = PyCom_SetAndLogCOMErrorFromPyException(szMethodName, IID_IShellFolder); ! } Py_DECREF(result); return hr; |