[pywin32-checkins] pywin32/com/win32comext/adsi/src PyADSIUtil.cpp,1.4,1.5
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-06-02 06:27:36
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/adsi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16246 Modified Files: PyADSIUtil.cpp Log Message: Support ADSTYPE_NT_SECURITY_DESCRIPTOR type and write a warning when an unknown type is encountered (as we return None in that case, which kinda sucks) Index: PyADSIUtil.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/adsi/src/PyADSIUtil.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyADSIUtil.cpp 31 May 2005 12:49:49 -0000 1.4 --- PyADSIUtil.cpp 2 Jun 2005 06:27:24 -0000 1.5 *************** *** 133,139 **** --- 133,156 ---- } break; + case ADSTYPE_NT_SECURITY_DESCRIPTOR: + { + // Get a pointer to the security descriptor. + PSECURITY_DESCRIPTOR pSD = (PSECURITY_DESCRIPTOR)(v.SecurityDescriptor.lpValue); + DWORD SDSize = v.SecurityDescriptor.dwLength; + // eeek - we don't pass the length - pywintypes relies on + // GetSecurityDescriptorLength - make noise if this may bite us. + if (SDSize != GetSecurityDescriptorLength(pSD)) + PyErr_Warn(PyExc_RuntimeWarning, "Security-descriptor size mis-match"); + ob = PyWinObject_FromSECURITY_DESCRIPTOR(pSD); + break; + } default: + { + char msg[100]; + wsprintf(msg, "Unknown ADS type code 0x%x - None will be returned", v.dwType); + PyErr_Warn(PyExc_RuntimeWarning, msg); ob = Py_None; Py_INCREF(ob); + } } if (ob==NULL) *************** *** 524,528 **** {NULL} }; ! // @prop [<o PyADS_ATTR_INFO>, ...]|Values| --- 541,545 ---- {NULL} }; ! // @prop [<o PyADSVALUE>, ...]|Values| |