[pywin32-checkins] pywin32/com/win32comext/shell/src shell.cpp,1.18,1.19
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2004-04-10 05:32:06
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30440/win32comext/shell/src Modified Files: shell.cpp Log Message: Add a module for the TaskScheduler interfaces - from Roger Upole Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** shell.cpp 9 Apr 2004 11:18:37 -0000 1.18 --- shell.cpp 10 Apr 2004 05:18:40 -0000 1.19 *************** *** 72,75 **** --- 72,81 ---- PyObject *PyObject_FromPIDL(LPCITEMIDLIST pidl, BOOL bFreeSystemPIDL) { + if (pidl==NULL) { + if (bFreeSystemPIDL) + PyShell_FreeMem( (void *)pidl); + Py_INCREF(Py_None); + return Py_None; + } PyObject *ret = PyList_New(0); if (!ret) *************** *** 202,205 **** --- 208,215 ---- PyObject *PyObject_FromPIDLArray(UINT cidl, LPCITEMIDLIST *pidl) { + if (pidl==NULL) { + Py_INCREF(Py_None); + return Py_None; + } PyObject *ob = PyList_New(cidl); if (!ob) return NULL; *************** *** 224,227 **** --- 234,241 ---- PyObject *ret = NULL; PyObject *obItems = NULL; + if (pida==NULL) { + Py_INCREF(Py_None); + return Py_None; + } PyObject *obFolder = PyObject_FromPIDL(GetPIDLFolder(pida), FALSE); if (obFolder==NULL) *************** *** 412,415 **** --- 426,435 ---- PyObject *PyObject_FromSTRRET(STRRET *ps, ITEMIDLIST *pidl, BOOL bFree) { + if (ps==NULL) { + if (bFree) + PyObject_FreeSTRRET(*ps); + Py_INCREF(Py_None); + return Py_None; + } PyObject *ret; switch (ps->uType) { *************** *** 439,442 **** --- 459,466 ---- PyObject *PyObject_FromMSG(const MSG *msg) { + if (!msg) { + Py_INCREF(Py_None); + return Py_None; + } return Py_BuildValue("iiiii(ii)", msg->hwnd,msg->message,msg->wParam,msg->lParam,msg->time,msg->pt.x,msg->pt.y); } *************** *** 448,451 **** --- 472,479 ---- PyObject *PyObject_FromFOLDERSETTINGS( const FOLDERSETTINGS *pf) { + if (!pf) { + Py_INCREF(Py_None); + return Py_None; + } return Py_BuildValue("ii", pf->ViewMode, pf->fFlags); } *************** *** 457,460 **** --- 485,492 ---- PyObject *PyObject_FromRECT(const RECT *r) { + if (!r) { + Py_INCREF(Py_None); + return Py_None; + } return Py_BuildValue("iiii", r->left, r->top, r->right, r->bottom); } *************** *** 483,486 **** --- 515,522 ---- PyObject *PyObject_FromSHCOLUMNID(LPCSHCOLUMNID p) { + if (!p) { + Py_INCREF(Py_None); + return Py_None; + } PyObject *obIID = PyWinObject_FromIID(p->fmtid); if (!obIID) *************** *** 500,503 **** --- 536,543 ---- PyObject *PyObject_FromSHCOLUMNINIT(LPCSHCOLUMNINIT p) { + if (!p) { + Py_INCREF(Py_None); + return Py_None; + } PyObject *obName = PyWinObject_FromWCHAR(p->wszFolder); if (!obName) *************** *** 523,526 **** --- 563,570 ---- PyObject *PyObject_FromSHCOLUMNINFO(LPCSHCOLUMNINFO p) { + if (!p) { + Py_INCREF(Py_None); + return Py_None; + } PyObject *rc = NULL, *obID = NULL; PyObject *obDescription = NULL, *obTitle = NULL; *************** *** 559,562 **** --- 603,610 ---- PyObject *PyObject_FromSHCOLUMNDATA(LPCSHCOLUMNDATA p) { + if (!p) { + Py_INCREF(Py_None); + return Py_None; + } PyObject *obFile = PyWinObject_FromWCHAR(p->wszFile); if (!obFile) return NULL; *************** *** 574,577 **** --- 622,629 ---- PyObject *PyObject_FromSHFILEINFO(SHFILEINFO *p) { + if (!p) { + Py_INCREF(Py_None); + return Py_None; + } PyObject *obDisplayName = PyWinObject_FromTCHAR(p->szDisplayName); PyObject *obTypeName = PyWinObject_FromTCHAR(p->szTypeName); *************** *** 591,594 **** --- 643,650 ---- PyObject *PyObject_FromOLEMENUGROUPWIDTHS(OLEMENUGROUPWIDTHS *pWidths) { + if (!pWidths) { + Py_INCREF(Py_None); + return Py_None; + } return Py_BuildValue("(iiiiii)", pWidths->width[0], pWidths->width[1], *************** *** 810,814 **** PY_INTERFACE_POSTCALL; ret = Py_BuildValue("iN", dw, PyObject_FromSHFILEINFO(&info)); - done: if (name) PyWinObject_FreeTCHAR(name); if (pidl) PyObject_FreePIDL(pidl); --- 866,869 ---- |