Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv864
Modified Files:
PyACL.cpp PySECURITY_ATTRIBUTES.cpp PySECURITY_DESCRIPTOR.cpp
PySID.cpp PySecurityObjects.h PyWinTypesmodule.cpp
Log Message:
Formalize excluding the security objects from the build, for Windows CE
and for MainWin.
Index: PySECURITY_DESCRIPTOR.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PySECURITY_DESCRIPTOR.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** PySECURITY_DESCRIPTOR.cpp 7 Nov 2003 03:58:17 -0000 1.10
--- PySECURITY_DESCRIPTOR.cpp 30 Mar 2004 04:14:27 -0000 1.11
***************
*** 7,11 ****
#include "structmember.h"
! #ifndef MS_WINCE /* This code is not available on Windows CE */
void FreeSD_DACL(PSECURITY_DESCRIPTOR psd)
--- 7,11 ----
#include "structmember.h"
! #ifndef NO_PYWINTYPES_SECURITY
void FreeSD_DACL(PSECURITY_DESCRIPTOR psd)
***************
*** 719,721 ****
}
! #endif /* MS_WINCE */
--- 719,752 ----
}
! #else /* NO_PYWINTYPES_SECURITY */
!
! BOOL PyWinObject_AsSECURITY_DESCRIPTOR(PyObject *ob, PSECURITY_DESCRIPTOR *ppSECURITY_DESCRIPTOR, BOOL bNoneOK /*= TRUE*/)
! {
! if (bNoneOK && ob==Py_None) {
! *ppSECURITY_DESCRIPTOR = NULL;
! } else {
! if (bNoneOK)
! PyErr_SetString(PyExc_TypeError,
! "This build of pywintypes only supports None as "
! "a SECURITY_DESCRIPTOR");
! else
! PyErr_SetString(PyExc_TypeError,
! "This function can not work in this build, as "
! "only None may be used as a SECURITY_DESCRIPTOR");
! return FALSE;
! }
! return TRUE;
! }
! PyObject *PyWinObject_FromSECURITY_DESCRIPTOR(PSECURITY_DESCRIPTOR psd)
! {
! if (psd==NULL) {
! Py_INCREF(Py_None);
! return Py_None;
! }
! PyErr_SetString(PyExc_RuntimeError,
! "A non-NULL SECURITY_DESCRIPTOR was passed, but security "
! "descriptors are disabled from this build");
! return NULL;
! }
!
! #endif /* NO_PYWINTYPES_SECURITY */
Index: PyACL.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyACL.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** PyACL.cpp 15 Mar 2004 02:19:38 -0000 1.9
--- PyACL.cpp 30 Mar 2004 04:14:27 -0000 1.10
***************
*** 6,10 ****
#include "PyWinObjects.h"
#include "PySecurityObjects.h"
! #ifndef MS_WINCE /* This source is not included for WinCE */
#include "accctrl.h"
#include "aclapi.h"
--- 6,12 ----
#include "PyWinObjects.h"
#include "PySecurityObjects.h"
!
! #ifndef NO_PYWINTYPES_SECURITY
!
#include "accctrl.h"
#include "aclapi.h"
***************
*** 891,893 ****
}
! #endif /* MS_WINCE */
--- 893,895 ----
}
! #endif /* NO_PYWINTYPES_SECURITY */
Index: PySID.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PySID.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** PySID.cpp 13 Feb 2004 06:26:19 -0000 1.9
--- PySID.cpp 30 Mar 2004 04:14:27 -0000 1.10
***************
*** 6,10 ****
#include "PySecurityObjects.h"
! #ifndef MS_WINCE /* This code is not available on Windows CE */
// @pymethod <o PySID>|pywintypes|SID|Creates a new SID object
--- 6,10 ----
#include "PySecurityObjects.h"
! #ifndef NO_PYWINTYPES_SECURITY
// @pymethod <o PySID>|pywintypes|SID|Creates a new SID object
***************
*** 398,402 ****
return PyString_FromString(buf);
}
! #endif /* MS_WINCE */
--- 398,431 ----
return PyString_FromString(buf);
}
+ #else /* NO_PYWINTYPES_SECURITY */
+ BOOL PyWinObject_AsSID(PyObject *ob, PSID *ppSID, BOOL bNoneOK /*= TRUE*/)
+ {
+ if (bNoneOK && ob==Py_None) {
+ *ppSID = NULL;
+ } else {
+ if (bNoneOK)
+ PyErr_SetString(PyExc_TypeError,
+ "This build of pywintypes only supports None as "
+ "a SID");
+ else
+ PyErr_SetString(PyExc_TypeError,
+ "This function can not work in this build, as "
+ "only None may be used as a SID");
+ return FALSE;
+ }
+ return TRUE;
+ }
+ PyObject *PyWinObject_FromSID(PSID psid)
+ {
+ if (psid==NULL) {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ PyErr_SetString(PyExc_RuntimeError,
+ "A non-NULL SID was passed, but security "
+ "descriptors are disabled from this build");
+ return NULL;
+ }
! #endif /* NO_PYWINTYPES_SECURITY */
Index: PySecurityObjects.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PySecurityObjects.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** PySecurityObjects.h 15 Mar 2004 02:19:38 -0000 1.9
--- PySecurityObjects.h 30 Mar 2004 04:14:27 -0000 1.10
***************
*** 2,6 ****
// Much of the security support written by Roger Upole <rw...@ms...>
! #ifndef MS_WINCE /* Not on CE */
extern BOOL (WINAPI *addaccessallowedaceex)(PACL, DWORD, DWORD, DWORD, PSID);
--- 2,10 ----
// Much of the security support written by Roger Upole <rw...@ms...>
! #ifdef MS_WINCE
! # define NO_PYWINTYPES_SECURITY /* This source is not included for WinCE */
! #endif
!
! #ifndef NO_PYWINTYPES_SECURITY
extern BOOL (WINAPI *addaccessallowedaceex)(PACL, DWORD, DWORD, DWORD, PSID);
***************
*** 187,189 ****
};
! #endif // MS_WINCE
--- 191,193 ----
};
! #endif // NO_PYWINTYPES_SECURITY
Index: PySECURITY_ATTRIBUTES.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PySECURITY_ATTRIBUTES.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** PySECURITY_ATTRIBUTES.cpp 7 Nov 2003 03:58:17 -0000 1.5
--- PySECURITY_ATTRIBUTES.cpp 30 Mar 2004 04:14:27 -0000 1.6
***************
*** 7,11 ****
#include "structmember.h"
! #ifdef MS_WINCE
BOOL PyWinObject_AsSECURITY_ATTRIBUTES(PyObject *ob, SECURITY_ATTRIBUTES **ppSECURITY_ATTRIBUTES, BOOL bNoneOK /*= TRUE*/)
--- 7,11 ----
#include "structmember.h"
! #ifdef NO_PYWINTYPES_SECURITY
BOOL PyWinObject_AsSECURITY_ATTRIBUTES(PyObject *ob, SECURITY_ATTRIBUTES **ppSECURITY_ATTRIBUTES, BOOL bNoneOK /*= TRUE*/)
***************
*** 15,21 ****
} else {
if (bNoneOK)
! PyErr_SetString(PyExc_TypeError, "Windows CE only supports None as a SECURITY_ATTRIBUTE");
else
! PyErr_SetString(PyExc_TypeError, "This function can not work under Windows CE, as only None may be used as a SECURITY_ATTRIBUTE");
return FALSE;
}
--- 15,21 ----
} else {
if (bNoneOK)
! PyErr_SetString(PyExc_TypeError, "This build of pywintypes only supports None as a SECURITY_ATTRIBUTE");
else
! PyErr_SetString(PyExc_TypeError, "This function can not work in this build, as only None may be used as a SECURITY_ATTRIBUTE");
return FALSE;
}
***************
*** 23,27 ****
}
! #else /* This code is not available on Windows CE */
// @pymethod <o PySECURITY_ATTRIBUTES>|pywintypes|SECURITY_ATTRIBUTES|Creates a new SECURITY_ATTRIBUTES object
--- 23,27 ----
}
! #else
// @pymethod <o PySECURITY_ATTRIBUTES>|pywintypes|SECURITY_ATTRIBUTES|Creates a new SECURITY_ATTRIBUTES object
Index: PyWinTypesmodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypesmodule.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** PyWinTypesmodule.cpp 25 Nov 2003 05:19:58 -0000 1.13
--- PyWinTypesmodule.cpp 30 Mar 2004 04:14:27 -0000 1.14
***************
*** 392,400 ****
#ifndef MS_WINCE
{"CreateGuid", PyWin_CreateGuid, 1 }, // @pymeth CreateGuid|Creates a new, unique GUIID.
{"ACL", PyWinMethod_NewACL, 1 }, // @pymeth ACL|Creates a new <o PyACL> object.
{"SID", PyWinMethod_NewSID, 1 }, // @pymeth SID|Creates a new <o PySID> object.
{"SECURITY_ATTRIBUTES", PyWinMethod_NewSECURITY_ATTRIBUTES, 1 }, // @pymeth SECURITY_ATTRIBUTES|Creates a new <o PySECURITY_ATTRIBUTES> object.
{"SECURITY_DESCRIPTOR", PyWinMethod_NewSECURITY_DESCRIPTOR, 1 }, // @pymeth SECURITY_DESCRIPTOR|Creates a new <o PySECURITY_DESCRIPTOR> object.
! #endif
{"HANDLE", PyWinMethod_NewHANDLE, 1 }, // @pymeth HANDLE|Creates a new <o PyHANDLE> object.
{"HKEY", PyWinMethod_NewHKEY, 1 }, // @pymeth HKEY|Creates a new <o PyHKEY> object.
--- 392,402 ----
#ifndef MS_WINCE
{"CreateGuid", PyWin_CreateGuid, 1 }, // @pymeth CreateGuid|Creates a new, unique GUIID.
+ #endif // MS_WINCE
+ #ifndef NO_PYWINTYPES_SECURITY
{"ACL", PyWinMethod_NewACL, 1 }, // @pymeth ACL|Creates a new <o PyACL> object.
{"SID", PyWinMethod_NewSID, 1 }, // @pymeth SID|Creates a new <o PySID> object.
{"SECURITY_ATTRIBUTES", PyWinMethod_NewSECURITY_ATTRIBUTES, 1 }, // @pymeth SECURITY_ATTRIBUTES|Creates a new <o PySECURITY_ATTRIBUTES> object.
{"SECURITY_DESCRIPTOR", PyWinMethod_NewSECURITY_DESCRIPTOR, 1 }, // @pymeth SECURITY_DESCRIPTOR|Creates a new <o PySECURITY_DESCRIPTOR> object.
! #endif // NO_PYWINTYPES_SECURITY
{"HANDLE", PyWinMethod_NewHANDLE, 1 }, // @pymeth HANDLE|Creates a new <o PyHANDLE> object.
{"HKEY", PyWinMethod_NewHKEY, 1 }, // @pymeth HKEY|Creates a new <o PyHKEY> object.
***************
*** 479,483 ****
#endif // NO_PYWINTYPES_IID
PyDict_SetItemString(dict, "UnicodeType", (PyObject *)&PyUnicodeType);
! #ifndef MS_WINCE
PyDict_SetItemString(dict, "SECURITY_ATTRIBUTESType", (PyObject *)&PySECURITY_ATTRIBUTESType);
PyDict_SetItemString(dict, "SIDType", (PyObject *)&PySIDType);
--- 481,485 ----
#endif // NO_PYWINTYPES_IID
PyDict_SetItemString(dict, "UnicodeType", (PyObject *)&PyUnicodeType);
! #ifndef NO_PYWINTYPES_SECURITY
PyDict_SetItemString(dict, "SECURITY_ATTRIBUTESType", (PyObject *)&PySECURITY_ATTRIBUTESType);
PyDict_SetItemString(dict, "SIDType", (PyObject *)&PySIDType);
***************
*** 495,498 ****
--- 497,501 ----
BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved)
{
+ #ifndef NO_PYWINTYPES_SECURITY
FARPROC fp;
// dll usually will already be loaded
***************
*** 511,515 ****
addauditaccessaceex=(BOOL (WINAPI *)(PACL, DWORD, DWORD, DWORD, PSID, BOOL, BOOL))(fp);
}
!
switch (dwReason) {
case DLL_PROCESS_ATTACH: {
--- 514,518 ----
addauditaccessaceex=(BOOL (WINAPI *)(PACL, DWORD, DWORD, DWORD, PSID, BOOL, BOOL))(fp);
}
! #endif // NO_PYWINTYPES_SECURITY
switch (dwReason) {
case DLL_PROCESS_ATTACH: {
|