LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - py_security.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 710 2067 34.3 %
Date: 2021-09-23 10:06:22 Functions: 33 143 23.1 %

          Line data    Source code
       1             : 
       2             : /* Python wrapper functions auto-generated by pidl */
       3             : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
       4             : #include <Python.h>
       5             : #include "python/py3compat.h"
       6             : #include "includes.h"
       7             : #include "python/modules.h"
       8             : #include <pytalloc.h>
       9             : #include "librpc/rpc/pyrpc.h"
      10             : #include "librpc/rpc/pyrpc_util.h"
      11             : #include "bin/default/librpc/gen_ndr/ndr_security.h"
      12             : 
      13             : 
      14             : /*
      15             :  * Suppress compiler warnings if the generated code does not call these
      16             :  * functions
      17             :  */
      18             : #ifndef _MAYBE_UNUSED_
      19             : #ifdef __has_attribute
      20             : #if __has_attribute(unused)
      21             : #define _MAYBE_UNUSED_ __attribute__ ((unused))
      22             : #else
      23             : #define _MAYBE_UNUSED_
      24             : #endif
      25             : #endif
      26             : #endif
      27             : /*
      28             :  * These functions are here to ensure they can be optimized out by
      29             :  * the compiler based on the constant input values
      30             :  */
      31             : 
      32      564609 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
      33             : {
      34      564609 :         switch (var_size) {
      35           0 :         case 8:
      36           0 :                 return UINT64_MAX;
      37      282114 :         case 4:
      38      282114 :                 return UINT32_MAX;
      39      278911 :         case 2:
      40      278911 :                 return UINT16_MAX;
      41        3584 :         case 1:
      42        3584 :                 return UINT8_MAX;
      43             :         }
      44             : 
      45           0 :         return 0;
      46             : }
      47             : 
      48           0 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
      49             : {
      50           0 :         switch (var_size) {
      51           0 :         case 8:
      52           0 :                 return INT64_MAX;
      53           0 :         case 4:
      54           0 :                 return INT32_MAX;
      55           0 :         case 2:
      56           0 :                 return INT16_MAX;
      57           0 :         case 1:
      58           0 :                 return INT8_MAX;
      59             :         }
      60             : 
      61           0 :         return 0;
      62             : }
      63             : 
      64             : #include "librpc/gen_ndr/misc.h"
      65             : static PyTypeObject dom_sid_Type;
      66             : static PyTypeObject security_ace_object_type_Type;
      67             : static PyTypeObject security_ace_object_inherited_type_Type;
      68             : static PyTypeObject security_ace_object_Type;
      69             : static PyTypeObject security_ace_object_ctr_Type;
      70             : static PyTypeObject security_ace_Type;
      71             : static PyTypeObject security_acl_Type;
      72             : static PyTypeObject security_descriptor_Type;
      73             : static PyTypeObject sec_desc_buf_Type;
      74             : static PyTypeObject security_token_Type;
      75             : static PyTypeObject security_unix_token_Type;
      76             : static PyTypeObject LSAP_TOKEN_INFO_INTEGRITY_Type;
      77             : static PyTypeObject generic_mapping_Type;
      78             : static PyTypeObject standard_mapping_Type;
      79             : static PyTypeObject security_InterfaceType;
      80             : 
      81             : static PyTypeObject *BaseObject_Type;
      82             : static PyTypeObject *GUID_Type;
      83             : static PyTypeObject *ClientConnection_Type;
      84             : static PyTypeObject *ndr_syntax_id_Type;
      85             : #include "librpc/ndr/py_security.c"
      86             : 
      87             : 
      88           0 : static PyObject *py_dom_sid_get_sid_rev_num(PyObject *obj, void *closure)
      89             : {
      90           0 :         struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(obj);
      91             :         PyObject *py_sid_rev_num;
      92           0 :         py_sid_rev_num = PyLong_FromLong((uint16_t)object->sid_rev_num);
      93           0 :         return py_sid_rev_num;
      94             : }
      95             : 
      96           0 : static int py_dom_sid_set_sid_rev_num(PyObject *py_obj, PyObject *value, void *closure)
      97             : {
      98           0 :         struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
      99           0 :         if (value == NULL) {
     100           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_rev_num");
     101           0 :                 return -1;
     102             :         }
     103             :         {
     104           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_rev_num));
     105           0 :                 if (PyLong_Check(value)) {
     106             :                         unsigned long long test_var;
     107           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     108           0 :                         if (PyErr_Occurred() != NULL) {
     109           0 :                                 return -1;
     110             :                         }
     111           0 :                         if (test_var > uint_max) {
     112           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     113             :                                   PyLong_Type.tp_name, uint_max, test_var);
     114           0 :                                 return -1;
     115             :                         }
     116           0 :                         object->sid_rev_num = test_var;
     117             :                 } else {
     118           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     119             :                           PyLong_Type.tp_name);
     120           0 :                         return -1;
     121             :                 }
     122             :         }
     123           0 :         return 0;
     124             : }
     125             : 
     126           0 : static PyObject *py_dom_sid_get_num_auths(PyObject *obj, void *closure)
     127             : {
     128           0 :         struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(obj);
     129             :         PyObject *py_num_auths;
     130           0 :         py_num_auths = PyLong_FromLong(object->num_auths);
     131           0 :         return py_num_auths;
     132             : }
     133             : 
     134           0 : static int py_dom_sid_set_num_auths(PyObject *py_obj, PyObject *value, void *closure)
     135             : {
     136           0 :         struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
     137           0 :         if (value == NULL) {
     138           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_auths");
     139           0 :                 return -1;
     140             :         }
     141             :         {
     142           0 :                 const long long int_max = ndr_sizeof2intmax(sizeof(object->num_auths));
     143           0 :                 const long long int_min = -int_max - 1;
     144           0 :                 if (PyLong_Check(value)) {
     145             :                         long long test_var;
     146           0 :                         test_var = PyLong_AsLongLong(value);
     147           0 :                         if (PyErr_Occurred() != NULL) {
     148           0 :                                 return -1;
     149             :                         }
     150           0 :                         if (test_var < int_min || test_var > int_max) {
     151           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\
     152             :                                   PyLong_Type.tp_name, int_min, int_max, test_var);
     153           0 :                                 return -1;
     154             :                         }
     155           0 :                         object->num_auths = test_var;
     156             :                 } else {
     157           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     158             :                           PyLong_Type.tp_name);
     159           0 :                         return -1;
     160             :                 }
     161             :         }
     162           0 :         return 0;
     163             : }
     164             : 
     165           0 : static PyObject *py_dom_sid_get_id_auth(PyObject *obj, void *closure)
     166             : {
     167           0 :         struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(obj);
     168             :         PyObject *py_id_auth;
     169           0 :         py_id_auth = PyList_New(6);
     170           0 :         if (py_id_auth == NULL) {
     171           0 :                 return NULL;
     172             :         }
     173             :         {
     174             :                 int id_auth_cntr_0;
     175           0 :                 for (id_auth_cntr_0 = 0; id_auth_cntr_0 < (6); id_auth_cntr_0++) {
     176             :                         PyObject *py_id_auth_0;
     177           0 :                         py_id_auth_0 = PyLong_FromLong((uint16_t)object->id_auth[id_auth_cntr_0]);
     178           0 :                         PyList_SetItem(py_id_auth, id_auth_cntr_0, py_id_auth_0);
     179             :                 }
     180             :         }
     181           0 :         return py_id_auth;
     182             : }
     183             : 
     184           0 : static int py_dom_sid_set_id_auth(PyObject *py_obj, PyObject *value, void *closure)
     185             : {
     186           0 :         struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
     187           0 :         if (value == NULL) {
     188           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->id_auth");
     189           0 :                 return -1;
     190             :         }
     191           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
     192             :         {
     193             :                 int id_auth_cntr_0;
     194           0 :                 if (ARRAY_SIZE(object->id_auth) != PyList_GET_SIZE(value)) {
     195           0 :                         PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->id_auth),  PyList_GET_SIZE(value));
     196           0 :                         return -1;
     197             :                 }
     198           0 :                 for (id_auth_cntr_0 = 0; id_auth_cntr_0 < PyList_GET_SIZE(value); id_auth_cntr_0++) {
     199           0 :                         if (PyList_GET_ITEM(value, id_auth_cntr_0) == NULL) {
     200           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->id_auth[id_auth_cntr_0]");
     201           0 :                                 return -1;
     202             :                         }
     203             :                         {
     204           0 :                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->id_auth[id_auth_cntr_0]));
     205           0 :                                 if (PyLong_Check(PyList_GET_ITEM(value, id_auth_cntr_0))) {
     206             :                                         unsigned long long test_var;
     207           0 :                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, id_auth_cntr_0));
     208           0 :                                         if (PyErr_Occurred() != NULL) {
     209           0 :                                                 return -1;
     210             :                                         }
     211           0 :                                         if (test_var > uint_max) {
     212           0 :                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     213             :                                                   PyLong_Type.tp_name, uint_max, test_var);
     214           0 :                                                 return -1;
     215             :                                         }
     216           0 :                                         object->id_auth[id_auth_cntr_0] = test_var;
     217             :                                 } else {
     218           0 :                                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     219             :                                           PyLong_Type.tp_name);
     220           0 :                                         return -1;
     221             :                                 }
     222             :                         }
     223             :                 }
     224             :         }
     225           0 :         return 0;
     226             : }
     227             : 
     228           0 : static PyObject *py_dom_sid_get_sub_auths(PyObject *obj, void *closure)
     229             : {
     230           0 :         struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(obj);
     231             :         PyObject *py_sub_auths;
     232           0 :         py_sub_auths = PyList_New(15);
     233           0 :         if (py_sub_auths == NULL) {
     234           0 :                 return NULL;
     235             :         }
     236             :         {
     237             :                 int sub_auths_cntr_0;
     238           0 :                 for (sub_auths_cntr_0 = 0; sub_auths_cntr_0 < (15); sub_auths_cntr_0++) {
     239             :                         PyObject *py_sub_auths_0;
     240           0 :                         py_sub_auths_0 = PyLong_FromUnsignedLongLong((uint32_t)object->sub_auths[sub_auths_cntr_0]);
     241           0 :                         PyList_SetItem(py_sub_auths, sub_auths_cntr_0, py_sub_auths_0);
     242             :                 }
     243             :         }
     244           0 :         return py_sub_auths;
     245             : }
     246             : 
     247           0 : static int py_dom_sid_set_sub_auths(PyObject *py_obj, PyObject *value, void *closure)
     248             : {
     249           0 :         struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
     250           0 :         if (value == NULL) {
     251           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sub_auths");
     252           0 :                 return -1;
     253             :         }
     254           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
     255             :         {
     256             :                 int sub_auths_cntr_0;
     257           0 :                 if (ARRAY_SIZE(object->sub_auths) != PyList_GET_SIZE(value)) {
     258           0 :                         PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->sub_auths),  PyList_GET_SIZE(value));
     259           0 :                         return -1;
     260             :                 }
     261           0 :                 for (sub_auths_cntr_0 = 0; sub_auths_cntr_0 < PyList_GET_SIZE(value); sub_auths_cntr_0++) {
     262           0 :                         if (PyList_GET_ITEM(value, sub_auths_cntr_0) == NULL) {
     263           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sub_auths[sub_auths_cntr_0]");
     264           0 :                                 return -1;
     265             :                         }
     266             :                         {
     267           0 :                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sub_auths[sub_auths_cntr_0]));
     268           0 :                                 if (PyLong_Check(PyList_GET_ITEM(value, sub_auths_cntr_0))) {
     269             :                                         unsigned long long test_var;
     270           0 :                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, sub_auths_cntr_0));
     271           0 :                                         if (PyErr_Occurred() != NULL) {
     272           0 :                                                 return -1;
     273             :                                         }
     274           0 :                                         if (test_var > uint_max) {
     275           0 :                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     276             :                                                   PyLong_Type.tp_name, uint_max, test_var);
     277           0 :                                                 return -1;
     278             :                                         }
     279           0 :                                         object->sub_auths[sub_auths_cntr_0] = test_var;
     280             :                                 } else {
     281           0 :                                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     282             :                                           PyLong_Type.tp_name);
     283           0 :                                         return -1;
     284             :                                 }
     285             :                         }
     286             :                 }
     287             :         }
     288           0 :         return 0;
     289             : }
     290             : 
     291             : static PyGetSetDef py_dom_sid_getsetters[] = {
     292             :         {
     293             :                 .name = discard_const_p(char, "sid_rev_num"),
     294             :                 .get = py_dom_sid_get_sid_rev_num,
     295             :                 .set = py_dom_sid_set_sid_rev_num,
     296             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     297             :         },
     298             :         {
     299             :                 .name = discard_const_p(char, "num_auths"),
     300             :                 .get = py_dom_sid_get_num_auths,
     301             :                 .set = py_dom_sid_set_num_auths,
     302             :                 .doc = discard_const_p(char, "PIDL-generated element of base type int8")
     303             :         },
     304             :         {
     305             :                 .name = discard_const_p(char, "id_auth"),
     306             :                 .get = py_dom_sid_get_id_auth,
     307             :                 .set = py_dom_sid_set_id_auth,
     308             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     309             :         },
     310             :         {
     311             :                 .name = discard_const_p(char, "sub_auths"),
     312             :                 .get = py_dom_sid_get_sub_auths,
     313             :                 .set = py_dom_sid_set_sub_auths,
     314             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     315             :         },
     316             :         { .name = NULL }
     317             : };
     318             : 
     319      101389 : static PyObject *py_dom_sid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     320             : {
     321      101389 :         return pytalloc_new(struct dom_sid, type);
     322             : }
     323             : 
     324         250 : static PyObject *py_dom_sid_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
     325             : {
     326         250 :         struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
     327         250 :         PyObject *ret = NULL;
     328             :         DATA_BLOB blob;
     329             :         enum ndr_err_code err;
     330         250 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
     331         250 :         if (tmp_ctx == NULL) {
     332           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
     333           0 :                 return NULL;
     334             :         }
     335         250 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dom_sid);
     336         250 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     337           0 :                 TALLOC_FREE(tmp_ctx);
     338           0 :                 PyErr_SetNdrError(err);
     339           0 :                 return NULL;
     340             :         }
     341             : 
     342         250 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
     343         250 :         TALLOC_FREE(tmp_ctx);
     344         250 :         return ret;
     345             : }
     346             : 
     347       17138 : static PyObject *py_dom_sid_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
     348             : {
     349       17138 :         struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
     350       17138 :         DATA_BLOB blob = {.data = NULL, .length = 0};
     351       17138 :         Py_ssize_t blob_length = 0;
     352             :         enum ndr_err_code err;
     353       17138 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
     354       17138 :         PyObject *allow_remaining_obj = NULL;
     355       17138 :         bool allow_remaining = false;
     356             : 
     357       17138 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
     358             :                 discard_const_p(char *, kwnames),
     359             :                 &blob.data, &blob_length,
     360             :                 &allow_remaining_obj)) {
     361           0 :                 return NULL;
     362             :         }
     363       17138 :         blob.length = blob_length;
     364             : 
     365       17138 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
     366           0 :                 allow_remaining = true;
     367             :         }
     368             : 
     369       17034 :         if (allow_remaining) {
     370           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dom_sid);
     371             :         } else {
     372       17138 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dom_sid);
     373             :         }
     374       17138 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     375           0 :                 PyErr_SetNdrError(err);
     376           0 :                 return NULL;
     377             :         }
     378             : 
     379       17138 :         Py_RETURN_NONE;
     380             : }
     381             : 
     382           0 : static PyObject *py_dom_sid_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
     383             : {
     384           0 :         struct dom_sid *object = (struct dom_sid *)pytalloc_get_ptr(py_obj);
     385             :         PyObject *ret;
     386             :         char *retstr;
     387             : 
     388           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dom_sid, "dom_sid", object);
     389           0 :         ret = PyUnicode_FromString(retstr);
     390           0 :         talloc_free(retstr);
     391             : 
     392           0 :         return ret;
     393             : }
     394             : 
     395             : static PyMethodDef py_dom_sid_methods[] = {
     396             :         { "__ndr_pack__", (PyCFunction)py_dom_sid_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
     397             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dom_sid_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
     398             :         { "__ndr_print__", (PyCFunction)py_dom_sid_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
     399             :         { NULL, NULL, 0, NULL }
     400             : };
     401             : 
     402             : 
     403             : static PyTypeObject dom_sid_Type = {
     404             :         PyVarObject_HEAD_INIT(NULL, 0)
     405             :         .tp_name = "security.dom_sid",
     406             :         .tp_getset = py_dom_sid_getsetters,
     407             :         .tp_methods = py_dom_sid_methods,
     408             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     409             :         .tp_new = py_dom_sid_new,
     410             : };
     411             : 
     412           0 : static PyObject *py_import_security_ace_object_type(TALLOC_CTX *mem_ctx, int level, union security_ace_object_type *in)
     413             : {
     414             :         PyObject *ret;
     415             : 
     416           0 :         switch (level) {
     417           0 :                 case SEC_ACE_OBJECT_TYPE_PRESENT:
     418           0 :                         ret = pytalloc_reference_ex(GUID_Type, mem_ctx, &in->type);
     419           0 :                         return ret;
     420             : 
     421           0 :                 default:
     422           0 :                         ret = Py_None;
     423           0 :                         Py_INCREF(ret);
     424           0 :                         return ret;
     425             : 
     426             :         }
     427             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
     428             :         return NULL;
     429             : }
     430             : 
     431           0 : static union security_ace_object_type *py_export_security_ace_object_type(TALLOC_CTX *mem_ctx, int level, PyObject *in)
     432             : {
     433           0 :         union security_ace_object_type *ret = talloc_zero(mem_ctx, union security_ace_object_type);
     434           0 :         switch (level) {
     435           0 :                 case SEC_ACE_OBJECT_TYPE_PRESENT:
     436           0 :                         if (in == NULL) {
     437           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->type");
     438           0 :                                 talloc_free(ret); return NULL;
     439             :                         }
     440           0 :                         PY_CHECK_TYPE(GUID_Type, in, talloc_free(ret); return NULL;);
     441           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
     442           0 :                                 PyErr_NoMemory();
     443           0 :                                 talloc_free(ret); return NULL;
     444             :                         }
     445           0 :                         ret->type = *(struct GUID *)pytalloc_get_ptr(in);
     446           0 :                         break;
     447             : 
     448           0 :                 default:
     449           0 :                         break;
     450             : 
     451             :         }
     452             : 
     453           0 :         return ret;
     454             : }
     455             : 
     456           0 : static PyObject *py_security_ace_object_type_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     457             : {
     458           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
     459           0 :         PyObject *mem_ctx_obj = NULL;
     460           0 :         TALLOC_CTX *mem_ctx = NULL;
     461           0 :         int level = 0;
     462           0 :         PyObject *in_obj = NULL;
     463           0 :         union security_ace_object_type *in = NULL;
     464             : 
     465           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
     466             :                 discard_const_p(char *, kwnames),
     467             :                 &mem_ctx_obj,
     468             :                 &level,
     469             :                 &in_obj)) {
     470           0 :                 return NULL;
     471             :         }
     472           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
     473           0 :         if (mem_ctx == NULL) {
     474           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
     475           0 :                 return NULL;
     476             :         }
     477           0 :         in = (union security_ace_object_type *)pytalloc_get_ptr(in_obj);
     478           0 :         if (in == NULL) {
     479           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union security_ace_object_type!");
     480           0 :                 return NULL;
     481             :         }
     482             : 
     483           0 :         return py_import_security_ace_object_type(mem_ctx, level, in);
     484             : }
     485             : 
     486           0 : static PyObject *py_security_ace_object_type_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     487             : {
     488           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
     489           0 :         PyObject *mem_ctx_obj = NULL;
     490           0 :         TALLOC_CTX *mem_ctx = NULL;
     491           0 :         int level = 0;
     492           0 :         PyObject *in = NULL;
     493           0 :         union security_ace_object_type *out = NULL;
     494             : 
     495           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
     496             :                 discard_const_p(char *, kwnames),
     497             :                 &mem_ctx_obj,
     498             :                 &level,
     499             :                 &in)) {
     500           0 :                 return NULL;
     501             :         }
     502           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
     503           0 :         if (mem_ctx == NULL) {
     504           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
     505           0 :                 return NULL;
     506             :         }
     507             : 
     508           0 :         out = py_export_security_ace_object_type(mem_ctx, level, in);
     509           0 :         if (out == NULL) {
     510           0 :                 return NULL;
     511             :         }
     512             : 
     513           0 :         return pytalloc_GenericObject_reference(out);
     514             : }
     515             : 
     516             : static PyMethodDef py_security_ace_object_type_methods[] = {
     517             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_type_import),
     518             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
     519             :                 "T.__import__(mem_ctx, level, in) => ret." },
     520             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_type_export),
     521             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
     522             :                 "T.__export__(mem_ctx, level, in) => ret." },
     523             :         { NULL, NULL, 0, NULL }
     524             : };
     525             : 
     526           0 : static PyObject *py_security_ace_object_type_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     527             : {
     528           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
     529           0 :         return NULL;
     530             : }
     531             : 
     532             : 
     533             : static PyTypeObject security_ace_object_type_Type = {
     534             :         PyVarObject_HEAD_INIT(NULL, 0)
     535             :         .tp_name = "security.ace_object_type",
     536             :         .tp_getset = NULL,
     537             :         .tp_methods = py_security_ace_object_type_methods,
     538             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     539             :         .tp_new = py_security_ace_object_type_new,
     540             : };
     541             : 
     542       27137 : static PyObject *py_import_security_ace_object_inherited_type(TALLOC_CTX *mem_ctx, int level, union security_ace_object_inherited_type *in)
     543             : {
     544             :         PyObject *ret;
     545             : 
     546       27137 :         switch (level) {
     547       27137 :                 case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT:
     548       27137 :                         ret = pytalloc_reference_ex(GUID_Type, mem_ctx, &in->inherited_type);
     549       27137 :                         return ret;
     550             : 
     551           0 :                 default:
     552           0 :                         ret = Py_None;
     553           0 :                         Py_INCREF(ret);
     554           0 :                         return ret;
     555             : 
     556             :         }
     557             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
     558             :         return NULL;
     559             : }
     560             : 
     561           0 : static union security_ace_object_inherited_type *py_export_security_ace_object_inherited_type(TALLOC_CTX *mem_ctx, int level, PyObject *in)
     562             : {
     563           0 :         union security_ace_object_inherited_type *ret = talloc_zero(mem_ctx, union security_ace_object_inherited_type);
     564           0 :         switch (level) {
     565           0 :                 case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT:
     566           0 :                         if (in == NULL) {
     567           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->inherited_type");
     568           0 :                                 talloc_free(ret); return NULL;
     569             :                         }
     570           0 :                         PY_CHECK_TYPE(GUID_Type, in, talloc_free(ret); return NULL;);
     571           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
     572           0 :                                 PyErr_NoMemory();
     573           0 :                                 talloc_free(ret); return NULL;
     574             :                         }
     575           0 :                         ret->inherited_type = *(struct GUID *)pytalloc_get_ptr(in);
     576           0 :                         break;
     577             : 
     578           0 :                 default:
     579           0 :                         break;
     580             : 
     581             :         }
     582             : 
     583           0 :         return ret;
     584             : }
     585             : 
     586       27137 : static PyObject *py_security_ace_object_inherited_type_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     587             : {
     588       27137 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
     589       27137 :         PyObject *mem_ctx_obj = NULL;
     590       27137 :         TALLOC_CTX *mem_ctx = NULL;
     591       27137 :         int level = 0;
     592       27137 :         PyObject *in_obj = NULL;
     593       27137 :         union security_ace_object_inherited_type *in = NULL;
     594             : 
     595       27137 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
     596             :                 discard_const_p(char *, kwnames),
     597             :                 &mem_ctx_obj,
     598             :                 &level,
     599             :                 &in_obj)) {
     600           0 :                 return NULL;
     601             :         }
     602       27137 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
     603       27137 :         if (mem_ctx == NULL) {
     604           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
     605           0 :                 return NULL;
     606             :         }
     607       27137 :         in = (union security_ace_object_inherited_type *)pytalloc_get_ptr(in_obj);
     608       27137 :         if (in == NULL) {
     609           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union security_ace_object_inherited_type!");
     610           0 :                 return NULL;
     611             :         }
     612             : 
     613       27137 :         return py_import_security_ace_object_inherited_type(mem_ctx, level, in);
     614             : }
     615             : 
     616           0 : static PyObject *py_security_ace_object_inherited_type_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     617             : {
     618           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
     619           0 :         PyObject *mem_ctx_obj = NULL;
     620           0 :         TALLOC_CTX *mem_ctx = NULL;
     621           0 :         int level = 0;
     622           0 :         PyObject *in = NULL;
     623           0 :         union security_ace_object_inherited_type *out = NULL;
     624             : 
     625           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
     626             :                 discard_const_p(char *, kwnames),
     627             :                 &mem_ctx_obj,
     628             :                 &level,
     629             :                 &in)) {
     630           0 :                 return NULL;
     631             :         }
     632           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
     633           0 :         if (mem_ctx == NULL) {
     634           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
     635           0 :                 return NULL;
     636             :         }
     637             : 
     638           0 :         out = py_export_security_ace_object_inherited_type(mem_ctx, level, in);
     639           0 :         if (out == NULL) {
     640           0 :                 return NULL;
     641             :         }
     642             : 
     643           0 :         return pytalloc_GenericObject_reference(out);
     644             : }
     645             : 
     646             : static PyMethodDef py_security_ace_object_inherited_type_methods[] = {
     647             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_inherited_type_import),
     648             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
     649             :                 "T.__import__(mem_ctx, level, in) => ret." },
     650             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_inherited_type_export),
     651             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
     652             :                 "T.__export__(mem_ctx, level, in) => ret." },
     653             :         { NULL, NULL, 0, NULL }
     654             : };
     655             : 
     656           0 : static PyObject *py_security_ace_object_inherited_type_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     657             : {
     658           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
     659           0 :         return NULL;
     660             : }
     661             : 
     662             : 
     663             : static PyTypeObject security_ace_object_inherited_type_Type = {
     664             :         PyVarObject_HEAD_INIT(NULL, 0)
     665             :         .tp_name = "security.ace_object_inherited_type",
     666             :         .tp_getset = NULL,
     667             :         .tp_methods = py_security_ace_object_inherited_type_methods,
     668             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     669             :         .tp_new = py_security_ace_object_inherited_type_new,
     670             : };
     671             : 
     672             : 
     673       57381 : static PyObject *py_security_ace_object_get_flags(PyObject *obj, void *closure)
     674             : {
     675       57381 :         struct security_ace_object *object = (struct security_ace_object *)pytalloc_get_ptr(obj);
     676             :         PyObject *py_flags;
     677       57381 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
     678       57381 :         return py_flags;
     679             : }
     680             : 
     681           0 : static int py_security_ace_object_set_flags(PyObject *py_obj, PyObject *value, void *closure)
     682             : {
     683           0 :         struct security_ace_object *object = (struct security_ace_object *)pytalloc_get_ptr(py_obj);
     684           0 :         if (value == NULL) {
     685           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
     686           0 :                 return -1;
     687             :         }
     688             :         {
     689           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
     690           0 :                 if (PyLong_Check(value)) {
     691             :                         unsigned long long test_var;
     692           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     693           0 :                         if (PyErr_Occurred() != NULL) {
     694           0 :                                 return -1;
     695             :                         }
     696           0 :                         if (test_var > uint_max) {
     697           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     698             :                                   PyLong_Type.tp_name, uint_max, test_var);
     699           0 :                                 return -1;
     700             :                         }
     701           0 :                         object->flags = test_var;
     702             :                 } else {
     703           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     704             :                           PyLong_Type.tp_name);
     705           0 :                         return -1;
     706             :                 }
     707             :         }
     708           0 :         return 0;
     709             : }
     710             : 
     711           0 : static PyObject *py_security_ace_object_get_type(PyObject *obj, void *closure)
     712             : {
     713           0 :         struct security_ace_object *object = (struct security_ace_object *)pytalloc_get_ptr(obj);
     714             :         PyObject *py_type;
     715           0 :         py_type = pyrpc_import_union(&security_ace_object_type_Type, pytalloc_get_mem_ctx(obj), object->flags & SEC_ACE_OBJECT_TYPE_PRESENT, &object->type, "union security_ace_object_type");
     716           0 :         if (py_type == NULL) {
     717           0 :                 return NULL;
     718             :         }
     719           0 :         return py_type;
     720             : }
     721             : 
     722           0 : static int py_security_ace_object_set_type(PyObject *py_obj, PyObject *value, void *closure)
     723             : {
     724           0 :         struct security_ace_object *object = (struct security_ace_object *)pytalloc_get_ptr(py_obj);
     725           0 :         if (value == NULL) {
     726           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
     727           0 :                 return -1;
     728             :         }
     729             :         {
     730             :                 union security_ace_object_type *type_switch_0;
     731           0 :                 type_switch_0 = (union security_ace_object_type *)pyrpc_export_union(&security_ace_object_type_Type, pytalloc_get_mem_ctx(py_obj), object->flags & SEC_ACE_OBJECT_TYPE_PRESENT, value, "union security_ace_object_type");
     732           0 :                 if (type_switch_0 == NULL) {
     733           0 :                         return -1;
     734             :                 }
     735           0 :                 object->type = *type_switch_0;
     736             :         }
     737           0 :         return 0;
     738             : }
     739             : 
     740       27137 : static PyObject *py_security_ace_object_get_inherited_type(PyObject *obj, void *closure)
     741             : {
     742       27137 :         struct security_ace_object *object = (struct security_ace_object *)pytalloc_get_ptr(obj);
     743             :         PyObject *py_inherited_type;
     744       27137 :         py_inherited_type = pyrpc_import_union(&security_ace_object_inherited_type_Type, pytalloc_get_mem_ctx(obj), object->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT, &object->inherited_type, "union security_ace_object_inherited_type");
     745       27137 :         if (py_inherited_type == NULL) {
     746           0 :                 return NULL;
     747             :         }
     748       27137 :         return py_inherited_type;
     749             : }
     750             : 
     751           0 : static int py_security_ace_object_set_inherited_type(PyObject *py_obj, PyObject *value, void *closure)
     752             : {
     753           0 :         struct security_ace_object *object = (struct security_ace_object *)pytalloc_get_ptr(py_obj);
     754           0 :         if (value == NULL) {
     755           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->inherited_type");
     756           0 :                 return -1;
     757             :         }
     758             :         {
     759             :                 union security_ace_object_inherited_type *inherited_type_switch_0;
     760           0 :                 inherited_type_switch_0 = (union security_ace_object_inherited_type *)pyrpc_export_union(&security_ace_object_inherited_type_Type, pytalloc_get_mem_ctx(py_obj), object->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT, value, "union security_ace_object_inherited_type");
     761           0 :                 if (inherited_type_switch_0 == NULL) {
     762           0 :                         return -1;
     763             :                 }
     764           0 :                 object->inherited_type = *inherited_type_switch_0;
     765             :         }
     766           0 :         return 0;
     767             : }
     768             : 
     769             : static PyGetSetDef py_security_ace_object_getsetters[] = {
     770             :         {
     771             :                 .name = discard_const_p(char, "flags"),
     772             :                 .get = py_security_ace_object_get_flags,
     773             :                 .set = py_security_ace_object_set_flags,
     774             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_object_flags")
     775             :         },
     776             :         {
     777             :                 .name = discard_const_p(char, "type"),
     778             :                 .get = py_security_ace_object_get_type,
     779             :                 .set = py_security_ace_object_set_type,
     780             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_object_type")
     781             :         },
     782             :         {
     783             :                 .name = discard_const_p(char, "inherited_type"),
     784             :                 .get = py_security_ace_object_get_inherited_type,
     785             :                 .set = py_security_ace_object_set_inherited_type,
     786             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_object_inherited_type")
     787             :         },
     788             :         { .name = NULL }
     789             : };
     790             : 
     791           0 : static PyObject *py_security_ace_object_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     792             : {
     793           0 :         return pytalloc_new(struct security_ace_object, type);
     794             : }
     795             : 
     796             : 
     797             : static PyTypeObject security_ace_object_Type = {
     798             :         PyVarObject_HEAD_INIT(NULL, 0)
     799             :         .tp_name = "security.ace_object",
     800             :         .tp_getset = py_security_ace_object_getsetters,
     801             :         .tp_methods = NULL,
     802             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     803             :         .tp_new = py_security_ace_object_new,
     804             : };
     805             : 
     806       84518 : static PyObject *py_import_security_ace_object_ctr(TALLOC_CTX *mem_ctx, int level, union security_ace_object_ctr *in)
     807             : {
     808             :         PyObject *ret;
     809             : 
     810       84518 :         switch (level) {
     811       76854 :                 case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT:
     812       76854 :                         ret = pytalloc_reference_ex(&security_ace_object_Type, mem_ctx, &in->object);
     813       76854 :                         return ret;
     814             : 
     815           0 :                 case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT:
     816           0 :                         ret = pytalloc_reference_ex(&security_ace_object_Type, mem_ctx, &in->object);
     817           0 :                         return ret;
     818             : 
     819        7664 :                 case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT:
     820        7664 :                         ret = pytalloc_reference_ex(&security_ace_object_Type, mem_ctx, &in->object);
     821        7664 :                         return ret;
     822             : 
     823           0 :                 case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT:
     824           0 :                         ret = pytalloc_reference_ex(&security_ace_object_Type, mem_ctx, &in->object);
     825           0 :                         return ret;
     826             : 
     827           0 :                 default:
     828           0 :                         ret = Py_None;
     829           0 :                         Py_INCREF(ret);
     830           0 :                         return ret;
     831             : 
     832             :         }
     833             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
     834             :         return NULL;
     835             : }
     836             : 
     837           0 : static union security_ace_object_ctr *py_export_security_ace_object_ctr(TALLOC_CTX *mem_ctx, int level, PyObject *in)
     838             : {
     839           0 :         union security_ace_object_ctr *ret = talloc_zero(mem_ctx, union security_ace_object_ctr);
     840           0 :         switch (level) {
     841           0 :                 case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT:
     842           0 :                         if (in == NULL) {
     843           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->object");
     844           0 :                                 talloc_free(ret); return NULL;
     845             :                         }
     846           0 :                         PY_CHECK_TYPE(&security_ace_object_Type, in, talloc_free(ret); return NULL;);
     847           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
     848           0 :                                 PyErr_NoMemory();
     849           0 :                                 talloc_free(ret); return NULL;
     850             :                         }
     851           0 :                         ret->object = *(struct security_ace_object *)pytalloc_get_ptr(in);
     852           0 :                         break;
     853             : 
     854           0 :                 case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT:
     855           0 :                         if (in == NULL) {
     856           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->object");
     857           0 :                                 talloc_free(ret); return NULL;
     858             :                         }
     859           0 :                         PY_CHECK_TYPE(&security_ace_object_Type, in, talloc_free(ret); return NULL;);
     860           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
     861           0 :                                 PyErr_NoMemory();
     862           0 :                                 talloc_free(ret); return NULL;
     863             :                         }
     864           0 :                         ret->object = *(struct security_ace_object *)pytalloc_get_ptr(in);
     865           0 :                         break;
     866             : 
     867           0 :                 case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT:
     868           0 :                         if (in == NULL) {
     869           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->object");
     870           0 :                                 talloc_free(ret); return NULL;
     871             :                         }
     872           0 :                         PY_CHECK_TYPE(&security_ace_object_Type, in, talloc_free(ret); return NULL;);
     873           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
     874           0 :                                 PyErr_NoMemory();
     875           0 :                                 talloc_free(ret); return NULL;
     876             :                         }
     877           0 :                         ret->object = *(struct security_ace_object *)pytalloc_get_ptr(in);
     878           0 :                         break;
     879             : 
     880           0 :                 case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT:
     881           0 :                         if (in == NULL) {
     882           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->object");
     883           0 :                                 talloc_free(ret); return NULL;
     884             :                         }
     885           0 :                         PY_CHECK_TYPE(&security_ace_object_Type, in, talloc_free(ret); return NULL;);
     886           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
     887           0 :                                 PyErr_NoMemory();
     888           0 :                                 talloc_free(ret); return NULL;
     889             :                         }
     890           0 :                         ret->object = *(struct security_ace_object *)pytalloc_get_ptr(in);
     891           0 :                         break;
     892             : 
     893           0 :                 default:
     894           0 :                         break;
     895             : 
     896             :         }
     897             : 
     898           0 :         return ret;
     899             : }
     900             : 
     901       84518 : static PyObject *py_security_ace_object_ctr_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     902             : {
     903       84518 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
     904       84518 :         PyObject *mem_ctx_obj = NULL;
     905       84518 :         TALLOC_CTX *mem_ctx = NULL;
     906       84518 :         int level = 0;
     907       84518 :         PyObject *in_obj = NULL;
     908       84518 :         union security_ace_object_ctr *in = NULL;
     909             : 
     910       84518 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
     911             :                 discard_const_p(char *, kwnames),
     912             :                 &mem_ctx_obj,
     913             :                 &level,
     914             :                 &in_obj)) {
     915           0 :                 return NULL;
     916             :         }
     917       84518 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
     918       84518 :         if (mem_ctx == NULL) {
     919           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
     920           0 :                 return NULL;
     921             :         }
     922       84518 :         in = (union security_ace_object_ctr *)pytalloc_get_ptr(in_obj);
     923       84518 :         if (in == NULL) {
     924           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union security_ace_object_ctr!");
     925           0 :                 return NULL;
     926             :         }
     927             : 
     928       84518 :         return py_import_security_ace_object_ctr(mem_ctx, level, in);
     929             : }
     930             : 
     931           0 : static PyObject *py_security_ace_object_ctr_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     932             : {
     933           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
     934           0 :         PyObject *mem_ctx_obj = NULL;
     935           0 :         TALLOC_CTX *mem_ctx = NULL;
     936           0 :         int level = 0;
     937           0 :         PyObject *in = NULL;
     938           0 :         union security_ace_object_ctr *out = NULL;
     939             : 
     940           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
     941             :                 discard_const_p(char *, kwnames),
     942             :                 &mem_ctx_obj,
     943             :                 &level,
     944             :                 &in)) {
     945           0 :                 return NULL;
     946             :         }
     947           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
     948           0 :         if (mem_ctx == NULL) {
     949           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
     950           0 :                 return NULL;
     951             :         }
     952             : 
     953           0 :         out = py_export_security_ace_object_ctr(mem_ctx, level, in);
     954           0 :         if (out == NULL) {
     955           0 :                 return NULL;
     956             :         }
     957             : 
     958           0 :         return pytalloc_GenericObject_reference(out);
     959             : }
     960             : 
     961             : static PyMethodDef py_security_ace_object_ctr_methods[] = {
     962             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_ctr_import),
     963             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
     964             :                 "T.__import__(mem_ctx, level, in) => ret." },
     965             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_object_ctr_export),
     966             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
     967             :                 "T.__export__(mem_ctx, level, in) => ret." },
     968             :         { NULL, NULL, 0, NULL }
     969             : };
     970             : 
     971           0 : static PyObject *py_security_ace_object_ctr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     972             : {
     973           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
     974           0 :         return NULL;
     975             : }
     976             : 
     977             : 
     978             : static PyTypeObject security_ace_object_ctr_Type = {
     979             :         PyVarObject_HEAD_INIT(NULL, 0)
     980             :         .tp_name = "security.ace_object_ctr",
     981             :         .tp_getset = NULL,
     982             :         .tp_methods = py_security_ace_object_ctr_methods,
     983             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     984             :         .tp_new = py_security_ace_object_ctr_new,
     985             : };
     986             : 
     987             : 
     988     4228361 : static PyObject *py_security_ace_get_type(PyObject *obj, void *closure)
     989             : {
     990     4228361 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(obj);
     991             :         PyObject *py_type;
     992     4228361 :         py_type = PyLong_FromLong((uint16_t)object->type);
     993     4228361 :         return py_type;
     994             : }
     995             : 
     996           0 : static int py_security_ace_set_type(PyObject *py_obj, PyObject *value, void *closure)
     997             : {
     998           0 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
     999           0 :         if (value == NULL) {
    1000           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    1001           0 :                 return -1;
    1002             :         }
    1003             :         {
    1004           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    1005           0 :                 if (PyLong_Check(value)) {
    1006             :                         unsigned long long test_var;
    1007           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1008           0 :                         if (PyErr_Occurred() != NULL) {
    1009           0 :                                 return -1;
    1010             :                         }
    1011           0 :                         if (test_var > uint_max) {
    1012           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1013             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1014           0 :                                 return -1;
    1015             :                         }
    1016           0 :                         object->type = test_var;
    1017             :                 } else {
    1018           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1019             :                           PyLong_Type.tp_name);
    1020           0 :                         return -1;
    1021             :                 }
    1022             :         }
    1023           0 :         return 0;
    1024             : }
    1025             : 
    1026     4019140 : static PyObject *py_security_ace_get_flags(PyObject *obj, void *closure)
    1027             : {
    1028     4019140 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(obj);
    1029             :         PyObject *py_flags;
    1030     4019140 :         py_flags = PyLong_FromLong((uint16_t)object->flags);
    1031     4019140 :         return py_flags;
    1032             : }
    1033             : 
    1034        3888 : static int py_security_ace_set_flags(PyObject *py_obj, PyObject *value, void *closure)
    1035             : {
    1036        3888 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
    1037        3888 :         if (value == NULL) {
    1038           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
    1039           0 :                 return -1;
    1040             :         }
    1041             :         {
    1042        3888 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
    1043        3888 :                 if (PyLong_Check(value)) {
    1044             :                         unsigned long long test_var;
    1045        3888 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1046        3888 :                         if (PyErr_Occurred() != NULL) {
    1047           0 :                                 return -1;
    1048             :                         }
    1049        3888 :                         if (test_var > uint_max) {
    1050           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1051             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1052           0 :                                 return -1;
    1053             :                         }
    1054        3888 :                         object->flags = test_var;
    1055             :                 } else {
    1056           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1057             :                           PyLong_Type.tp_name);
    1058           0 :                         return -1;
    1059             :                 }
    1060             :         }
    1061        3888 :         return 0;
    1062             : }
    1063             : 
    1064           0 : static PyObject *py_security_ace_get_size(PyObject *obj, void *closure)
    1065             : {
    1066           0 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(obj);
    1067             :         PyObject *py_size;
    1068           0 :         py_size = PyLong_FromLong((uint16_t)object->size);
    1069           0 :         return py_size;
    1070             : }
    1071             : 
    1072           0 : static int py_security_ace_set_size(PyObject *py_obj, PyObject *value, void *closure)
    1073             : {
    1074           0 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
    1075           0 :         if (value == NULL) {
    1076           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
    1077           0 :                 return -1;
    1078             :         }
    1079             :         {
    1080           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
    1081           0 :                 if (PyLong_Check(value)) {
    1082             :                         unsigned long long test_var;
    1083           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1084           0 :                         if (PyErr_Occurred() != NULL) {
    1085           0 :                                 return -1;
    1086             :                         }
    1087           0 :                         if (test_var > uint_max) {
    1088           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1089             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1090           0 :                                 return -1;
    1091             :                         }
    1092           0 :                         object->size = test_var;
    1093             :                 } else {
    1094           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1095             :                           PyLong_Type.tp_name);
    1096           0 :                         return -1;
    1097             :                 }
    1098             :         }
    1099           0 :         return 0;
    1100             : }
    1101             : 
    1102        3477 : static PyObject *py_security_ace_get_access_mask(PyObject *obj, void *closure)
    1103             : {
    1104        3477 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(obj);
    1105             :         PyObject *py_access_mask;
    1106        3477 :         py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->access_mask);
    1107        3477 :         return py_access_mask;
    1108             : }
    1109             : 
    1110        3477 : static int py_security_ace_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
    1111             : {
    1112        3477 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
    1113        3477 :         if (value == NULL) {
    1114           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->access_mask");
    1115           0 :                 return -1;
    1116             :         }
    1117             :         {
    1118        3477 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->access_mask));
    1119        3477 :                 if (PyLong_Check(value)) {
    1120             :                         unsigned long long test_var;
    1121        3477 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1122        3477 :                         if (PyErr_Occurred() != NULL) {
    1123           0 :                                 return -1;
    1124             :                         }
    1125        3477 :                         if (test_var > uint_max) {
    1126           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1127             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1128           0 :                                 return -1;
    1129             :                         }
    1130        3477 :                         object->access_mask = test_var;
    1131             :                 } else {
    1132           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1133             :                           PyLong_Type.tp_name);
    1134           0 :                         return -1;
    1135             :                 }
    1136             :         }
    1137        3477 :         return 0;
    1138             : }
    1139             : 
    1140       84518 : static PyObject *py_security_ace_get_object(PyObject *obj, void *closure)
    1141             : {
    1142       84518 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(obj);
    1143             :         PyObject *py_object;
    1144       84518 :         py_object = pyrpc_import_union(&security_ace_object_ctr_Type, pytalloc_get_mem_ctx(obj), object->type, &object->object, "union security_ace_object_ctr");
    1145       84518 :         if (py_object == NULL) {
    1146           0 :                 return NULL;
    1147             :         }
    1148       84518 :         return py_object;
    1149             : }
    1150             : 
    1151           0 : static int py_security_ace_set_object(PyObject *py_obj, PyObject *value, void *closure)
    1152             : {
    1153           0 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
    1154           0 :         if (value == NULL) {
    1155           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->object");
    1156           0 :                 return -1;
    1157             :         }
    1158             :         {
    1159             :                 union security_ace_object_ctr *object_switch_0;
    1160           0 :                 object_switch_0 = (union security_ace_object_ctr *)pyrpc_export_union(&security_ace_object_ctr_Type, pytalloc_get_mem_ctx(py_obj), object->type, value, "union security_ace_object_ctr");
    1161           0 :                 if (object_switch_0 == NULL) {
    1162           0 :                         return -1;
    1163             :                 }
    1164           0 :                 object->object = *object_switch_0;
    1165             :         }
    1166           0 :         return 0;
    1167             : }
    1168             : 
    1169        7551 : static PyObject *py_security_ace_get_trustee(PyObject *obj, void *closure)
    1170             : {
    1171        7551 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(obj);
    1172             :         PyObject *py_trustee;
    1173        7551 :         py_trustee = pytalloc_reference_ex(&dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->trustee);
    1174        7551 :         return py_trustee;
    1175             : }
    1176             : 
    1177          72 : static int py_security_ace_set_trustee(PyObject *py_obj, PyObject *value, void *closure)
    1178             : {
    1179          72 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
    1180          72 :         if (value == NULL) {
    1181           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trustee");
    1182           0 :                 return -1;
    1183             :         }
    1184          72 :         PY_CHECK_TYPE(&dom_sid_Type, value, return -1;);
    1185          72 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1186           0 :                 PyErr_NoMemory();
    1187           0 :                 return -1;
    1188             :         }
    1189          72 :         object->trustee = *(struct dom_sid *)pytalloc_get_ptr(value);
    1190          72 :         return 0;
    1191             : }
    1192             : 
    1193             : static PyGetSetDef py_security_ace_getsetters[] = {
    1194             :         {
    1195             :                 .name = discard_const_p(char, "type"),
    1196             :                 .get = py_security_ace_get_type,
    1197             :                 .set = py_security_ace_set_type,
    1198             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_type")
    1199             :         },
    1200             :         {
    1201             :                 .name = discard_const_p(char, "flags"),
    1202             :                 .get = py_security_ace_get_flags,
    1203             :                 .set = py_security_ace_set_flags,
    1204             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_flags")
    1205             :         },
    1206             :         {
    1207             :                 .name = discard_const_p(char, "size"),
    1208             :                 .get = py_security_ace_get_size,
    1209             :                 .set = py_security_ace_set_size,
    1210             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1211             :         },
    1212             :         {
    1213             :                 .name = discard_const_p(char, "access_mask"),
    1214             :                 .get = py_security_ace_get_access_mask,
    1215             :                 .set = py_security_ace_set_access_mask,
    1216             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1217             :         },
    1218             :         {
    1219             :                 .name = discard_const_p(char, "object"),
    1220             :                 .get = py_security_ace_get_object,
    1221             :                 .set = py_security_ace_set_object,
    1222             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_ace_object_ctr")
    1223             :         },
    1224             :         {
    1225             :                 .name = discard_const_p(char, "trustee"),
    1226             :                 .get = py_security_ace_get_trustee,
    1227             :                 .set = py_security_ace_set_trustee,
    1228             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    1229             :         },
    1230             :         { .name = NULL }
    1231             : };
    1232             : 
    1233           0 : static PyObject *py_security_ace_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1234             : {
    1235           0 :         return pytalloc_new(struct security_ace, type);
    1236             : }
    1237             : 
    1238           0 : static PyObject *py_security_ace_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1239             : {
    1240           0 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
    1241           0 :         PyObject *ret = NULL;
    1242             :         DATA_BLOB blob;
    1243             :         enum ndr_err_code err;
    1244           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1245           0 :         if (tmp_ctx == NULL) {
    1246           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1247           0 :                 return NULL;
    1248             :         }
    1249           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_ace);
    1250           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1251           0 :                 TALLOC_FREE(tmp_ctx);
    1252           0 :                 PyErr_SetNdrError(err);
    1253           0 :                 return NULL;
    1254             :         }
    1255             : 
    1256           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1257           0 :         TALLOC_FREE(tmp_ctx);
    1258           0 :         return ret;
    1259             : }
    1260             : 
    1261           0 : static PyObject *py_security_ace_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1262             : {
    1263           0 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
    1264           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1265           0 :         Py_ssize_t blob_length = 0;
    1266             :         enum ndr_err_code err;
    1267           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1268           0 :         PyObject *allow_remaining_obj = NULL;
    1269           0 :         bool allow_remaining = false;
    1270             : 
    1271           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1272             :                 discard_const_p(char *, kwnames),
    1273             :                 &blob.data, &blob_length,
    1274             :                 &allow_remaining_obj)) {
    1275           0 :                 return NULL;
    1276             :         }
    1277           0 :         blob.length = blob_length;
    1278             : 
    1279           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1280           0 :                 allow_remaining = true;
    1281             :         }
    1282             : 
    1283           0 :         if (allow_remaining) {
    1284           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_ace);
    1285             :         } else {
    1286           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_ace);
    1287             :         }
    1288           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1289           0 :                 PyErr_SetNdrError(err);
    1290           0 :                 return NULL;
    1291             :         }
    1292             : 
    1293           0 :         Py_RETURN_NONE;
    1294             : }
    1295             : 
    1296           0 : static PyObject *py_security_ace_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1297             : {
    1298           0 :         struct security_ace *object = (struct security_ace *)pytalloc_get_ptr(py_obj);
    1299             :         PyObject *ret;
    1300             :         char *retstr;
    1301             : 
    1302           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_ace, "security_ace", object);
    1303           0 :         ret = PyUnicode_FromString(retstr);
    1304           0 :         talloc_free(retstr);
    1305             : 
    1306           0 :         return ret;
    1307             : }
    1308             : 
    1309             : static PyMethodDef py_security_ace_methods[] = {
    1310             :         { "__ndr_pack__", (PyCFunction)py_security_ace_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1311             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_ace_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1312             :         { "__ndr_print__", (PyCFunction)py_security_ace_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1313             :         { NULL, NULL, 0, NULL }
    1314             : };
    1315             : 
    1316             : 
    1317             : static PyTypeObject security_ace_Type = {
    1318             :         PyVarObject_HEAD_INIT(NULL, 0)
    1319             :         .tp_name = "security.ace",
    1320             :         .tp_getset = py_security_ace_getsetters,
    1321             :         .tp_methods = py_security_ace_methods,
    1322             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1323             :         .tp_new = py_security_ace_new,
    1324             : };
    1325             : 
    1326             : 
    1327           0 : static PyObject *py_security_acl_get_revision(PyObject *obj, void *closure)
    1328             : {
    1329           0 :         struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(obj);
    1330             :         PyObject *py_revision;
    1331           0 :         py_revision = PyLong_FromLong((uint16_t)object->revision);
    1332           0 :         return py_revision;
    1333             : }
    1334             : 
    1335           0 : static int py_security_acl_set_revision(PyObject *py_obj, PyObject *value, void *closure)
    1336             : {
    1337           0 :         struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
    1338           0 :         if (value == NULL) {
    1339           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->revision");
    1340           0 :                 return -1;
    1341             :         }
    1342             :         {
    1343           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->revision));
    1344           0 :                 if (PyLong_Check(value)) {
    1345             :                         unsigned long long test_var;
    1346           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1347           0 :                         if (PyErr_Occurred() != NULL) {
    1348           0 :                                 return -1;
    1349             :                         }
    1350           0 :                         if (test_var > uint_max) {
    1351           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1352             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1353           0 :                                 return -1;
    1354             :                         }
    1355           0 :                         object->revision = test_var;
    1356             :                 } else {
    1357           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1358             :                           PyLong_Type.tp_name);
    1359           0 :                         return -1;
    1360             :                 }
    1361             :         }
    1362           0 :         return 0;
    1363             : }
    1364             : 
    1365           0 : static PyObject *py_security_acl_get_size(PyObject *obj, void *closure)
    1366             : {
    1367           0 :         struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(obj);
    1368             :         PyObject *py_size;
    1369           0 :         py_size = PyLong_FromLong((uint16_t)object->size);
    1370           0 :         return py_size;
    1371             : }
    1372             : 
    1373           0 : static int py_security_acl_set_size(PyObject *py_obj, PyObject *value, void *closure)
    1374             : {
    1375           0 :         struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
    1376           0 :         if (value == NULL) {
    1377           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
    1378           0 :                 return -1;
    1379             :         }
    1380             :         {
    1381           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
    1382           0 :                 if (PyLong_Check(value)) {
    1383             :                         unsigned long long test_var;
    1384           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1385           0 :                         if (PyErr_Occurred() != NULL) {
    1386           0 :                                 return -1;
    1387             :                         }
    1388           0 :                         if (test_var > uint_max) {
    1389           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1390             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1391           0 :                                 return -1;
    1392             :                         }
    1393           0 :                         object->size = test_var;
    1394             :                 } else {
    1395           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1396             :                           PyLong_Type.tp_name);
    1397           0 :                         return -1;
    1398             :                 }
    1399             :         }
    1400           0 :         return 0;
    1401             : }
    1402             : 
    1403           0 : static PyObject *py_security_acl_get_num_aces(PyObject *obj, void *closure)
    1404             : {
    1405           0 :         struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(obj);
    1406             :         PyObject *py_num_aces;
    1407           0 :         py_num_aces = PyLong_FromUnsignedLongLong((uint32_t)object->num_aces);
    1408           0 :         return py_num_aces;
    1409             : }
    1410             : 
    1411           0 : static int py_security_acl_set_num_aces(PyObject *py_obj, PyObject *value, void *closure)
    1412             : {
    1413           0 :         struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
    1414           0 :         if (value == NULL) {
    1415           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_aces");
    1416           0 :                 return -1;
    1417             :         }
    1418             :         {
    1419           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_aces));
    1420           0 :                 if (PyLong_Check(value)) {
    1421             :                         unsigned long long test_var;
    1422           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1423           0 :                         if (PyErr_Occurred() != NULL) {
    1424           0 :                                 return -1;
    1425             :                         }
    1426           0 :                         if (test_var > uint_max) {
    1427           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1428             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1429           0 :                                 return -1;
    1430             :                         }
    1431           0 :                         object->num_aces = test_var;
    1432             :                 } else {
    1433           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1434             :                           PyLong_Type.tp_name);
    1435           0 :                         return -1;
    1436             :                 }
    1437             :         }
    1438           0 :         return 0;
    1439             : }
    1440             : 
    1441      522374 : static PyObject *py_security_acl_get_aces(PyObject *obj, void *closure)
    1442             : {
    1443      522374 :         struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(obj);
    1444             :         PyObject *py_aces;
    1445      522374 :         py_aces = PyList_New(object->num_aces);
    1446      522374 :         if (py_aces == NULL) {
    1447           0 :                 return NULL;
    1448             :         }
    1449             :         {
    1450             :                 int aces_cntr_0;
    1451     2817603 :                 for (aces_cntr_0 = 0; aces_cntr_0 < (object->num_aces); aces_cntr_0++) {
    1452             :                         PyObject *py_aces_0;
    1453     2385076 :                         py_aces_0 = pytalloc_reference_ex(&security_ace_Type, object->aces, &object->aces[aces_cntr_0]);
    1454     2385076 :                         PyList_SetItem(py_aces, aces_cntr_0, py_aces_0);
    1455             :                 }
    1456             :         }
    1457      432527 :         return py_aces;
    1458             : }
    1459             : 
    1460           0 : static int py_security_acl_set_aces(PyObject *py_obj, PyObject *value, void *closure)
    1461             : {
    1462           0 :         struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
    1463           0 :         if (value == NULL) {
    1464           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->aces");
    1465           0 :                 return -1;
    1466             :         }
    1467           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1468             :         {
    1469             :                 int aces_cntr_0;
    1470           0 :                 object->aces = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->aces, PyList_GET_SIZE(value));
    1471           0 :                 if (!object->aces) { return -1;; }
    1472           0 :                 talloc_set_name_const(object->aces, "ARRAY: object->aces");
    1473           0 :                 for (aces_cntr_0 = 0; aces_cntr_0 < PyList_GET_SIZE(value); aces_cntr_0++) {
    1474           0 :                         if (PyList_GET_ITEM(value, aces_cntr_0) == NULL) {
    1475           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->aces[aces_cntr_0]");
    1476           0 :                                 return -1;
    1477             :                         }
    1478           0 :                         PY_CHECK_TYPE(&security_ace_Type, PyList_GET_ITEM(value, aces_cntr_0), return -1;);
    1479           0 :                         if (talloc_reference(object->aces, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, aces_cntr_0))) == NULL) {
    1480           0 :                                 PyErr_NoMemory();
    1481           0 :                                 return -1;
    1482             :                         }
    1483           0 :                         object->aces[aces_cntr_0] = *(struct security_ace *)pytalloc_get_ptr(PyList_GET_ITEM(value, aces_cntr_0));
    1484             :                 }
    1485             :         }
    1486           0 :         return 0;
    1487             : }
    1488             : 
    1489             : static PyGetSetDef py_security_acl_getsetters[] = {
    1490             :         {
    1491             :                 .name = discard_const_p(char, "revision"),
    1492             :                 .get = py_security_acl_get_revision,
    1493             :                 .set = py_security_acl_set_revision,
    1494             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_acl_revision")
    1495             :         },
    1496             :         {
    1497             :                 .name = discard_const_p(char, "size"),
    1498             :                 .get = py_security_acl_get_size,
    1499             :                 .set = py_security_acl_set_size,
    1500             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1501             :         },
    1502             :         {
    1503             :                 .name = discard_const_p(char, "num_aces"),
    1504             :                 .get = py_security_acl_get_num_aces,
    1505             :                 .set = py_security_acl_set_num_aces,
    1506             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1507             :         },
    1508             :         {
    1509             :                 .name = discard_const_p(char, "aces"),
    1510             :                 .get = py_security_acl_get_aces,
    1511             :                 .set = py_security_acl_set_aces,
    1512             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_ace")
    1513             :         },
    1514             :         { .name = NULL }
    1515             : };
    1516             : 
    1517           0 : static PyObject *py_security_acl_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1518             : {
    1519           0 :         return pytalloc_new(struct security_acl, type);
    1520             : }
    1521             : 
    1522           0 : static PyObject *py_security_acl_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1523             : {
    1524           0 :         struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
    1525           0 :         PyObject *ret = NULL;
    1526             :         DATA_BLOB blob;
    1527             :         enum ndr_err_code err;
    1528           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1529           0 :         if (tmp_ctx == NULL) {
    1530           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1531           0 :                 return NULL;
    1532             :         }
    1533           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_acl);
    1534           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1535           0 :                 TALLOC_FREE(tmp_ctx);
    1536           0 :                 PyErr_SetNdrError(err);
    1537           0 :                 return NULL;
    1538             :         }
    1539             : 
    1540           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1541           0 :         TALLOC_FREE(tmp_ctx);
    1542           0 :         return ret;
    1543             : }
    1544             : 
    1545           0 : static PyObject *py_security_acl_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1546             : {
    1547           0 :         struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
    1548           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1549           0 :         Py_ssize_t blob_length = 0;
    1550             :         enum ndr_err_code err;
    1551           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1552           0 :         PyObject *allow_remaining_obj = NULL;
    1553           0 :         bool allow_remaining = false;
    1554             : 
    1555           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1556             :                 discard_const_p(char *, kwnames),
    1557             :                 &blob.data, &blob_length,
    1558             :                 &allow_remaining_obj)) {
    1559           0 :                 return NULL;
    1560             :         }
    1561           0 :         blob.length = blob_length;
    1562             : 
    1563           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1564           0 :                 allow_remaining = true;
    1565             :         }
    1566             : 
    1567           0 :         if (allow_remaining) {
    1568           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_acl);
    1569             :         } else {
    1570           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_acl);
    1571             :         }
    1572           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1573           0 :                 PyErr_SetNdrError(err);
    1574           0 :                 return NULL;
    1575             :         }
    1576             : 
    1577           0 :         Py_RETURN_NONE;
    1578             : }
    1579             : 
    1580           0 : static PyObject *py_security_acl_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1581             : {
    1582           0 :         struct security_acl *object = (struct security_acl *)pytalloc_get_ptr(py_obj);
    1583             :         PyObject *ret;
    1584             :         char *retstr;
    1585             : 
    1586           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_acl, "security_acl", object);
    1587           0 :         ret = PyUnicode_FromString(retstr);
    1588           0 :         talloc_free(retstr);
    1589             : 
    1590           0 :         return ret;
    1591             : }
    1592             : 
    1593             : static PyMethodDef py_security_acl_methods[] = {
    1594             :         { "__ndr_pack__", (PyCFunction)py_security_acl_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1595             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_acl_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1596             :         { "__ndr_print__", (PyCFunction)py_security_acl_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1597             :         { NULL, NULL, 0, NULL }
    1598             : };
    1599             : 
    1600             : 
    1601             : static PyTypeObject security_acl_Type = {
    1602             :         PyVarObject_HEAD_INIT(NULL, 0)
    1603             :         .tp_name = "security.acl",
    1604             :         .tp_getset = py_security_acl_getsetters,
    1605             :         .tp_methods = py_security_acl_methods,
    1606             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1607             :         .tp_new = py_security_acl_new,
    1608             : };
    1609             : 
    1610             : 
    1611      337485 : static PyObject *py_security_descriptor_get_revision(PyObject *obj, void *closure)
    1612             : {
    1613      337485 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(obj);
    1614             :         PyObject *py_revision;
    1615      337485 :         py_revision = PyLong_FromLong((uint16_t)object->revision);
    1616      337485 :         return py_revision;
    1617             : }
    1618             : 
    1619      337484 : static int py_security_descriptor_set_revision(PyObject *py_obj, PyObject *value, void *closure)
    1620             : {
    1621      337484 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
    1622      337484 :         if (value == NULL) {
    1623           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->revision");
    1624           0 :                 return -1;
    1625             :         }
    1626             :         {
    1627      337484 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->revision));
    1628      337484 :                 if (PyLong_Check(value)) {
    1629             :                         unsigned long long test_var;
    1630      337484 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1631      337484 :                         if (PyErr_Occurred() != NULL) {
    1632           0 :                                 return -1;
    1633             :                         }
    1634      337484 :                         if (test_var > uint_max) {
    1635           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1636             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1637           0 :                                 return -1;
    1638             :                         }
    1639      337484 :                         object->revision = test_var;
    1640             :                 } else {
    1641           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1642             :                           PyLong_Type.tp_name);
    1643           0 :                         return -1;
    1644             :                 }
    1645             :         }
    1646      337484 :         return 0;
    1647             : }
    1648             : 
    1649      337497 : static PyObject *py_security_descriptor_get_type(PyObject *obj, void *closure)
    1650             : {
    1651      337497 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(obj);
    1652             :         PyObject *py_type;
    1653      337497 :         py_type = PyLong_FromLong((uint16_t)object->type);
    1654      337497 :         return py_type;
    1655             : }
    1656             : 
    1657      337492 : static int py_security_descriptor_set_type(PyObject *py_obj, PyObject *value, void *closure)
    1658             : {
    1659      337492 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
    1660      337492 :         if (value == NULL) {
    1661           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    1662           0 :                 return -1;
    1663             :         }
    1664             :         {
    1665      337492 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    1666      337492 :                 if (PyLong_Check(value)) {
    1667             :                         unsigned long long test_var;
    1668      337492 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1669      337492 :                         if (PyErr_Occurred() != NULL) {
    1670           0 :                                 return -1;
    1671             :                         }
    1672      337492 :                         if (test_var > uint_max) {
    1673           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1674             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1675           0 :                                 return -1;
    1676             :                         }
    1677      337492 :                         object->type = test_var;
    1678             :                 } else {
    1679           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1680             :                           PyLong_Type.tp_name);
    1681           0 :                         return -1;
    1682             :                 }
    1683             :         }
    1684      337492 :         return 0;
    1685             : }
    1686             : 
    1687      702453 : static PyObject *py_security_descriptor_get_owner_sid(PyObject *obj, void *closure)
    1688             : {
    1689      702453 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(obj);
    1690             :         PyObject *py_owner_sid;
    1691      702453 :         if (object->owner_sid == NULL) {
    1692         336 :                 Py_RETURN_NONE;
    1693             :         }
    1694      585455 :         if (object->owner_sid == NULL) {
    1695           0 :                 py_owner_sid = Py_None;
    1696           0 :                 Py_INCREF(py_owner_sid);
    1697             :         } else {
    1698      702117 :                 py_owner_sid = pytalloc_reference_ex(&dom_sid_Type, object->owner_sid, object->owner_sid);
    1699             :         }
    1700      702117 :         return py_owner_sid;
    1701             : }
    1702             : 
    1703      337541 : static int py_security_descriptor_set_owner_sid(PyObject *py_obj, PyObject *value, void *closure)
    1704             : {
    1705      337541 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
    1706      337541 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->owner_sid));
    1707      337541 :         if (value == NULL) {
    1708           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->owner_sid");
    1709           0 :                 return -1;
    1710             :         }
    1711      337541 :         if (value == Py_None) {
    1712         274 :                 object->owner_sid = NULL;
    1713             :         } else {
    1714      337267 :                 object->owner_sid = NULL;
    1715      337267 :                 PY_CHECK_TYPE(&dom_sid_Type, value, return -1;);
    1716      337267 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1717           0 :                         PyErr_NoMemory();
    1718           0 :                         return -1;
    1719             :                 }
    1720      337267 :                 object->owner_sid = (struct dom_sid *)pytalloc_get_ptr(value);
    1721             :         }
    1722      278960 :         return 0;
    1723             : }
    1724             : 
    1725      701115 : static PyObject *py_security_descriptor_get_group_sid(PyObject *obj, void *closure)
    1726             : {
    1727      701115 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(obj);
    1728             :         PyObject *py_group_sid;
    1729      701115 :         if (object->group_sid == NULL) {
    1730         336 :                 Py_RETURN_NONE;
    1731             :         }
    1732      584222 :         if (object->group_sid == NULL) {
    1733           0 :                 py_group_sid = Py_None;
    1734           0 :                 Py_INCREF(py_group_sid);
    1735             :         } else {
    1736      700779 :                 py_group_sid = pytalloc_reference_ex(&dom_sid_Type, object->group_sid, object->group_sid);
    1737             :         }
    1738      700779 :         return py_group_sid;
    1739             : }
    1740             : 
    1741      337541 : static int py_security_descriptor_set_group_sid(PyObject *py_obj, PyObject *value, void *closure)
    1742             : {
    1743      337541 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
    1744      337541 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->group_sid));
    1745      337541 :         if (value == NULL) {
    1746           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->group_sid");
    1747           0 :                 return -1;
    1748             :         }
    1749      337541 :         if (value == Py_None) {
    1750         274 :                 object->group_sid = NULL;
    1751             :         } else {
    1752      337267 :                 object->group_sid = NULL;
    1753      337267 :                 PY_CHECK_TYPE(&dom_sid_Type, value, return -1;);
    1754      337267 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1755           0 :                         PyErr_NoMemory();
    1756           0 :                         return -1;
    1757             :                 }
    1758      337267 :                 object->group_sid = (struct dom_sid *)pytalloc_get_ptr(value);
    1759             :         }
    1760      278960 :         return 0;
    1761             : }
    1762             : 
    1763      521818 : static PyObject *py_security_descriptor_get_sacl(PyObject *obj, void *closure)
    1764             : {
    1765      521818 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(obj);
    1766             :         PyObject *py_sacl;
    1767      521818 :         if (object->sacl == NULL) {
    1768      152196 :                 Py_RETURN_NONE;
    1769             :         }
    1770      307090 :         if (object->sacl == NULL) {
    1771           0 :                 py_sacl = Py_None;
    1772           0 :                 Py_INCREF(py_sacl);
    1773             :         } else {
    1774      369622 :                 py_sacl = pytalloc_reference_ex(&security_acl_Type, object->sacl, object->sacl);
    1775             :         }
    1776      369622 :         return py_sacl;
    1777             : }
    1778             : 
    1779           0 : static int py_security_descriptor_set_sacl(PyObject *py_obj, PyObject *value, void *closure)
    1780             : {
    1781           0 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
    1782           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sacl));
    1783           0 :         if (value == NULL) {
    1784           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sacl");
    1785           0 :                 return -1;
    1786             :         }
    1787           0 :         if (value == Py_None) {
    1788           0 :                 object->sacl = NULL;
    1789             :         } else {
    1790           0 :                 object->sacl = NULL;
    1791           0 :                 PY_CHECK_TYPE(&security_acl_Type, value, return -1;);
    1792           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1793           0 :                         PyErr_NoMemory();
    1794           0 :                         return -1;
    1795             :                 }
    1796           0 :                 object->sacl = (struct security_acl *)pytalloc_get_ptr(value);
    1797             :         }
    1798           0 :         return 0;
    1799             : }
    1800             : 
    1801      674565 : static PyObject *py_security_descriptor_get_dacl(PyObject *obj, void *closure)
    1802             : {
    1803      674565 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(obj);
    1804             :         PyObject *py_dacl;
    1805      674565 :         if (object->dacl == NULL) {
    1806           0 :                 Py_RETURN_NONE;
    1807             :         }
    1808      557441 :         if (object->dacl == NULL) {
    1809           0 :                 py_dacl = Py_None;
    1810           0 :                 Py_INCREF(py_dacl);
    1811             :         } else {
    1812      674565 :                 py_dacl = pytalloc_reference_ex(&security_acl_Type, object->dacl, object->dacl);
    1813             :         }
    1814      674565 :         return py_dacl;
    1815             : }
    1816             : 
    1817           0 : static int py_security_descriptor_set_dacl(PyObject *py_obj, PyObject *value, void *closure)
    1818             : {
    1819           0 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
    1820           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->dacl));
    1821           0 :         if (value == NULL) {
    1822           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dacl");
    1823           0 :                 return -1;
    1824             :         }
    1825           0 :         if (value == Py_None) {
    1826           0 :                 object->dacl = NULL;
    1827             :         } else {
    1828           0 :                 object->dacl = NULL;
    1829           0 :                 PY_CHECK_TYPE(&security_acl_Type, value, return -1;);
    1830           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1831           0 :                         PyErr_NoMemory();
    1832           0 :                         return -1;
    1833             :                 }
    1834           0 :                 object->dacl = (struct security_acl *)pytalloc_get_ptr(value);
    1835             :         }
    1836           0 :         return 0;
    1837             : }
    1838             : 
    1839             : static PyGetSetDef py_security_descriptor_getsetters[] = {
    1840             :         {
    1841             :                 .name = discard_const_p(char, "revision"),
    1842             :                 .get = py_security_descriptor_get_revision,
    1843             :                 .set = py_security_descriptor_set_revision,
    1844             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor_revision")
    1845             :         },
    1846             :         {
    1847             :                 .name = discard_const_p(char, "type"),
    1848             :                 .get = py_security_descriptor_get_type,
    1849             :                 .set = py_security_descriptor_set_type,
    1850             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor_type")
    1851             :         },
    1852             :         {
    1853             :                 .name = discard_const_p(char, "owner_sid"),
    1854             :                 .get = py_security_descriptor_get_owner_sid,
    1855             :                 .set = py_security_descriptor_set_owner_sid,
    1856             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    1857             :         },
    1858             :         {
    1859             :                 .name = discard_const_p(char, "group_sid"),
    1860             :                 .get = py_security_descriptor_get_group_sid,
    1861             :                 .set = py_security_descriptor_set_group_sid,
    1862             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    1863             :         },
    1864             :         {
    1865             :                 .name = discard_const_p(char, "sacl"),
    1866             :                 .get = py_security_descriptor_get_sacl,
    1867             :                 .set = py_security_descriptor_set_sacl,
    1868             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_acl")
    1869             :         },
    1870             :         {
    1871             :                 .name = discard_const_p(char, "dacl"),
    1872             :                 .get = py_security_descriptor_get_dacl,
    1873             :                 .set = py_security_descriptor_set_dacl,
    1874             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_acl")
    1875             :         },
    1876             :         { .name = NULL }
    1877             : };
    1878             : 
    1879           0 : static PyObject *py_security_descriptor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1880             : {
    1881           0 :         return pytalloc_new(struct security_descriptor, type);
    1882             : }
    1883             : 
    1884       28161 : static PyObject *py_security_descriptor_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1885             : {
    1886       28161 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
    1887       28161 :         PyObject *ret = NULL;
    1888             :         DATA_BLOB blob;
    1889             :         enum ndr_err_code err;
    1890       28161 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1891       28161 :         if (tmp_ctx == NULL) {
    1892           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1893           0 :                 return NULL;
    1894             :         }
    1895       28161 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_descriptor);
    1896       28161 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1897           0 :                 TALLOC_FREE(tmp_ctx);
    1898           0 :                 PyErr_SetNdrError(err);
    1899           0 :                 return NULL;
    1900             :         }
    1901             : 
    1902       28161 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1903       28161 :         TALLOC_FREE(tmp_ctx);
    1904       28161 :         return ret;
    1905             : }
    1906             : 
    1907      438068 : static PyObject *py_security_descriptor_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1908             : {
    1909      438068 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
    1910      438068 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1911      438068 :         Py_ssize_t blob_length = 0;
    1912             :         enum ndr_err_code err;
    1913      438068 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1914      438068 :         PyObject *allow_remaining_obj = NULL;
    1915      438068 :         bool allow_remaining = false;
    1916             : 
    1917      438068 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1918             :                 discard_const_p(char *, kwnames),
    1919             :                 &blob.data, &blob_length,
    1920             :                 &allow_remaining_obj)) {
    1921           0 :                 return NULL;
    1922             :         }
    1923      438068 :         blob.length = blob_length;
    1924             : 
    1925      438068 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1926           2 :                 allow_remaining = true;
    1927             :         }
    1928             : 
    1929      379422 :         if (allow_remaining) {
    1930           2 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
    1931             :         } else {
    1932      438066 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
    1933             :         }
    1934      438068 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1935           0 :                 PyErr_SetNdrError(err);
    1936           0 :                 return NULL;
    1937             :         }
    1938             : 
    1939      438068 :         Py_RETURN_NONE;
    1940             : }
    1941             : 
    1942           0 : static PyObject *py_security_descriptor_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1943             : {
    1944           0 :         struct security_descriptor *object = (struct security_descriptor *)pytalloc_get_ptr(py_obj);
    1945             :         PyObject *ret;
    1946             :         char *retstr;
    1947             : 
    1948           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_descriptor, "security_descriptor", object);
    1949           0 :         ret = PyUnicode_FromString(retstr);
    1950           0 :         talloc_free(retstr);
    1951             : 
    1952           0 :         return ret;
    1953             : }
    1954             : 
    1955             : static PyMethodDef py_security_descriptor_methods[] = {
    1956             :         { "__ndr_pack__", (PyCFunction)py_security_descriptor_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1957             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_descriptor_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1958             :         { "__ndr_print__", (PyCFunction)py_security_descriptor_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1959             :         { NULL, NULL, 0, NULL }
    1960             : };
    1961             : 
    1962             : 
    1963             : static PyTypeObject security_descriptor_Type = {
    1964             :         PyVarObject_HEAD_INIT(NULL, 0)
    1965             :         .tp_name = "security.descriptor",
    1966             :         .tp_getset = py_security_descriptor_getsetters,
    1967             :         .tp_methods = py_security_descriptor_methods,
    1968             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1969             :         .tp_new = py_security_descriptor_new,
    1970             : };
    1971             : 
    1972             : 
    1973           0 : static PyObject *py_sec_desc_buf_get_sd_size(PyObject *obj, void *closure)
    1974             : {
    1975           0 :         struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(obj);
    1976             :         PyObject *py_sd_size;
    1977           0 :         py_sd_size = PyLong_FromUnsignedLongLong((uint32_t)object->sd_size);
    1978           0 :         return py_sd_size;
    1979             : }
    1980             : 
    1981           0 : static int py_sec_desc_buf_set_sd_size(PyObject *py_obj, PyObject *value, void *closure)
    1982             : {
    1983           0 :         struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(py_obj);
    1984           0 :         if (value == NULL) {
    1985           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sd_size");
    1986           0 :                 return -1;
    1987             :         }
    1988             :         {
    1989           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sd_size));
    1990           0 :                 if (PyLong_Check(value)) {
    1991             :                         unsigned long long test_var;
    1992           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1993           0 :                         if (PyErr_Occurred() != NULL) {
    1994           0 :                                 return -1;
    1995             :                         }
    1996           0 :                         if (test_var > uint_max) {
    1997           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1998             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1999           0 :                                 return -1;
    2000             :                         }
    2001           0 :                         object->sd_size = test_var;
    2002             :                 } else {
    2003           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2004             :                           PyLong_Type.tp_name);
    2005           0 :                         return -1;
    2006             :                 }
    2007             :         }
    2008           0 :         return 0;
    2009             : }
    2010             : 
    2011           0 : static PyObject *py_sec_desc_buf_get_sd(PyObject *obj, void *closure)
    2012             : {
    2013           0 :         struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(obj);
    2014             :         PyObject *py_sd;
    2015           0 :         if (object->sd == NULL) {
    2016           0 :                 Py_RETURN_NONE;
    2017             :         }
    2018           0 :         if (object->sd == NULL) {
    2019           0 :                 py_sd = Py_None;
    2020           0 :                 Py_INCREF(py_sd);
    2021             :         } else {
    2022           0 :                 py_sd = pytalloc_reference_ex(&security_descriptor_Type, object->sd, object->sd);
    2023             :         }
    2024           0 :         return py_sd;
    2025             : }
    2026             : 
    2027           0 : static int py_sec_desc_buf_set_sd(PyObject *py_obj, PyObject *value, void *closure)
    2028             : {
    2029           0 :         struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(py_obj);
    2030           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sd));
    2031           0 :         if (value == NULL) {
    2032           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sd");
    2033           0 :                 return -1;
    2034             :         }
    2035           0 :         if (value == Py_None) {
    2036           0 :                 object->sd = NULL;
    2037             :         } else {
    2038           0 :                 object->sd = NULL;
    2039           0 :                 PY_CHECK_TYPE(&security_descriptor_Type, value, return -1;);
    2040           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2041           0 :                         PyErr_NoMemory();
    2042           0 :                         return -1;
    2043             :                 }
    2044           0 :                 object->sd = (struct security_descriptor *)pytalloc_get_ptr(value);
    2045             :         }
    2046           0 :         return 0;
    2047             : }
    2048             : 
    2049             : static PyGetSetDef py_sec_desc_buf_getsetters[] = {
    2050             :         {
    2051             :                 .name = discard_const_p(char, "sd_size"),
    2052             :                 .get = py_sec_desc_buf_get_sd_size,
    2053             :                 .set = py_sec_desc_buf_set_sd_size,
    2054             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2055             :         },
    2056             :         {
    2057             :                 .name = discard_const_p(char, "sd"),
    2058             :                 .get = py_sec_desc_buf_get_sd,
    2059             :                 .set = py_sec_desc_buf_set_sd,
    2060             :                 .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor")
    2061             :         },
    2062             :         { .name = NULL }
    2063             : };
    2064             : 
    2065           0 : static PyObject *py_sec_desc_buf_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2066             : {
    2067           0 :         return pytalloc_new(struct sec_desc_buf, type);
    2068             : }
    2069             : 
    2070           0 : static PyObject *py_sec_desc_buf_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2071             : {
    2072           0 :         struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(py_obj);
    2073           0 :         PyObject *ret = NULL;
    2074             :         DATA_BLOB blob;
    2075             :         enum ndr_err_code err;
    2076           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2077           0 :         if (tmp_ctx == NULL) {
    2078           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2079           0 :                 return NULL;
    2080             :         }
    2081           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_sec_desc_buf);
    2082           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2083           0 :                 TALLOC_FREE(tmp_ctx);
    2084           0 :                 PyErr_SetNdrError(err);
    2085           0 :                 return NULL;
    2086             :         }
    2087             : 
    2088           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2089           0 :         TALLOC_FREE(tmp_ctx);
    2090           0 :         return ret;
    2091             : }
    2092             : 
    2093           0 : static PyObject *py_sec_desc_buf_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2094             : {
    2095           0 :         struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(py_obj);
    2096           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2097           0 :         Py_ssize_t blob_length = 0;
    2098             :         enum ndr_err_code err;
    2099           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2100           0 :         PyObject *allow_remaining_obj = NULL;
    2101           0 :         bool allow_remaining = false;
    2102             : 
    2103           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2104             :                 discard_const_p(char *, kwnames),
    2105             :                 &blob.data, &blob_length,
    2106             :                 &allow_remaining_obj)) {
    2107           0 :                 return NULL;
    2108             :         }
    2109           0 :         blob.length = blob_length;
    2110             : 
    2111           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2112           0 :                 allow_remaining = true;
    2113             :         }
    2114             : 
    2115           0 :         if (allow_remaining) {
    2116           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_sec_desc_buf);
    2117             :         } else {
    2118           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_sec_desc_buf);
    2119             :         }
    2120           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2121           0 :                 PyErr_SetNdrError(err);
    2122           0 :                 return NULL;
    2123             :         }
    2124             : 
    2125           0 :         Py_RETURN_NONE;
    2126             : }
    2127             : 
    2128           0 : static PyObject *py_sec_desc_buf_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2129             : {
    2130           0 :         struct sec_desc_buf *object = (struct sec_desc_buf *)pytalloc_get_ptr(py_obj);
    2131             :         PyObject *ret;
    2132             :         char *retstr;
    2133             : 
    2134           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_sec_desc_buf, "sec_desc_buf", object);
    2135           0 :         ret = PyUnicode_FromString(retstr);
    2136           0 :         talloc_free(retstr);
    2137             : 
    2138           0 :         return ret;
    2139             : }
    2140             : 
    2141             : static PyMethodDef py_sec_desc_buf_methods[] = {
    2142             :         { "__ndr_pack__", (PyCFunction)py_sec_desc_buf_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2143             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_sec_desc_buf_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2144             :         { "__ndr_print__", (PyCFunction)py_sec_desc_buf_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2145             :         { NULL, NULL, 0, NULL }
    2146             : };
    2147             : 
    2148             : 
    2149             : static PyTypeObject sec_desc_buf_Type = {
    2150             :         PyVarObject_HEAD_INIT(NULL, 0)
    2151             :         .tp_name = "security.sec_desc_buf",
    2152             :         .tp_getset = py_sec_desc_buf_getsetters,
    2153             :         .tp_methods = py_sec_desc_buf_methods,
    2154             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2155             :         .tp_new = py_sec_desc_buf_new,
    2156             : };
    2157             : 
    2158             : 
    2159           0 : static PyObject *py_security_token_get_num_sids(PyObject *obj, void *closure)
    2160             : {
    2161           0 :         struct security_token *object = (struct security_token *)pytalloc_get_ptr(obj);
    2162             :         PyObject *py_num_sids;
    2163           0 :         py_num_sids = PyLong_FromUnsignedLongLong((uint32_t)object->num_sids);
    2164           0 :         return py_num_sids;
    2165             : }
    2166             : 
    2167           0 : static int py_security_token_set_num_sids(PyObject *py_obj, PyObject *value, void *closure)
    2168             : {
    2169           0 :         struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
    2170           0 :         if (value == NULL) {
    2171           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_sids");
    2172           0 :                 return -1;
    2173             :         }
    2174             :         {
    2175           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sids));
    2176           0 :                 if (PyLong_Check(value)) {
    2177             :                         unsigned long long test_var;
    2178           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2179           0 :                         if (PyErr_Occurred() != NULL) {
    2180           0 :                                 return -1;
    2181             :                         }
    2182           0 :                         if (test_var > uint_max) {
    2183           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2184             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2185           0 :                                 return -1;
    2186             :                         }
    2187           0 :                         object->num_sids = test_var;
    2188             :                 } else {
    2189           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2190             :                           PyLong_Type.tp_name);
    2191           0 :                         return -1;
    2192             :                 }
    2193             :         }
    2194           0 :         return 0;
    2195             : }
    2196             : 
    2197          24 : static PyObject *py_security_token_get_sids(PyObject *obj, void *closure)
    2198             : {
    2199          24 :         struct security_token *object = (struct security_token *)pytalloc_get_ptr(obj);
    2200             :         PyObject *py_sids;
    2201          24 :         py_sids = PyList_New(object->num_sids);
    2202          24 :         if (py_sids == NULL) {
    2203           0 :                 return NULL;
    2204             :         }
    2205             :         {
    2206             :                 int sids_cntr_0;
    2207         356 :                 for (sids_cntr_0 = 0; sids_cntr_0 < (object->num_sids); sids_cntr_0++) {
    2208             :                         PyObject *py_sids_0;
    2209         332 :                         py_sids_0 = pytalloc_reference_ex(&dom_sid_Type, object->sids, &object->sids[sids_cntr_0]);
    2210         332 :                         PyList_SetItem(py_sids, sids_cntr_0, py_sids_0);
    2211             :                 }
    2212             :         }
    2213          24 :         return py_sids;
    2214             : }
    2215             : 
    2216           0 : static int py_security_token_set_sids(PyObject *py_obj, PyObject *value, void *closure)
    2217             : {
    2218           0 :         struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
    2219           0 :         if (value == NULL) {
    2220           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
    2221           0 :                 return -1;
    2222             :         }
    2223           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    2224             :         {
    2225             :                 int sids_cntr_0;
    2226           0 :                 object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
    2227           0 :                 if (!object->sids) { return -1;; }
    2228           0 :                 talloc_set_name_const(object->sids, "ARRAY: object->sids");
    2229           0 :                 for (sids_cntr_0 = 0; sids_cntr_0 < PyList_GET_SIZE(value); sids_cntr_0++) {
    2230           0 :                         if (PyList_GET_ITEM(value, sids_cntr_0) == NULL) {
    2231           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_0]");
    2232           0 :                                 return -1;
    2233             :                         }
    2234           0 :                         PY_CHECK_TYPE(&dom_sid_Type, PyList_GET_ITEM(value, sids_cntr_0), return -1;);
    2235           0 :                         if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_0))) == NULL) {
    2236           0 :                                 PyErr_NoMemory();
    2237           0 :                                 return -1;
    2238             :                         }
    2239           0 :                         object->sids[sids_cntr_0] = *(struct dom_sid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_0));
    2240             :                 }
    2241             :         }
    2242           0 :         return 0;
    2243             : }
    2244             : 
    2245           0 : static PyObject *py_security_token_get_privilege_mask(PyObject *obj, void *closure)
    2246             : {
    2247           0 :         struct security_token *object = (struct security_token *)pytalloc_get_ptr(obj);
    2248             :         PyObject *py_privilege_mask;
    2249           0 :         py_privilege_mask = PyLong_FromUnsignedLongLong(object->privilege_mask);
    2250           0 :         return py_privilege_mask;
    2251             : }
    2252             : 
    2253           0 : static int py_security_token_set_privilege_mask(PyObject *py_obj, PyObject *value, void *closure)
    2254             : {
    2255           0 :         struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
    2256           0 :         if (value == NULL) {
    2257           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_mask");
    2258           0 :                 return -1;
    2259             :         }
    2260             :         {
    2261           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->privilege_mask));
    2262           0 :                 if (PyLong_Check(value)) {
    2263             :                         unsigned long long test_var;
    2264           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2265           0 :                         if (PyErr_Occurred() != NULL) {
    2266           0 :                                 return -1;
    2267             :                         }
    2268           0 :                         if (test_var > uint_max) {
    2269           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2270             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2271           0 :                                 return -1;
    2272             :                         }
    2273           0 :                         object->privilege_mask = test_var;
    2274             :                 } else {
    2275           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2276             :                           PyLong_Type.tp_name);
    2277           0 :                         return -1;
    2278             :                 }
    2279             :         }
    2280           0 :         return 0;
    2281             : }
    2282             : 
    2283           0 : static PyObject *py_security_token_get_rights_mask(PyObject *obj, void *closure)
    2284             : {
    2285           0 :         struct security_token *object = (struct security_token *)pytalloc_get_ptr(obj);
    2286             :         PyObject *py_rights_mask;
    2287           0 :         py_rights_mask = PyLong_FromUnsignedLongLong((uint32_t)object->rights_mask);
    2288           0 :         return py_rights_mask;
    2289             : }
    2290             : 
    2291           0 : static int py_security_token_set_rights_mask(PyObject *py_obj, PyObject *value, void *closure)
    2292             : {
    2293           0 :         struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
    2294           0 :         if (value == NULL) {
    2295           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rights_mask");
    2296           0 :                 return -1;
    2297             :         }
    2298             :         {
    2299           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rights_mask));
    2300           0 :                 if (PyLong_Check(value)) {
    2301             :                         unsigned long long test_var;
    2302           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2303           0 :                         if (PyErr_Occurred() != NULL) {
    2304           0 :                                 return -1;
    2305             :                         }
    2306           0 :                         if (test_var > uint_max) {
    2307           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2308             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2309           0 :                                 return -1;
    2310             :                         }
    2311           0 :                         object->rights_mask = test_var;
    2312             :                 } else {
    2313           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2314             :                           PyLong_Type.tp_name);
    2315           0 :                         return -1;
    2316             :                 }
    2317             :         }
    2318           0 :         return 0;
    2319             : }
    2320             : 
    2321             : static PyGetSetDef py_security_token_getsetters[] = {
    2322             :         {
    2323             :                 .name = discard_const_p(char, "num_sids"),
    2324             :                 .get = py_security_token_get_num_sids,
    2325             :                 .set = py_security_token_set_num_sids,
    2326             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2327             :         },
    2328             :         {
    2329             :                 .name = discard_const_p(char, "sids"),
    2330             :                 .get = py_security_token_get_sids,
    2331             :                 .set = py_security_token_set_sids,
    2332             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    2333             :         },
    2334             :         {
    2335             :                 .name = discard_const_p(char, "privilege_mask"),
    2336             :                 .get = py_security_token_get_privilege_mask,
    2337             :                 .set = py_security_token_set_privilege_mask,
    2338             :                 .doc = discard_const_p(char, "PIDL-generated element of base type se_privilege")
    2339             :         },
    2340             :         {
    2341             :                 .name = discard_const_p(char, "rights_mask"),
    2342             :                 .get = py_security_token_get_rights_mask,
    2343             :                 .set = py_security_token_set_rights_mask,
    2344             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SystemAccessModeFlags")
    2345             :         },
    2346             :         { .name = NULL }
    2347             : };
    2348             : 
    2349           0 : static PyObject *py_security_token_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2350             : {
    2351           0 :         return pytalloc_new(struct security_token, type);
    2352             : }
    2353             : 
    2354           0 : static PyObject *py_security_token_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2355             : {
    2356           0 :         struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
    2357           0 :         PyObject *ret = NULL;
    2358             :         DATA_BLOB blob;
    2359             :         enum ndr_err_code err;
    2360           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2361           0 :         if (tmp_ctx == NULL) {
    2362           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2363           0 :                 return NULL;
    2364             :         }
    2365           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_token);
    2366           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2367           0 :                 TALLOC_FREE(tmp_ctx);
    2368           0 :                 PyErr_SetNdrError(err);
    2369           0 :                 return NULL;
    2370             :         }
    2371             : 
    2372           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2373           0 :         TALLOC_FREE(tmp_ctx);
    2374           0 :         return ret;
    2375             : }
    2376             : 
    2377           0 : static PyObject *py_security_token_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2378             : {
    2379           0 :         struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
    2380           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2381           0 :         Py_ssize_t blob_length = 0;
    2382             :         enum ndr_err_code err;
    2383           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2384           0 :         PyObject *allow_remaining_obj = NULL;
    2385           0 :         bool allow_remaining = false;
    2386             : 
    2387           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2388             :                 discard_const_p(char *, kwnames),
    2389             :                 &blob.data, &blob_length,
    2390             :                 &allow_remaining_obj)) {
    2391           0 :                 return NULL;
    2392             :         }
    2393           0 :         blob.length = blob_length;
    2394             : 
    2395           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2396           0 :                 allow_remaining = true;
    2397             :         }
    2398             : 
    2399           0 :         if (allow_remaining) {
    2400           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_token);
    2401             :         } else {
    2402           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_token);
    2403             :         }
    2404           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2405           0 :                 PyErr_SetNdrError(err);
    2406           0 :                 return NULL;
    2407             :         }
    2408             : 
    2409           0 :         Py_RETURN_NONE;
    2410             : }
    2411             : 
    2412           0 : static PyObject *py_security_token_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2413             : {
    2414           0 :         struct security_token *object = (struct security_token *)pytalloc_get_ptr(py_obj);
    2415             :         PyObject *ret;
    2416             :         char *retstr;
    2417             : 
    2418           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_token, "security_token", object);
    2419           0 :         ret = PyUnicode_FromString(retstr);
    2420           0 :         talloc_free(retstr);
    2421             : 
    2422           0 :         return ret;
    2423             : }
    2424             : 
    2425             : static PyMethodDef py_security_token_methods[] = {
    2426             :         { "__ndr_pack__", (PyCFunction)py_security_token_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2427             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_token_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2428             :         { "__ndr_print__", (PyCFunction)py_security_token_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2429             :         { NULL, NULL, 0, NULL }
    2430             : };
    2431             : 
    2432             : 
    2433             : static PyTypeObject security_token_Type = {
    2434             :         PyVarObject_HEAD_INIT(NULL, 0)
    2435             :         .tp_name = "security.token",
    2436             :         .tp_getset = py_security_token_getsetters,
    2437             :         .tp_methods = py_security_token_methods,
    2438             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2439             :         .tp_new = py_security_token_new,
    2440             : };
    2441             : 
    2442             : 
    2443           0 : static PyObject *py_security_unix_token_get_uid(PyObject *obj, void *closure)
    2444             : {
    2445           0 :         struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(obj);
    2446             :         PyObject *py_uid;
    2447           0 :         py_uid = PyLong_FromUnsignedLongLong(object->uid);
    2448           0 :         return py_uid;
    2449             : }
    2450             : 
    2451           0 : static int py_security_unix_token_set_uid(PyObject *py_obj, PyObject *value, void *closure)
    2452             : {
    2453           0 :         struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
    2454           0 :         if (value == NULL) {
    2455           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->uid");
    2456           0 :                 return -1;
    2457             :         }
    2458             :         {
    2459           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->uid));
    2460           0 :                 if (PyLong_Check(value)) {
    2461             :                         unsigned long long test_var;
    2462           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2463           0 :                         if (PyErr_Occurred() != NULL) {
    2464           0 :                                 return -1;
    2465             :                         }
    2466           0 :                         if (test_var > uint_max) {
    2467           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2468             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2469           0 :                                 return -1;
    2470             :                         }
    2471           0 :                         object->uid = test_var;
    2472             :                 } else {
    2473           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2474             :                           PyLong_Type.tp_name);
    2475           0 :                         return -1;
    2476             :                 }
    2477             :         }
    2478           0 :         return 0;
    2479             : }
    2480             : 
    2481           0 : static PyObject *py_security_unix_token_get_gid(PyObject *obj, void *closure)
    2482             : {
    2483           0 :         struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(obj);
    2484             :         PyObject *py_gid;
    2485           0 :         py_gid = PyLong_FromUnsignedLongLong(object->gid);
    2486           0 :         return py_gid;
    2487             : }
    2488             : 
    2489           0 : static int py_security_unix_token_set_gid(PyObject *py_obj, PyObject *value, void *closure)
    2490             : {
    2491           0 :         struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
    2492           0 :         if (value == NULL) {
    2493           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->gid");
    2494           0 :                 return -1;
    2495             :         }
    2496             :         {
    2497           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->gid));
    2498           0 :                 if (PyLong_Check(value)) {
    2499             :                         unsigned long long test_var;
    2500           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2501           0 :                         if (PyErr_Occurred() != NULL) {
    2502           0 :                                 return -1;
    2503             :                         }
    2504           0 :                         if (test_var > uint_max) {
    2505           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2506             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2507           0 :                                 return -1;
    2508             :                         }
    2509           0 :                         object->gid = test_var;
    2510             :                 } else {
    2511           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2512             :                           PyLong_Type.tp_name);
    2513           0 :                         return -1;
    2514             :                 }
    2515             :         }
    2516           0 :         return 0;
    2517             : }
    2518             : 
    2519           0 : static PyObject *py_security_unix_token_get_ngroups(PyObject *obj, void *closure)
    2520             : {
    2521           0 :         struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(obj);
    2522             :         PyObject *py_ngroups;
    2523           0 :         py_ngroups = PyLong_FromUnsignedLongLong((uint32_t)object->ngroups);
    2524           0 :         return py_ngroups;
    2525             : }
    2526             : 
    2527           0 : static int py_security_unix_token_set_ngroups(PyObject *py_obj, PyObject *value, void *closure)
    2528             : {
    2529           0 :         struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
    2530           0 :         if (value == NULL) {
    2531           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ngroups");
    2532           0 :                 return -1;
    2533             :         }
    2534             :         {
    2535           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ngroups));
    2536           0 :                 if (PyLong_Check(value)) {
    2537             :                         unsigned long long test_var;
    2538           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2539           0 :                         if (PyErr_Occurred() != NULL) {
    2540           0 :                                 return -1;
    2541             :                         }
    2542           0 :                         if (test_var > uint_max) {
    2543           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2544             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2545           0 :                                 return -1;
    2546             :                         }
    2547           0 :                         object->ngroups = test_var;
    2548             :                 } else {
    2549           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2550             :                           PyLong_Type.tp_name);
    2551           0 :                         return -1;
    2552             :                 }
    2553             :         }
    2554           0 :         return 0;
    2555             : }
    2556             : 
    2557           0 : static PyObject *py_security_unix_token_get_groups(PyObject *obj, void *closure)
    2558             : {
    2559           0 :         struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(obj);
    2560             :         PyObject *py_groups;
    2561           0 :         py_groups = PyList_New(object->ngroups);
    2562           0 :         if (py_groups == NULL) {
    2563           0 :                 return NULL;
    2564             :         }
    2565             :         {
    2566             :                 int groups_cntr_0;
    2567           0 :                 for (groups_cntr_0 = 0; groups_cntr_0 < (object->ngroups); groups_cntr_0++) {
    2568             :                         PyObject *py_groups_0;
    2569           0 :                         py_groups_0 = PyLong_FromUnsignedLongLong(object->groups[groups_cntr_0]);
    2570           0 :                         PyList_SetItem(py_groups, groups_cntr_0, py_groups_0);
    2571             :                 }
    2572             :         }
    2573           0 :         return py_groups;
    2574             : }
    2575             : 
    2576           0 : static int py_security_unix_token_set_groups(PyObject *py_obj, PyObject *value, void *closure)
    2577             : {
    2578           0 :         struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
    2579           0 :         if (value == NULL) {
    2580           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->groups");
    2581           0 :                 return -1;
    2582             :         }
    2583           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    2584             :         {
    2585             :                 int groups_cntr_0;
    2586           0 :                 object->groups = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->groups, PyList_GET_SIZE(value));
    2587           0 :                 if (!object->groups) { return -1;; }
    2588           0 :                 talloc_set_name_const(object->groups, "ARRAY: object->groups");
    2589           0 :                 for (groups_cntr_0 = 0; groups_cntr_0 < PyList_GET_SIZE(value); groups_cntr_0++) {
    2590           0 :                         if (PyList_GET_ITEM(value, groups_cntr_0) == NULL) {
    2591           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->groups[groups_cntr_0]");
    2592           0 :                                 return -1;
    2593             :                         }
    2594             :                         {
    2595           0 :                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->groups[groups_cntr_0]));
    2596           0 :                                 if (PyLong_Check(PyList_GET_ITEM(value, groups_cntr_0))) {
    2597             :                                         unsigned long long test_var;
    2598           0 :                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, groups_cntr_0));
    2599           0 :                                         if (PyErr_Occurred() != NULL) {
    2600           0 :                                                 return -1;
    2601             :                                         }
    2602           0 :                                         if (test_var > uint_max) {
    2603           0 :                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2604             :                                                   PyLong_Type.tp_name, uint_max, test_var);
    2605           0 :                                                 return -1;
    2606             :                                         }
    2607           0 :                                         object->groups[groups_cntr_0] = test_var;
    2608             :                                 } else {
    2609           0 :                                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2610             :                                           PyLong_Type.tp_name);
    2611           0 :                                         return -1;
    2612             :                                 }
    2613             :                         }
    2614             :                 }
    2615             :         }
    2616           0 :         return 0;
    2617             : }
    2618             : 
    2619             : static PyGetSetDef py_security_unix_token_getsetters[] = {
    2620             :         {
    2621             :                 .name = discard_const_p(char, "uid"),
    2622             :                 .get = py_security_unix_token_get_uid,
    2623             :                 .set = py_security_unix_token_set_uid,
    2624             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uid_t")
    2625             :         },
    2626             :         {
    2627             :                 .name = discard_const_p(char, "gid"),
    2628             :                 .get = py_security_unix_token_get_gid,
    2629             :                 .set = py_security_unix_token_set_gid,
    2630             :                 .doc = discard_const_p(char, "PIDL-generated element of base type gid_t")
    2631             :         },
    2632             :         {
    2633             :                 .name = discard_const_p(char, "ngroups"),
    2634             :                 .get = py_security_unix_token_get_ngroups,
    2635             :                 .set = py_security_unix_token_set_ngroups,
    2636             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2637             :         },
    2638             :         {
    2639             :                 .name = discard_const_p(char, "groups"),
    2640             :                 .get = py_security_unix_token_get_groups,
    2641             :                 .set = py_security_unix_token_set_groups,
    2642             :                 .doc = discard_const_p(char, "PIDL-generated element of base type gid_t")
    2643             :         },
    2644             :         { .name = NULL }
    2645             : };
    2646             : 
    2647           0 : static PyObject *py_security_unix_token_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2648             : {
    2649           0 :         return pytalloc_new(struct security_unix_token, type);
    2650             : }
    2651             : 
    2652           0 : static PyObject *py_security_unix_token_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2653             : {
    2654           0 :         struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
    2655           0 :         PyObject *ret = NULL;
    2656             :         DATA_BLOB blob;
    2657             :         enum ndr_err_code err;
    2658           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2659           0 :         if (tmp_ctx == NULL) {
    2660           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2661           0 :                 return NULL;
    2662             :         }
    2663           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_security_unix_token);
    2664           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2665           0 :                 TALLOC_FREE(tmp_ctx);
    2666           0 :                 PyErr_SetNdrError(err);
    2667           0 :                 return NULL;
    2668             :         }
    2669             : 
    2670           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2671           0 :         TALLOC_FREE(tmp_ctx);
    2672           0 :         return ret;
    2673             : }
    2674             : 
    2675           0 : static PyObject *py_security_unix_token_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2676             : {
    2677           0 :         struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
    2678           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2679           0 :         Py_ssize_t blob_length = 0;
    2680             :         enum ndr_err_code err;
    2681           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2682           0 :         PyObject *allow_remaining_obj = NULL;
    2683           0 :         bool allow_remaining = false;
    2684             : 
    2685           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2686             :                 discard_const_p(char *, kwnames),
    2687             :                 &blob.data, &blob_length,
    2688             :                 &allow_remaining_obj)) {
    2689           0 :                 return NULL;
    2690             :         }
    2691           0 :         blob.length = blob_length;
    2692             : 
    2693           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2694           0 :                 allow_remaining = true;
    2695             :         }
    2696             : 
    2697           0 :         if (allow_remaining) {
    2698           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_unix_token);
    2699             :         } else {
    2700           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_security_unix_token);
    2701             :         }
    2702           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2703           0 :                 PyErr_SetNdrError(err);
    2704           0 :                 return NULL;
    2705             :         }
    2706             : 
    2707           0 :         Py_RETURN_NONE;
    2708             : }
    2709             : 
    2710           0 : static PyObject *py_security_unix_token_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2711             : {
    2712           0 :         struct security_unix_token *object = (struct security_unix_token *)pytalloc_get_ptr(py_obj);
    2713             :         PyObject *ret;
    2714             :         char *retstr;
    2715             : 
    2716           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_security_unix_token, "security_unix_token", object);
    2717           0 :         ret = PyUnicode_FromString(retstr);
    2718           0 :         talloc_free(retstr);
    2719             : 
    2720           0 :         return ret;
    2721             : }
    2722             : 
    2723             : static PyMethodDef py_security_unix_token_methods[] = {
    2724             :         { "__ndr_pack__", (PyCFunction)py_security_unix_token_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2725             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_security_unix_token_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2726             :         { "__ndr_print__", (PyCFunction)py_security_unix_token_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2727             :         { NULL, NULL, 0, NULL }
    2728             : };
    2729             : 
    2730             : 
    2731             : static PyTypeObject security_unix_token_Type = {
    2732             :         PyVarObject_HEAD_INIT(NULL, 0)
    2733             :         .tp_name = "security.unix_token",
    2734             :         .tp_getset = py_security_unix_token_getsetters,
    2735             :         .tp_methods = py_security_unix_token_methods,
    2736             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2737             :         .tp_new = py_security_unix_token_new,
    2738             : };
    2739             : 
    2740             : 
    2741           0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_get_Flags(PyObject *obj, void *closure)
    2742             : {
    2743           0 :         struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(obj);
    2744             :         PyObject *py_Flags;
    2745           0 :         py_Flags = PyLong_FromUnsignedLongLong((uint32_t)object->Flags);
    2746           0 :         return py_Flags;
    2747             : }
    2748             : 
    2749           0 : static int py_LSAP_TOKEN_INFO_INTEGRITY_set_Flags(PyObject *py_obj, PyObject *value, void *closure)
    2750             : {
    2751           0 :         struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(py_obj);
    2752           0 :         if (value == NULL) {
    2753           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Flags");
    2754           0 :                 return -1;
    2755             :         }
    2756             :         {
    2757           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Flags));
    2758           0 :                 if (PyLong_Check(value)) {
    2759             :                         unsigned long long test_var;
    2760           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2761           0 :                         if (PyErr_Occurred() != NULL) {
    2762           0 :                                 return -1;
    2763             :                         }
    2764           0 :                         if (test_var > uint_max) {
    2765           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2766             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2767           0 :                                 return -1;
    2768             :                         }
    2769           0 :                         object->Flags = test_var;
    2770             :                 } else {
    2771           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2772             :                           PyLong_Type.tp_name);
    2773           0 :                         return -1;
    2774             :                 }
    2775             :         }
    2776           0 :         return 0;
    2777             : }
    2778             : 
    2779           0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_get_TokenIL(PyObject *obj, void *closure)
    2780             : {
    2781           0 :         struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(obj);
    2782             :         PyObject *py_TokenIL;
    2783           0 :         py_TokenIL = PyLong_FromUnsignedLongLong((uint32_t)object->TokenIL);
    2784           0 :         return py_TokenIL;
    2785             : }
    2786             : 
    2787           0 : static int py_LSAP_TOKEN_INFO_INTEGRITY_set_TokenIL(PyObject *py_obj, PyObject *value, void *closure)
    2788             : {
    2789           0 :         struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(py_obj);
    2790           0 :         if (value == NULL) {
    2791           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->TokenIL");
    2792           0 :                 return -1;
    2793             :         }
    2794             :         {
    2795           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->TokenIL));
    2796           0 :                 if (PyLong_Check(value)) {
    2797             :                         unsigned long long test_var;
    2798           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2799           0 :                         if (PyErr_Occurred() != NULL) {
    2800           0 :                                 return -1;
    2801             :                         }
    2802           0 :                         if (test_var > uint_max) {
    2803           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2804             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2805           0 :                                 return -1;
    2806             :                         }
    2807           0 :                         object->TokenIL = test_var;
    2808             :                 } else {
    2809           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2810             :                           PyLong_Type.tp_name);
    2811           0 :                         return -1;
    2812             :                 }
    2813             :         }
    2814           0 :         return 0;
    2815             : }
    2816             : 
    2817           0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_get_MachineId(PyObject *obj, void *closure)
    2818             : {
    2819           0 :         struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(obj);
    2820             :         PyObject *py_MachineId;
    2821           0 :         py_MachineId = PyList_New(32);
    2822           0 :         if (py_MachineId == NULL) {
    2823           0 :                 return NULL;
    2824             :         }
    2825             :         {
    2826             :                 int MachineId_cntr_0;
    2827           0 :                 for (MachineId_cntr_0 = 0; MachineId_cntr_0 < (32); MachineId_cntr_0++) {
    2828             :                         PyObject *py_MachineId_0;
    2829           0 :                         py_MachineId_0 = PyLong_FromLong((uint16_t)object->MachineId[MachineId_cntr_0]);
    2830           0 :                         PyList_SetItem(py_MachineId, MachineId_cntr_0, py_MachineId_0);
    2831             :                 }
    2832             :         }
    2833           0 :         return py_MachineId;
    2834             : }
    2835             : 
    2836           0 : static int py_LSAP_TOKEN_INFO_INTEGRITY_set_MachineId(PyObject *py_obj, PyObject *value, void *closure)
    2837             : {
    2838           0 :         struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(py_obj);
    2839           0 :         if (value == NULL) {
    2840           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->MachineId");
    2841           0 :                 return -1;
    2842             :         }
    2843           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    2844             :         {
    2845             :                 int MachineId_cntr_0;
    2846           0 :                 if (ARRAY_SIZE(object->MachineId) != PyList_GET_SIZE(value)) {
    2847           0 :                         PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->MachineId),  PyList_GET_SIZE(value));
    2848           0 :                         return -1;
    2849             :                 }
    2850           0 :                 for (MachineId_cntr_0 = 0; MachineId_cntr_0 < PyList_GET_SIZE(value); MachineId_cntr_0++) {
    2851           0 :                         if (PyList_GET_ITEM(value, MachineId_cntr_0) == NULL) {
    2852           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->MachineId[MachineId_cntr_0]");
    2853           0 :                                 return -1;
    2854             :                         }
    2855             :                         {
    2856           0 :                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->MachineId[MachineId_cntr_0]));
    2857           0 :                                 if (PyLong_Check(PyList_GET_ITEM(value, MachineId_cntr_0))) {
    2858             :                                         unsigned long long test_var;
    2859           0 :                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, MachineId_cntr_0));
    2860           0 :                                         if (PyErr_Occurred() != NULL) {
    2861           0 :                                                 return -1;
    2862             :                                         }
    2863           0 :                                         if (test_var > uint_max) {
    2864           0 :                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2865             :                                                   PyLong_Type.tp_name, uint_max, test_var);
    2866           0 :                                                 return -1;
    2867             :                                         }
    2868           0 :                                         object->MachineId[MachineId_cntr_0] = test_var;
    2869             :                                 } else {
    2870           0 :                                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2871             :                                           PyLong_Type.tp_name);
    2872           0 :                                         return -1;
    2873             :                                 }
    2874             :                         }
    2875             :                 }
    2876             :         }
    2877           0 :         return 0;
    2878             : }
    2879             : 
    2880             : static PyGetSetDef py_LSAP_TOKEN_INFO_INTEGRITY_getsetters[] = {
    2881             :         {
    2882             :                 .name = discard_const_p(char, "Flags"),
    2883             :                 .get = py_LSAP_TOKEN_INFO_INTEGRITY_get_Flags,
    2884             :                 .set = py_LSAP_TOKEN_INFO_INTEGRITY_set_Flags,
    2885             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2886             :         },
    2887             :         {
    2888             :                 .name = discard_const_p(char, "TokenIL"),
    2889             :                 .get = py_LSAP_TOKEN_INFO_INTEGRITY_get_TokenIL,
    2890             :                 .set = py_LSAP_TOKEN_INFO_INTEGRITY_set_TokenIL,
    2891             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2892             :         },
    2893             :         {
    2894             :                 .name = discard_const_p(char, "MachineId"),
    2895             :                 .get = py_LSAP_TOKEN_INFO_INTEGRITY_get_MachineId,
    2896             :                 .set = py_LSAP_TOKEN_INFO_INTEGRITY_set_MachineId,
    2897             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    2898             :         },
    2899             :         { .name = NULL }
    2900             : };
    2901             : 
    2902           0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2903             : {
    2904           0 :         return pytalloc_new(struct LSAP_TOKEN_INFO_INTEGRITY, type);
    2905             : }
    2906             : 
    2907           0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2908             : {
    2909           0 :         struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(py_obj);
    2910           0 :         PyObject *ret = NULL;
    2911             :         DATA_BLOB blob;
    2912             :         enum ndr_err_code err;
    2913           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2914           0 :         if (tmp_ctx == NULL) {
    2915           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2916           0 :                 return NULL;
    2917             :         }
    2918           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_LSAP_TOKEN_INFO_INTEGRITY);
    2919           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2920           0 :                 TALLOC_FREE(tmp_ctx);
    2921           0 :                 PyErr_SetNdrError(err);
    2922           0 :                 return NULL;
    2923             :         }
    2924             : 
    2925           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2926           0 :         TALLOC_FREE(tmp_ctx);
    2927           0 :         return ret;
    2928             : }
    2929             : 
    2930           0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2931             : {
    2932           0 :         struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(py_obj);
    2933           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2934           0 :         Py_ssize_t blob_length = 0;
    2935             :         enum ndr_err_code err;
    2936           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2937           0 :         PyObject *allow_remaining_obj = NULL;
    2938           0 :         bool allow_remaining = false;
    2939             : 
    2940           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2941             :                 discard_const_p(char *, kwnames),
    2942             :                 &blob.data, &blob_length,
    2943             :                 &allow_remaining_obj)) {
    2944           0 :                 return NULL;
    2945             :         }
    2946           0 :         blob.length = blob_length;
    2947             : 
    2948           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2949           0 :                 allow_remaining = true;
    2950             :         }
    2951             : 
    2952           0 :         if (allow_remaining) {
    2953           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_LSAP_TOKEN_INFO_INTEGRITY);
    2954             :         } else {
    2955           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_LSAP_TOKEN_INFO_INTEGRITY);
    2956             :         }
    2957           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2958           0 :                 PyErr_SetNdrError(err);
    2959           0 :                 return NULL;
    2960             :         }
    2961             : 
    2962           0 :         Py_RETURN_NONE;
    2963             : }
    2964             : 
    2965           0 : static PyObject *py_LSAP_TOKEN_INFO_INTEGRITY_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2966             : {
    2967           0 :         struct LSAP_TOKEN_INFO_INTEGRITY *object = (struct LSAP_TOKEN_INFO_INTEGRITY *)pytalloc_get_ptr(py_obj);
    2968             :         PyObject *ret;
    2969             :         char *retstr;
    2970             : 
    2971           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_LSAP_TOKEN_INFO_INTEGRITY, "LSAP_TOKEN_INFO_INTEGRITY", object);
    2972           0 :         ret = PyUnicode_FromString(retstr);
    2973           0 :         talloc_free(retstr);
    2974             : 
    2975           0 :         return ret;
    2976             : }
    2977             : 
    2978             : static PyMethodDef py_LSAP_TOKEN_INFO_INTEGRITY_methods[] = {
    2979             :         { "__ndr_pack__", (PyCFunction)py_LSAP_TOKEN_INFO_INTEGRITY_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2980             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_LSAP_TOKEN_INFO_INTEGRITY_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2981             :         { "__ndr_print__", (PyCFunction)py_LSAP_TOKEN_INFO_INTEGRITY_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2982             :         { NULL, NULL, 0, NULL }
    2983             : };
    2984             : 
    2985             : 
    2986             : static PyTypeObject LSAP_TOKEN_INFO_INTEGRITY_Type = {
    2987             :         PyVarObject_HEAD_INIT(NULL, 0)
    2988             :         .tp_name = "security.LSAP_TOKEN_INFO_INTEGRITY",
    2989             :         .tp_getset = py_LSAP_TOKEN_INFO_INTEGRITY_getsetters,
    2990             :         .tp_methods = py_LSAP_TOKEN_INFO_INTEGRITY_methods,
    2991             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2992             :         .tp_new = py_LSAP_TOKEN_INFO_INTEGRITY_new,
    2993             : };
    2994             : 
    2995             : 
    2996           0 : static PyObject *py_generic_mapping_get_generic_read(PyObject *obj, void *closure)
    2997             : {
    2998           0 :         struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(obj);
    2999             :         PyObject *py_generic_read;
    3000           0 :         py_generic_read = PyLong_FromUnsignedLongLong((uint32_t)object->generic_read);
    3001           0 :         return py_generic_read;
    3002             : }
    3003             : 
    3004           0 : static int py_generic_mapping_set_generic_read(PyObject *py_obj, PyObject *value, void *closure)
    3005             : {
    3006           0 :         struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(py_obj);
    3007           0 :         if (value == NULL) {
    3008           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->generic_read");
    3009           0 :                 return -1;
    3010             :         }
    3011             :         {
    3012           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->generic_read));
    3013           0 :                 if (PyLong_Check(value)) {
    3014             :                         unsigned long long test_var;
    3015           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3016           0 :                         if (PyErr_Occurred() != NULL) {
    3017           0 :                                 return -1;
    3018             :                         }
    3019           0 :                         if (test_var > uint_max) {
    3020           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3021             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3022           0 :                                 return -1;
    3023             :                         }
    3024           0 :                         object->generic_read = test_var;
    3025             :                 } else {
    3026           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3027             :                           PyLong_Type.tp_name);
    3028           0 :                         return -1;
    3029             :                 }
    3030             :         }
    3031           0 :         return 0;
    3032             : }
    3033             : 
    3034           0 : static PyObject *py_generic_mapping_get_generic_write(PyObject *obj, void *closure)
    3035             : {
    3036           0 :         struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(obj);
    3037             :         PyObject *py_generic_write;
    3038           0 :         py_generic_write = PyLong_FromUnsignedLongLong((uint32_t)object->generic_write);
    3039           0 :         return py_generic_write;
    3040             : }
    3041             : 
    3042           0 : static int py_generic_mapping_set_generic_write(PyObject *py_obj, PyObject *value, void *closure)
    3043             : {
    3044           0 :         struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(py_obj);
    3045           0 :         if (value == NULL) {
    3046           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->generic_write");
    3047           0 :                 return -1;
    3048             :         }
    3049             :         {
    3050           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->generic_write));
    3051           0 :                 if (PyLong_Check(value)) {
    3052             :                         unsigned long long test_var;
    3053           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3054           0 :                         if (PyErr_Occurred() != NULL) {
    3055           0 :                                 return -1;
    3056             :                         }
    3057           0 :                         if (test_var > uint_max) {
    3058           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3059             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3060           0 :                                 return -1;
    3061             :                         }
    3062           0 :                         object->generic_write = test_var;
    3063             :                 } else {
    3064           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3065             :                           PyLong_Type.tp_name);
    3066           0 :                         return -1;
    3067             :                 }
    3068             :         }
    3069           0 :         return 0;
    3070             : }
    3071             : 
    3072           0 : static PyObject *py_generic_mapping_get_generic_execute(PyObject *obj, void *closure)
    3073             : {
    3074           0 :         struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(obj);
    3075             :         PyObject *py_generic_execute;
    3076           0 :         py_generic_execute = PyLong_FromUnsignedLongLong((uint32_t)object->generic_execute);
    3077           0 :         return py_generic_execute;
    3078             : }
    3079             : 
    3080           0 : static int py_generic_mapping_set_generic_execute(PyObject *py_obj, PyObject *value, void *closure)
    3081             : {
    3082           0 :         struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(py_obj);
    3083           0 :         if (value == NULL) {
    3084           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->generic_execute");
    3085           0 :                 return -1;
    3086             :         }
    3087             :         {
    3088           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->generic_execute));
    3089           0 :                 if (PyLong_Check(value)) {
    3090             :                         unsigned long long test_var;
    3091           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3092           0 :                         if (PyErr_Occurred() != NULL) {
    3093           0 :                                 return -1;
    3094             :                         }
    3095           0 :                         if (test_var > uint_max) {
    3096           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3097             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3098           0 :                                 return -1;
    3099             :                         }
    3100           0 :                         object->generic_execute = test_var;
    3101             :                 } else {
    3102           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3103             :                           PyLong_Type.tp_name);
    3104           0 :                         return -1;
    3105             :                 }
    3106             :         }
    3107           0 :         return 0;
    3108             : }
    3109             : 
    3110           0 : static PyObject *py_generic_mapping_get_generic_all(PyObject *obj, void *closure)
    3111             : {
    3112           0 :         struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(obj);
    3113             :         PyObject *py_generic_all;
    3114           0 :         py_generic_all = PyLong_FromUnsignedLongLong((uint32_t)object->generic_all);
    3115           0 :         return py_generic_all;
    3116             : }
    3117             : 
    3118           0 : static int py_generic_mapping_set_generic_all(PyObject *py_obj, PyObject *value, void *closure)
    3119             : {
    3120           0 :         struct generic_mapping *object = (struct generic_mapping *)pytalloc_get_ptr(py_obj);
    3121           0 :         if (value == NULL) {
    3122           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->generic_all");
    3123           0 :                 return -1;
    3124             :         }
    3125             :         {
    3126           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->generic_all));
    3127           0 :                 if (PyLong_Check(value)) {
    3128             :                         unsigned long long test_var;
    3129           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3130           0 :                         if (PyErr_Occurred() != NULL) {
    3131           0 :                                 return -1;
    3132             :                         }
    3133           0 :                         if (test_var > uint_max) {
    3134           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3135             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3136           0 :                                 return -1;
    3137             :                         }
    3138           0 :                         object->generic_all = test_var;
    3139             :                 } else {
    3140           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3141             :                           PyLong_Type.tp_name);
    3142           0 :                         return -1;
    3143             :                 }
    3144             :         }
    3145           0 :         return 0;
    3146             : }
    3147             : 
    3148             : static PyGetSetDef py_generic_mapping_getsetters[] = {
    3149             :         {
    3150             :                 .name = discard_const_p(char, "generic_read"),
    3151             :                 .get = py_generic_mapping_get_generic_read,
    3152             :                 .set = py_generic_mapping_set_generic_read,
    3153             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3154             :         },
    3155             :         {
    3156             :                 .name = discard_const_p(char, "generic_write"),
    3157             :                 .get = py_generic_mapping_get_generic_write,
    3158             :                 .set = py_generic_mapping_set_generic_write,
    3159             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3160             :         },
    3161             :         {
    3162             :                 .name = discard_const_p(char, "generic_execute"),
    3163             :                 .get = py_generic_mapping_get_generic_execute,
    3164             :                 .set = py_generic_mapping_set_generic_execute,
    3165             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3166             :         },
    3167             :         {
    3168             :                 .name = discard_const_p(char, "generic_all"),
    3169             :                 .get = py_generic_mapping_get_generic_all,
    3170             :                 .set = py_generic_mapping_set_generic_all,
    3171             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3172             :         },
    3173             :         { .name = NULL }
    3174             : };
    3175             : 
    3176           0 : static PyObject *py_generic_mapping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3177             : {
    3178           0 :         return pytalloc_new(struct generic_mapping, type);
    3179             : }
    3180             : 
    3181             : 
    3182             : static PyTypeObject generic_mapping_Type = {
    3183             :         PyVarObject_HEAD_INIT(NULL, 0)
    3184             :         .tp_name = "security.generic_mapping",
    3185             :         .tp_getset = py_generic_mapping_getsetters,
    3186             :         .tp_methods = NULL,
    3187             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3188             :         .tp_new = py_generic_mapping_new,
    3189             : };
    3190             : 
    3191             : 
    3192           0 : static PyObject *py_standard_mapping_get_std_read(PyObject *obj, void *closure)
    3193             : {
    3194           0 :         struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(obj);
    3195             :         PyObject *py_std_read;
    3196           0 :         py_std_read = PyLong_FromUnsignedLongLong((uint32_t)object->std_read);
    3197           0 :         return py_std_read;
    3198             : }
    3199             : 
    3200           0 : static int py_standard_mapping_set_std_read(PyObject *py_obj, PyObject *value, void *closure)
    3201             : {
    3202           0 :         struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(py_obj);
    3203           0 :         if (value == NULL) {
    3204           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->std_read");
    3205           0 :                 return -1;
    3206             :         }
    3207             :         {
    3208           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->std_read));
    3209           0 :                 if (PyLong_Check(value)) {
    3210             :                         unsigned long long test_var;
    3211           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3212           0 :                         if (PyErr_Occurred() != NULL) {
    3213           0 :                                 return -1;
    3214             :                         }
    3215           0 :                         if (test_var > uint_max) {
    3216           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3217             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3218           0 :                                 return -1;
    3219             :                         }
    3220           0 :                         object->std_read = test_var;
    3221             :                 } else {
    3222           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3223             :                           PyLong_Type.tp_name);
    3224           0 :                         return -1;
    3225             :                 }
    3226             :         }
    3227           0 :         return 0;
    3228             : }
    3229             : 
    3230           0 : static PyObject *py_standard_mapping_get_std_write(PyObject *obj, void *closure)
    3231             : {
    3232           0 :         struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(obj);
    3233             :         PyObject *py_std_write;
    3234           0 :         py_std_write = PyLong_FromUnsignedLongLong((uint32_t)object->std_write);
    3235           0 :         return py_std_write;
    3236             : }
    3237             : 
    3238           0 : static int py_standard_mapping_set_std_write(PyObject *py_obj, PyObject *value, void *closure)
    3239             : {
    3240           0 :         struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(py_obj);
    3241           0 :         if (value == NULL) {
    3242           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->std_write");
    3243           0 :                 return -1;
    3244             :         }
    3245             :         {
    3246           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->std_write));
    3247           0 :                 if (PyLong_Check(value)) {
    3248             :                         unsigned long long test_var;
    3249           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3250           0 :                         if (PyErr_Occurred() != NULL) {
    3251           0 :                                 return -1;
    3252             :                         }
    3253           0 :                         if (test_var > uint_max) {
    3254           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3255             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3256           0 :                                 return -1;
    3257             :                         }
    3258           0 :                         object->std_write = test_var;
    3259             :                 } else {
    3260           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3261             :                           PyLong_Type.tp_name);
    3262           0 :                         return -1;
    3263             :                 }
    3264             :         }
    3265           0 :         return 0;
    3266             : }
    3267             : 
    3268           0 : static PyObject *py_standard_mapping_get_std_execute(PyObject *obj, void *closure)
    3269             : {
    3270           0 :         struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(obj);
    3271             :         PyObject *py_std_execute;
    3272           0 :         py_std_execute = PyLong_FromUnsignedLongLong((uint32_t)object->std_execute);
    3273           0 :         return py_std_execute;
    3274             : }
    3275             : 
    3276           0 : static int py_standard_mapping_set_std_execute(PyObject *py_obj, PyObject *value, void *closure)
    3277             : {
    3278           0 :         struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(py_obj);
    3279           0 :         if (value == NULL) {
    3280           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->std_execute");
    3281           0 :                 return -1;
    3282             :         }
    3283             :         {
    3284           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->std_execute));
    3285           0 :                 if (PyLong_Check(value)) {
    3286             :                         unsigned long long test_var;
    3287           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3288           0 :                         if (PyErr_Occurred() != NULL) {
    3289           0 :                                 return -1;
    3290             :                         }
    3291           0 :                         if (test_var > uint_max) {
    3292           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3293             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3294           0 :                                 return -1;
    3295             :                         }
    3296           0 :                         object->std_execute = test_var;
    3297             :                 } else {
    3298           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3299             :                           PyLong_Type.tp_name);
    3300           0 :                         return -1;
    3301             :                 }
    3302             :         }
    3303           0 :         return 0;
    3304             : }
    3305             : 
    3306           0 : static PyObject *py_standard_mapping_get_std_all(PyObject *obj, void *closure)
    3307             : {
    3308           0 :         struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(obj);
    3309             :         PyObject *py_std_all;
    3310           0 :         py_std_all = PyLong_FromUnsignedLongLong((uint32_t)object->std_all);
    3311           0 :         return py_std_all;
    3312             : }
    3313             : 
    3314           0 : static int py_standard_mapping_set_std_all(PyObject *py_obj, PyObject *value, void *closure)
    3315             : {
    3316           0 :         struct standard_mapping *object = (struct standard_mapping *)pytalloc_get_ptr(py_obj);
    3317           0 :         if (value == NULL) {
    3318           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->std_all");
    3319           0 :                 return -1;
    3320             :         }
    3321             :         {
    3322           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->std_all));
    3323           0 :                 if (PyLong_Check(value)) {
    3324             :                         unsigned long long test_var;
    3325           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3326           0 :                         if (PyErr_Occurred() != NULL) {
    3327           0 :                                 return -1;
    3328             :                         }
    3329           0 :                         if (test_var > uint_max) {
    3330           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3331             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3332           0 :                                 return -1;
    3333             :                         }
    3334           0 :                         object->std_all = test_var;
    3335             :                 } else {
    3336           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3337             :                           PyLong_Type.tp_name);
    3338           0 :                         return -1;
    3339             :                 }
    3340             :         }
    3341           0 :         return 0;
    3342             : }
    3343             : 
    3344             : static PyGetSetDef py_standard_mapping_getsetters[] = {
    3345             :         {
    3346             :                 .name = discard_const_p(char, "std_read"),
    3347             :                 .get = py_standard_mapping_get_std_read,
    3348             :                 .set = py_standard_mapping_set_std_read,
    3349             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3350             :         },
    3351             :         {
    3352             :                 .name = discard_const_p(char, "std_write"),
    3353             :                 .get = py_standard_mapping_get_std_write,
    3354             :                 .set = py_standard_mapping_set_std_write,
    3355             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3356             :         },
    3357             :         {
    3358             :                 .name = discard_const_p(char, "std_execute"),
    3359             :                 .get = py_standard_mapping_get_std_execute,
    3360             :                 .set = py_standard_mapping_set_std_execute,
    3361             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3362             :         },
    3363             :         {
    3364             :                 .name = discard_const_p(char, "std_all"),
    3365             :                 .get = py_standard_mapping_get_std_all,
    3366             :                 .set = py_standard_mapping_set_std_all,
    3367             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3368             :         },
    3369             :         { .name = NULL }
    3370             : };
    3371             : 
    3372           0 : static PyObject *py_standard_mapping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3373             : {
    3374           0 :         return pytalloc_new(struct standard_mapping, type);
    3375             : }
    3376             : 
    3377             : 
    3378             : static PyTypeObject standard_mapping_Type = {
    3379             :         PyVarObject_HEAD_INIT(NULL, 0)
    3380             :         .tp_name = "security.standard_mapping",
    3381             :         .tp_getset = py_standard_mapping_getsetters,
    3382             :         .tp_methods = NULL,
    3383             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3384             :         .tp_new = py_standard_mapping_new,
    3385             : };
    3386             : 
    3387             : 
    3388             : const struct PyNdrRpcMethodDef py_ndr_security_methods[] = {
    3389             :         {0}
    3390             : };
    3391             : 
    3392           0 : static PyObject *interface_security_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3393             : {
    3394           0 :         return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_security);
    3395             : }
    3396             : 
    3397             : static PyTypeObject security_InterfaceType = {
    3398             :         PyVarObject_HEAD_INIT(NULL, 0)
    3399             :         .tp_name = "security.security",
    3400             :         .tp_basicsize = sizeof(dcerpc_InterfaceObject),
    3401             :         .tp_doc = "security(binding, lp_ctx=None, credentials=None) -> connection\n"
    3402             : "\n"
    3403             : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
    3404             : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
    3405             : "credentials should be a credentials.Credentials object.\n\n",
    3406             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3407             :         .tp_new = interface_security_new,
    3408             : };
    3409             : 
    3410           0 : static PyObject *syntax_security_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3411             : {
    3412           0 :         return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_security.syntax_id);
    3413             : }
    3414             : 
    3415             : static PyTypeObject security_SyntaxType = {
    3416             :         PyVarObject_HEAD_INIT(NULL, 0)
    3417             :         .tp_name = "security.security_abstract_syntax",
    3418             :         .tp_doc = "security_abstract_syntax()\n",
    3419             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3420             :         .tp_new = syntax_security_new,
    3421             : };
    3422             : 
    3423             : static PyMethodDef security_methods[] = {
    3424             :         { NULL, NULL, 0, NULL }
    3425             : };
    3426             : 
    3427             : static struct PyModuleDef moduledef = {
    3428             :         PyModuleDef_HEAD_INIT,
    3429             :         .m_name = "security",
    3430             :         .m_doc = "security DCE/RPC",
    3431             :         .m_size = -1,
    3432             :         .m_methods = security_methods,
    3433             : };
    3434        4994 : MODULE_INIT_FUNC(security)
    3435             : {
    3436        4994 :         PyObject *m = NULL;
    3437        4994 :         PyObject *dep_samba_dcerpc_misc = NULL;
    3438        4994 :         PyObject *dep_talloc = NULL;
    3439        4994 :         PyObject *dep_samba_dcerpc_base = NULL;
    3440             : 
    3441        4994 :         dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
    3442        4994 :         if (dep_samba_dcerpc_misc == NULL)
    3443           0 :                 goto out;
    3444             : 
    3445        4994 :         dep_talloc = PyImport_ImportModule("talloc");
    3446        4994 :         if (dep_talloc == NULL)
    3447           0 :                 goto out;
    3448             : 
    3449        4994 :         dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
    3450        4994 :         if (dep_samba_dcerpc_base == NULL)
    3451           0 :                 goto out;
    3452             : 
    3453        4994 :         BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
    3454        4994 :         if (BaseObject_Type == NULL)
    3455           0 :                 goto out;
    3456             : 
    3457        4994 :         GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
    3458        4994 :         if (GUID_Type == NULL)
    3459           0 :                 goto out;
    3460             : 
    3461        4994 :         ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
    3462        4994 :         if (ClientConnection_Type == NULL)
    3463           0 :                 goto out;
    3464             : 
    3465        4994 :         ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
    3466        4994 :         if (ndr_syntax_id_Type == NULL)
    3467           0 :                 goto out;
    3468             : 
    3469        4994 :         dom_sid_Type.tp_base = BaseObject_Type;
    3470        4994 :         dom_sid_Type.tp_basicsize = pytalloc_BaseObject_size();
    3471             : 
    3472        4994 :         security_ace_object_type_Type.tp_base = BaseObject_Type;
    3473        4994 :         security_ace_object_type_Type.tp_basicsize = pytalloc_BaseObject_size();
    3474             : 
    3475        4994 :         security_ace_object_inherited_type_Type.tp_base = BaseObject_Type;
    3476        4994 :         security_ace_object_inherited_type_Type.tp_basicsize = pytalloc_BaseObject_size();
    3477             : 
    3478        4994 :         security_ace_object_Type.tp_base = BaseObject_Type;
    3479        4994 :         security_ace_object_Type.tp_basicsize = pytalloc_BaseObject_size();
    3480             : 
    3481        4994 :         security_ace_object_ctr_Type.tp_base = BaseObject_Type;
    3482        4994 :         security_ace_object_ctr_Type.tp_basicsize = pytalloc_BaseObject_size();
    3483             : 
    3484        4994 :         security_ace_Type.tp_base = BaseObject_Type;
    3485        4994 :         security_ace_Type.tp_basicsize = pytalloc_BaseObject_size();
    3486             : 
    3487        4994 :         security_acl_Type.tp_base = BaseObject_Type;
    3488        4994 :         security_acl_Type.tp_basicsize = pytalloc_BaseObject_size();
    3489             : 
    3490        4994 :         security_descriptor_Type.tp_base = BaseObject_Type;
    3491        4994 :         security_descriptor_Type.tp_basicsize = pytalloc_BaseObject_size();
    3492             : 
    3493        4994 :         sec_desc_buf_Type.tp_base = BaseObject_Type;
    3494        4994 :         sec_desc_buf_Type.tp_basicsize = pytalloc_BaseObject_size();
    3495             : 
    3496        4994 :         security_token_Type.tp_base = BaseObject_Type;
    3497        4994 :         security_token_Type.tp_basicsize = pytalloc_BaseObject_size();
    3498             : 
    3499        4994 :         security_unix_token_Type.tp_base = BaseObject_Type;
    3500        4994 :         security_unix_token_Type.tp_basicsize = pytalloc_BaseObject_size();
    3501             : 
    3502        4994 :         LSAP_TOKEN_INFO_INTEGRITY_Type.tp_base = BaseObject_Type;
    3503        4994 :         LSAP_TOKEN_INFO_INTEGRITY_Type.tp_basicsize = pytalloc_BaseObject_size();
    3504             : 
    3505        4994 :         generic_mapping_Type.tp_base = BaseObject_Type;
    3506        4994 :         generic_mapping_Type.tp_basicsize = pytalloc_BaseObject_size();
    3507             : 
    3508        4994 :         standard_mapping_Type.tp_base = BaseObject_Type;
    3509        4994 :         standard_mapping_Type.tp_basicsize = pytalloc_BaseObject_size();
    3510             : 
    3511        4994 :         security_InterfaceType.tp_base = ClientConnection_Type;
    3512             : 
    3513        4994 :         security_SyntaxType.tp_base = ndr_syntax_id_Type;
    3514        4994 :         security_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
    3515             : 
    3516        4994 :         if (PyType_Ready(&dom_sid_Type) < 0)
    3517           0 :                 goto out;
    3518        4994 :         if (PyType_Ready(&security_ace_object_type_Type) < 0)
    3519           0 :                 goto out;
    3520        4994 :         if (PyType_Ready(&security_ace_object_inherited_type_Type) < 0)
    3521           0 :                 goto out;
    3522        4994 :         if (PyType_Ready(&security_ace_object_Type) < 0)
    3523           0 :                 goto out;
    3524        4994 :         if (PyType_Ready(&security_ace_object_ctr_Type) < 0)
    3525           0 :                 goto out;
    3526        4994 :         if (PyType_Ready(&security_ace_Type) < 0)
    3527           0 :                 goto out;
    3528        4994 :         if (PyType_Ready(&security_acl_Type) < 0)
    3529           0 :                 goto out;
    3530        4994 :         if (PyType_Ready(&security_descriptor_Type) < 0)
    3531           0 :                 goto out;
    3532        4994 :         if (PyType_Ready(&sec_desc_buf_Type) < 0)
    3533           0 :                 goto out;
    3534        4994 :         if (PyType_Ready(&security_token_Type) < 0)
    3535           0 :                 goto out;
    3536        4994 :         if (PyType_Ready(&security_unix_token_Type) < 0)
    3537           0 :                 goto out;
    3538        4994 :         if (PyType_Ready(&LSAP_TOKEN_INFO_INTEGRITY_Type) < 0)
    3539           0 :                 goto out;
    3540        4994 :         if (PyType_Ready(&generic_mapping_Type) < 0)
    3541           0 :                 goto out;
    3542        4994 :         if (PyType_Ready(&standard_mapping_Type) < 0)
    3543           0 :                 goto out;
    3544        4994 :         if (PyType_Ready(&security_InterfaceType) < 0)
    3545           0 :                 goto out;
    3546        4994 :         if (PyType_Ready(&security_SyntaxType) < 0)
    3547           0 :                 goto out;
    3548        4994 :         if (!PyInterface_AddNdrRpcMethods(&security_InterfaceType, py_ndr_security_methods))
    3549           0 :                 return NULL;
    3550             : 
    3551             : #ifdef PY_DOM_SID_PATCH
    3552        4994 :         PY_DOM_SID_PATCH(&dom_sid_Type);
    3553             : #endif
    3554             : #ifdef PY_ACE_OBJECT_TYPE_PATCH
    3555             :         PY_ACE_OBJECT_TYPE_PATCH(&security_ace_object_type_Type);
    3556             : #endif
    3557             : #ifdef PY_ACE_OBJECT_INHERITED_TYPE_PATCH
    3558             :         PY_ACE_OBJECT_INHERITED_TYPE_PATCH(&security_ace_object_inherited_type_Type);
    3559             : #endif
    3560             : #ifdef PY_ACE_OBJECT_PATCH
    3561             :         PY_ACE_OBJECT_PATCH(&security_ace_object_Type);
    3562             : #endif
    3563             : #ifdef PY_ACE_OBJECT_CTR_PATCH
    3564             :         PY_ACE_OBJECT_CTR_PATCH(&security_ace_object_ctr_Type);
    3565             : #endif
    3566             : #ifdef PY_ACE_PATCH
    3567             :         PY_ACE_PATCH(&security_ace_Type);
    3568             : #endif
    3569             : #ifdef PY_ACL_PATCH
    3570             :         PY_ACL_PATCH(&security_acl_Type);
    3571             : #endif
    3572             : #ifdef PY_DESCRIPTOR_PATCH
    3573        4994 :         PY_DESCRIPTOR_PATCH(&security_descriptor_Type);
    3574             : #endif
    3575             : #ifdef PY_SEC_DESC_BUF_PATCH
    3576             :         PY_SEC_DESC_BUF_PATCH(&sec_desc_buf_Type);
    3577             : #endif
    3578             : #ifdef PY_TOKEN_PATCH
    3579        4994 :         PY_TOKEN_PATCH(&security_token_Type);
    3580             : #endif
    3581             : #ifdef PY_UNIX_TOKEN_PATCH
    3582             :         PY_UNIX_TOKEN_PATCH(&security_unix_token_Type);
    3583             : #endif
    3584             : #ifdef PY_LSAP_TOKEN_INFO_INTEGRITY_PATCH
    3585             :         PY_LSAP_TOKEN_INFO_INTEGRITY_PATCH(&LSAP_TOKEN_INFO_INTEGRITY_Type);
    3586             : #endif
    3587             : #ifdef PY_GENERIC_MAPPING_PATCH
    3588             :         PY_GENERIC_MAPPING_PATCH(&generic_mapping_Type);
    3589             : #endif
    3590             : #ifdef PY_STANDARD_MAPPING_PATCH
    3591             :         PY_STANDARD_MAPPING_PATCH(&standard_mapping_Type);
    3592             : #endif
    3593             : #ifdef PY_SECURITY_PATCH
    3594             :         PY_SECURITY_PATCH(&security_InterfaceType);
    3595             : #endif
    3596             : #ifdef PY_SECURITY_ABSTRACT_SYNTAX_PATCH
    3597             :         PY_SECURITY_ABSTRACT_SYNTAX_PATCH(&security_SyntaxType);
    3598             : #endif
    3599             : #ifdef PY_ABSTRACT_SYNTAX_PATCH
    3600             :         PY_ABSTRACT_SYNTAX_PATCH(&security_SyntaxType);
    3601             : #endif
    3602             : 
    3603        4994 :         m = PyModule_Create(&moduledef);
    3604        4994 :         if (m == NULL)
    3605           0 :                 goto out;
    3606             : 
    3607        4994 :         PyModule_AddObject(m, "SEC_MASK_GENERIC", PyLong_FromUnsignedLongLong(0xF0000000));
    3608        4994 :         PyModule_AddObject(m, "SEC_MASK_FLAGS", PyLong_FromUnsignedLongLong(0x0F000000));
    3609        4994 :         PyModule_AddObject(m, "SEC_MASK_STANDARD", PyLong_FromUnsignedLongLong(0x00FF0000));
    3610        4994 :         PyModule_AddObject(m, "SEC_MASK_SPECIFIC", PyLong_FromUnsignedLongLong(0x0000FFFF));
    3611        4994 :         PyModule_AddObject(m, "SEC_GENERIC_ALL", PyLong_FromUnsignedLongLong(0x10000000));
    3612        4994 :         PyModule_AddObject(m, "SEC_GENERIC_EXECUTE", PyLong_FromUnsignedLongLong(0x20000000));
    3613        4994 :         PyModule_AddObject(m, "SEC_GENERIC_WRITE", PyLong_FromUnsignedLongLong(0x40000000));
    3614        4994 :         PyModule_AddObject(m, "SEC_GENERIC_READ", PyLong_FromUnsignedLongLong(0x80000000));
    3615        4994 :         PyModule_AddObject(m, "SEC_FLAG_SYSTEM_SECURITY", PyLong_FromUnsignedLongLong(0x01000000));
    3616        4994 :         PyModule_AddObject(m, "SEC_FLAG_MAXIMUM_ALLOWED", PyLong_FromUnsignedLongLong(0x02000000));
    3617        4994 :         PyModule_AddObject(m, "SEC_STD_DELETE", PyLong_FromUnsignedLongLong(0x00010000));
    3618        4994 :         PyModule_AddObject(m, "SEC_STD_READ_CONTROL", PyLong_FromUnsignedLongLong(0x00020000));
    3619        4994 :         PyModule_AddObject(m, "SEC_STD_WRITE_DAC", PyLong_FromUnsignedLongLong(0x00040000));
    3620        4994 :         PyModule_AddObject(m, "SEC_STD_WRITE_OWNER", PyLong_FromUnsignedLongLong(0x00080000));
    3621        4994 :         PyModule_AddObject(m, "SEC_STD_SYNCHRONIZE", PyLong_FromUnsignedLongLong(0x00100000));
    3622        4994 :         PyModule_AddObject(m, "SEC_STD_REQUIRED", PyLong_FromUnsignedLongLong(0x000F0000));
    3623        4994 :         PyModule_AddObject(m, "SEC_STD_ALL", PyLong_FromUnsignedLongLong(0x001F0000));
    3624        4994 :         PyModule_AddObject(m, "SEC_FILE_READ_DATA", PyLong_FromUnsignedLongLong(0x00000001));
    3625        4994 :         PyModule_AddObject(m, "SEC_FILE_WRITE_DATA", PyLong_FromUnsignedLongLong(0x00000002));
    3626        4994 :         PyModule_AddObject(m, "SEC_FILE_APPEND_DATA", PyLong_FromUnsignedLongLong(0x00000004));
    3627        4994 :         PyModule_AddObject(m, "SEC_FILE_READ_EA", PyLong_FromUnsignedLongLong(0x00000008));
    3628        4994 :         PyModule_AddObject(m, "SEC_FILE_WRITE_EA", PyLong_FromUnsignedLongLong(0x00000010));
    3629        4994 :         PyModule_AddObject(m, "SEC_FILE_EXECUTE", PyLong_FromUnsignedLongLong(0x00000020));
    3630        4994 :         PyModule_AddObject(m, "SEC_FILE_READ_ATTRIBUTE", PyLong_FromUnsignedLongLong(0x00000080));
    3631        4994 :         PyModule_AddObject(m, "SEC_FILE_WRITE_ATTRIBUTE", PyLong_FromUnsignedLongLong(0x00000100));
    3632        4994 :         PyModule_AddObject(m, "SEC_FILE_ALL", PyLong_FromUnsignedLongLong(0x000001ff));
    3633        4994 :         PyModule_AddObject(m, "SEC_DIR_LIST", PyLong_FromUnsignedLongLong(0x00000001));
    3634        4994 :         PyModule_AddObject(m, "SEC_DIR_ADD_FILE", PyLong_FromUnsignedLongLong(0x00000002));
    3635        4994 :         PyModule_AddObject(m, "SEC_DIR_ADD_SUBDIR", PyLong_FromUnsignedLongLong(0x00000004));
    3636        4994 :         PyModule_AddObject(m, "SEC_DIR_READ_EA", PyLong_FromUnsignedLongLong(0x00000008));
    3637        4994 :         PyModule_AddObject(m, "SEC_DIR_WRITE_EA", PyLong_FromUnsignedLongLong(0x00000010));
    3638        4994 :         PyModule_AddObject(m, "SEC_DIR_TRAVERSE", PyLong_FromUnsignedLongLong(0x00000020));
    3639        4994 :         PyModule_AddObject(m, "SEC_DIR_DELETE_CHILD", PyLong_FromUnsignedLongLong(0x00000040));
    3640        4994 :         PyModule_AddObject(m, "SEC_DIR_READ_ATTRIBUTE", PyLong_FromUnsignedLongLong(0x00000080));
    3641        4994 :         PyModule_AddObject(m, "SEC_DIR_WRITE_ATTRIBUTE", PyLong_FromUnsignedLongLong(0x00000100));
    3642        4994 :         PyModule_AddObject(m, "SEC_REG_QUERY_VALUE", PyLong_FromUnsignedLongLong(0x00000001));
    3643        4994 :         PyModule_AddObject(m, "SEC_REG_SET_VALUE", PyLong_FromUnsignedLongLong(0x00000002));
    3644        4994 :         PyModule_AddObject(m, "SEC_REG_CREATE_SUBKEY", PyLong_FromUnsignedLongLong(0x00000004));
    3645        4994 :         PyModule_AddObject(m, "SEC_REG_ENUM_SUBKEYS", PyLong_FromUnsignedLongLong(0x00000008));
    3646        4994 :         PyModule_AddObject(m, "SEC_REG_NOTIFY", PyLong_FromUnsignedLongLong(0x00000010));
    3647        4994 :         PyModule_AddObject(m, "SEC_REG_CREATE_LINK", PyLong_FromUnsignedLongLong(0x00000020));
    3648        4994 :         PyModule_AddObject(m, "SEC_ADS_CREATE_CHILD", PyLong_FromUnsignedLongLong(0x00000001));
    3649        4994 :         PyModule_AddObject(m, "SEC_ADS_DELETE_CHILD", PyLong_FromUnsignedLongLong(0x00000002));
    3650        4994 :         PyModule_AddObject(m, "SEC_ADS_LIST", PyLong_FromUnsignedLongLong(0x00000004));
    3651        4994 :         PyModule_AddObject(m, "SEC_ADS_SELF_WRITE", PyLong_FromUnsignedLongLong(0x00000008));
    3652        4994 :         PyModule_AddObject(m, "SEC_ADS_READ_PROP", PyLong_FromUnsignedLongLong(0x00000010));
    3653        4994 :         PyModule_AddObject(m, "SEC_ADS_WRITE_PROP", PyLong_FromUnsignedLongLong(0x00000020));
    3654        4994 :         PyModule_AddObject(m, "SEC_ADS_DELETE_TREE", PyLong_FromUnsignedLongLong(0x00000040));
    3655        4994 :         PyModule_AddObject(m, "SEC_ADS_LIST_OBJECT", PyLong_FromUnsignedLongLong(0x00000080));
    3656        4994 :         PyModule_AddObject(m, "SEC_ADS_CONTROL_ACCESS", PyLong_FromUnsignedLongLong(0x00000100));
    3657        4994 :         PyModule_AddObject(m, "SEC_MASK_INVALID", PyLong_FromUnsignedLongLong(0x0ce0fe00));
    3658        4994 :         PyModule_AddObject(m, "SEC_RIGHTS_FILE_READ", PyLong_FromLong(SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_READ_DATA|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_READ_EA));
    3659        4994 :         PyModule_AddObject(m, "SEC_RIGHTS_FILE_WRITE", PyLong_FromLong(SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_WRITE_DATA|SEC_FILE_WRITE_ATTRIBUTE|SEC_FILE_WRITE_EA|SEC_FILE_APPEND_DATA));
    3660        4994 :         PyModule_AddObject(m, "SEC_RIGHTS_FILE_EXECUTE", PyLong_FromLong(SEC_STD_SYNCHRONIZE|SEC_STD_READ_CONTROL|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_EXECUTE));
    3661        4994 :         PyModule_AddObject(m, "SEC_RIGHTS_FILE_ALL", PyLong_FromLong(SEC_STD_ALL|SEC_FILE_ALL));
    3662        4994 :         PyModule_AddObject(m, "SEC_RIGHTS_DIR_READ", PyLong_FromLong(SEC_RIGHTS_FILE_READ));
    3663        4994 :         PyModule_AddObject(m, "SEC_RIGHTS_DIR_WRITE", PyLong_FromLong(SEC_RIGHTS_FILE_WRITE));
    3664        4994 :         PyModule_AddObject(m, "SEC_RIGHTS_DIR_EXECUTE", PyLong_FromLong(SEC_RIGHTS_FILE_EXECUTE));
    3665        4994 :         PyModule_AddObject(m, "SEC_RIGHTS_DIR_ALL", PyLong_FromLong(SEC_RIGHTS_FILE_ALL));
    3666        4994 :         PyModule_AddObject(m, "SEC_RIGHTS_PRIV_BACKUP", PyLong_FromLong(SEC_STD_READ_CONTROL|SEC_FLAG_SYSTEM_SECURITY|SEC_RIGHTS_FILE_READ|SEC_DIR_TRAVERSE));
    3667        4994 :         PyModule_AddObject(m, "SEC_RIGHTS_PRIV_RESTORE", PyLong_FromLong(SEC_STD_WRITE_DAC|SEC_STD_WRITE_OWNER|SEC_FLAG_SYSTEM_SECURITY|SEC_RIGHTS_FILE_WRITE|SEC_DIR_ADD_FILE|SEC_DIR_ADD_SUBDIR|SEC_STD_DELETE));
    3668        4994 :         PyModule_AddObject(m, "STANDARD_RIGHTS_ALL_ACCESS", PyLong_FromLong(SEC_STD_ALL));
    3669        4994 :         PyModule_AddObject(m, "STANDARD_RIGHTS_MODIFY_ACCESS", PyLong_FromLong(SEC_STD_READ_CONTROL));
    3670        4994 :         PyModule_AddObject(m, "STANDARD_RIGHTS_EXECUTE_ACCESS", PyLong_FromLong(SEC_STD_READ_CONTROL));
    3671        4994 :         PyModule_AddObject(m, "STANDARD_RIGHTS_READ_ACCESS", PyLong_FromLong(SEC_STD_READ_CONTROL));
    3672        4994 :         PyModule_AddObject(m, "STANDARD_RIGHTS_WRITE_ACCESS", PyLong_FromLong((SEC_STD_WRITE_OWNER|SEC_STD_WRITE_DAC|SEC_STD_DELETE)));
    3673        4994 :         PyModule_AddObject(m, "STANDARD_RIGHTS_REQUIRED_ACCESS", PyLong_FromLong((SEC_STD_DELETE|SEC_STD_READ_CONTROL|SEC_STD_WRITE_DAC|SEC_STD_WRITE_OWNER)));
    3674        4994 :         PyModule_AddObject(m, "SEC_ADS_GENERIC_ALL_DS", PyLong_FromLong((SEC_STD_DELETE|SEC_STD_WRITE_DAC|SEC_STD_WRITE_OWNER|SEC_ADS_CREATE_CHILD|SEC_ADS_DELETE_CHILD|SEC_ADS_DELETE_TREE|SEC_ADS_CONTROL_ACCESS)));
    3675        4994 :         PyModule_AddObject(m, "SEC_ADS_GENERIC_EXECUTE", PyLong_FromLong(SEC_STD_READ_CONTROL|SEC_ADS_LIST));
    3676        4994 :         PyModule_AddObject(m, "SEC_ADS_GENERIC_WRITE", PyLong_FromLong((SEC_STD_READ_CONTROL|SEC_ADS_SELF_WRITE|SEC_ADS_WRITE_PROP)));
    3677        4994 :         PyModule_AddObject(m, "SEC_ADS_GENERIC_READ", PyLong_FromLong((SEC_STD_READ_CONTROL|SEC_ADS_LIST|SEC_ADS_READ_PROP|SEC_ADS_LIST_OBJECT)));
    3678        4994 :         PyModule_AddObject(m, "SEC_ADS_GENERIC_ALL", PyLong_FromLong((SEC_ADS_GENERIC_EXECUTE|SEC_ADS_GENERIC_WRITE|SEC_ADS_GENERIC_READ|SEC_ADS_GENERIC_ALL_DS)));
    3679        4994 :         PyModule_AddObject(m, "SID_NULL", PyUnicode_FromString("S-1-0-0"));
    3680        4994 :         PyModule_AddObject(m, "NAME_WORLD", PyUnicode_FromString("WORLD"));
    3681        4994 :         PyModule_AddObject(m, "SID_WORLD_DOMAIN", PyUnicode_FromString("S-1-1"));
    3682        4994 :         PyModule_AddObject(m, "SID_WORLD", PyUnicode_FromString("S-1-1-0"));
    3683        4994 :         PyModule_AddObject(m, "SID_CREATOR_OWNER_DOMAIN", PyUnicode_FromString("S-1-3"));
    3684        4994 :         PyModule_AddObject(m, "SID_CREATOR_OWNER", PyUnicode_FromString("S-1-3-0"));
    3685        4994 :         PyModule_AddObject(m, "SID_CREATOR_GROUP", PyUnicode_FromString("S-1-3-1"));
    3686        4994 :         PyModule_AddObject(m, "SID_OWNER_RIGHTS", PyUnicode_FromString("S-1-3-4"));
    3687        4994 :         PyModule_AddObject(m, "NAME_NT_AUTHORITY", PyUnicode_FromString("NT AUTHORITY"));
    3688        4994 :         PyModule_AddObject(m, "SID_NT_AUTHORITY", PyUnicode_FromString("S-1-5"));
    3689        4994 :         PyModule_AddObject(m, "SID_NT_DIALUP", PyUnicode_FromString("S-1-5-1"));
    3690        4994 :         PyModule_AddObject(m, "SID_NT_NETWORK", PyUnicode_FromString("S-1-5-2"));
    3691        4994 :         PyModule_AddObject(m, "SID_NT_BATCH", PyUnicode_FromString("S-1-5-3"));
    3692        4994 :         PyModule_AddObject(m, "SID_NT_INTERACTIVE", PyUnicode_FromString("S-1-5-4"));
    3693        4994 :         PyModule_AddObject(m, "SID_NT_SERVICE", PyUnicode_FromString("S-1-5-6"));
    3694        4994 :         PyModule_AddObject(m, "SID_NT_ANONYMOUS", PyUnicode_FromString("S-1-5-7"));
    3695        4994 :         PyModule_AddObject(m, "SID_NT_PROXY", PyUnicode_FromString("S-1-5-8"));
    3696        4994 :         PyModule_AddObject(m, "SID_NT_ENTERPRISE_DCS", PyUnicode_FromString("S-1-5-9"));
    3697        4994 :         PyModule_AddObject(m, "SID_NT_SELF", PyUnicode_FromString("S-1-5-10"));
    3698        4994 :         PyModule_AddObject(m, "SID_NT_AUTHENTICATED_USERS", PyUnicode_FromString("S-1-5-11"));
    3699        4994 :         PyModule_AddObject(m, "SID_NT_RESTRICTED", PyUnicode_FromString("S-1-5-12"));
    3700        4994 :         PyModule_AddObject(m, "SID_NT_TERMINAL_SERVER_USERS", PyUnicode_FromString("S-1-5-13"));
    3701        4994 :         PyModule_AddObject(m, "SID_NT_REMOTE_INTERACTIVE", PyUnicode_FromString("S-1-5-14"));
    3702        4994 :         PyModule_AddObject(m, "SID_NT_THIS_ORGANISATION", PyUnicode_FromString("S-1-5-15"));
    3703        4994 :         PyModule_AddObject(m, "SID_NT_IUSR", PyUnicode_FromString("S-1-5-17"));
    3704        4994 :         PyModule_AddObject(m, "SID_NT_SYSTEM", PyUnicode_FromString("S-1-5-18"));
    3705        4994 :         PyModule_AddObject(m, "SID_NT_LOCAL_SERVICE", PyUnicode_FromString("S-1-5-19"));
    3706        4994 :         PyModule_AddObject(m, "SID_NT_NETWORK_SERVICE", PyUnicode_FromString("S-1-5-20"));
    3707        4994 :         PyModule_AddObject(m, "SID_NT_DIGEST_AUTHENTICATION", PyUnicode_FromString("S-1-5-64-21"));
    3708        4994 :         PyModule_AddObject(m, "SID_NT_NTLM_AUTHENTICATION", PyUnicode_FromString("S-1-5-64-10"));
    3709        4994 :         PyModule_AddObject(m, "SID_NT_SCHANNEL_AUTHENTICATION", PyUnicode_FromString("S-1-5-64-14"));
    3710        4994 :         PyModule_AddObject(m, "SID_NT_OTHER_ORGANISATION", PyUnicode_FromString("S-1-5-1000"));
    3711        4994 :         PyModule_AddObject(m, "NAME_BUILTIN", PyUnicode_FromString("BUILTIN"));
    3712        4994 :         PyModule_AddObject(m, "SID_BUILTIN", PyUnicode_FromString("S-1-5-32"));
    3713        4994 :         PyModule_AddObject(m, "SID_BUILTIN_ADMINISTRATORS", PyUnicode_FromString("S-1-5-32-544"));
    3714        4994 :         PyModule_AddObject(m, "SID_BUILTIN_USERS", PyUnicode_FromString("S-1-5-32-545"));
    3715        4994 :         PyModule_AddObject(m, "SID_BUILTIN_GUESTS", PyUnicode_FromString("S-1-5-32-546"));
    3716        4994 :         PyModule_AddObject(m, "SID_BUILTIN_POWER_USERS", PyUnicode_FromString("S-1-5-32-547"));
    3717        4994 :         PyModule_AddObject(m, "SID_BUILTIN_ACCOUNT_OPERATORS", PyUnicode_FromString("S-1-5-32-548"));
    3718        4994 :         PyModule_AddObject(m, "SID_BUILTIN_SERVER_OPERATORS", PyUnicode_FromString("S-1-5-32-549"));
    3719        4994 :         PyModule_AddObject(m, "SID_BUILTIN_PRINT_OPERATORS", PyUnicode_FromString("S-1-5-32-550"));
    3720        4994 :         PyModule_AddObject(m, "SID_BUILTIN_BACKUP_OPERATORS", PyUnicode_FromString("S-1-5-32-551"));
    3721        4994 :         PyModule_AddObject(m, "SID_BUILTIN_REPLICATOR", PyUnicode_FromString("S-1-5-32-552"));
    3722        4994 :         PyModule_AddObject(m, "SID_BUILTIN_RAS_SERVERS", PyUnicode_FromString("S-1-5-32-553"));
    3723        4994 :         PyModule_AddObject(m, "SID_BUILTIN_PREW2K", PyUnicode_FromString("S-1-5-32-554"));
    3724        4994 :         PyModule_AddObject(m, "SID_BUILTIN_REMOTE_DESKTOP_USERS", PyUnicode_FromString("S-1-5-32-555"));
    3725        4994 :         PyModule_AddObject(m, "SID_BUILTIN_NETWORK_CONF_OPERATORS", PyUnicode_FromString("S-1-5-32-556"));
    3726        4994 :         PyModule_AddObject(m, "SID_BUILTIN_INCOMING_FOREST_TRUST", PyUnicode_FromString("S-1-5-32-557"));
    3727        4994 :         PyModule_AddObject(m, "SID_BUILTIN_PERFMON_USERS", PyUnicode_FromString("S-1-5-32-558"));
    3728        4994 :         PyModule_AddObject(m, "SID_BUILTIN_PERFLOG_USERS", PyUnicode_FromString("S-1-5-32-559"));
    3729        4994 :         PyModule_AddObject(m, "SID_BUILTIN_AUTH_ACCESS", PyUnicode_FromString("S-1-5-32-560"));
    3730        4994 :         PyModule_AddObject(m, "SID_BUILTIN_TS_LICENSE_SERVERS", PyUnicode_FromString("S-1-5-32-561"));
    3731        4994 :         PyModule_AddObject(m, "SID_BUILTIN_DISTRIBUTED_COM_USERS", PyUnicode_FromString("S-1-5-32-562"));
    3732        4994 :         PyModule_AddObject(m, "SID_BUILTIN_CRYPTO_OPERATORS", PyUnicode_FromString("S-1-5-32-569"));
    3733        4994 :         PyModule_AddObject(m, "SID_BUILTIN_EVENT_LOG_READERS", PyUnicode_FromString("S-1-5-32-573"));
    3734        4994 :         PyModule_AddObject(m, "SID_BUILTIN_CERT_SERV_DCOM_ACCESS", PyUnicode_FromString("S-1-5-32-574"));
    3735        4994 :         PyModule_AddObject(m, "SID_SAMBA_UNIX_USER_OWNER", PyUnicode_FromString("S-1-22-1"));
    3736        4994 :         PyModule_AddObject(m, "SID_SAMBA_UNIX_GROUP_OWNER", PyUnicode_FromString("S-1-22-2"));
    3737        4994 :         PyModule_AddObject(m, "SID_SAMBA_SMB3", PyUnicode_FromString("S-1-22-1397571891"));
    3738        4994 :         PyModule_AddObject(m, "NAME_NT_SERVICE", PyUnicode_FromString("NT SERVICE"));
    3739        4994 :         PyModule_AddObject(m, "SID_NT_NT_SERVICE", PyUnicode_FromString("S-1-5-80"));
    3740        4994 :         PyModule_AddObject(m, "SID_NT_TRUSTED_INSTALLER", PyUnicode_FromString("S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464"));
    3741        4994 :         PyModule_AddObject(m, "SID_AUTHENTICATION_AUTHORITY_ASSERTED_IDENTITY", PyUnicode_FromString("S-1-18-1"));
    3742        4994 :         PyModule_AddObject(m, "SID_SERVICE_ASSERTED_IDENTITY", PyUnicode_FromString("S-1-18-2"));
    3743        4994 :         PyModule_AddObject(m, "SID_COMPOUNDED_AUTHENTICATION", PyUnicode_FromString("S-1-5-21-0-0-0-496"));
    3744        4994 :         PyModule_AddObject(m, "SID_CLAIMS_VALID", PyUnicode_FromString("S-1-5-21-0-0-0-497"));
    3745        4994 :         PyModule_AddObject(m, "SID_NT_NFS_SUBSYSTEM", PyUnicode_FromString("S-1-5-88"));
    3746        4994 :         PyModule_AddObject(m, "SID_NT_NFS_USER", PyUnicode_FromString("S-1-5-88-1"));
    3747        4994 :         PyModule_AddObject(m, "SID_NT_NFS_GROUP", PyUnicode_FromString("S-1-5-88-2"));
    3748        4994 :         PyModule_AddObject(m, "SID_NT_NFS_MASK", PyUnicode_FromString("S-1-5-88-3"));
    3749        4994 :         PyModule_AddObject(m, "SID_NT_NFS_OTHERS", PyUnicode_FromString("S-1-5-88-4"));
    3750        4994 :         PyModule_AddObject(m, "DOMAIN_RID_LOGON", PyLong_FromUnsignedLongLong(9));
    3751        4994 :         PyModule_AddObject(m, "DOMAIN_RID_ENTERPRISE_READONLY_DCS", PyLong_FromUnsignedLongLong(498));
    3752        4994 :         PyModule_AddObject(m, "DOMAIN_RID_ADMINISTRATOR", PyLong_FromUnsignedLongLong(500));
    3753        4994 :         PyModule_AddObject(m, "DOMAIN_RID_GUEST", PyLong_FromUnsignedLongLong(501));
    3754        4994 :         PyModule_AddObject(m, "DOMAIN_RID_KRBTGT", PyLong_FromUnsignedLongLong(502));
    3755        4994 :         PyModule_AddObject(m, "DOMAIN_RID_ADMINS", PyLong_FromUnsignedLongLong(512));
    3756        4994 :         PyModule_AddObject(m, "DOMAIN_RID_USERS", PyLong_FromUnsignedLongLong(513));
    3757        4994 :         PyModule_AddObject(m, "DOMAIN_RID_GUESTS", PyLong_FromUnsignedLongLong(514));
    3758        4994 :         PyModule_AddObject(m, "DOMAIN_RID_DOMAIN_MEMBERS", PyLong_FromUnsignedLongLong(515));
    3759        4994 :         PyModule_AddObject(m, "DOMAIN_RID_DCS", PyLong_FromUnsignedLongLong(516));
    3760        4994 :         PyModule_AddObject(m, "DOMAIN_RID_CERT_ADMINS", PyLong_FromUnsignedLongLong(517));
    3761        4994 :         PyModule_AddObject(m, "DOMAIN_RID_SCHEMA_ADMINS", PyLong_FromUnsignedLongLong(518));
    3762        4994 :         PyModule_AddObject(m, "DOMAIN_RID_ENTERPRISE_ADMINS", PyLong_FromUnsignedLongLong(519));
    3763        4994 :         PyModule_AddObject(m, "DOMAIN_RID_POLICY_ADMINS", PyLong_FromUnsignedLongLong(520));
    3764        4994 :         PyModule_AddObject(m, "DOMAIN_RID_READONLY_DCS", PyLong_FromUnsignedLongLong(521));
    3765        4994 :         PyModule_AddObject(m, "DOMAIN_RID_RAS_SERVERS", PyLong_FromUnsignedLongLong(553));
    3766        4994 :         PyModule_AddObject(m, "DOMAIN_RID_RODC_ALLOW", PyLong_FromUnsignedLongLong(571));
    3767        4994 :         PyModule_AddObject(m, "DOMAIN_RID_RODC_DENY", PyLong_FromUnsignedLongLong(572));
    3768        4994 :         PyModule_AddObject(m, "BUILTIN_RID_ADMINISTRATORS", PyLong_FromUnsignedLongLong(544));
    3769        4994 :         PyModule_AddObject(m, "BUILTIN_RID_USERS", PyLong_FromUnsignedLongLong(545));
    3770        4994 :         PyModule_AddObject(m, "BUILTIN_RID_GUESTS", PyLong_FromUnsignedLongLong(546));
    3771        4994 :         PyModule_AddObject(m, "BUILTIN_RID_POWER_USERS", PyLong_FromUnsignedLongLong(547));
    3772        4994 :         PyModule_AddObject(m, "BUILTIN_RID_ACCOUNT_OPERATORS", PyLong_FromUnsignedLongLong(548));
    3773        4994 :         PyModule_AddObject(m, "BUILTIN_RID_SERVER_OPERATORS", PyLong_FromUnsignedLongLong(549));
    3774        4994 :         PyModule_AddObject(m, "BUILTIN_RID_PRINT_OPERATORS", PyLong_FromUnsignedLongLong(550));
    3775        4994 :         PyModule_AddObject(m, "BUILTIN_RID_BACKUP_OPERATORS", PyLong_FromUnsignedLongLong(551));
    3776        4994 :         PyModule_AddObject(m, "BUILTIN_RID_REPLICATOR", PyLong_FromUnsignedLongLong(552));
    3777        4994 :         PyModule_AddObject(m, "BUILTIN_RID_RAS_SERVERS", PyLong_FromUnsignedLongLong(553));
    3778        4994 :         PyModule_AddObject(m, "BUILTIN_RID_PRE_2K_ACCESS", PyLong_FromUnsignedLongLong(554));
    3779        4994 :         PyModule_AddObject(m, "BUILTIN_RID_REMOTE_DESKTOP_USERS", PyLong_FromUnsignedLongLong(555));
    3780        4994 :         PyModule_AddObject(m, "BUILTIN_RID_NETWORK_CONF_OPERATORS", PyLong_FromUnsignedLongLong(556));
    3781        4994 :         PyModule_AddObject(m, "BUILTIN_RID_INCOMING_FOREST_TRUST", PyLong_FromUnsignedLongLong(557));
    3782        4994 :         PyModule_AddObject(m, "BUILTIN_RID_PERFMON_USERS", PyLong_FromUnsignedLongLong(558));
    3783        4994 :         PyModule_AddObject(m, "BUILTIN_RID_PERFLOG_USERS", PyLong_FromUnsignedLongLong(559));
    3784        4994 :         PyModule_AddObject(m, "BUILTIN_RID_AUTH_ACCESS", PyLong_FromUnsignedLongLong(560));
    3785        4994 :         PyModule_AddObject(m, "BUILTIN_RID_TS_LICENSE_SERVERS", PyLong_FromUnsignedLongLong(561));
    3786        4994 :         PyModule_AddObject(m, "BUILTIN_RID_DISTRIBUTED_COM_USERS", PyLong_FromUnsignedLongLong(562));
    3787        4994 :         PyModule_AddObject(m, "BUILTIN_RID_CRYPTO_OPERATORS", PyLong_FromUnsignedLongLong(569));
    3788        4994 :         PyModule_AddObject(m, "BUILTIN_RID_EVENT_LOG_READERS", PyLong_FromUnsignedLongLong(573));
    3789        4994 :         PyModule_AddObject(m, "BUILTIN_RID_CERT_SERV_DCOM_ACCESS", PyLong_FromUnsignedLongLong(574));
    3790        4994 :         PyModule_AddObject(m, "NT4_ACL_REVISION", PyLong_FromUnsignedLongLong((uint32_t)SECURITY_ACL_REVISION_NT4));
    3791        4994 :         PyModule_AddObject(m, "SD_REVISION", PyLong_FromLong(SECURITY_DESCRIPTOR_REVISION_1));
    3792        4994 :         PyModule_AddObject(m, "SMB_SUPPORTED_SECINFO_FLAGS", PyLong_FromLong((SECINFO_OWNER|SECINFO_GROUP|SECINFO_DACL|SECINFO_SACL|SECINFO_LABEL|SECINFO_ATTRIBUTE|SECINFO_SCOPE|SECINFO_BACKUP|0)));
    3793        4994 :         PyModule_AddObject(m, "GUID_DRS_ALLOCATE_RIDS", PyUnicode_FromString("1abd7cf8-0a99-11d1-adbb-00c04fd8d5cd"));
    3794        4994 :         PyModule_AddObject(m, "GUID_DRS_CHANGE_DOMAIN_MASTER", PyUnicode_FromString("014bf69c-7b3b-11d1-85f6-08002be74fab"));
    3795        4994 :         PyModule_AddObject(m, "GUID_DRS_CHANGE_INFR_MASTER", PyUnicode_FromString("cc17b1fb-33d9-11d2-97d4-00c04fd8d5cd"));
    3796        4994 :         PyModule_AddObject(m, "GUID_DRS_CHANGE_PDC", PyUnicode_FromString("bae50096-4752-11d1-9052-00c04fc2d4cf"));
    3797        4994 :         PyModule_AddObject(m, "GUID_DRS_CHANGE_RID_MASTER", PyUnicode_FromString("d58d5f36-0a98-11d1-adbb-00c04fd8d5cd"));
    3798        4994 :         PyModule_AddObject(m, "GUID_DRS_CHANGE_SCHEMA_MASTER", PyUnicode_FromString("e12b56b6-0a95-11d1-adbb-00c04fd8d5cd"));
    3799        4994 :         PyModule_AddObject(m, "GUID_DRS_GET_CHANGES", PyUnicode_FromString("1131f6aa-9c07-11d1-f79f-00c04fc2dcd2"));
    3800        4994 :         PyModule_AddObject(m, "GUID_DRS_REPL_SYNCRONIZE", PyUnicode_FromString("1131f6ab-9c07-11d1-f79f-00c04fc2dcd2"));
    3801        4994 :         PyModule_AddObject(m, "GUID_DRS_MANAGE_TOPOLOGY", PyUnicode_FromString("1131f6ac-9c07-11d1-f79f-00c04fc2dcd2"));
    3802        4994 :         PyModule_AddObject(m, "GUID_DRS_GET_ALL_CHANGES", PyUnicode_FromString("1131f6ad-9c07-11d1-f79f-00c04fc2dcd2"));
    3803        4994 :         PyModule_AddObject(m, "GUID_DRS_RO_REPL_SECRET_SYNC", PyUnicode_FromString("1131f6ae-9c07-11d1-f79f-00c04fc2dcd2"));
    3804        4994 :         PyModule_AddObject(m, "GUID_DRS_GET_FILTERED_ATTRIBUTES", PyUnicode_FromString("89e95b76-444d-4c62-991a-0facbeda640c"));
    3805        4994 :         PyModule_AddObject(m, "GUID_DRS_MONITOR_TOPOLOGY", PyUnicode_FromString("f98340fb-7c5b-4cdb-a00b-2ebdfa115a96"));
    3806        4994 :         PyModule_AddObject(m, "GUID_DRS_USER_CHANGE_PASSWORD", PyUnicode_FromString("ab721a53-1e2f-11d0-9819-00aa0040529b"));
    3807        4994 :         PyModule_AddObject(m, "GUID_DRS_FORCE_CHANGE_PASSWORD", PyUnicode_FromString("00299570-246d-11d0-a768-00aa006e0529"));
    3808        4994 :         PyModule_AddObject(m, "GUID_DRS_UPDATE_PASSWORD_NOT_REQUIRED_BIT", PyUnicode_FromString("280f369c-67c7-438e-ae98-1d46f3c6f541"));
    3809        4994 :         PyModule_AddObject(m, "GUID_DRS_UNEXPIRE_PASSWORD", PyUnicode_FromString("ccc2dc7d-a6ad-4a7a-8846-c04e3cc53501"));
    3810        4994 :         PyModule_AddObject(m, "GUID_DRS_ENABLE_PER_USER_REVERSIBLY_ENCRYPTED_PASSWORD", PyUnicode_FromString("05c74c5e-4deb-43b4-bd9f-86664c2a7fd5"));
    3811        4994 :         PyModule_AddObject(m, "GUID_DRS_DS_INSTALL_REPLICA", PyUnicode_FromString("9923a32a-3607-11d2-b9be-0000f87a36b2"));
    3812        4994 :         PyModule_AddObject(m, "GUID_DRS_REANIMATE_TOMBSTONE", PyUnicode_FromString("45ec5156-db7e-47bb-b53f-dbeb2d03c40f"));
    3813        4994 :         PyModule_AddObject(m, "GUID_DRS_ALLOWED_TO_AUTHENTICATE", PyUnicode_FromString("68b1d179-0d15-4D4F-ab71-46152e79a7bc"));
    3814        4994 :         PyModule_AddObject(m, "GUID_DRS_VALIDATE_SPN", PyUnicode_FromString("f3a64788-5306-11d1-a9c5-0000f80367c1"));
    3815        4994 :         PyModule_AddObject(m, "GUID_DRS_SELF_MEMBERSHIP", PyUnicode_FromString("bf9679c0-0de6-11d0-a285-00aa003049e2"));
    3816        4994 :         PyModule_AddObject(m, "GUID_DRS_DNS_HOST_NAME", PyUnicode_FromString("72e39547-7b18-11d1-adef-00c04fd8d5cd"));
    3817        4994 :         PyModule_AddObject(m, "GUID_DRS_ADD_DNS_HOST_NAME", PyUnicode_FromString("80863791-dbe9-4eb8-837e-7f0ab55d9ac7"));
    3818        4994 :         PyModule_AddObject(m, "GUID_DRS_BEHAVIOR_VERSION", PyUnicode_FromString("d31a8757-2447-4545-8081-3bb610cacbf2"));
    3819        4994 :         PyModule_AddObject(m, "SEC_PRIV_INVALID", PyLong_FromLong((uint16_t)SEC_PRIV_INVALID));
    3820        4994 :         PyModule_AddObject(m, "SEC_PRIV_INCREASE_QUOTA", PyLong_FromLong((uint16_t)SEC_PRIV_INCREASE_QUOTA));
    3821        4994 :         PyModule_AddObject(m, "SEC_PRIV_MACHINE_ACCOUNT", PyLong_FromLong((uint16_t)SEC_PRIV_MACHINE_ACCOUNT));
    3822        4994 :         PyModule_AddObject(m, "SEC_PRIV_SECURITY", PyLong_FromLong((uint16_t)SEC_PRIV_SECURITY));
    3823        4994 :         PyModule_AddObject(m, "SEC_PRIV_TAKE_OWNERSHIP", PyLong_FromLong((uint16_t)SEC_PRIV_TAKE_OWNERSHIP));
    3824        4994 :         PyModule_AddObject(m, "SEC_PRIV_LOAD_DRIVER", PyLong_FromLong((uint16_t)SEC_PRIV_LOAD_DRIVER));
    3825        4994 :         PyModule_AddObject(m, "SEC_PRIV_SYSTEM_PROFILE", PyLong_FromLong((uint16_t)SEC_PRIV_SYSTEM_PROFILE));
    3826        4994 :         PyModule_AddObject(m, "SEC_PRIV_SYSTEMTIME", PyLong_FromLong((uint16_t)SEC_PRIV_SYSTEMTIME));
    3827        4994 :         PyModule_AddObject(m, "SEC_PRIV_PROFILE_SINGLE_PROCESS", PyLong_FromLong((uint16_t)SEC_PRIV_PROFILE_SINGLE_PROCESS));
    3828        4994 :         PyModule_AddObject(m, "SEC_PRIV_INCREASE_BASE_PRIORITY", PyLong_FromLong((uint16_t)SEC_PRIV_INCREASE_BASE_PRIORITY));
    3829        4994 :         PyModule_AddObject(m, "SEC_PRIV_CREATE_PAGEFILE", PyLong_FromLong((uint16_t)SEC_PRIV_CREATE_PAGEFILE));
    3830        4994 :         PyModule_AddObject(m, "SEC_PRIV_BACKUP", PyLong_FromLong((uint16_t)SEC_PRIV_BACKUP));
    3831        4994 :         PyModule_AddObject(m, "SEC_PRIV_RESTORE", PyLong_FromLong((uint16_t)SEC_PRIV_RESTORE));
    3832        4994 :         PyModule_AddObject(m, "SEC_PRIV_SHUTDOWN", PyLong_FromLong((uint16_t)SEC_PRIV_SHUTDOWN));
    3833        4994 :         PyModule_AddObject(m, "SEC_PRIV_DEBUG", PyLong_FromLong((uint16_t)SEC_PRIV_DEBUG));
    3834        4994 :         PyModule_AddObject(m, "SEC_PRIV_SYSTEM_ENVIRONMENT", PyLong_FromLong((uint16_t)SEC_PRIV_SYSTEM_ENVIRONMENT));
    3835        4994 :         PyModule_AddObject(m, "SEC_PRIV_CHANGE_NOTIFY", PyLong_FromLong((uint16_t)SEC_PRIV_CHANGE_NOTIFY));
    3836        4994 :         PyModule_AddObject(m, "SEC_PRIV_REMOTE_SHUTDOWN", PyLong_FromLong((uint16_t)SEC_PRIV_REMOTE_SHUTDOWN));
    3837        4994 :         PyModule_AddObject(m, "SEC_PRIV_UNDOCK", PyLong_FromLong((uint16_t)SEC_PRIV_UNDOCK));
    3838        4994 :         PyModule_AddObject(m, "SEC_PRIV_ENABLE_DELEGATION", PyLong_FromLong((uint16_t)SEC_PRIV_ENABLE_DELEGATION));
    3839        4994 :         PyModule_AddObject(m, "SEC_PRIV_MANAGE_VOLUME", PyLong_FromLong((uint16_t)SEC_PRIV_MANAGE_VOLUME));
    3840        4994 :         PyModule_AddObject(m, "SEC_PRIV_IMPERSONATE", PyLong_FromLong((uint16_t)SEC_PRIV_IMPERSONATE));
    3841        4994 :         PyModule_AddObject(m, "SEC_PRIV_CREATE_GLOBAL", PyLong_FromLong((uint16_t)SEC_PRIV_CREATE_GLOBAL));
    3842        4994 :         PyModule_AddObject(m, "SEC_PRIV_PRINT_OPERATOR", PyLong_FromLong((uint16_t)SEC_PRIV_PRINT_OPERATOR));
    3843        4994 :         PyModule_AddObject(m, "SEC_PRIV_ADD_USERS", PyLong_FromLong((uint16_t)SEC_PRIV_ADD_USERS));
    3844        4994 :         PyModule_AddObject(m, "SEC_PRIV_DISK_OPERATOR", PyLong_FromLong((uint16_t)SEC_PRIV_DISK_OPERATOR));
    3845        4994 :         PyModule_AddObject(m, "SEC_PRIV_MACHINE_ACCOUNT_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_MACHINE_ACCOUNT_BIT));
    3846        4994 :         PyModule_AddObject(m, "SEC_PRIV_PRINT_OPERATOR_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_PRINT_OPERATOR_BIT));
    3847        4994 :         PyModule_AddObject(m, "SEC_PRIV_ADD_USERS_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_ADD_USERS_BIT));
    3848        4994 :         PyModule_AddObject(m, "SEC_PRIV_DISK_OPERATOR_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_DISK_OPERATOR_BIT));
    3849        4994 :         PyModule_AddObject(m, "SEC_PRIV_REMOTE_SHUTDOWN_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_REMOTE_SHUTDOWN_BIT));
    3850        4994 :         PyModule_AddObject(m, "SEC_PRIV_BACKUP_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_BACKUP_BIT));
    3851        4994 :         PyModule_AddObject(m, "SEC_PRIV_RESTORE_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_RESTORE_BIT));
    3852        4994 :         PyModule_AddObject(m, "SEC_PRIV_TAKE_OWNERSHIP_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_TAKE_OWNERSHIP_BIT));
    3853        4994 :         PyModule_AddObject(m, "SEC_PRIV_INCREASE_QUOTA_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_INCREASE_QUOTA_BIT));
    3854        4994 :         PyModule_AddObject(m, "SEC_PRIV_SECURITY_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SECURITY_BIT));
    3855        4994 :         PyModule_AddObject(m, "SEC_PRIV_LOAD_DRIVER_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_LOAD_DRIVER_BIT));
    3856        4994 :         PyModule_AddObject(m, "SEC_PRIV_SYSTEM_PROFILE_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SYSTEM_PROFILE_BIT));
    3857        4994 :         PyModule_AddObject(m, "SEC_PRIV_SYSTEMTIME_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SYSTEMTIME_BIT));
    3858        4994 :         PyModule_AddObject(m, "SEC_PRIV_PROFILE_SINGLE_PROCESS_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_PROFILE_SINGLE_PROCESS_BIT));
    3859        4994 :         PyModule_AddObject(m, "SEC_PRIV_INCREASE_BASE_PRIORITY_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_INCREASE_BASE_PRIORITY_BIT));
    3860        4994 :         PyModule_AddObject(m, "SEC_PRIV_CREATE_PAGEFILE_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_CREATE_PAGEFILE_BIT));
    3861        4994 :         PyModule_AddObject(m, "SEC_PRIV_SHUTDOWN_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SHUTDOWN_BIT));
    3862        4994 :         PyModule_AddObject(m, "SEC_PRIV_DEBUG_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_DEBUG_BIT));
    3863        4994 :         PyModule_AddObject(m, "SEC_PRIV_SYSTEM_ENVIRONMENT_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_SYSTEM_ENVIRONMENT_BIT));
    3864        4994 :         PyModule_AddObject(m, "SEC_PRIV_CHANGE_NOTIFY_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_CHANGE_NOTIFY_BIT));
    3865        4994 :         PyModule_AddObject(m, "SEC_PRIV_UNDOCK_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_UNDOCK_BIT));
    3866        4994 :         PyModule_AddObject(m, "SEC_PRIV_ENABLE_DELEGATION_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_ENABLE_DELEGATION_BIT));
    3867        4994 :         PyModule_AddObject(m, "SEC_PRIV_MANAGE_VOLUME_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_MANAGE_VOLUME_BIT));
    3868        4994 :         PyModule_AddObject(m, "SEC_PRIV_IMPERSONATE_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_IMPERSONATE_BIT));
    3869        4994 :         PyModule_AddObject(m, "SEC_PRIV_CREATE_GLOBAL_BIT", PyLong_FromUnsignedLongLong(SEC_PRIV_CREATE_GLOBAL_BIT));
    3870        4994 :         PyModule_AddObject(m, "LSA_POLICY_MODE_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_INTERACTIVE));
    3871        4994 :         PyModule_AddObject(m, "LSA_POLICY_MODE_NETWORK", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_NETWORK));
    3872        4994 :         PyModule_AddObject(m, "LSA_POLICY_MODE_BATCH", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_BATCH));
    3873        4994 :         PyModule_AddObject(m, "LSA_POLICY_MODE_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_SERVICE));
    3874        4994 :         PyModule_AddObject(m, "LSA_POLICY_MODE_PROXY", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_PROXY));
    3875        4994 :         PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_DENY_INTERACTIVE));
    3876        4994 :         PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_NETWORK", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_DENY_NETWORK));
    3877        4994 :         PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_BATCH", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_DENY_BATCH));
    3878        4994 :         PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_DENY_SERVICE));
    3879        4994 :         PyModule_AddObject(m, "LSA_POLICY_MODE_REMOTE_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_REMOTE_INTERACTIVE));
    3880        4994 :         PyModule_AddObject(m, "LSA_POLICY_MODE_DENY_REMOTE_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_DENY_REMOTE_INTERACTIVE));
    3881        4994 :         PyModule_AddObject(m, "LSA_POLICY_MODE_ALL", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_ALL));
    3882        4994 :         PyModule_AddObject(m, "LSA_POLICY_MODE_ALL_NT4", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_MODE_ALL_NT4));
    3883        4994 :         PyModule_AddObject(m, "SEC_ACE_FLAG_OBJECT_INHERIT", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_OBJECT_INHERIT));
    3884        4994 :         PyModule_AddObject(m, "SEC_ACE_FLAG_CONTAINER_INHERIT", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_CONTAINER_INHERIT));
    3885        4994 :         PyModule_AddObject(m, "SEC_ACE_FLAG_NO_PROPAGATE_INHERIT", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_NO_PROPAGATE_INHERIT));
    3886        4994 :         PyModule_AddObject(m, "SEC_ACE_FLAG_INHERIT_ONLY", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_INHERIT_ONLY));
    3887        4994 :         PyModule_AddObject(m, "SEC_ACE_FLAG_INHERITED_ACE", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_INHERITED_ACE));
    3888        4994 :         PyModule_AddObject(m, "SEC_ACE_FLAG_VALID_INHERIT", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_VALID_INHERIT));
    3889        4994 :         PyModule_AddObject(m, "SEC_ACE_FLAG_SUCCESSFUL_ACCESS", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_SUCCESSFUL_ACCESS));
    3890        4994 :         PyModule_AddObject(m, "SEC_ACE_FLAG_FAILED_ACCESS", PyLong_FromLong((uint16_t)SEC_ACE_FLAG_FAILED_ACCESS));
    3891        4994 :         PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_ALLOWED", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_ACCESS_ALLOWED));
    3892        4994 :         PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_DENIED", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_ACCESS_DENIED));
    3893        4994 :         PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_AUDIT", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_SYSTEM_AUDIT));
    3894        4994 :         PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_ALARM", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_SYSTEM_ALARM));
    3895        4994 :         PyModule_AddObject(m, "SEC_ACE_TYPE_ALLOWED_COMPOUND", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_ALLOWED_COMPOUND));
    3896        4994 :         PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT));
    3897        4994 :         PyModule_AddObject(m, "SEC_ACE_TYPE_ACCESS_DENIED_OBJECT", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_ACCESS_DENIED_OBJECT));
    3898        4994 :         PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT));
    3899        4994 :         PyModule_AddObject(m, "SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT", PyLong_FromLong((uint16_t)SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT));
    3900        4994 :         PyModule_AddObject(m, "SEC_ACE_OBJECT_TYPE_PRESENT", PyLong_FromUnsignedLongLong((uint32_t)SEC_ACE_OBJECT_TYPE_PRESENT));
    3901        4994 :         PyModule_AddObject(m, "SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT", PyLong_FromUnsignedLongLong((uint32_t)SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT));
    3902        4994 :         PyModule_AddObject(m, "SECURITY_ACL_REVISION_NT4", PyLong_FromLong((uint16_t)SECURITY_ACL_REVISION_NT4));
    3903        4994 :         PyModule_AddObject(m, "SECURITY_ACL_REVISION_ADS", PyLong_FromLong((uint16_t)SECURITY_ACL_REVISION_ADS));
    3904        4994 :         PyModule_AddObject(m, "SECURITY_DESCRIPTOR_REVISION_1", PyLong_FromLong((uint16_t)SECURITY_DESCRIPTOR_REVISION_1));
    3905        4994 :         PyModule_AddObject(m, "SEC_DESC_OWNER_DEFAULTED", PyLong_FromLong((uint16_t)SEC_DESC_OWNER_DEFAULTED));
    3906        4994 :         PyModule_AddObject(m, "SEC_DESC_GROUP_DEFAULTED", PyLong_FromLong((uint16_t)SEC_DESC_GROUP_DEFAULTED));
    3907        4994 :         PyModule_AddObject(m, "SEC_DESC_DACL_PRESENT", PyLong_FromLong((uint16_t)SEC_DESC_DACL_PRESENT));
    3908        4994 :         PyModule_AddObject(m, "SEC_DESC_DACL_DEFAULTED", PyLong_FromLong((uint16_t)SEC_DESC_DACL_DEFAULTED));
    3909        4994 :         PyModule_AddObject(m, "SEC_DESC_SACL_PRESENT", PyLong_FromLong((uint16_t)SEC_DESC_SACL_PRESENT));
    3910        4994 :         PyModule_AddObject(m, "SEC_DESC_SACL_DEFAULTED", PyLong_FromLong((uint16_t)SEC_DESC_SACL_DEFAULTED));
    3911        4994 :         PyModule_AddObject(m, "SEC_DESC_DACL_TRUSTED", PyLong_FromLong((uint16_t)SEC_DESC_DACL_TRUSTED));
    3912        4994 :         PyModule_AddObject(m, "SEC_DESC_SERVER_SECURITY", PyLong_FromLong((uint16_t)SEC_DESC_SERVER_SECURITY));
    3913        4994 :         PyModule_AddObject(m, "SEC_DESC_DACL_AUTO_INHERIT_REQ", PyLong_FromLong((uint16_t)SEC_DESC_DACL_AUTO_INHERIT_REQ));
    3914        4994 :         PyModule_AddObject(m, "SEC_DESC_SACL_AUTO_INHERIT_REQ", PyLong_FromLong((uint16_t)SEC_DESC_SACL_AUTO_INHERIT_REQ));
    3915        4994 :         PyModule_AddObject(m, "SEC_DESC_DACL_AUTO_INHERITED", PyLong_FromLong((uint16_t)SEC_DESC_DACL_AUTO_INHERITED));
    3916        4994 :         PyModule_AddObject(m, "SEC_DESC_SACL_AUTO_INHERITED", PyLong_FromLong((uint16_t)SEC_DESC_SACL_AUTO_INHERITED));
    3917        4994 :         PyModule_AddObject(m, "SEC_DESC_DACL_PROTECTED", PyLong_FromLong((uint16_t)SEC_DESC_DACL_PROTECTED));
    3918        4994 :         PyModule_AddObject(m, "SEC_DESC_SACL_PROTECTED", PyLong_FromLong((uint16_t)SEC_DESC_SACL_PROTECTED));
    3919        4994 :         PyModule_AddObject(m, "SEC_DESC_RM_CONTROL_VALID", PyLong_FromLong((uint16_t)SEC_DESC_RM_CONTROL_VALID));
    3920        4994 :         PyModule_AddObject(m, "SEC_DESC_SELF_RELATIVE", PyLong_FromLong((uint16_t)SEC_DESC_SELF_RELATIVE));
    3921        4994 :         PyModule_AddObject(m, "SE_GROUP_MANDATORY", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_MANDATORY));
    3922        4994 :         PyModule_AddObject(m, "SE_GROUP_ENABLED_BY_DEFAULT", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_ENABLED_BY_DEFAULT));
    3923        4994 :         PyModule_AddObject(m, "SE_GROUP_ENABLED", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_ENABLED));
    3924        4994 :         PyModule_AddObject(m, "SE_GROUP_OWNER", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_OWNER));
    3925        4994 :         PyModule_AddObject(m, "SE_GROUP_USE_FOR_DENY_ONLY", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_USE_FOR_DENY_ONLY));
    3926        4994 :         PyModule_AddObject(m, "SE_GROUP_INTEGRITY", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_INTEGRITY));
    3927        4994 :         PyModule_AddObject(m, "SE_GROUP_INTEGRITY_ENABLED", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_INTEGRITY_ENABLED));
    3928        4994 :         PyModule_AddObject(m, "SE_GROUP_RESOURCE", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_RESOURCE));
    3929        4994 :         PyModule_AddObject(m, "SE_GROUP_LOGON_ID", PyLong_FromUnsignedLongLong((uint32_t)SE_GROUP_LOGON_ID));
    3930        4994 :         PyModule_AddObject(m, "SECINFO_OWNER", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_OWNER));
    3931        4994 :         PyModule_AddObject(m, "SECINFO_GROUP", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_GROUP));
    3932        4994 :         PyModule_AddObject(m, "SECINFO_DACL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_DACL));
    3933        4994 :         PyModule_AddObject(m, "SECINFO_SACL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_SACL));
    3934        4994 :         PyModule_AddObject(m, "SECINFO_LABEL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_LABEL));
    3935        4994 :         PyModule_AddObject(m, "SECINFO_ATTRIBUTE", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_ATTRIBUTE));
    3936        4994 :         PyModule_AddObject(m, "SECINFO_SCOPE", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_SCOPE));
    3937        4994 :         PyModule_AddObject(m, "SECINFO_BACKUP", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_BACKUP));
    3938        4994 :         PyModule_AddObject(m, "SECINFO_UNPROTECTED_SACL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_UNPROTECTED_SACL));
    3939        4994 :         PyModule_AddObject(m, "SECINFO_UNPROTECTED_DACL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_UNPROTECTED_DACL));
    3940        4994 :         PyModule_AddObject(m, "SECINFO_PROTECTED_SACL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_PROTECTED_SACL));
    3941        4994 :         PyModule_AddObject(m, "SECINFO_PROTECTED_DACL", PyLong_FromUnsignedLongLong((uint32_t)SECINFO_PROTECTED_DACL));
    3942        4994 :         PyModule_AddObject(m, "KERB_ENCTYPE_DES_CBC_CRC", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_DES_CBC_CRC));
    3943        4994 :         PyModule_AddObject(m, "KERB_ENCTYPE_DES_CBC_MD5", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_DES_CBC_MD5));
    3944        4994 :         PyModule_AddObject(m, "KERB_ENCTYPE_RC4_HMAC_MD5", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_RC4_HMAC_MD5));
    3945        4994 :         PyModule_AddObject(m, "KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96));
    3946        4994 :         PyModule_AddObject(m, "KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96));
    3947        4994 :         PyModule_AddObject(m, "KERB_ENCTYPE_FAST_SUPPORTED", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_FAST_SUPPORTED));
    3948        4994 :         PyModule_AddObject(m, "KERB_ENCTYPE_COMPOUND_IDENTITY_SUPPORTED", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_COMPOUND_IDENTITY_SUPPORTED));
    3949        4994 :         PyModule_AddObject(m, "KERB_ENCTYPE_CLAIMS_SUPPORTED", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_CLAIMS_SUPPORTED));
    3950        4994 :         PyModule_AddObject(m, "KERB_ENCTYPE_RESOURCE_SID_COMPRESSION_DISABLED", PyLong_FromUnsignedLongLong((uint32_t)KERB_ENCTYPE_RESOURCE_SID_COMPRESSION_DISABLED));
    3951        4994 :         PyModule_AddObject(m, "SEC_DACL_AUTO_INHERIT", PyLong_FromUnsignedLongLong((uint32_t)SEC_DACL_AUTO_INHERIT));
    3952        4994 :         PyModule_AddObject(m, "SEC_SACL_AUTO_INHERIT", PyLong_FromUnsignedLongLong((uint32_t)SEC_SACL_AUTO_INHERIT));
    3953        4994 :         PyModule_AddObject(m, "SEC_DEFAULT_DESCRIPTOR", PyLong_FromUnsignedLongLong((uint32_t)SEC_DEFAULT_DESCRIPTOR));
    3954        4994 :         PyModule_AddObject(m, "SEC_OWNER_FROM_PARENT", PyLong_FromUnsignedLongLong((uint32_t)SEC_OWNER_FROM_PARENT));
    3955        4994 :         PyModule_AddObject(m, "SEC_GROUP_FROM_PARENT", PyLong_FromUnsignedLongLong((uint32_t)SEC_GROUP_FROM_PARENT));
    3956        4994 :         Py_INCREF((PyObject *)(void *)&dom_sid_Type);
    3957        4994 :         PyModule_AddObject(m, "dom_sid", (PyObject *)(void *)&dom_sid_Type);
    3958        4994 :         Py_INCREF((PyObject *)(void *)&security_ace_object_type_Type);
    3959        4994 :         PyModule_AddObject(m, "ace_object_type", (PyObject *)(void *)&security_ace_object_type_Type);
    3960        4994 :         Py_INCREF((PyObject *)(void *)&security_ace_object_inherited_type_Type);
    3961        4994 :         PyModule_AddObject(m, "ace_object_inherited_type", (PyObject *)(void *)&security_ace_object_inherited_type_Type);
    3962        4994 :         Py_INCREF((PyObject *)(void *)&security_ace_object_Type);
    3963        4994 :         PyModule_AddObject(m, "ace_object", (PyObject *)(void *)&security_ace_object_Type);
    3964        4994 :         Py_INCREF((PyObject *)(void *)&security_ace_object_ctr_Type);
    3965        4994 :         PyModule_AddObject(m, "ace_object_ctr", (PyObject *)(void *)&security_ace_object_ctr_Type);
    3966        4994 :         Py_INCREF((PyObject *)(void *)&security_ace_Type);
    3967        4994 :         PyModule_AddObject(m, "ace", (PyObject *)(void *)&security_ace_Type);
    3968        4994 :         Py_INCREF((PyObject *)(void *)&security_acl_Type);
    3969        4994 :         PyModule_AddObject(m, "acl", (PyObject *)(void *)&security_acl_Type);
    3970        4994 :         Py_INCREF((PyObject *)(void *)&security_descriptor_Type);
    3971        4994 :         PyModule_AddObject(m, "descriptor", (PyObject *)(void *)&security_descriptor_Type);
    3972        4994 :         Py_INCREF((PyObject *)(void *)&sec_desc_buf_Type);
    3973        4994 :         PyModule_AddObject(m, "sec_desc_buf", (PyObject *)(void *)&sec_desc_buf_Type);
    3974        4994 :         Py_INCREF((PyObject *)(void *)&security_token_Type);
    3975        4994 :         PyModule_AddObject(m, "token", (PyObject *)(void *)&security_token_Type);
    3976        4994 :         Py_INCREF((PyObject *)(void *)&security_unix_token_Type);
    3977        4994 :         PyModule_AddObject(m, "unix_token", (PyObject *)(void *)&security_unix_token_Type);
    3978        4994 :         Py_INCREF((PyObject *)(void *)&LSAP_TOKEN_INFO_INTEGRITY_Type);
    3979        4994 :         PyModule_AddObject(m, "LSAP_TOKEN_INFO_INTEGRITY", (PyObject *)(void *)&LSAP_TOKEN_INFO_INTEGRITY_Type);
    3980        4994 :         Py_INCREF((PyObject *)(void *)&generic_mapping_Type);
    3981        4994 :         PyModule_AddObject(m, "generic_mapping", (PyObject *)(void *)&generic_mapping_Type);
    3982        4994 :         Py_INCREF((PyObject *)(void *)&standard_mapping_Type);
    3983        4994 :         PyModule_AddObject(m, "standard_mapping", (PyObject *)(void *)&standard_mapping_Type);
    3984        4994 :         Py_INCREF((PyObject *)(void *)&security_InterfaceType);
    3985        4994 :         PyModule_AddObject(m, "security", (PyObject *)(void *)&security_InterfaceType);
    3986        4994 :         Py_INCREF((PyObject *)(void *)&security_SyntaxType);
    3987        4994 :         PyModule_AddObject(m, "security_abstract_syntax", (PyObject *)(void *)&security_SyntaxType);
    3988        4994 :         Py_INCREF((PyObject *)(void *)&security_SyntaxType);
    3989        4994 :         PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&security_SyntaxType);
    3990             : #ifdef PY_MOD_SECURITY_PATCH
    3991        4994 :         PY_MOD_SECURITY_PATCH(m);
    3992             : #endif
    3993        4994 :         out:
    3994        4994 :         Py_XDECREF(dep_samba_dcerpc_misc);
    3995        4994 :         Py_XDECREF(dep_talloc);
    3996        4994 :         Py_XDECREF(dep_samba_dcerpc_base);
    3997        4823 :         return m;
    3998             : 
    3999             : }

Generated by: LCOV version 1.13