LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - py_winbind.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 416 7441 5.6 %
Date: 2021-09-23 10:06:22 Functions: 21 585 3.6 %

          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_winbind.h"
      12             : #include "bin/default/librpc/gen_ndr/ndr_winbind_c.h"
      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           4 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
      33             : {
      34           4 :         switch (var_size) {
      35           0 :         case 8:
      36           0 :                 return UINT64_MAX;
      37           4 :         case 4:
      38           4 :                 return UINT32_MAX;
      39           0 :         case 2:
      40           0 :                 return UINT16_MAX;
      41           0 :         case 1:
      42           0 :                 return UINT8_MAX;
      43             :         }
      44             : 
      45           0 :         return 0;
      46             : }
      47             : 
      48             : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
      49             : {
      50             :         switch (var_size) {
      51             :         case 8:
      52             :                 return INT64_MAX;
      53             :         case 4:
      54             :                 return INT32_MAX;
      55             :         case 2:
      56             :                 return INT16_MAX;
      57             :         case 1:
      58             :                 return INT8_MAX;
      59             :         }
      60             : 
      61             :         return 0;
      62             : }
      63             : 
      64             : #include "librpc/gen_ndr/lsa.h"
      65             : #include "librpc/gen_ndr/netlogon.h"
      66             : #include "librpc/gen_ndr/misc.h"
      67             : #include "librpc/gen_ndr/security.h"
      68             : #include "librpc/gen_ndr/idmap.h"
      69             : static PyTypeObject wbint_TransID_Type;
      70             : static PyTypeObject wbint_TransIDArray_Type;
      71             : static PyTypeObject wbint_userinfo_Type;
      72             : static PyTypeObject wbint_SidArray_Type;
      73             : static PyTypeObject wbint_RidArray_Type;
      74             : static PyTypeObject wbint_Principal_Type;
      75             : static PyTypeObject wbint_Principals_Type;
      76             : static PyTypeObject wbint_userinfos_Type;
      77             : static PyTypeObject winbind_InterfaceType;
      78             : static PyTypeObject wbint_Ping_Type;
      79             : static PyTypeObject wbint_LookupSid_Type;
      80             : static PyTypeObject wbint_LookupSids_Type;
      81             : static PyTypeObject wbint_LookupName_Type;
      82             : static PyTypeObject wbint_Sids2UnixIDs_Type;
      83             : static PyTypeObject wbint_UnixIDs2Sids_Type;
      84             : static PyTypeObject wbint_AllocateUid_Type;
      85             : static PyTypeObject wbint_AllocateGid_Type;
      86             : static PyTypeObject wbint_GetNssInfo_Type;
      87             : static PyTypeObject wbint_LookupUserAliases_Type;
      88             : static PyTypeObject wbint_LookupUserGroups_Type;
      89             : static PyTypeObject wbint_QuerySequenceNumber_Type;
      90             : static PyTypeObject wbint_LookupGroupMembers_Type;
      91             : static PyTypeObject wbint_QueryGroupList_Type;
      92             : static PyTypeObject wbint_QueryUserRidList_Type;
      93             : static PyTypeObject wbint_DsGetDcName_Type;
      94             : static PyTypeObject wbint_LookupRids_Type;
      95             : static PyTypeObject wbint_CheckMachineAccount_Type;
      96             : static PyTypeObject wbint_ChangeMachineAccount_Type;
      97             : static PyTypeObject wbint_PingDc_Type;
      98             : static PyTypeObject winbind_SamLogon_Type;
      99             : static PyTypeObject winbind_DsrUpdateReadOnlyServerDnsRecords_Type;
     100             : static PyTypeObject winbind_LogonControl_Type;
     101             : static PyTypeObject winbind_GetForestTrustInformation_Type;
     102             : static PyTypeObject winbind_SendToSam_Type;
     103             : 
     104             : static PyTypeObject *unixid_Type;
     105             : static PyTypeObject *BaseObject_Type;
     106             : static PyTypeObject *dom_sid_Type;
     107             : static PyTypeObject *lsa_SidArray_Type;
     108             : static PyTypeObject *lsa_RefDomainList_Type;
     109             : static PyTypeObject *lsa_TransNameArray_Type;
     110             : static PyTypeObject *GUID_Type;
     111             : static PyTypeObject *netr_DsRGetDCNameInfo_Type;
     112             : static PyTypeObject *netr_LogonLevel_Type;
     113             : static PyTypeObject *netr_Validation_Type;
     114             : static PyTypeObject *NL_DNS_NAME_INFO_ARRAY_Type;
     115             : static PyTypeObject *netr_CONTROL_DATA_INFORMATION_Type;
     116             : static PyTypeObject *netr_CONTROL_QUERY_INFORMATION_Type;
     117             : static PyTypeObject *lsa_ForestTrustInformation_Type;
     118             : static PyTypeObject *netr_SendToSamBase_Type;
     119             : static PyTypeObject *ClientConnection_Type;
     120             : static PyTypeObject *ndr_syntax_id_Type;
     121             : 
     122           0 : static PyObject *py_wbint_TransID_get_type_hint(PyObject *obj, void *closure)
     123             : {
     124           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(obj);
     125             :         PyObject *py_type_hint;
     126           0 :         py_type_hint = PyLong_FromLong((uint16_t)object->type_hint);
     127           0 :         return py_type_hint;
     128             : }
     129             : 
     130           0 : static int py_wbint_TransID_set_type_hint(PyObject *py_obj, PyObject *value, void *closure)
     131             : {
     132           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(py_obj);
     133           0 :         if (value == NULL) {
     134           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type_hint");
     135           0 :                 return -1;
     136             :         }
     137             :         {
     138           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type_hint));
     139           0 :                 if (PyLong_Check(value)) {
     140             :                         unsigned long long test_var;
     141           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     142           0 :                         if (PyErr_Occurred() != NULL) {
     143           0 :                                 return -1;
     144             :                         }
     145           0 :                         if (test_var > uint_max) {
     146           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     147             :                                   PyLong_Type.tp_name, uint_max, test_var);
     148           0 :                                 return -1;
     149             :                         }
     150           0 :                         object->type_hint = test_var;
     151             :                 } else {
     152           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     153             :                           PyLong_Type.tp_name);
     154           0 :                         return -1;
     155             :                 }
     156             :         }
     157           0 :         return 0;
     158             : }
     159             : 
     160           0 : static PyObject *py_wbint_TransID_get_domain_index(PyObject *obj, void *closure)
     161             : {
     162           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(obj);
     163             :         PyObject *py_domain_index;
     164           0 :         py_domain_index = PyLong_FromUnsignedLongLong((uint32_t)object->domain_index);
     165           0 :         return py_domain_index;
     166             : }
     167             : 
     168           0 : static int py_wbint_TransID_set_domain_index(PyObject *py_obj, PyObject *value, void *closure)
     169             : {
     170           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(py_obj);
     171           0 :         if (value == NULL) {
     172           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_index");
     173           0 :                 return -1;
     174             :         }
     175             :         {
     176           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_index));
     177           0 :                 if (PyLong_Check(value)) {
     178             :                         unsigned long long test_var;
     179           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     180           0 :                         if (PyErr_Occurred() != NULL) {
     181           0 :                                 return -1;
     182             :                         }
     183           0 :                         if (test_var > uint_max) {
     184           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     185             :                                   PyLong_Type.tp_name, uint_max, test_var);
     186           0 :                                 return -1;
     187             :                         }
     188           0 :                         object->domain_index = test_var;
     189             :                 } else {
     190           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     191             :                           PyLong_Type.tp_name);
     192           0 :                         return -1;
     193             :                 }
     194             :         }
     195           0 :         return 0;
     196             : }
     197             : 
     198           0 : static PyObject *py_wbint_TransID_get_rid(PyObject *obj, void *closure)
     199             : {
     200           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(obj);
     201             :         PyObject *py_rid;
     202           0 :         py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
     203           0 :         return py_rid;
     204             : }
     205             : 
     206           0 : static int py_wbint_TransID_set_rid(PyObject *py_obj, PyObject *value, void *closure)
     207             : {
     208           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(py_obj);
     209           0 :         if (value == NULL) {
     210           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
     211           0 :                 return -1;
     212             :         }
     213             :         {
     214           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
     215           0 :                 if (PyLong_Check(value)) {
     216             :                         unsigned long long test_var;
     217           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     218           0 :                         if (PyErr_Occurred() != NULL) {
     219           0 :                                 return -1;
     220             :                         }
     221           0 :                         if (test_var > uint_max) {
     222           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     223             :                                   PyLong_Type.tp_name, uint_max, test_var);
     224           0 :                                 return -1;
     225             :                         }
     226           0 :                         object->rid = test_var;
     227             :                 } else {
     228           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     229             :                           PyLong_Type.tp_name);
     230           0 :                         return -1;
     231             :                 }
     232             :         }
     233           0 :         return 0;
     234             : }
     235             : 
     236           0 : static PyObject *py_wbint_TransID_get_xid(PyObject *obj, void *closure)
     237             : {
     238           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(obj);
     239             :         PyObject *py_xid;
     240           0 :         py_xid = pytalloc_reference_ex(unixid_Type, pytalloc_get_mem_ctx(obj), &object->xid);
     241           0 :         return py_xid;
     242             : }
     243             : 
     244           0 : static int py_wbint_TransID_set_xid(PyObject *py_obj, PyObject *value, void *closure)
     245             : {
     246           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(py_obj);
     247           0 :         if (value == NULL) {
     248           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->xid");
     249           0 :                 return -1;
     250             :         }
     251           0 :         PY_CHECK_TYPE(unixid_Type, value, return -1;);
     252           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     253           0 :                 PyErr_NoMemory();
     254           0 :                 return -1;
     255             :         }
     256           0 :         object->xid = *(struct unixid *)pytalloc_get_ptr(value);
     257           0 :         return 0;
     258             : }
     259             : 
     260             : static PyGetSetDef py_wbint_TransID_getsetters[] = {
     261             :         {
     262             :                 .name = discard_const_p(char, "type_hint"),
     263             :                 .get = py_wbint_TransID_get_type_hint,
     264             :                 .set = py_wbint_TransID_set_type_hint,
     265             :                 .doc = discard_const_p(char, "PIDL-generated element of base type id_type")
     266             :         },
     267             :         {
     268             :                 .name = discard_const_p(char, "domain_index"),
     269             :                 .get = py_wbint_TransID_get_domain_index,
     270             :                 .set = py_wbint_TransID_set_domain_index,
     271             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     272             :         },
     273             :         {
     274             :                 .name = discard_const_p(char, "rid"),
     275             :                 .get = py_wbint_TransID_get_rid,
     276             :                 .set = py_wbint_TransID_set_rid,
     277             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     278             :         },
     279             :         {
     280             :                 .name = discard_const_p(char, "xid"),
     281             :                 .get = py_wbint_TransID_get_xid,
     282             :                 .set = py_wbint_TransID_set_xid,
     283             :                 .doc = discard_const_p(char, "PIDL-generated element of base type unixid")
     284             :         },
     285             :         { .name = NULL }
     286             : };
     287             : 
     288           0 : static PyObject *py_wbint_TransID_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     289             : {
     290           0 :         return pytalloc_new(struct wbint_TransID, type);
     291             : }
     292             : 
     293             : 
     294             : static PyTypeObject wbint_TransID_Type = {
     295             :         PyVarObject_HEAD_INIT(NULL, 0)
     296             :         .tp_name = "winbind.wbint_TransID",
     297             :         .tp_getset = py_wbint_TransID_getsetters,
     298             :         .tp_methods = NULL,
     299             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     300             :         .tp_new = py_wbint_TransID_new,
     301             : };
     302             : 
     303             : 
     304           0 : static PyObject *py_wbint_TransIDArray_get_num_ids(PyObject *obj, void *closure)
     305             : {
     306           0 :         struct wbint_TransIDArray *object = (struct wbint_TransIDArray *)pytalloc_get_ptr(obj);
     307             :         PyObject *py_num_ids;
     308           0 :         py_num_ids = PyLong_FromUnsignedLongLong((uint32_t)object->num_ids);
     309           0 :         return py_num_ids;
     310             : }
     311             : 
     312           0 : static int py_wbint_TransIDArray_set_num_ids(PyObject *py_obj, PyObject *value, void *closure)
     313             : {
     314           0 :         struct wbint_TransIDArray *object = (struct wbint_TransIDArray *)pytalloc_get_ptr(py_obj);
     315           0 :         if (value == NULL) {
     316           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_ids");
     317           0 :                 return -1;
     318             :         }
     319             :         {
     320           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_ids));
     321           0 :                 if (PyLong_Check(value)) {
     322             :                         unsigned long long test_var;
     323           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     324           0 :                         if (PyErr_Occurred() != NULL) {
     325           0 :                                 return -1;
     326             :                         }
     327           0 :                         if (test_var > uint_max) {
     328           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     329             :                                   PyLong_Type.tp_name, uint_max, test_var);
     330           0 :                                 return -1;
     331             :                         }
     332           0 :                         object->num_ids = test_var;
     333             :                 } else {
     334           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     335             :                           PyLong_Type.tp_name);
     336           0 :                         return -1;
     337             :                 }
     338             :         }
     339           0 :         return 0;
     340             : }
     341             : 
     342           0 : static PyObject *py_wbint_TransIDArray_get_ids(PyObject *obj, void *closure)
     343             : {
     344           0 :         struct wbint_TransIDArray *object = (struct wbint_TransIDArray *)pytalloc_get_ptr(obj);
     345             :         PyObject *py_ids;
     346           0 :         py_ids = PyList_New(object->num_ids);
     347           0 :         if (py_ids == NULL) {
     348           0 :                 return NULL;
     349             :         }
     350             :         {
     351             :                 int ids_cntr_0;
     352           0 :                 for (ids_cntr_0 = 0; ids_cntr_0 < (object->num_ids); ids_cntr_0++) {
     353             :                         PyObject *py_ids_0;
     354           0 :                         py_ids_0 = pytalloc_reference_ex(&wbint_TransID_Type, object->ids, &object->ids[ids_cntr_0]);
     355           0 :                         PyList_SetItem(py_ids, ids_cntr_0, py_ids_0);
     356             :                 }
     357             :         }
     358           0 :         return py_ids;
     359             : }
     360             : 
     361           0 : static int py_wbint_TransIDArray_set_ids(PyObject *py_obj, PyObject *value, void *closure)
     362             : {
     363           0 :         struct wbint_TransIDArray *object = (struct wbint_TransIDArray *)pytalloc_get_ptr(py_obj);
     364           0 :         if (value == NULL) {
     365           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ids");
     366           0 :                 return -1;
     367             :         }
     368           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
     369             :         {
     370             :                 int ids_cntr_0;
     371           0 :                 object->ids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->ids, PyList_GET_SIZE(value));
     372           0 :                 if (!object->ids) { return -1;; }
     373           0 :                 talloc_set_name_const(object->ids, "ARRAY: object->ids");
     374           0 :                 for (ids_cntr_0 = 0; ids_cntr_0 < PyList_GET_SIZE(value); ids_cntr_0++) {
     375           0 :                         if (PyList_GET_ITEM(value, ids_cntr_0) == NULL) {
     376           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ids[ids_cntr_0]");
     377           0 :                                 return -1;
     378             :                         }
     379           0 :                         PY_CHECK_TYPE(&wbint_TransID_Type, PyList_GET_ITEM(value, ids_cntr_0), return -1;);
     380           0 :                         if (talloc_reference(object->ids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, ids_cntr_0))) == NULL) {
     381           0 :                                 PyErr_NoMemory();
     382           0 :                                 return -1;
     383             :                         }
     384           0 :                         object->ids[ids_cntr_0] = *(struct wbint_TransID *)pytalloc_get_ptr(PyList_GET_ITEM(value, ids_cntr_0));
     385             :                 }
     386             :         }
     387           0 :         return 0;
     388             : }
     389             : 
     390             : static PyGetSetDef py_wbint_TransIDArray_getsetters[] = {
     391             :         {
     392             :                 .name = discard_const_p(char, "num_ids"),
     393             :                 .get = py_wbint_TransIDArray_get_num_ids,
     394             :                 .set = py_wbint_TransIDArray_set_num_ids,
     395             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     396             :         },
     397             :         {
     398             :                 .name = discard_const_p(char, "ids"),
     399             :                 .get = py_wbint_TransIDArray_get_ids,
     400             :                 .set = py_wbint_TransIDArray_set_ids,
     401             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_TransID")
     402             :         },
     403             :         { .name = NULL }
     404             : };
     405             : 
     406           0 : static PyObject *py_wbint_TransIDArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     407             : {
     408           0 :         return pytalloc_new(struct wbint_TransIDArray, type);
     409             : }
     410             : 
     411             : 
     412             : static PyTypeObject wbint_TransIDArray_Type = {
     413             :         PyVarObject_HEAD_INIT(NULL, 0)
     414             :         .tp_name = "winbind.wbint_TransIDArray",
     415             :         .tp_getset = py_wbint_TransIDArray_getsetters,
     416             :         .tp_methods = NULL,
     417             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     418             :         .tp_new = py_wbint_TransIDArray_new,
     419             : };
     420             : 
     421             : 
     422           0 : static PyObject *py_wbint_userinfo_get_domain_name(PyObject *obj, void *closure)
     423             : {
     424           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     425             :         PyObject *py_domain_name;
     426           0 :         if (object->domain_name == NULL) {
     427           0 :                 Py_RETURN_NONE;
     428             :         }
     429           0 :         if (object->domain_name == NULL) {
     430           0 :                 py_domain_name = Py_None;
     431           0 :                 Py_INCREF(py_domain_name);
     432             :         } else {
     433           0 :                 if (object->domain_name == NULL) {
     434           0 :                         py_domain_name = Py_None;
     435           0 :                         Py_INCREF(py_domain_name);
     436             :                 } else {
     437           0 :                         py_domain_name = PyUnicode_Decode(object->domain_name, strlen(object->domain_name), "utf-8", "ignore");
     438             :                 }
     439             :         }
     440           0 :         return py_domain_name;
     441             : }
     442             : 
     443           0 : static int py_wbint_userinfo_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
     444             : {
     445           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     446           0 :         if (value == NULL) {
     447           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
     448           0 :                 return -1;
     449             :         }
     450           0 :         if (value == Py_None) {
     451           0 :                 object->domain_name = NULL;
     452             :         } else {
     453           0 :                 object->domain_name = NULL;
     454             :                 {
     455             :                         const char *test_str;
     456             :                         const char *talloc_str;
     457           0 :                         PyObject *unicode = NULL;
     458           0 :                         if (PyUnicode_Check(value)) {
     459           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     460           0 :                                 if (unicode == NULL) {
     461           0 :                                         PyErr_NoMemory();
     462           0 :                                         return -1;
     463             :                                 }
     464           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     465           0 :                         } else if (PyBytes_Check(value)) {
     466           0 :                                 test_str = PyBytes_AS_STRING(value);
     467             :                         } else {
     468           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     469           0 :                                 return -1;
     470             :                         }
     471           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     472           0 :                         if (unicode != NULL) {
     473           0 :                                 Py_DECREF(unicode);
     474             :                         }
     475           0 :                         if (talloc_str == NULL) {
     476           0 :                                 PyErr_NoMemory();
     477           0 :                                 return -1;
     478             :                         }
     479           0 :                         object->domain_name = talloc_str;
     480             :                 }
     481             :         }
     482           0 :         return 0;
     483             : }
     484             : 
     485           0 : static PyObject *py_wbint_userinfo_get_acct_name(PyObject *obj, void *closure)
     486             : {
     487           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     488             :         PyObject *py_acct_name;
     489           0 :         if (object->acct_name == NULL) {
     490           0 :                 Py_RETURN_NONE;
     491             :         }
     492           0 :         if (object->acct_name == NULL) {
     493           0 :                 py_acct_name = Py_None;
     494           0 :                 Py_INCREF(py_acct_name);
     495             :         } else {
     496           0 :                 if (object->acct_name == NULL) {
     497           0 :                         py_acct_name = Py_None;
     498           0 :                         Py_INCREF(py_acct_name);
     499             :                 } else {
     500           0 :                         py_acct_name = PyUnicode_Decode(object->acct_name, strlen(object->acct_name), "utf-8", "ignore");
     501             :                 }
     502             :         }
     503           0 :         return py_acct_name;
     504             : }
     505             : 
     506           0 : static int py_wbint_userinfo_set_acct_name(PyObject *py_obj, PyObject *value, void *closure)
     507             : {
     508           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     509           0 :         if (value == NULL) {
     510           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_name");
     511           0 :                 return -1;
     512             :         }
     513           0 :         if (value == Py_None) {
     514           0 :                 object->acct_name = NULL;
     515             :         } else {
     516           0 :                 object->acct_name = NULL;
     517             :                 {
     518             :                         const char *test_str;
     519             :                         const char *talloc_str;
     520           0 :                         PyObject *unicode = NULL;
     521           0 :                         if (PyUnicode_Check(value)) {
     522           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     523           0 :                                 if (unicode == NULL) {
     524           0 :                                         PyErr_NoMemory();
     525           0 :                                         return -1;
     526             :                                 }
     527           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     528           0 :                         } else if (PyBytes_Check(value)) {
     529           0 :                                 test_str = PyBytes_AS_STRING(value);
     530             :                         } else {
     531           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     532           0 :                                 return -1;
     533             :                         }
     534           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     535           0 :                         if (unicode != NULL) {
     536           0 :                                 Py_DECREF(unicode);
     537             :                         }
     538           0 :                         if (talloc_str == NULL) {
     539           0 :                                 PyErr_NoMemory();
     540           0 :                                 return -1;
     541             :                         }
     542           0 :                         object->acct_name = talloc_str;
     543             :                 }
     544             :         }
     545           0 :         return 0;
     546             : }
     547             : 
     548           0 : static PyObject *py_wbint_userinfo_get_full_name(PyObject *obj, void *closure)
     549             : {
     550           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     551             :         PyObject *py_full_name;
     552           0 :         if (object->full_name == NULL) {
     553           0 :                 Py_RETURN_NONE;
     554             :         }
     555           0 :         if (object->full_name == NULL) {
     556           0 :                 py_full_name = Py_None;
     557           0 :                 Py_INCREF(py_full_name);
     558             :         } else {
     559           0 :                 if (object->full_name == NULL) {
     560           0 :                         py_full_name = Py_None;
     561           0 :                         Py_INCREF(py_full_name);
     562             :                 } else {
     563           0 :                         py_full_name = PyUnicode_Decode(object->full_name, strlen(object->full_name), "utf-8", "ignore");
     564             :                 }
     565             :         }
     566           0 :         return py_full_name;
     567             : }
     568             : 
     569           0 : static int py_wbint_userinfo_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
     570             : {
     571           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     572           0 :         if (value == NULL) {
     573           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name");
     574           0 :                 return -1;
     575             :         }
     576           0 :         if (value == Py_None) {
     577           0 :                 object->full_name = NULL;
     578             :         } else {
     579           0 :                 object->full_name = NULL;
     580             :                 {
     581             :                         const char *test_str;
     582             :                         const char *talloc_str;
     583           0 :                         PyObject *unicode = NULL;
     584           0 :                         if (PyUnicode_Check(value)) {
     585           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     586           0 :                                 if (unicode == NULL) {
     587           0 :                                         PyErr_NoMemory();
     588           0 :                                         return -1;
     589             :                                 }
     590           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     591           0 :                         } else if (PyBytes_Check(value)) {
     592           0 :                                 test_str = PyBytes_AS_STRING(value);
     593             :                         } else {
     594           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     595           0 :                                 return -1;
     596             :                         }
     597           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     598           0 :                         if (unicode != NULL) {
     599           0 :                                 Py_DECREF(unicode);
     600             :                         }
     601           0 :                         if (talloc_str == NULL) {
     602           0 :                                 PyErr_NoMemory();
     603           0 :                                 return -1;
     604             :                         }
     605           0 :                         object->full_name = talloc_str;
     606             :                 }
     607             :         }
     608           0 :         return 0;
     609             : }
     610             : 
     611           0 : static PyObject *py_wbint_userinfo_get_homedir(PyObject *obj, void *closure)
     612             : {
     613           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     614             :         PyObject *py_homedir;
     615           0 :         if (object->homedir == NULL) {
     616           0 :                 Py_RETURN_NONE;
     617             :         }
     618           0 :         if (object->homedir == NULL) {
     619           0 :                 py_homedir = Py_None;
     620           0 :                 Py_INCREF(py_homedir);
     621             :         } else {
     622           0 :                 if (object->homedir == NULL) {
     623           0 :                         py_homedir = Py_None;
     624           0 :                         Py_INCREF(py_homedir);
     625             :                 } else {
     626           0 :                         py_homedir = PyUnicode_Decode(object->homedir, strlen(object->homedir), "utf-8", "ignore");
     627             :                 }
     628             :         }
     629           0 :         return py_homedir;
     630             : }
     631             : 
     632           0 : static int py_wbint_userinfo_set_homedir(PyObject *py_obj, PyObject *value, void *closure)
     633             : {
     634           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     635           0 :         if (value == NULL) {
     636           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->homedir");
     637           0 :                 return -1;
     638             :         }
     639           0 :         if (value == Py_None) {
     640           0 :                 object->homedir = NULL;
     641             :         } else {
     642           0 :                 object->homedir = NULL;
     643             :                 {
     644             :                         const char *test_str;
     645             :                         const char *talloc_str;
     646           0 :                         PyObject *unicode = NULL;
     647           0 :                         if (PyUnicode_Check(value)) {
     648           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     649           0 :                                 if (unicode == NULL) {
     650           0 :                                         PyErr_NoMemory();
     651           0 :                                         return -1;
     652             :                                 }
     653           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     654           0 :                         } else if (PyBytes_Check(value)) {
     655           0 :                                 test_str = PyBytes_AS_STRING(value);
     656             :                         } else {
     657           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     658           0 :                                 return -1;
     659             :                         }
     660           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     661           0 :                         if (unicode != NULL) {
     662           0 :                                 Py_DECREF(unicode);
     663             :                         }
     664           0 :                         if (talloc_str == NULL) {
     665           0 :                                 PyErr_NoMemory();
     666           0 :                                 return -1;
     667             :                         }
     668           0 :                         object->homedir = talloc_str;
     669             :                 }
     670             :         }
     671           0 :         return 0;
     672             : }
     673             : 
     674           0 : static PyObject *py_wbint_userinfo_get_shell(PyObject *obj, void *closure)
     675             : {
     676           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     677             :         PyObject *py_shell;
     678           0 :         if (object->shell == NULL) {
     679           0 :                 Py_RETURN_NONE;
     680             :         }
     681           0 :         if (object->shell == NULL) {
     682           0 :                 py_shell = Py_None;
     683           0 :                 Py_INCREF(py_shell);
     684             :         } else {
     685           0 :                 if (object->shell == NULL) {
     686           0 :                         py_shell = Py_None;
     687           0 :                         Py_INCREF(py_shell);
     688             :                 } else {
     689           0 :                         py_shell = PyUnicode_Decode(object->shell, strlen(object->shell), "utf-8", "ignore");
     690             :                 }
     691             :         }
     692           0 :         return py_shell;
     693             : }
     694             : 
     695           0 : static int py_wbint_userinfo_set_shell(PyObject *py_obj, PyObject *value, void *closure)
     696             : {
     697           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     698           0 :         if (value == NULL) {
     699           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->shell");
     700           0 :                 return -1;
     701             :         }
     702           0 :         if (value == Py_None) {
     703           0 :                 object->shell = NULL;
     704             :         } else {
     705           0 :                 object->shell = NULL;
     706             :                 {
     707             :                         const char *test_str;
     708             :                         const char *talloc_str;
     709           0 :                         PyObject *unicode = NULL;
     710           0 :                         if (PyUnicode_Check(value)) {
     711           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     712           0 :                                 if (unicode == NULL) {
     713           0 :                                         PyErr_NoMemory();
     714           0 :                                         return -1;
     715             :                                 }
     716           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     717           0 :                         } else if (PyBytes_Check(value)) {
     718           0 :                                 test_str = PyBytes_AS_STRING(value);
     719             :                         } else {
     720           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     721           0 :                                 return -1;
     722             :                         }
     723           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     724           0 :                         if (unicode != NULL) {
     725           0 :                                 Py_DECREF(unicode);
     726             :                         }
     727           0 :                         if (talloc_str == NULL) {
     728           0 :                                 PyErr_NoMemory();
     729           0 :                                 return -1;
     730             :                         }
     731           0 :                         object->shell = talloc_str;
     732             :                 }
     733             :         }
     734           0 :         return 0;
     735             : }
     736             : 
     737           0 : static PyObject *py_wbint_userinfo_get_uid(PyObject *obj, void *closure)
     738             : {
     739           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     740             :         PyObject *py_uid;
     741           0 :         py_uid = PyLong_FromUnsignedLongLong(object->uid);
     742           0 :         return py_uid;
     743             : }
     744             : 
     745           0 : static int py_wbint_userinfo_set_uid(PyObject *py_obj, PyObject *value, void *closure)
     746             : {
     747           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     748           0 :         if (value == NULL) {
     749           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->uid");
     750           0 :                 return -1;
     751             :         }
     752             :         {
     753           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->uid));
     754           0 :                 if (PyLong_Check(value)) {
     755             :                         unsigned long long test_var;
     756           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     757           0 :                         if (PyErr_Occurred() != NULL) {
     758           0 :                                 return -1;
     759             :                         }
     760           0 :                         if (test_var > uint_max) {
     761           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     762             :                                   PyLong_Type.tp_name, uint_max, test_var);
     763           0 :                                 return -1;
     764             :                         }
     765           0 :                         object->uid = test_var;
     766             :                 } else {
     767           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     768             :                           PyLong_Type.tp_name);
     769           0 :                         return -1;
     770             :                 }
     771             :         }
     772           0 :         return 0;
     773             : }
     774             : 
     775           0 : static PyObject *py_wbint_userinfo_get_primary_gid(PyObject *obj, void *closure)
     776             : {
     777           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     778             :         PyObject *py_primary_gid;
     779           0 :         py_primary_gid = PyLong_FromUnsignedLongLong(object->primary_gid);
     780           0 :         return py_primary_gid;
     781             : }
     782             : 
     783           0 : static int py_wbint_userinfo_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
     784             : {
     785           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     786           0 :         if (value == NULL) {
     787           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid");
     788           0 :                 return -1;
     789             :         }
     790             :         {
     791           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid));
     792           0 :                 if (PyLong_Check(value)) {
     793             :                         unsigned long long test_var;
     794           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     795           0 :                         if (PyErr_Occurred() != NULL) {
     796           0 :                                 return -1;
     797             :                         }
     798           0 :                         if (test_var > uint_max) {
     799           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     800             :                                   PyLong_Type.tp_name, uint_max, test_var);
     801           0 :                                 return -1;
     802             :                         }
     803           0 :                         object->primary_gid = test_var;
     804             :                 } else {
     805           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     806             :                           PyLong_Type.tp_name);
     807           0 :                         return -1;
     808             :                 }
     809             :         }
     810           0 :         return 0;
     811             : }
     812             : 
     813           0 : static PyObject *py_wbint_userinfo_get_primary_group_name(PyObject *obj, void *closure)
     814             : {
     815           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     816             :         PyObject *py_primary_group_name;
     817           0 :         if (object->primary_group_name == NULL) {
     818           0 :                 Py_RETURN_NONE;
     819             :         }
     820           0 :         if (object->primary_group_name == NULL) {
     821           0 :                 py_primary_group_name = Py_None;
     822           0 :                 Py_INCREF(py_primary_group_name);
     823             :         } else {
     824           0 :                 if (object->primary_group_name == NULL) {
     825           0 :                         py_primary_group_name = Py_None;
     826           0 :                         Py_INCREF(py_primary_group_name);
     827             :                 } else {
     828           0 :                         py_primary_group_name = PyUnicode_Decode(object->primary_group_name, strlen(object->primary_group_name), "utf-8", "ignore");
     829             :                 }
     830             :         }
     831           0 :         return py_primary_group_name;
     832             : }
     833             : 
     834           0 : static int py_wbint_userinfo_set_primary_group_name(PyObject *py_obj, PyObject *value, void *closure)
     835             : {
     836           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     837           0 :         if (value == NULL) {
     838           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_group_name");
     839           0 :                 return -1;
     840             :         }
     841           0 :         if (value == Py_None) {
     842           0 :                 object->primary_group_name = NULL;
     843             :         } else {
     844           0 :                 object->primary_group_name = NULL;
     845             :                 {
     846             :                         const char *test_str;
     847             :                         const char *talloc_str;
     848           0 :                         PyObject *unicode = NULL;
     849           0 :                         if (PyUnicode_Check(value)) {
     850           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     851           0 :                                 if (unicode == NULL) {
     852           0 :                                         PyErr_NoMemory();
     853           0 :                                         return -1;
     854             :                                 }
     855           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     856           0 :                         } else if (PyBytes_Check(value)) {
     857           0 :                                 test_str = PyBytes_AS_STRING(value);
     858             :                         } else {
     859           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     860           0 :                                 return -1;
     861             :                         }
     862           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     863           0 :                         if (unicode != NULL) {
     864           0 :                                 Py_DECREF(unicode);
     865             :                         }
     866           0 :                         if (talloc_str == NULL) {
     867           0 :                                 PyErr_NoMemory();
     868           0 :                                 return -1;
     869             :                         }
     870           0 :                         object->primary_group_name = talloc_str;
     871             :                 }
     872             :         }
     873           0 :         return 0;
     874             : }
     875             : 
     876           0 : static PyObject *py_wbint_userinfo_get_user_sid(PyObject *obj, void *closure)
     877             : {
     878           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     879             :         PyObject *py_user_sid;
     880           0 :         py_user_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->user_sid);
     881           0 :         return py_user_sid;
     882             : }
     883             : 
     884           0 : static int py_wbint_userinfo_set_user_sid(PyObject *py_obj, PyObject *value, void *closure)
     885             : {
     886           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     887           0 :         if (value == NULL) {
     888           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_sid");
     889           0 :                 return -1;
     890             :         }
     891           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
     892           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     893           0 :                 PyErr_NoMemory();
     894           0 :                 return -1;
     895             :         }
     896           0 :         object->user_sid = *(struct dom_sid *)pytalloc_get_ptr(value);
     897           0 :         return 0;
     898             : }
     899             : 
     900           0 : static PyObject *py_wbint_userinfo_get_group_sid(PyObject *obj, void *closure)
     901             : {
     902           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     903             :         PyObject *py_group_sid;
     904           0 :         py_group_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->group_sid);
     905           0 :         return py_group_sid;
     906             : }
     907             : 
     908           0 : static int py_wbint_userinfo_set_group_sid(PyObject *py_obj, PyObject *value, void *closure)
     909             : {
     910           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     911           0 :         if (value == NULL) {
     912           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->group_sid");
     913           0 :                 return -1;
     914             :         }
     915           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
     916           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     917           0 :                 PyErr_NoMemory();
     918           0 :                 return -1;
     919             :         }
     920           0 :         object->group_sid = *(struct dom_sid *)pytalloc_get_ptr(value);
     921           0 :         return 0;
     922             : }
     923             : 
     924             : static PyGetSetDef py_wbint_userinfo_getsetters[] = {
     925             :         {
     926             :                 .name = discard_const_p(char, "domain_name"),
     927             :                 .get = py_wbint_userinfo_get_domain_name,
     928             :                 .set = py_wbint_userinfo_set_domain_name,
     929             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     930             :         },
     931             :         {
     932             :                 .name = discard_const_p(char, "acct_name"),
     933             :                 .get = py_wbint_userinfo_get_acct_name,
     934             :                 .set = py_wbint_userinfo_set_acct_name,
     935             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     936             :         },
     937             :         {
     938             :                 .name = discard_const_p(char, "full_name"),
     939             :                 .get = py_wbint_userinfo_get_full_name,
     940             :                 .set = py_wbint_userinfo_set_full_name,
     941             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     942             :         },
     943             :         {
     944             :                 .name = discard_const_p(char, "homedir"),
     945             :                 .get = py_wbint_userinfo_get_homedir,
     946             :                 .set = py_wbint_userinfo_set_homedir,
     947             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     948             :         },
     949             :         {
     950             :                 .name = discard_const_p(char, "shell"),
     951             :                 .get = py_wbint_userinfo_get_shell,
     952             :                 .set = py_wbint_userinfo_set_shell,
     953             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     954             :         },
     955             :         {
     956             :                 .name = discard_const_p(char, "uid"),
     957             :                 .get = py_wbint_userinfo_get_uid,
     958             :                 .set = py_wbint_userinfo_set_uid,
     959             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
     960             :         },
     961             :         {
     962             :                 .name = discard_const_p(char, "primary_gid"),
     963             :                 .get = py_wbint_userinfo_get_primary_gid,
     964             :                 .set = py_wbint_userinfo_set_primary_gid,
     965             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
     966             :         },
     967             :         {
     968             :                 .name = discard_const_p(char, "primary_group_name"),
     969             :                 .get = py_wbint_userinfo_get_primary_group_name,
     970             :                 .set = py_wbint_userinfo_set_primary_group_name,
     971             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     972             :         },
     973             :         {
     974             :                 .name = discard_const_p(char, "user_sid"),
     975             :                 .get = py_wbint_userinfo_get_user_sid,
     976             :                 .set = py_wbint_userinfo_set_user_sid,
     977             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
     978             :         },
     979             :         {
     980             :                 .name = discard_const_p(char, "group_sid"),
     981             :                 .get = py_wbint_userinfo_get_group_sid,
     982             :                 .set = py_wbint_userinfo_set_group_sid,
     983             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
     984             :         },
     985             :         { .name = NULL }
     986             : };
     987             : 
     988           0 : static PyObject *py_wbint_userinfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     989             : {
     990           0 :         return pytalloc_new(struct wbint_userinfo, type);
     991             : }
     992             : 
     993           0 : static PyObject *py_wbint_userinfo_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
     994             : {
     995           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     996           0 :         PyObject *ret = NULL;
     997             :         DATA_BLOB blob;
     998             :         enum ndr_err_code err;
     999           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1000           0 :         if (tmp_ctx == NULL) {
    1001           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1002           0 :                 return NULL;
    1003             :         }
    1004           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_userinfo);
    1005           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1006           0 :                 TALLOC_FREE(tmp_ctx);
    1007           0 :                 PyErr_SetNdrError(err);
    1008           0 :                 return NULL;
    1009             :         }
    1010             : 
    1011           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1012           0 :         TALLOC_FREE(tmp_ctx);
    1013           0 :         return ret;
    1014             : }
    1015             : 
    1016           0 : static PyObject *py_wbint_userinfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1017             : {
    1018           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
    1019           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1020           0 :         Py_ssize_t blob_length = 0;
    1021             :         enum ndr_err_code err;
    1022           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1023           0 :         PyObject *allow_remaining_obj = NULL;
    1024           0 :         bool allow_remaining = false;
    1025             : 
    1026           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1027             :                 discard_const_p(char *, kwnames),
    1028             :                 &blob.data, &blob_length,
    1029             :                 &allow_remaining_obj)) {
    1030           0 :                 return NULL;
    1031             :         }
    1032           0 :         blob.length = blob_length;
    1033             : 
    1034           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1035           0 :                 allow_remaining = true;
    1036             :         }
    1037             : 
    1038           0 :         if (allow_remaining) {
    1039           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfo);
    1040             :         } else {
    1041           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfo);
    1042             :         }
    1043           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1044           0 :                 PyErr_SetNdrError(err);
    1045           0 :                 return NULL;
    1046             :         }
    1047             : 
    1048           0 :         Py_RETURN_NONE;
    1049             : }
    1050             : 
    1051           0 : static PyObject *py_wbint_userinfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1052             : {
    1053           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
    1054             :         PyObject *ret;
    1055             :         char *retstr;
    1056             : 
    1057           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_userinfo, "wbint_userinfo", object);
    1058           0 :         ret = PyUnicode_FromString(retstr);
    1059           0 :         talloc_free(retstr);
    1060             : 
    1061           0 :         return ret;
    1062             : }
    1063             : 
    1064             : static PyMethodDef py_wbint_userinfo_methods[] = {
    1065             :         { "__ndr_pack__", (PyCFunction)py_wbint_userinfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1066             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_userinfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1067             :         { "__ndr_print__", (PyCFunction)py_wbint_userinfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1068             :         { NULL, NULL, 0, NULL }
    1069             : };
    1070             : 
    1071             : 
    1072             : static PyTypeObject wbint_userinfo_Type = {
    1073             :         PyVarObject_HEAD_INIT(NULL, 0)
    1074             :         .tp_name = "winbind.wbint_userinfo",
    1075             :         .tp_getset = py_wbint_userinfo_getsetters,
    1076             :         .tp_methods = py_wbint_userinfo_methods,
    1077             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1078             :         .tp_new = py_wbint_userinfo_new,
    1079             : };
    1080             : 
    1081             : 
    1082           0 : static PyObject *py_wbint_SidArray_get_num_sids(PyObject *obj, void *closure)
    1083             : {
    1084           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(obj);
    1085             :         PyObject *py_num_sids;
    1086           0 :         py_num_sids = PyLong_FromUnsignedLongLong((uint32_t)object->num_sids);
    1087           0 :         return py_num_sids;
    1088             : }
    1089             : 
    1090           0 : static int py_wbint_SidArray_set_num_sids(PyObject *py_obj, PyObject *value, void *closure)
    1091             : {
    1092           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj);
    1093           0 :         if (value == NULL) {
    1094           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_sids");
    1095           0 :                 return -1;
    1096             :         }
    1097             :         {
    1098           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sids));
    1099           0 :                 if (PyLong_Check(value)) {
    1100             :                         unsigned long long test_var;
    1101           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1102           0 :                         if (PyErr_Occurred() != NULL) {
    1103           0 :                                 return -1;
    1104             :                         }
    1105           0 :                         if (test_var > uint_max) {
    1106           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1107             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1108           0 :                                 return -1;
    1109             :                         }
    1110           0 :                         object->num_sids = test_var;
    1111             :                 } else {
    1112           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1113             :                           PyLong_Type.tp_name);
    1114           0 :                         return -1;
    1115             :                 }
    1116             :         }
    1117           0 :         return 0;
    1118             : }
    1119             : 
    1120           0 : static PyObject *py_wbint_SidArray_get_sids(PyObject *obj, void *closure)
    1121             : {
    1122           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(obj);
    1123             :         PyObject *py_sids;
    1124           0 :         py_sids = PyList_New(object->num_sids);
    1125           0 :         if (py_sids == NULL) {
    1126           0 :                 return NULL;
    1127             :         }
    1128             :         {
    1129             :                 int sids_cntr_0;
    1130           0 :                 for (sids_cntr_0 = 0; sids_cntr_0 < (object->num_sids); sids_cntr_0++) {
    1131             :                         PyObject *py_sids_0;
    1132           0 :                         py_sids_0 = pytalloc_reference_ex(dom_sid_Type, object->sids, &object->sids[sids_cntr_0]);
    1133           0 :                         PyList_SetItem(py_sids, sids_cntr_0, py_sids_0);
    1134             :                 }
    1135             :         }
    1136           0 :         return py_sids;
    1137             : }
    1138             : 
    1139           0 : static int py_wbint_SidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure)
    1140             : {
    1141           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj);
    1142           0 :         if (value == NULL) {
    1143           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
    1144           0 :                 return -1;
    1145             :         }
    1146           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1147             :         {
    1148             :                 int sids_cntr_0;
    1149           0 :                 object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
    1150           0 :                 if (!object->sids) { return -1;; }
    1151           0 :                 talloc_set_name_const(object->sids, "ARRAY: object->sids");
    1152           0 :                 for (sids_cntr_0 = 0; sids_cntr_0 < PyList_GET_SIZE(value); sids_cntr_0++) {
    1153           0 :                         if (PyList_GET_ITEM(value, sids_cntr_0) == NULL) {
    1154           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_0]");
    1155           0 :                                 return -1;
    1156             :                         }
    1157           0 :                         PY_CHECK_TYPE(dom_sid_Type, PyList_GET_ITEM(value, sids_cntr_0), return -1;);
    1158           0 :                         if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_0))) == NULL) {
    1159           0 :                                 PyErr_NoMemory();
    1160           0 :                                 return -1;
    1161             :                         }
    1162           0 :                         object->sids[sids_cntr_0] = *(struct dom_sid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_0));
    1163             :                 }
    1164             :         }
    1165           0 :         return 0;
    1166             : }
    1167             : 
    1168             : static PyGetSetDef py_wbint_SidArray_getsetters[] = {
    1169             :         {
    1170             :                 .name = discard_const_p(char, "num_sids"),
    1171             :                 .get = py_wbint_SidArray_get_num_sids,
    1172             :                 .set = py_wbint_SidArray_set_num_sids,
    1173             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1174             :         },
    1175             :         {
    1176             :                 .name = discard_const_p(char, "sids"),
    1177             :                 .get = py_wbint_SidArray_get_sids,
    1178             :                 .set = py_wbint_SidArray_set_sids,
    1179             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    1180             :         },
    1181             :         { .name = NULL }
    1182             : };
    1183             : 
    1184           0 : static PyObject *py_wbint_SidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1185             : {
    1186           0 :         return pytalloc_new(struct wbint_SidArray, type);
    1187             : }
    1188             : 
    1189           0 : static PyObject *py_wbint_SidArray_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1190             : {
    1191           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj);
    1192           0 :         PyObject *ret = NULL;
    1193             :         DATA_BLOB blob;
    1194             :         enum ndr_err_code err;
    1195           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1196           0 :         if (tmp_ctx == NULL) {
    1197           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1198           0 :                 return NULL;
    1199             :         }
    1200           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_SidArray);
    1201           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1202           0 :                 TALLOC_FREE(tmp_ctx);
    1203           0 :                 PyErr_SetNdrError(err);
    1204           0 :                 return NULL;
    1205             :         }
    1206             : 
    1207           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1208           0 :         TALLOC_FREE(tmp_ctx);
    1209           0 :         return ret;
    1210             : }
    1211             : 
    1212           0 : static PyObject *py_wbint_SidArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1213             : {
    1214           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj);
    1215           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1216           0 :         Py_ssize_t blob_length = 0;
    1217             :         enum ndr_err_code err;
    1218           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1219           0 :         PyObject *allow_remaining_obj = NULL;
    1220           0 :         bool allow_remaining = false;
    1221             : 
    1222           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1223             :                 discard_const_p(char *, kwnames),
    1224             :                 &blob.data, &blob_length,
    1225             :                 &allow_remaining_obj)) {
    1226           0 :                 return NULL;
    1227             :         }
    1228           0 :         blob.length = blob_length;
    1229             : 
    1230           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1231           0 :                 allow_remaining = true;
    1232             :         }
    1233             : 
    1234           0 :         if (allow_remaining) {
    1235           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_SidArray);
    1236             :         } else {
    1237           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_SidArray);
    1238             :         }
    1239           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1240           0 :                 PyErr_SetNdrError(err);
    1241           0 :                 return NULL;
    1242             :         }
    1243             : 
    1244           0 :         Py_RETURN_NONE;
    1245             : }
    1246             : 
    1247           0 : static PyObject *py_wbint_SidArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1248             : {
    1249           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj);
    1250             :         PyObject *ret;
    1251             :         char *retstr;
    1252             : 
    1253           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_SidArray, "wbint_SidArray", object);
    1254           0 :         ret = PyUnicode_FromString(retstr);
    1255           0 :         talloc_free(retstr);
    1256             : 
    1257           0 :         return ret;
    1258             : }
    1259             : 
    1260             : static PyMethodDef py_wbint_SidArray_methods[] = {
    1261             :         { "__ndr_pack__", (PyCFunction)py_wbint_SidArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1262             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_SidArray_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1263             :         { "__ndr_print__", (PyCFunction)py_wbint_SidArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1264             :         { NULL, NULL, 0, NULL }
    1265             : };
    1266             : 
    1267             : 
    1268             : static PyTypeObject wbint_SidArray_Type = {
    1269             :         PyVarObject_HEAD_INIT(NULL, 0)
    1270             :         .tp_name = "winbind.wbint_SidArray",
    1271             :         .tp_getset = py_wbint_SidArray_getsetters,
    1272             :         .tp_methods = py_wbint_SidArray_methods,
    1273             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1274             :         .tp_new = py_wbint_SidArray_new,
    1275             : };
    1276             : 
    1277             : 
    1278           0 : static PyObject *py_wbint_RidArray_get_num_rids(PyObject *obj, void *closure)
    1279             : {
    1280           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(obj);
    1281             :         PyObject *py_num_rids;
    1282           0 :         py_num_rids = PyLong_FromUnsignedLongLong((uint32_t)object->num_rids);
    1283           0 :         return py_num_rids;
    1284             : }
    1285             : 
    1286           0 : static int py_wbint_RidArray_set_num_rids(PyObject *py_obj, PyObject *value, void *closure)
    1287             : {
    1288           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj);
    1289           0 :         if (value == NULL) {
    1290           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_rids");
    1291           0 :                 return -1;
    1292             :         }
    1293             :         {
    1294           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_rids));
    1295           0 :                 if (PyLong_Check(value)) {
    1296             :                         unsigned long long test_var;
    1297           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1298           0 :                         if (PyErr_Occurred() != NULL) {
    1299           0 :                                 return -1;
    1300             :                         }
    1301           0 :                         if (test_var > uint_max) {
    1302           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1303             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1304           0 :                                 return -1;
    1305             :                         }
    1306           0 :                         object->num_rids = test_var;
    1307             :                 } else {
    1308           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1309             :                           PyLong_Type.tp_name);
    1310           0 :                         return -1;
    1311             :                 }
    1312             :         }
    1313           0 :         return 0;
    1314             : }
    1315             : 
    1316           0 : static PyObject *py_wbint_RidArray_get_rids(PyObject *obj, void *closure)
    1317             : {
    1318           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(obj);
    1319             :         PyObject *py_rids;
    1320           0 :         py_rids = PyList_New(object->num_rids);
    1321           0 :         if (py_rids == NULL) {
    1322           0 :                 return NULL;
    1323             :         }
    1324             :         {
    1325             :                 int rids_cntr_0;
    1326           0 :                 for (rids_cntr_0 = 0; rids_cntr_0 < (object->num_rids); rids_cntr_0++) {
    1327             :                         PyObject *py_rids_0;
    1328           0 :                         py_rids_0 = PyLong_FromUnsignedLongLong((uint32_t)object->rids[rids_cntr_0]);
    1329           0 :                         PyList_SetItem(py_rids, rids_cntr_0, py_rids_0);
    1330             :                 }
    1331             :         }
    1332           0 :         return py_rids;
    1333             : }
    1334             : 
    1335           0 : static int py_wbint_RidArray_set_rids(PyObject *py_obj, PyObject *value, void *closure)
    1336             : {
    1337           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj);
    1338           0 :         if (value == NULL) {
    1339           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids");
    1340           0 :                 return -1;
    1341             :         }
    1342           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1343             :         {
    1344             :                 int rids_cntr_0;
    1345           0 :                 object->rids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->rids, PyList_GET_SIZE(value));
    1346           0 :                 if (!object->rids) { return -1;; }
    1347           0 :                 talloc_set_name_const(object->rids, "ARRAY: object->rids");
    1348           0 :                 for (rids_cntr_0 = 0; rids_cntr_0 < PyList_GET_SIZE(value); rids_cntr_0++) {
    1349           0 :                         if (PyList_GET_ITEM(value, rids_cntr_0) == NULL) {
    1350           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids[rids_cntr_0]");
    1351           0 :                                 return -1;
    1352             :                         }
    1353             :                         {
    1354           0 :                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rids[rids_cntr_0]));
    1355           0 :                                 if (PyLong_Check(PyList_GET_ITEM(value, rids_cntr_0))) {
    1356             :                                         unsigned long long test_var;
    1357           0 :                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, rids_cntr_0));
    1358           0 :                                         if (PyErr_Occurred() != NULL) {
    1359           0 :                                                 return -1;
    1360             :                                         }
    1361           0 :                                         if (test_var > uint_max) {
    1362           0 :                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1363             :                                                   PyLong_Type.tp_name, uint_max, test_var);
    1364           0 :                                                 return -1;
    1365             :                                         }
    1366           0 :                                         object->rids[rids_cntr_0] = test_var;
    1367             :                                 } else {
    1368           0 :                                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1369             :                                           PyLong_Type.tp_name);
    1370           0 :                                         return -1;
    1371             :                                 }
    1372             :                         }
    1373             :                 }
    1374             :         }
    1375           0 :         return 0;
    1376             : }
    1377             : 
    1378             : static PyGetSetDef py_wbint_RidArray_getsetters[] = {
    1379             :         {
    1380             :                 .name = discard_const_p(char, "num_rids"),
    1381             :                 .get = py_wbint_RidArray_get_num_rids,
    1382             :                 .set = py_wbint_RidArray_set_num_rids,
    1383             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1384             :         },
    1385             :         {
    1386             :                 .name = discard_const_p(char, "rids"),
    1387             :                 .get = py_wbint_RidArray_get_rids,
    1388             :                 .set = py_wbint_RidArray_set_rids,
    1389             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1390             :         },
    1391             :         { .name = NULL }
    1392             : };
    1393             : 
    1394           0 : static PyObject *py_wbint_RidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1395             : {
    1396           0 :         return pytalloc_new(struct wbint_RidArray, type);
    1397             : }
    1398             : 
    1399           0 : static PyObject *py_wbint_RidArray_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1400             : {
    1401           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj);
    1402           0 :         PyObject *ret = NULL;
    1403             :         DATA_BLOB blob;
    1404             :         enum ndr_err_code err;
    1405           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1406           0 :         if (tmp_ctx == NULL) {
    1407           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1408           0 :                 return NULL;
    1409             :         }
    1410           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_RidArray);
    1411           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1412           0 :                 TALLOC_FREE(tmp_ctx);
    1413           0 :                 PyErr_SetNdrError(err);
    1414           0 :                 return NULL;
    1415             :         }
    1416             : 
    1417           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1418           0 :         TALLOC_FREE(tmp_ctx);
    1419           0 :         return ret;
    1420             : }
    1421             : 
    1422           0 : static PyObject *py_wbint_RidArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1423             : {
    1424           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj);
    1425           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1426           0 :         Py_ssize_t blob_length = 0;
    1427             :         enum ndr_err_code err;
    1428           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1429           0 :         PyObject *allow_remaining_obj = NULL;
    1430           0 :         bool allow_remaining = false;
    1431             : 
    1432           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1433             :                 discard_const_p(char *, kwnames),
    1434             :                 &blob.data, &blob_length,
    1435             :                 &allow_remaining_obj)) {
    1436           0 :                 return NULL;
    1437             :         }
    1438           0 :         blob.length = blob_length;
    1439             : 
    1440           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1441           0 :                 allow_remaining = true;
    1442             :         }
    1443             : 
    1444           0 :         if (allow_remaining) {
    1445           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_RidArray);
    1446             :         } else {
    1447           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_RidArray);
    1448             :         }
    1449           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1450           0 :                 PyErr_SetNdrError(err);
    1451           0 :                 return NULL;
    1452             :         }
    1453             : 
    1454           0 :         Py_RETURN_NONE;
    1455             : }
    1456             : 
    1457           0 : static PyObject *py_wbint_RidArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1458             : {
    1459           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj);
    1460             :         PyObject *ret;
    1461             :         char *retstr;
    1462             : 
    1463           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_RidArray, "wbint_RidArray", object);
    1464           0 :         ret = PyUnicode_FromString(retstr);
    1465           0 :         talloc_free(retstr);
    1466             : 
    1467           0 :         return ret;
    1468             : }
    1469             : 
    1470             : static PyMethodDef py_wbint_RidArray_methods[] = {
    1471             :         { "__ndr_pack__", (PyCFunction)py_wbint_RidArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1472             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_RidArray_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1473             :         { "__ndr_print__", (PyCFunction)py_wbint_RidArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1474             :         { NULL, NULL, 0, NULL }
    1475             : };
    1476             : 
    1477             : 
    1478             : static PyTypeObject wbint_RidArray_Type = {
    1479             :         PyVarObject_HEAD_INIT(NULL, 0)
    1480             :         .tp_name = "winbind.wbint_RidArray",
    1481             :         .tp_getset = py_wbint_RidArray_getsetters,
    1482             :         .tp_methods = py_wbint_RidArray_methods,
    1483             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1484             :         .tp_new = py_wbint_RidArray_new,
    1485             : };
    1486             : 
    1487             : 
    1488          44 : static PyObject *py_wbint_Principal_get_sid(PyObject *obj, void *closure)
    1489             : {
    1490          44 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(obj);
    1491             :         PyObject *py_sid;
    1492          44 :         py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid);
    1493          44 :         return py_sid;
    1494             : }
    1495             : 
    1496       65558 : static int py_wbint_Principal_set_sid(PyObject *py_obj, PyObject *value, void *closure)
    1497             : {
    1498       65558 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj);
    1499       65558 :         if (value == NULL) {
    1500           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
    1501           0 :                 return -1;
    1502             :         }
    1503       65558 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    1504       65558 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1505           0 :                 PyErr_NoMemory();
    1506           0 :                 return -1;
    1507             :         }
    1508       65558 :         object->sid = *(struct dom_sid *)pytalloc_get_ptr(value);
    1509       65558 :         return 0;
    1510             : }
    1511             : 
    1512          44 : static PyObject *py_wbint_Principal_get_type(PyObject *obj, void *closure)
    1513             : {
    1514          44 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(obj);
    1515             :         PyObject *py_type;
    1516          44 :         py_type = PyLong_FromLong((uint16_t)object->type);
    1517          44 :         return py_type;
    1518             : }
    1519             : 
    1520       65558 : static int py_wbint_Principal_set_type(PyObject *py_obj, PyObject *value, void *closure)
    1521             : {
    1522       65558 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj);
    1523       65558 :         if (value == NULL) {
    1524           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    1525           0 :                 return -1;
    1526             :         }
    1527             :         {
    1528       65558 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    1529       65558 :                 if (PyLong_Check(value)) {
    1530             :                         unsigned long long test_var;
    1531       65558 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1532       65558 :                         if (PyErr_Occurred() != NULL) {
    1533           0 :                                 return -1;
    1534             :                         }
    1535       65558 :                         if (test_var > uint_max) {
    1536           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1537             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1538           0 :                                 return -1;
    1539             :                         }
    1540       65558 :                         object->type = test_var;
    1541             :                 } else {
    1542           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1543             :                           PyLong_Type.tp_name);
    1544           0 :                         return -1;
    1545             :                 }
    1546             :         }
    1547       65558 :         return 0;
    1548             : }
    1549             : 
    1550          44 : static PyObject *py_wbint_Principal_get_name(PyObject *obj, void *closure)
    1551             : {
    1552          44 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(obj);
    1553             :         PyObject *py_name;
    1554          44 :         if (object->name == NULL) {
    1555          22 :                 Py_RETURN_NONE;
    1556             :         }
    1557           0 :         if (object->name == NULL) {
    1558           0 :                 py_name = Py_None;
    1559           0 :                 Py_INCREF(py_name);
    1560             :         } else {
    1561           0 :                 if (object->name == NULL) {
    1562           0 :                         py_name = Py_None;
    1563           0 :                         Py_INCREF(py_name);
    1564             :                 } else {
    1565          22 :                         py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
    1566             :                 }
    1567             :         }
    1568          22 :         return py_name;
    1569             : }
    1570             : 
    1571       65558 : static int py_wbint_Principal_set_name(PyObject *py_obj, PyObject *value, void *closure)
    1572             : {
    1573       65558 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj);
    1574       65558 :         if (value == NULL) {
    1575           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
    1576           0 :                 return -1;
    1577             :         }
    1578       65558 :         if (value == Py_None) {
    1579          11 :                 object->name = NULL;
    1580             :         } else {
    1581       65547 :                 object->name = NULL;
    1582             :                 {
    1583             :                         const char *test_str;
    1584             :                         const char *talloc_str;
    1585       65547 :                         PyObject *unicode = NULL;
    1586       65547 :                         if (PyUnicode_Check(value)) {
    1587       65547 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1588       65547 :                                 if (unicode == NULL) {
    1589           0 :                                         PyErr_NoMemory();
    1590           0 :                                         return -1;
    1591             :                                 }
    1592       65547 :                                 test_str = PyBytes_AS_STRING(unicode);
    1593           0 :                         } else if (PyBytes_Check(value)) {
    1594           0 :                                 test_str = PyBytes_AS_STRING(value);
    1595             :                         } else {
    1596           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1597           0 :                                 return -1;
    1598             :                         }
    1599       65547 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1600       65547 :                         if (unicode != NULL) {
    1601       65547 :                                 Py_DECREF(unicode);
    1602             :                         }
    1603       65547 :                         if (talloc_str == NULL) {
    1604           0 :                                 PyErr_NoMemory();
    1605           0 :                                 return -1;
    1606             :                         }
    1607       65547 :                         object->name = talloc_str;
    1608             :                 }
    1609             :         }
    1610           0 :         return 0;
    1611             : }
    1612             : 
    1613             : static PyGetSetDef py_wbint_Principal_getsetters[] = {
    1614             :         {
    1615             :                 .name = discard_const_p(char, "sid"),
    1616             :                 .get = py_wbint_Principal_get_sid,
    1617             :                 .set = py_wbint_Principal_set_sid,
    1618             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    1619             :         },
    1620             :         {
    1621             :                 .name = discard_const_p(char, "type"),
    1622             :                 .get = py_wbint_Principal_get_type,
    1623             :                 .set = py_wbint_Principal_set_type,
    1624             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
    1625             :         },
    1626             :         {
    1627             :                 .name = discard_const_p(char, "name"),
    1628             :                 .get = py_wbint_Principal_get_name,
    1629             :                 .set = py_wbint_Principal_set_name,
    1630             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    1631             :         },
    1632             :         { .name = NULL }
    1633             : };
    1634             : 
    1635       65560 : static PyObject *py_wbint_Principal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1636             : {
    1637       65560 :         return pytalloc_new(struct wbint_Principal, type);
    1638             : }
    1639             : 
    1640           2 : static PyObject *py_wbint_Principal_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1641             : {
    1642           2 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj);
    1643           2 :         PyObject *ret = NULL;
    1644             :         DATA_BLOB blob;
    1645             :         enum ndr_err_code err;
    1646           2 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1647           2 :         if (tmp_ctx == NULL) {
    1648           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1649           0 :                 return NULL;
    1650             :         }
    1651           2 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_Principal);
    1652           2 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1653           0 :                 TALLOC_FREE(tmp_ctx);
    1654           0 :                 PyErr_SetNdrError(err);
    1655           0 :                 return NULL;
    1656             :         }
    1657             : 
    1658           2 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1659           2 :         TALLOC_FREE(tmp_ctx);
    1660           2 :         return ret;
    1661             : }
    1662             : 
    1663           2 : static PyObject *py_wbint_Principal_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1664             : {
    1665           2 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj);
    1666           2 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1667           2 :         Py_ssize_t blob_length = 0;
    1668             :         enum ndr_err_code err;
    1669           2 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1670           2 :         PyObject *allow_remaining_obj = NULL;
    1671           2 :         bool allow_remaining = false;
    1672             : 
    1673           2 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1674             :                 discard_const_p(char *, kwnames),
    1675             :                 &blob.data, &blob_length,
    1676             :                 &allow_remaining_obj)) {
    1677           0 :                 return NULL;
    1678             :         }
    1679           2 :         blob.length = blob_length;
    1680             : 
    1681           2 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1682           0 :                 allow_remaining = true;
    1683             :         }
    1684             : 
    1685           0 :         if (allow_remaining) {
    1686           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principal);
    1687             :         } else {
    1688           2 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principal);
    1689             :         }
    1690           2 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1691           0 :                 PyErr_SetNdrError(err);
    1692           0 :                 return NULL;
    1693             :         }
    1694             : 
    1695           2 :         Py_RETURN_NONE;
    1696             : }
    1697             : 
    1698           0 : static PyObject *py_wbint_Principal_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1699             : {
    1700           0 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj);
    1701             :         PyObject *ret;
    1702             :         char *retstr;
    1703             : 
    1704           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_Principal, "wbint_Principal", object);
    1705           0 :         ret = PyUnicode_FromString(retstr);
    1706           0 :         talloc_free(retstr);
    1707             : 
    1708           0 :         return ret;
    1709             : }
    1710             : 
    1711             : static PyMethodDef py_wbint_Principal_methods[] = {
    1712             :         { "__ndr_pack__", (PyCFunction)py_wbint_Principal_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1713             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Principal_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1714             :         { "__ndr_print__", (PyCFunction)py_wbint_Principal_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1715             :         { NULL, NULL, 0, NULL }
    1716             : };
    1717             : 
    1718             : 
    1719             : static PyTypeObject wbint_Principal_Type = {
    1720             :         PyVarObject_HEAD_INIT(NULL, 0)
    1721             :         .tp_name = "winbind.wbint_Principal",
    1722             :         .tp_getset = py_wbint_Principal_getsetters,
    1723             :         .tp_methods = py_wbint_Principal_methods,
    1724             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1725             :         .tp_new = py_wbint_Principal_new,
    1726             : };
    1727             : 
    1728             : 
    1729           6 : static PyObject *py_wbint_Principals_get_num_principals(PyObject *obj, void *closure)
    1730             : {
    1731           6 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(obj);
    1732             :         PyObject *py_num_principals;
    1733           6 :         py_num_principals = PyLong_FromUnsignedLongLong((uint32_t)object->num_principals);
    1734           6 :         return py_num_principals;
    1735             : }
    1736             : 
    1737           3 : static int py_wbint_Principals_set_num_principals(PyObject *py_obj, PyObject *value, void *closure)
    1738             : {
    1739           3 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj);
    1740           3 :         if (value == NULL) {
    1741           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_principals");
    1742           0 :                 return -1;
    1743             :         }
    1744             :         {
    1745           3 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_principals));
    1746           3 :                 if (PyLong_Check(value)) {
    1747             :                         unsigned long long test_var;
    1748           3 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1749           3 :                         if (PyErr_Occurred() != NULL) {
    1750           0 :                                 return -1;
    1751             :                         }
    1752           3 :                         if (test_var > uint_max) {
    1753           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1754             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1755           0 :                                 return -1;
    1756             :                         }
    1757           3 :                         object->num_principals = test_var;
    1758             :                 } else {
    1759           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1760             :                           PyLong_Type.tp_name);
    1761           0 :                         return -1;
    1762             :                 }
    1763             :         }
    1764           3 :         return 0;
    1765             : }
    1766             : 
    1767          20 : static PyObject *py_wbint_Principals_get_principals(PyObject *obj, void *closure)
    1768             : {
    1769          20 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(obj);
    1770             :         PyObject *py_principals;
    1771          20 :         py_principals = PyList_New(object->num_principals);
    1772          20 :         if (py_principals == NULL) {
    1773           0 :                 return NULL;
    1774             :         }
    1775             :         {
    1776             :                 int principals_cntr_0;
    1777         200 :                 for (principals_cntr_0 = 0; principals_cntr_0 < (object->num_principals); principals_cntr_0++) {
    1778             :                         PyObject *py_principals_0;
    1779         200 :                         py_principals_0 = pytalloc_reference_ex(&wbint_Principal_Type, object->principals, &object->principals[principals_cntr_0]);
    1780         200 :                         PyList_SetItem(py_principals, principals_cntr_0, py_principals_0);
    1781             :                 }
    1782             :         }
    1783           0 :         return py_principals;
    1784             : }
    1785             : 
    1786           3 : static int py_wbint_Principals_set_principals(PyObject *py_obj, PyObject *value, void *closure)
    1787             : {
    1788           3 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj);
    1789           3 :         if (value == NULL) {
    1790           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->principals");
    1791           0 :                 return -1;
    1792             :         }
    1793           3 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1794             :         {
    1795             :                 int principals_cntr_0;
    1796           3 :                 object->principals = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->principals, PyList_GET_SIZE(value));
    1797           3 :                 if (!object->principals) { return -1;; }
    1798           3 :                 talloc_set_name_const(object->principals, "ARRAY: object->principals");
    1799       65559 :                 for (principals_cntr_0 = 0; principals_cntr_0 < PyList_GET_SIZE(value); principals_cntr_0++) {
    1800       65556 :                         if (PyList_GET_ITEM(value, principals_cntr_0) == NULL) {
    1801           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->principals[principals_cntr_0]");
    1802           0 :                                 return -1;
    1803             :                         }
    1804       65556 :                         PY_CHECK_TYPE(&wbint_Principal_Type, PyList_GET_ITEM(value, principals_cntr_0), return -1;);
    1805       65556 :                         if (talloc_reference(object->principals, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, principals_cntr_0))) == NULL) {
    1806           0 :                                 PyErr_NoMemory();
    1807           0 :                                 return -1;
    1808             :                         }
    1809       65556 :                         object->principals[principals_cntr_0] = *(struct wbint_Principal *)pytalloc_get_ptr(PyList_GET_ITEM(value, principals_cntr_0));
    1810             :                 }
    1811             :         }
    1812           0 :         return 0;
    1813             : }
    1814             : 
    1815             : static PyGetSetDef py_wbint_Principals_getsetters[] = {
    1816             :         {
    1817             :                 .name = discard_const_p(char, "num_principals"),
    1818             :                 .get = py_wbint_Principals_get_num_principals,
    1819             :                 .set = py_wbint_Principals_set_num_principals,
    1820             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1821             :         },
    1822             :         {
    1823             :                 .name = discard_const_p(char, "principals"),
    1824             :                 .get = py_wbint_Principals_get_principals,
    1825             :                 .set = py_wbint_Principals_set_principals,
    1826             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principal")
    1827             :         },
    1828             :         { .name = NULL }
    1829             : };
    1830             : 
    1831           6 : static PyObject *py_wbint_Principals_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1832             : {
    1833           6 :         return pytalloc_new(struct wbint_Principals, type);
    1834             : }
    1835             : 
    1836           3 : static PyObject *py_wbint_Principals_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1837             : {
    1838           3 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj);
    1839           3 :         PyObject *ret = NULL;
    1840             :         DATA_BLOB blob;
    1841             :         enum ndr_err_code err;
    1842           3 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1843           3 :         if (tmp_ctx == NULL) {
    1844           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1845           0 :                 return NULL;
    1846             :         }
    1847           3 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_Principals);
    1848           3 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1849           0 :                 TALLOC_FREE(tmp_ctx);
    1850           0 :                 PyErr_SetNdrError(err);
    1851           0 :                 return NULL;
    1852             :         }
    1853             : 
    1854           3 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1855           3 :         TALLOC_FREE(tmp_ctx);
    1856           3 :         return ret;
    1857             : }
    1858             : 
    1859           3 : static PyObject *py_wbint_Principals_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1860             : {
    1861           3 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj);
    1862           3 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1863           3 :         Py_ssize_t blob_length = 0;
    1864             :         enum ndr_err_code err;
    1865           3 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1866           3 :         PyObject *allow_remaining_obj = NULL;
    1867           3 :         bool allow_remaining = false;
    1868             : 
    1869           3 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1870             :                 discard_const_p(char *, kwnames),
    1871             :                 &blob.data, &blob_length,
    1872             :                 &allow_remaining_obj)) {
    1873           0 :                 return NULL;
    1874             :         }
    1875           3 :         blob.length = blob_length;
    1876             : 
    1877           3 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1878           0 :                 allow_remaining = true;
    1879             :         }
    1880             : 
    1881           0 :         if (allow_remaining) {
    1882           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principals);
    1883             :         } else {
    1884           3 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principals);
    1885             :         }
    1886           3 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1887           0 :                 PyErr_SetNdrError(err);
    1888           0 :                 return NULL;
    1889             :         }
    1890             : 
    1891           3 :         Py_RETURN_NONE;
    1892             : }
    1893             : 
    1894           0 : static PyObject *py_wbint_Principals_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1895             : {
    1896           0 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj);
    1897             :         PyObject *ret;
    1898             :         char *retstr;
    1899             : 
    1900           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_Principals, "wbint_Principals", object);
    1901           0 :         ret = PyUnicode_FromString(retstr);
    1902           0 :         talloc_free(retstr);
    1903             : 
    1904           0 :         return ret;
    1905             : }
    1906             : 
    1907             : static PyMethodDef py_wbint_Principals_methods[] = {
    1908             :         { "__ndr_pack__", (PyCFunction)py_wbint_Principals_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1909             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Principals_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1910             :         { "__ndr_print__", (PyCFunction)py_wbint_Principals_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1911             :         { NULL, NULL, 0, NULL }
    1912             : };
    1913             : 
    1914             : 
    1915             : static PyTypeObject wbint_Principals_Type = {
    1916             :         PyVarObject_HEAD_INIT(NULL, 0)
    1917             :         .tp_name = "winbind.wbint_Principals",
    1918             :         .tp_getset = py_wbint_Principals_getsetters,
    1919             :         .tp_methods = py_wbint_Principals_methods,
    1920             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1921             :         .tp_new = py_wbint_Principals_new,
    1922             : };
    1923             : 
    1924             : 
    1925           0 : static PyObject *py_wbint_userinfos_get_num_userinfos(PyObject *obj, void *closure)
    1926             : {
    1927           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(obj);
    1928             :         PyObject *py_num_userinfos;
    1929           0 :         py_num_userinfos = PyLong_FromUnsignedLongLong((uint32_t)object->num_userinfos);
    1930           0 :         return py_num_userinfos;
    1931             : }
    1932             : 
    1933           0 : static int py_wbint_userinfos_set_num_userinfos(PyObject *py_obj, PyObject *value, void *closure)
    1934             : {
    1935           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj);
    1936           0 :         if (value == NULL) {
    1937           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_userinfos");
    1938           0 :                 return -1;
    1939             :         }
    1940             :         {
    1941           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_userinfos));
    1942           0 :                 if (PyLong_Check(value)) {
    1943             :                         unsigned long long test_var;
    1944           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1945           0 :                         if (PyErr_Occurred() != NULL) {
    1946           0 :                                 return -1;
    1947             :                         }
    1948           0 :                         if (test_var > uint_max) {
    1949           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1950             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1951           0 :                                 return -1;
    1952             :                         }
    1953           0 :                         object->num_userinfos = test_var;
    1954             :                 } else {
    1955           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1956             :                           PyLong_Type.tp_name);
    1957           0 :                         return -1;
    1958             :                 }
    1959             :         }
    1960           0 :         return 0;
    1961             : }
    1962             : 
    1963           0 : static PyObject *py_wbint_userinfos_get_userinfos(PyObject *obj, void *closure)
    1964             : {
    1965           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(obj);
    1966             :         PyObject *py_userinfos;
    1967           0 :         py_userinfos = PyList_New(object->num_userinfos);
    1968           0 :         if (py_userinfos == NULL) {
    1969           0 :                 return NULL;
    1970             :         }
    1971             :         {
    1972             :                 int userinfos_cntr_0;
    1973           0 :                 for (userinfos_cntr_0 = 0; userinfos_cntr_0 < (object->num_userinfos); userinfos_cntr_0++) {
    1974             :                         PyObject *py_userinfos_0;
    1975           0 :                         py_userinfos_0 = pytalloc_reference_ex(&wbint_userinfo_Type, object->userinfos, &object->userinfos[userinfos_cntr_0]);
    1976           0 :                         PyList_SetItem(py_userinfos, userinfos_cntr_0, py_userinfos_0);
    1977             :                 }
    1978             :         }
    1979           0 :         return py_userinfos;
    1980             : }
    1981             : 
    1982           0 : static int py_wbint_userinfos_set_userinfos(PyObject *py_obj, PyObject *value, void *closure)
    1983             : {
    1984           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj);
    1985           0 :         if (value == NULL) {
    1986           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->userinfos");
    1987           0 :                 return -1;
    1988             :         }
    1989           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1990             :         {
    1991             :                 int userinfos_cntr_0;
    1992           0 :                 object->userinfos = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->userinfos, PyList_GET_SIZE(value));
    1993           0 :                 if (!object->userinfos) { return -1;; }
    1994           0 :                 talloc_set_name_const(object->userinfos, "ARRAY: object->userinfos");
    1995           0 :                 for (userinfos_cntr_0 = 0; userinfos_cntr_0 < PyList_GET_SIZE(value); userinfos_cntr_0++) {
    1996           0 :                         if (PyList_GET_ITEM(value, userinfos_cntr_0) == NULL) {
    1997           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->userinfos[userinfos_cntr_0]");
    1998           0 :                                 return -1;
    1999             :                         }
    2000           0 :                         PY_CHECK_TYPE(&wbint_userinfo_Type, PyList_GET_ITEM(value, userinfos_cntr_0), return -1;);
    2001           0 :                         if (talloc_reference(object->userinfos, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, userinfos_cntr_0))) == NULL) {
    2002           0 :                                 PyErr_NoMemory();
    2003           0 :                                 return -1;
    2004             :                         }
    2005           0 :                         object->userinfos[userinfos_cntr_0] = *(struct wbint_userinfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, userinfos_cntr_0));
    2006             :                 }
    2007             :         }
    2008           0 :         return 0;
    2009             : }
    2010             : 
    2011             : static PyGetSetDef py_wbint_userinfos_getsetters[] = {
    2012             :         {
    2013             :                 .name = discard_const_p(char, "num_userinfos"),
    2014             :                 .get = py_wbint_userinfos_get_num_userinfos,
    2015             :                 .set = py_wbint_userinfos_set_num_userinfos,
    2016             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2017             :         },
    2018             :         {
    2019             :                 .name = discard_const_p(char, "userinfos"),
    2020             :                 .get = py_wbint_userinfos_get_userinfos,
    2021             :                 .set = py_wbint_userinfos_set_userinfos,
    2022             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_userinfo")
    2023             :         },
    2024             :         { .name = NULL }
    2025             : };
    2026             : 
    2027           0 : static PyObject *py_wbint_userinfos_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2028             : {
    2029           0 :         return pytalloc_new(struct wbint_userinfos, type);
    2030             : }
    2031             : 
    2032           0 : static PyObject *py_wbint_userinfos_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2033             : {
    2034           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj);
    2035           0 :         PyObject *ret = NULL;
    2036             :         DATA_BLOB blob;
    2037             :         enum ndr_err_code err;
    2038           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2039           0 :         if (tmp_ctx == NULL) {
    2040           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2041           0 :                 return NULL;
    2042             :         }
    2043           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_userinfos);
    2044           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2045           0 :                 TALLOC_FREE(tmp_ctx);
    2046           0 :                 PyErr_SetNdrError(err);
    2047           0 :                 return NULL;
    2048             :         }
    2049             : 
    2050           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2051           0 :         TALLOC_FREE(tmp_ctx);
    2052           0 :         return ret;
    2053             : }
    2054             : 
    2055           0 : static PyObject *py_wbint_userinfos_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2056             : {
    2057           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj);
    2058           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2059           0 :         Py_ssize_t blob_length = 0;
    2060             :         enum ndr_err_code err;
    2061           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2062           0 :         PyObject *allow_remaining_obj = NULL;
    2063           0 :         bool allow_remaining = false;
    2064             : 
    2065           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2066             :                 discard_const_p(char *, kwnames),
    2067             :                 &blob.data, &blob_length,
    2068             :                 &allow_remaining_obj)) {
    2069           0 :                 return NULL;
    2070             :         }
    2071           0 :         blob.length = blob_length;
    2072             : 
    2073           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2074           0 :                 allow_remaining = true;
    2075             :         }
    2076             : 
    2077           0 :         if (allow_remaining) {
    2078           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfos);
    2079             :         } else {
    2080           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfos);
    2081             :         }
    2082           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2083           0 :                 PyErr_SetNdrError(err);
    2084           0 :                 return NULL;
    2085             :         }
    2086             : 
    2087           0 :         Py_RETURN_NONE;
    2088             : }
    2089             : 
    2090           0 : static PyObject *py_wbint_userinfos_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2091             : {
    2092           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj);
    2093             :         PyObject *ret;
    2094             :         char *retstr;
    2095             : 
    2096           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_userinfos, "wbint_userinfos", object);
    2097           0 :         ret = PyUnicode_FromString(retstr);
    2098           0 :         talloc_free(retstr);
    2099             : 
    2100           0 :         return ret;
    2101             : }
    2102             : 
    2103             : static PyMethodDef py_wbint_userinfos_methods[] = {
    2104             :         { "__ndr_pack__", (PyCFunction)py_wbint_userinfos_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2105             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_userinfos_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2106             :         { "__ndr_print__", (PyCFunction)py_wbint_userinfos_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2107             :         { NULL, NULL, 0, NULL }
    2108             : };
    2109             : 
    2110             : 
    2111             : static PyTypeObject wbint_userinfos_Type = {
    2112             :         PyVarObject_HEAD_INIT(NULL, 0)
    2113             :         .tp_name = "winbind.wbint_userinfos",
    2114             :         .tp_getset = py_wbint_userinfos_getsetters,
    2115             :         .tp_methods = py_wbint_userinfos_methods,
    2116             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2117             :         .tp_new = py_wbint_userinfos_new,
    2118             : };
    2119             : 
    2120             : 
    2121             : 
    2122           0 : static PyObject *py_wbint_Ping_in_get_in_data(PyObject *obj, void *closure)
    2123             : {
    2124           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(obj);
    2125             :         PyObject *py_in_data;
    2126           0 :         py_in_data = PyLong_FromUnsignedLongLong((uint32_t)object->in.in_data);
    2127           0 :         return py_in_data;
    2128             : }
    2129             : 
    2130           0 : static int py_wbint_Ping_in_set_in_data(PyObject *py_obj, PyObject *value, void *closure)
    2131             : {
    2132           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj);
    2133           0 :         if (value == NULL) {
    2134           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.in_data");
    2135           0 :                 return -1;
    2136             :         }
    2137             :         {
    2138           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.in_data));
    2139           0 :                 if (PyLong_Check(value)) {
    2140             :                         unsigned long long test_var;
    2141           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2142           0 :                         if (PyErr_Occurred() != NULL) {
    2143           0 :                                 return -1;
    2144             :                         }
    2145           0 :                         if (test_var > uint_max) {
    2146           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2147             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2148           0 :                                 return -1;
    2149             :                         }
    2150           0 :                         object->in.in_data = test_var;
    2151             :                 } else {
    2152           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2153             :                           PyLong_Type.tp_name);
    2154           0 :                         return -1;
    2155             :                 }
    2156             :         }
    2157           0 :         return 0;
    2158             : }
    2159             : 
    2160           0 : static PyObject *py_wbint_Ping_out_get_out_data(PyObject *obj, void *closure)
    2161             : {
    2162           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(obj);
    2163             :         PyObject *py_out_data;
    2164           0 :         if (object->out.out_data == NULL) {
    2165           0 :                 Py_RETURN_NONE;
    2166             :         }
    2167           0 :         py_out_data = PyLong_FromUnsignedLongLong((uint32_t)*object->out.out_data);
    2168           0 :         return py_out_data;
    2169             : }
    2170             : 
    2171           0 : static int py_wbint_Ping_out_set_out_data(PyObject *py_obj, PyObject *value, void *closure)
    2172             : {
    2173           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj);
    2174           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.out_data));
    2175           0 :         if (value == NULL) {
    2176           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.out_data");
    2177           0 :                 return -1;
    2178             :         }
    2179           0 :         object->out.out_data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.out_data);
    2180           0 :         if (object->out.out_data == NULL) {
    2181           0 :                 PyErr_NoMemory();
    2182           0 :                 return -1;
    2183             :         }
    2184             :         {
    2185           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.out_data));
    2186           0 :                 if (PyLong_Check(value)) {
    2187             :                         unsigned long long test_var;
    2188           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2189           0 :                         if (PyErr_Occurred() != NULL) {
    2190           0 :                                 return -1;
    2191             :                         }
    2192           0 :                         if (test_var > uint_max) {
    2193           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2194             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2195           0 :                                 return -1;
    2196             :                         }
    2197           0 :                         *object->out.out_data = test_var;
    2198             :                 } else {
    2199           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2200             :                           PyLong_Type.tp_name);
    2201           0 :                         return -1;
    2202             :                 }
    2203             :         }
    2204           0 :         return 0;
    2205             : }
    2206             : 
    2207             : static PyGetSetDef py_wbint_Ping_getsetters[] = {
    2208             :         {
    2209             :                 .name = discard_const_p(char, "in_in_data"),
    2210             :                 .get = py_wbint_Ping_in_get_in_data,
    2211             :                 .set = py_wbint_Ping_in_set_in_data,
    2212             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2213             :         },
    2214             :         {
    2215             :                 .name = discard_const_p(char, "out_out_data"),
    2216             :                 .get = py_wbint_Ping_out_get_out_data,
    2217             :                 .set = py_wbint_Ping_out_set_out_data,
    2218             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2219             :         },
    2220             :         { .name = NULL }
    2221             : };
    2222             : 
    2223           0 : static PyObject *py_wbint_Ping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2224             : {
    2225           0 :         PyObject *self = pytalloc_new(struct wbint_Ping, type);
    2226           0 :         struct wbint_Ping *_self = (struct wbint_Ping *)pytalloc_get_ptr(self);
    2227           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    2228           0 :         _self->out.out_data = talloc_zero(mem_ctx, uint32_t);
    2229           0 :         return self;
    2230             : }
    2231             : 
    2232           0 : static PyObject *py_wbint_Ping_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    2233             : {
    2234             : 
    2235             : 
    2236           0 :         return PyLong_FromLong(0);
    2237             : }
    2238             : 
    2239           0 : static PyObject *py_wbint_Ping_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    2240             : {
    2241           0 :         const struct ndr_interface_call *call = NULL;
    2242           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj);
    2243           0 :         PyObject *ret = NULL;
    2244           0 :         struct ndr_push *push = NULL;
    2245             :         DATA_BLOB blob;
    2246             :         enum ndr_err_code err;
    2247             : 
    2248           0 :         if (ndr_table_winbind.num_calls < 1) {
    2249           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Ping_ndr_pack");
    2250           0 :                 return NULL;
    2251             :         }
    2252           0 :         call = &ndr_table_winbind.calls[0];
    2253             : 
    2254           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    2255           0 :         if (push == NULL) {
    2256           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2257           0 :                 return NULL;
    2258             :         }
    2259             : 
    2260           0 :         push->flags |= ndr_push_flags;
    2261             : 
    2262           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    2263           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2264           0 :                 TALLOC_FREE(push);
    2265           0 :                 PyErr_SetNdrError(err);
    2266           0 :                 return NULL;
    2267             :         }
    2268           0 :         blob = ndr_push_blob(push);
    2269           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2270           0 :         TALLOC_FREE(push);
    2271           0 :         return ret;
    2272             : }
    2273             : 
    2274           0 : static PyObject *py_wbint_Ping_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2275             : {
    2276           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    2277           0 :         PyObject *bigendian_obj = NULL;
    2278           0 :         PyObject *ndr64_obj = NULL;
    2279           0 :         uint32_t ndr_push_flags = 0;
    2280             : 
    2281           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    2282             :                 discard_const_p(char *, kwnames),
    2283             :                 &bigendian_obj,
    2284             :                 &ndr64_obj)) {
    2285           0 :                 return NULL;
    2286             :         }
    2287             : 
    2288           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    2289           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    2290             :         }
    2291           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    2292           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    2293             :         }
    2294             : 
    2295           0 :         return py_wbint_Ping_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    2296             : }
    2297             : 
    2298           0 : static PyObject *py_wbint_Ping_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2299             : {
    2300           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    2301           0 :         PyObject *bigendian_obj = NULL;
    2302           0 :         PyObject *ndr64_obj = NULL;
    2303           0 :         uint32_t ndr_push_flags = 0;
    2304             : 
    2305           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    2306             :                 discard_const_p(char *, kwnames),
    2307             :                 &bigendian_obj,
    2308             :                 &ndr64_obj)) {
    2309           0 :                 return NULL;
    2310             :         }
    2311             : 
    2312           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    2313           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    2314             :         }
    2315           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    2316           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    2317             :         }
    2318             : 
    2319           0 :         return py_wbint_Ping_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    2320             : }
    2321             : 
    2322           0 : static PyObject *py_wbint_Ping_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    2323             : {
    2324           0 :         const struct ndr_interface_call *call = NULL;
    2325           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj);
    2326           0 :         struct ndr_pull *pull = NULL;
    2327             :         enum ndr_err_code err;
    2328             : 
    2329           0 :         if (ndr_table_winbind.num_calls < 1) {
    2330           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Ping_ndr_unpack");
    2331           0 :                 return NULL;
    2332             :         }
    2333           0 :         call = &ndr_table_winbind.calls[0];
    2334             : 
    2335           0 :         pull = ndr_pull_init_blob(blob, object);
    2336           0 :         if (pull == NULL) {
    2337           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2338           0 :                 return NULL;
    2339             :         }
    2340             : 
    2341           0 :         pull->flags |= ndr_pull_flags;
    2342             : 
    2343           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    2344           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2345           0 :                 TALLOC_FREE(pull);
    2346           0 :                 PyErr_SetNdrError(err);
    2347           0 :                 return NULL;
    2348             :         }
    2349           0 :         if (!allow_remaining) {
    2350             :                 uint32_t highest_ofs;
    2351             : 
    2352           0 :                 if (pull->offset > pull->relative_highest_offset) {
    2353           0 :                         highest_ofs = pull->offset;
    2354             :                 } else {
    2355           0 :                         highest_ofs = pull->relative_highest_offset;
    2356             :                 }
    2357           0 :                 if (highest_ofs < pull->data_size) {
    2358           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    2359             :                                 "not all bytes consumed ofs[%u] size[%u]",
    2360             :                                 highest_ofs, pull->data_size);
    2361           0 :                         TALLOC_FREE(pull);
    2362           0 :                         PyErr_SetNdrError(err);
    2363           0 :                         return NULL;
    2364             :                 }
    2365             :         }
    2366             : 
    2367           0 :         TALLOC_FREE(pull);
    2368           0 :         Py_RETURN_NONE;
    2369             : }
    2370             : 
    2371           0 : static PyObject *py_wbint_Ping_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2372             : {
    2373             :         DATA_BLOB blob;
    2374           0 :         Py_ssize_t blob_length = 0;
    2375           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    2376           0 :         PyObject *bigendian_obj = NULL;
    2377           0 :         PyObject *ndr64_obj = NULL;
    2378           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    2379           0 :         PyObject *allow_remaining_obj = NULL;
    2380           0 :         bool allow_remaining = false;
    2381             : 
    2382           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    2383             :                 discard_const_p(char *, kwnames),
    2384             :                 &blob.data, &blob_length,
    2385             :                 &bigendian_obj,
    2386             :                 &ndr64_obj,
    2387             :                 &allow_remaining_obj)) {
    2388           0 :                 return NULL;
    2389             :         }
    2390           0 :         blob.length = blob_length;
    2391             : 
    2392           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    2393           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    2394             :         }
    2395           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    2396           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    2397             :         }
    2398             : 
    2399           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2400           0 :                 allow_remaining = true;
    2401             :         }
    2402             : 
    2403           0 :         return py_wbint_Ping_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    2404             : }
    2405             : 
    2406           0 : static PyObject *py_wbint_Ping_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2407             : {
    2408             :         DATA_BLOB blob;
    2409           0 :         Py_ssize_t blob_length = 0;
    2410           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    2411           0 :         PyObject *bigendian_obj = NULL;
    2412           0 :         PyObject *ndr64_obj = NULL;
    2413           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    2414           0 :         PyObject *allow_remaining_obj = NULL;
    2415           0 :         bool allow_remaining = false;
    2416             : 
    2417           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    2418             :                 discard_const_p(char *, kwnames),
    2419             :                 &blob.data, &blob_length,
    2420             :                 &bigendian_obj,
    2421             :                 &ndr64_obj,
    2422             :                 &allow_remaining_obj)) {
    2423           0 :                 return NULL;
    2424             :         }
    2425           0 :         blob.length = blob_length;
    2426             : 
    2427           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    2428           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    2429             :         }
    2430           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    2431           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    2432             :         }
    2433             : 
    2434           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2435           0 :                 allow_remaining = true;
    2436             :         }
    2437             : 
    2438           0 :         return py_wbint_Ping_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    2439             : }
    2440             : 
    2441           0 : static PyObject *py_wbint_Ping_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    2442             : {
    2443           0 :         const struct ndr_interface_call *call = NULL;
    2444           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj);
    2445             :         PyObject *ret;
    2446             :         char *retstr;
    2447             : 
    2448           0 :         if (ndr_table_winbind.num_calls < 1) {
    2449           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Ping_ndr_print");
    2450           0 :                 return NULL;
    2451             :         }
    2452           0 :         call = &ndr_table_winbind.calls[0];
    2453             : 
    2454           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    2455           0 :         ret = PyUnicode_FromString(retstr);
    2456           0 :         TALLOC_FREE(retstr);
    2457             : 
    2458           0 :         return ret;
    2459             : }
    2460             : 
    2461           0 : static PyObject *py_wbint_Ping_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2462             : {
    2463           0 :         return py_wbint_Ping_ndr_print(py_obj, "wbint_Ping_in", NDR_IN);
    2464             : }
    2465             : 
    2466           0 : static PyObject *py_wbint_Ping_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2467             : {
    2468           0 :         return py_wbint_Ping_ndr_print(py_obj, "wbint_Ping_out", NDR_OUT);
    2469             : }
    2470             : 
    2471             : static PyMethodDef py_wbint_Ping_methods[] = {
    2472             :         { "opnum", (PyCFunction)py_wbint_Ping_ndr_opnum, METH_NOARGS|METH_CLASS,
    2473             :                 "winbind.wbint_Ping.opnum() -> 0 (0x00) " },
    2474             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    2475             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    2476             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    2477             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    2478             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    2479             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    2480             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    2481             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    2482             :         { "__ndr_print_in__", (PyCFunction)py_wbint_Ping_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    2483             :         { "__ndr_print_out__", (PyCFunction)py_wbint_Ping_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    2484             :         { NULL, NULL, 0, NULL }
    2485             : };
    2486             : 
    2487             : 
    2488             : static PyTypeObject wbint_Ping_Type = {
    2489             :         PyVarObject_HEAD_INIT(NULL, 0)
    2490             :         .tp_name = "winbind.wbint_Ping",
    2491             :         .tp_getset = py_wbint_Ping_getsetters,
    2492             :         .tp_methods = py_wbint_Ping_methods,
    2493             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2494             :         .tp_new = py_wbint_Ping_new,
    2495             : };
    2496             : 
    2497           0 : static bool pack_py_wbint_Ping_args_in(PyObject *args, PyObject *kwargs, struct wbint_Ping *r)
    2498             : {
    2499             :         PyObject *py_in_data;
    2500           0 :         const char *kwnames[] = {
    2501             :                 "in_data", NULL
    2502             :         };
    2503             : 
    2504           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_Ping", discard_const_p(char *, kwnames), &py_in_data)) {
    2505           0 :                 return false;
    2506             :         }
    2507             : 
    2508           0 :         if (py_in_data == NULL) {
    2509           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.in_data");
    2510           0 :                 return false;
    2511             :         }
    2512             :         {
    2513           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.in_data));
    2514           0 :                 if (PyLong_Check(py_in_data)) {
    2515             :                         unsigned long long test_var;
    2516           0 :                         test_var = PyLong_AsUnsignedLongLong(py_in_data);
    2517           0 :                         if (PyErr_Occurred() != NULL) {
    2518           0 :                                 return false;
    2519             :                         }
    2520           0 :                         if (test_var > uint_max) {
    2521           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2522             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2523           0 :                                 return false;
    2524             :                         }
    2525           0 :                         r->in.in_data = test_var;
    2526             :                 } else {
    2527           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2528             :                           PyLong_Type.tp_name);
    2529           0 :                         return false;
    2530             :                 }
    2531             :         }
    2532           0 :         return true;
    2533             : }
    2534             : 
    2535           0 : static PyObject *unpack_py_wbint_Ping_args_out(struct wbint_Ping *r)
    2536             : {
    2537             :         PyObject *result;
    2538             :         PyObject *py_out_data;
    2539           0 :         py_out_data = PyLong_FromUnsignedLongLong((uint32_t)*r->out.out_data);
    2540           0 :         result = py_out_data;
    2541           0 :         return result;
    2542             : }
    2543             : 
    2544             : 
    2545           0 : static PyObject *py_wbint_LookupSid_in_get_sid(PyObject *obj, void *closure)
    2546             : {
    2547           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj);
    2548             :         PyObject *py_sid;
    2549           0 :         if (object->in.sid == NULL) {
    2550           0 :                 Py_RETURN_NONE;
    2551             :         }
    2552           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
    2553           0 :         return py_sid;
    2554             : }
    2555             : 
    2556           0 : static int py_wbint_LookupSid_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
    2557             : {
    2558           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    2559           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
    2560           0 :         if (value == NULL) {
    2561           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
    2562           0 :                 return -1;
    2563             :         }
    2564           0 :         object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
    2565           0 :         if (object->in.sid == NULL) {
    2566           0 :                 PyErr_NoMemory();
    2567           0 :                 return -1;
    2568             :         }
    2569           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    2570           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2571           0 :                 PyErr_NoMemory();
    2572           0 :                 return -1;
    2573             :         }
    2574           0 :         object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
    2575           0 :         return 0;
    2576             : }
    2577             : 
    2578           0 : static PyObject *py_wbint_LookupSid_out_get_type(PyObject *obj, void *closure)
    2579             : {
    2580           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj);
    2581             :         PyObject *py_type;
    2582           0 :         if (object->out.type == NULL) {
    2583           0 :                 Py_RETURN_NONE;
    2584             :         }
    2585           0 :         py_type = PyLong_FromLong((uint16_t)*object->out.type);
    2586           0 :         return py_type;
    2587             : }
    2588             : 
    2589           0 : static int py_wbint_LookupSid_out_set_type(PyObject *py_obj, PyObject *value, void *closure)
    2590             : {
    2591           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    2592           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.type));
    2593           0 :         if (value == NULL) {
    2594           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.type");
    2595           0 :                 return -1;
    2596             :         }
    2597           0 :         object->out.type = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.type);
    2598           0 :         if (object->out.type == NULL) {
    2599           0 :                 PyErr_NoMemory();
    2600           0 :                 return -1;
    2601             :         }
    2602             :         {
    2603           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.type));
    2604           0 :                 if (PyLong_Check(value)) {
    2605             :                         unsigned long long test_var;
    2606           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2607           0 :                         if (PyErr_Occurred() != NULL) {
    2608           0 :                                 return -1;
    2609             :                         }
    2610           0 :                         if (test_var > uint_max) {
    2611           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2612             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2613           0 :                                 return -1;
    2614             :                         }
    2615           0 :                         *object->out.type = test_var;
    2616             :                 } else {
    2617           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2618             :                           PyLong_Type.tp_name);
    2619           0 :                         return -1;
    2620             :                 }
    2621             :         }
    2622           0 :         return 0;
    2623             : }
    2624             : 
    2625           0 : static PyObject *py_wbint_LookupSid_out_get_domain(PyObject *obj, void *closure)
    2626             : {
    2627           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj);
    2628             :         PyObject *py_domain;
    2629           0 :         if (object->out.domain == NULL) {
    2630           0 :                 Py_RETURN_NONE;
    2631             :         }
    2632           0 :         if (*object->out.domain == NULL) {
    2633           0 :                 py_domain = Py_None;
    2634           0 :                 Py_INCREF(py_domain);
    2635             :         } else {
    2636           0 :                 if (*object->out.domain == NULL) {
    2637           0 :                         py_domain = Py_None;
    2638           0 :                         Py_INCREF(py_domain);
    2639             :                 } else {
    2640           0 :                         py_domain = PyUnicode_Decode(*object->out.domain, strlen(*object->out.domain), "utf-8", "ignore");
    2641             :                 }
    2642             :         }
    2643           0 :         return py_domain;
    2644             : }
    2645             : 
    2646           0 : static int py_wbint_LookupSid_out_set_domain(PyObject *py_obj, PyObject *value, void *closure)
    2647             : {
    2648           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    2649           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domain));
    2650           0 :         if (value == NULL) {
    2651           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domain");
    2652           0 :                 return -1;
    2653             :         }
    2654           0 :         object->out.domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domain);
    2655           0 :         if (object->out.domain == NULL) {
    2656           0 :                 PyErr_NoMemory();
    2657           0 :                 return -1;
    2658             :         }
    2659           0 :         if (value == Py_None) {
    2660           0 :                 *object->out.domain = NULL;
    2661             :         } else {
    2662           0 :                 *object->out.domain = NULL;
    2663             :                 {
    2664             :                         const char *test_str;
    2665             :                         const char *talloc_str;
    2666           0 :                         PyObject *unicode = NULL;
    2667           0 :                         if (PyUnicode_Check(value)) {
    2668           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2669           0 :                                 if (unicode == NULL) {
    2670           0 :                                         PyErr_NoMemory();
    2671           0 :                                         return -1;
    2672             :                                 }
    2673           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2674           0 :                         } else if (PyBytes_Check(value)) {
    2675           0 :                                 test_str = PyBytes_AS_STRING(value);
    2676             :                         } else {
    2677           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2678           0 :                                 return -1;
    2679             :                         }
    2680           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2681           0 :                         if (unicode != NULL) {
    2682           0 :                                 Py_DECREF(unicode);
    2683             :                         }
    2684           0 :                         if (talloc_str == NULL) {
    2685           0 :                                 PyErr_NoMemory();
    2686           0 :                                 return -1;
    2687             :                         }
    2688           0 :                         *object->out.domain = talloc_str;
    2689             :                 }
    2690             :         }
    2691           0 :         return 0;
    2692             : }
    2693             : 
    2694           0 : static PyObject *py_wbint_LookupSid_out_get_name(PyObject *obj, void *closure)
    2695             : {
    2696           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj);
    2697             :         PyObject *py_name;
    2698           0 :         if (object->out.name == NULL) {
    2699           0 :                 Py_RETURN_NONE;
    2700             :         }
    2701           0 :         if (*object->out.name == NULL) {
    2702           0 :                 py_name = Py_None;
    2703           0 :                 Py_INCREF(py_name);
    2704             :         } else {
    2705           0 :                 if (*object->out.name == NULL) {
    2706           0 :                         py_name = Py_None;
    2707           0 :                         Py_INCREF(py_name);
    2708             :                 } else {
    2709           0 :                         py_name = PyUnicode_Decode(*object->out.name, strlen(*object->out.name), "utf-8", "ignore");
    2710             :                 }
    2711             :         }
    2712           0 :         return py_name;
    2713             : }
    2714             : 
    2715           0 : static int py_wbint_LookupSid_out_set_name(PyObject *py_obj, PyObject *value, void *closure)
    2716             : {
    2717           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    2718           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.name));
    2719           0 :         if (value == NULL) {
    2720           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.name");
    2721           0 :                 return -1;
    2722             :         }
    2723           0 :         object->out.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.name);
    2724           0 :         if (object->out.name == NULL) {
    2725           0 :                 PyErr_NoMemory();
    2726           0 :                 return -1;
    2727             :         }
    2728           0 :         if (value == Py_None) {
    2729           0 :                 *object->out.name = NULL;
    2730             :         } else {
    2731           0 :                 *object->out.name = NULL;
    2732             :                 {
    2733             :                         const char *test_str;
    2734             :                         const char *talloc_str;
    2735           0 :                         PyObject *unicode = NULL;
    2736           0 :                         if (PyUnicode_Check(value)) {
    2737           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2738           0 :                                 if (unicode == NULL) {
    2739           0 :                                         PyErr_NoMemory();
    2740           0 :                                         return -1;
    2741             :                                 }
    2742           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2743           0 :                         } else if (PyBytes_Check(value)) {
    2744           0 :                                 test_str = PyBytes_AS_STRING(value);
    2745             :                         } else {
    2746           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2747           0 :                                 return -1;
    2748             :                         }
    2749           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2750           0 :                         if (unicode != NULL) {
    2751           0 :                                 Py_DECREF(unicode);
    2752             :                         }
    2753           0 :                         if (talloc_str == NULL) {
    2754           0 :                                 PyErr_NoMemory();
    2755           0 :                                 return -1;
    2756             :                         }
    2757           0 :                         *object->out.name = talloc_str;
    2758             :                 }
    2759             :         }
    2760           0 :         return 0;
    2761             : }
    2762             : 
    2763           0 : static PyObject *py_wbint_LookupSid_get_result(PyObject *obj, void *closure)
    2764             : {
    2765           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj);
    2766             :         PyObject *py_result;
    2767           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    2768           0 :         return py_result;
    2769             : }
    2770             : 
    2771           0 : static int py_wbint_LookupSid_set_result(PyObject *py_obj, PyObject *value, void *closure)
    2772             : {
    2773           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    2774           0 :         if (value == NULL) {
    2775           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    2776           0 :                 return -1;
    2777             :         }
    2778           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    2779           0 :         return 0;
    2780             : }
    2781             : 
    2782             : static PyGetSetDef py_wbint_LookupSid_getsetters[] = {
    2783             :         {
    2784             :                 .name = discard_const_p(char, "in_sid"),
    2785             :                 .get = py_wbint_LookupSid_in_get_sid,
    2786             :                 .set = py_wbint_LookupSid_in_set_sid,
    2787             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    2788             :         },
    2789             :         {
    2790             :                 .name = discard_const_p(char, "out_type"),
    2791             :                 .get = py_wbint_LookupSid_out_get_type,
    2792             :                 .set = py_wbint_LookupSid_out_set_type,
    2793             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
    2794             :         },
    2795             :         {
    2796             :                 .name = discard_const_p(char, "out_domain"),
    2797             :                 .get = py_wbint_LookupSid_out_get_domain,
    2798             :                 .set = py_wbint_LookupSid_out_set_domain,
    2799             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    2800             :         },
    2801             :         {
    2802             :                 .name = discard_const_p(char, "out_name"),
    2803             :                 .get = py_wbint_LookupSid_out_get_name,
    2804             :                 .set = py_wbint_LookupSid_out_set_name,
    2805             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    2806             :         },
    2807             :         {
    2808             :                 .name = discard_const_p(char, "result"),
    2809             :                 .get = py_wbint_LookupSid_get_result,
    2810             :                 .set = py_wbint_LookupSid_set_result,
    2811             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    2812             :         },
    2813             :         { .name = NULL }
    2814             : };
    2815             : 
    2816           0 : static PyObject *py_wbint_LookupSid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2817             : {
    2818           0 :         PyObject *self = pytalloc_new(struct wbint_LookupSid, type);
    2819           0 :         struct wbint_LookupSid *_self = (struct wbint_LookupSid *)pytalloc_get_ptr(self);
    2820           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    2821           0 :         _self->in.sid = talloc_zero(mem_ctx, struct dom_sid);
    2822           0 :         _self->out.type = talloc_zero(mem_ctx, enum lsa_SidType);
    2823           0 :         return self;
    2824             : }
    2825             : 
    2826           0 : static PyObject *py_wbint_LookupSid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    2827             : {
    2828             : 
    2829             : 
    2830           0 :         return PyLong_FromLong(1);
    2831             : }
    2832             : 
    2833           0 : static PyObject *py_wbint_LookupSid_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    2834             : {
    2835           0 :         const struct ndr_interface_call *call = NULL;
    2836           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    2837           0 :         PyObject *ret = NULL;
    2838           0 :         struct ndr_push *push = NULL;
    2839             :         DATA_BLOB blob;
    2840             :         enum ndr_err_code err;
    2841             : 
    2842           0 :         if (ndr_table_winbind.num_calls < 2) {
    2843           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSid_ndr_pack");
    2844           0 :                 return NULL;
    2845             :         }
    2846           0 :         call = &ndr_table_winbind.calls[1];
    2847             : 
    2848           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    2849           0 :         if (push == NULL) {
    2850           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2851           0 :                 return NULL;
    2852             :         }
    2853             : 
    2854           0 :         push->flags |= ndr_push_flags;
    2855             : 
    2856           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    2857           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2858           0 :                 TALLOC_FREE(push);
    2859           0 :                 PyErr_SetNdrError(err);
    2860           0 :                 return NULL;
    2861             :         }
    2862           0 :         blob = ndr_push_blob(push);
    2863           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2864           0 :         TALLOC_FREE(push);
    2865           0 :         return ret;
    2866             : }
    2867             : 
    2868           0 : static PyObject *py_wbint_LookupSid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2869             : {
    2870           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    2871           0 :         PyObject *bigendian_obj = NULL;
    2872           0 :         PyObject *ndr64_obj = NULL;
    2873           0 :         uint32_t ndr_push_flags = 0;
    2874             : 
    2875           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    2876             :                 discard_const_p(char *, kwnames),
    2877             :                 &bigendian_obj,
    2878             :                 &ndr64_obj)) {
    2879           0 :                 return NULL;
    2880             :         }
    2881             : 
    2882           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    2883           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    2884             :         }
    2885           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    2886           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    2887             :         }
    2888             : 
    2889           0 :         return py_wbint_LookupSid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    2890             : }
    2891             : 
    2892           0 : static PyObject *py_wbint_LookupSid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2893             : {
    2894           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    2895           0 :         PyObject *bigendian_obj = NULL;
    2896           0 :         PyObject *ndr64_obj = NULL;
    2897           0 :         uint32_t ndr_push_flags = 0;
    2898             : 
    2899           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    2900             :                 discard_const_p(char *, kwnames),
    2901             :                 &bigendian_obj,
    2902             :                 &ndr64_obj)) {
    2903           0 :                 return NULL;
    2904             :         }
    2905             : 
    2906           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    2907           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    2908             :         }
    2909           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    2910           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    2911             :         }
    2912             : 
    2913           0 :         return py_wbint_LookupSid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    2914             : }
    2915             : 
    2916           0 : static PyObject *py_wbint_LookupSid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    2917             : {
    2918           0 :         const struct ndr_interface_call *call = NULL;
    2919           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    2920           0 :         struct ndr_pull *pull = NULL;
    2921             :         enum ndr_err_code err;
    2922             : 
    2923           0 :         if (ndr_table_winbind.num_calls < 2) {
    2924           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSid_ndr_unpack");
    2925           0 :                 return NULL;
    2926             :         }
    2927           0 :         call = &ndr_table_winbind.calls[1];
    2928             : 
    2929           0 :         pull = ndr_pull_init_blob(blob, object);
    2930           0 :         if (pull == NULL) {
    2931           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2932           0 :                 return NULL;
    2933             :         }
    2934             : 
    2935           0 :         pull->flags |= ndr_pull_flags;
    2936             : 
    2937           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    2938           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2939           0 :                 TALLOC_FREE(pull);
    2940           0 :                 PyErr_SetNdrError(err);
    2941           0 :                 return NULL;
    2942             :         }
    2943           0 :         if (!allow_remaining) {
    2944             :                 uint32_t highest_ofs;
    2945             : 
    2946           0 :                 if (pull->offset > pull->relative_highest_offset) {
    2947           0 :                         highest_ofs = pull->offset;
    2948             :                 } else {
    2949           0 :                         highest_ofs = pull->relative_highest_offset;
    2950             :                 }
    2951           0 :                 if (highest_ofs < pull->data_size) {
    2952           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    2953             :                                 "not all bytes consumed ofs[%u] size[%u]",
    2954             :                                 highest_ofs, pull->data_size);
    2955           0 :                         TALLOC_FREE(pull);
    2956           0 :                         PyErr_SetNdrError(err);
    2957           0 :                         return NULL;
    2958             :                 }
    2959             :         }
    2960             : 
    2961           0 :         TALLOC_FREE(pull);
    2962           0 :         Py_RETURN_NONE;
    2963             : }
    2964             : 
    2965           0 : static PyObject *py_wbint_LookupSid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2966             : {
    2967             :         DATA_BLOB blob;
    2968           0 :         Py_ssize_t blob_length = 0;
    2969           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    2970           0 :         PyObject *bigendian_obj = NULL;
    2971           0 :         PyObject *ndr64_obj = NULL;
    2972           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    2973           0 :         PyObject *allow_remaining_obj = NULL;
    2974           0 :         bool allow_remaining = false;
    2975             : 
    2976           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    2977             :                 discard_const_p(char *, kwnames),
    2978             :                 &blob.data, &blob_length,
    2979             :                 &bigendian_obj,
    2980             :                 &ndr64_obj,
    2981             :                 &allow_remaining_obj)) {
    2982           0 :                 return NULL;
    2983             :         }
    2984           0 :         blob.length = blob_length;
    2985             : 
    2986           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    2987           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    2988             :         }
    2989           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    2990           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    2991             :         }
    2992             : 
    2993           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2994           0 :                 allow_remaining = true;
    2995             :         }
    2996             : 
    2997           0 :         return py_wbint_LookupSid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    2998             : }
    2999             : 
    3000           0 : static PyObject *py_wbint_LookupSid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3001             : {
    3002             :         DATA_BLOB blob;
    3003           0 :         Py_ssize_t blob_length = 0;
    3004           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3005           0 :         PyObject *bigendian_obj = NULL;
    3006           0 :         PyObject *ndr64_obj = NULL;
    3007           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3008           0 :         PyObject *allow_remaining_obj = NULL;
    3009           0 :         bool allow_remaining = false;
    3010             : 
    3011           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    3012             :                 discard_const_p(char *, kwnames),
    3013             :                 &blob.data, &blob_length,
    3014             :                 &bigendian_obj,
    3015             :                 &ndr64_obj,
    3016             :                 &allow_remaining_obj)) {
    3017           0 :                 return NULL;
    3018             :         }
    3019           0 :         blob.length = blob_length;
    3020             : 
    3021           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3022           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3023             :         }
    3024           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3025           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3026             :         }
    3027             : 
    3028           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3029           0 :                 allow_remaining = true;
    3030             :         }
    3031             : 
    3032           0 :         return py_wbint_LookupSid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    3033             : }
    3034             : 
    3035           0 : static PyObject *py_wbint_LookupSid_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    3036             : {
    3037           0 :         const struct ndr_interface_call *call = NULL;
    3038           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    3039             :         PyObject *ret;
    3040             :         char *retstr;
    3041             : 
    3042           0 :         if (ndr_table_winbind.num_calls < 2) {
    3043           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSid_ndr_print");
    3044           0 :                 return NULL;
    3045             :         }
    3046           0 :         call = &ndr_table_winbind.calls[1];
    3047             : 
    3048           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    3049           0 :         ret = PyUnicode_FromString(retstr);
    3050           0 :         TALLOC_FREE(retstr);
    3051             : 
    3052           0 :         return ret;
    3053             : }
    3054             : 
    3055           0 : static PyObject *py_wbint_LookupSid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3056             : {
    3057           0 :         return py_wbint_LookupSid_ndr_print(py_obj, "wbint_LookupSid_in", NDR_IN);
    3058             : }
    3059             : 
    3060           0 : static PyObject *py_wbint_LookupSid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3061             : {
    3062           0 :         return py_wbint_LookupSid_ndr_print(py_obj, "wbint_LookupSid_out", NDR_OUT);
    3063             : }
    3064             : 
    3065             : static PyMethodDef py_wbint_LookupSid_methods[] = {
    3066             :         { "opnum", (PyCFunction)py_wbint_LookupSid_ndr_opnum, METH_NOARGS|METH_CLASS,
    3067             :                 "winbind.wbint_LookupSid.opnum() -> 1 (0x01) " },
    3068             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    3069             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    3070             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    3071             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    3072             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    3073             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    3074             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    3075             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    3076             :         { "__ndr_print_in__", (PyCFunction)py_wbint_LookupSid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    3077             :         { "__ndr_print_out__", (PyCFunction)py_wbint_LookupSid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    3078             :         { NULL, NULL, 0, NULL }
    3079             : };
    3080             : 
    3081             : 
    3082             : static PyTypeObject wbint_LookupSid_Type = {
    3083             :         PyVarObject_HEAD_INIT(NULL, 0)
    3084             :         .tp_name = "winbind.wbint_LookupSid",
    3085             :         .tp_getset = py_wbint_LookupSid_getsetters,
    3086             :         .tp_methods = py_wbint_LookupSid_methods,
    3087             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3088             :         .tp_new = py_wbint_LookupSid_new,
    3089             : };
    3090             : 
    3091           0 : static bool pack_py_wbint_LookupSid_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupSid *r)
    3092             : {
    3093             :         PyObject *py_sid;
    3094           0 :         const char *kwnames[] = {
    3095             :                 "sid", NULL
    3096             :         };
    3097             : 
    3098           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupSid", discard_const_p(char *, kwnames), &py_sid)) {
    3099           0 :                 return false;
    3100             :         }
    3101             : 
    3102           0 :         if (py_sid == NULL) {
    3103           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
    3104           0 :                 return false;
    3105             :         }
    3106           0 :         r->in.sid = talloc_ptrtype(r, r->in.sid);
    3107           0 :         if (r->in.sid == NULL) {
    3108           0 :                 PyErr_NoMemory();
    3109           0 :                 return false;
    3110             :         }
    3111           0 :         PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
    3112           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
    3113           0 :                 PyErr_NoMemory();
    3114           0 :                 return false;
    3115             :         }
    3116           0 :         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
    3117           0 :         return true;
    3118             : }
    3119             : 
    3120           0 : static PyObject *unpack_py_wbint_LookupSid_args_out(struct wbint_LookupSid *r)
    3121             : {
    3122             :         PyObject *result;
    3123             :         PyObject *py_type;
    3124             :         PyObject *py_domain;
    3125             :         PyObject *py_name;
    3126           0 :         result = PyTuple_New(3);
    3127           0 :         py_type = PyLong_FromLong((uint16_t)*r->out.type);
    3128           0 :         PyTuple_SetItem(result, 0, py_type);
    3129           0 :         if (*r->out.domain == NULL) {
    3130           0 :                 py_domain = Py_None;
    3131           0 :                 Py_INCREF(py_domain);
    3132             :         } else {
    3133           0 :                 if (*r->out.domain == NULL) {
    3134           0 :                         py_domain = Py_None;
    3135           0 :                         Py_INCREF(py_domain);
    3136             :                 } else {
    3137           0 :                         py_domain = PyUnicode_Decode(*r->out.domain, strlen(*r->out.domain), "utf-8", "ignore");
    3138             :                 }
    3139             :         }
    3140           0 :         PyTuple_SetItem(result, 1, py_domain);
    3141           0 :         if (*r->out.name == NULL) {
    3142           0 :                 py_name = Py_None;
    3143           0 :                 Py_INCREF(py_name);
    3144             :         } else {
    3145           0 :                 if (*r->out.name == NULL) {
    3146           0 :                         py_name = Py_None;
    3147           0 :                         Py_INCREF(py_name);
    3148             :                 } else {
    3149           0 :                         py_name = PyUnicode_Decode(*r->out.name, strlen(*r->out.name), "utf-8", "ignore");
    3150             :                 }
    3151             :         }
    3152           0 :         PyTuple_SetItem(result, 2, py_name);
    3153           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    3154           0 :                 PyErr_SetNTSTATUS(r->out.result);
    3155           0 :                 return NULL;
    3156             :         }
    3157             : 
    3158           0 :         return result;
    3159             : }
    3160             : 
    3161             : 
    3162           0 : static PyObject *py_wbint_LookupSids_in_get_sids(PyObject *obj, void *closure)
    3163             : {
    3164           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(obj);
    3165             :         PyObject *py_sids;
    3166           0 :         if (object->in.sids == NULL) {
    3167           0 :                 Py_RETURN_NONE;
    3168             :         }
    3169           0 :         py_sids = pytalloc_reference_ex(lsa_SidArray_Type, object->in.sids, object->in.sids);
    3170           0 :         return py_sids;
    3171             : }
    3172             : 
    3173           0 : static int py_wbint_LookupSids_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
    3174             : {
    3175           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    3176           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
    3177           0 :         if (value == NULL) {
    3178           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
    3179           0 :                 return -1;
    3180             :         }
    3181           0 :         object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
    3182           0 :         if (object->in.sids == NULL) {
    3183           0 :                 PyErr_NoMemory();
    3184           0 :                 return -1;
    3185             :         }
    3186           0 :         PY_CHECK_TYPE(lsa_SidArray_Type, value, return -1;);
    3187           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3188           0 :                 PyErr_NoMemory();
    3189           0 :                 return -1;
    3190             :         }
    3191           0 :         object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
    3192           0 :         return 0;
    3193             : }
    3194             : 
    3195           0 : static PyObject *py_wbint_LookupSids_out_get_domains(PyObject *obj, void *closure)
    3196             : {
    3197           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(obj);
    3198             :         PyObject *py_domains;
    3199           0 :         if (object->out.domains == NULL) {
    3200           0 :                 Py_RETURN_NONE;
    3201             :         }
    3202           0 :         py_domains = pytalloc_reference_ex(lsa_RefDomainList_Type, object->out.domains, object->out.domains);
    3203           0 :         return py_domains;
    3204             : }
    3205             : 
    3206           0 : static int py_wbint_LookupSids_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
    3207             : {
    3208           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    3209           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
    3210           0 :         if (value == NULL) {
    3211           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
    3212           0 :                 return -1;
    3213             :         }
    3214           0 :         object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
    3215           0 :         if (object->out.domains == NULL) {
    3216           0 :                 PyErr_NoMemory();
    3217           0 :                 return -1;
    3218             :         }
    3219           0 :         PY_CHECK_TYPE(lsa_RefDomainList_Type, value, return -1;);
    3220           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3221           0 :                 PyErr_NoMemory();
    3222           0 :                 return -1;
    3223             :         }
    3224           0 :         object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
    3225           0 :         return 0;
    3226             : }
    3227             : 
    3228           0 : static PyObject *py_wbint_LookupSids_out_get_names(PyObject *obj, void *closure)
    3229             : {
    3230           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(obj);
    3231             :         PyObject *py_names;
    3232           0 :         if (object->out.names == NULL) {
    3233           0 :                 Py_RETURN_NONE;
    3234             :         }
    3235           0 :         py_names = pytalloc_reference_ex(lsa_TransNameArray_Type, object->out.names, object->out.names);
    3236           0 :         return py_names;
    3237             : }
    3238             : 
    3239           0 : static int py_wbint_LookupSids_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
    3240             : {
    3241           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    3242           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
    3243           0 :         if (value == NULL) {
    3244           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.names");
    3245           0 :                 return -1;
    3246             :         }
    3247           0 :         object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
    3248           0 :         if (object->out.names == NULL) {
    3249           0 :                 PyErr_NoMemory();
    3250           0 :                 return -1;
    3251             :         }
    3252           0 :         PY_CHECK_TYPE(lsa_TransNameArray_Type, value, return -1;);
    3253           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3254           0 :                 PyErr_NoMemory();
    3255           0 :                 return -1;
    3256             :         }
    3257           0 :         object->out.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(value);
    3258           0 :         return 0;
    3259             : }
    3260             : 
    3261           0 : static PyObject *py_wbint_LookupSids_get_result(PyObject *obj, void *closure)
    3262             : {
    3263           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(obj);
    3264             :         PyObject *py_result;
    3265           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    3266           0 :         return py_result;
    3267             : }
    3268             : 
    3269           0 : static int py_wbint_LookupSids_set_result(PyObject *py_obj, PyObject *value, void *closure)
    3270             : {
    3271           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    3272           0 :         if (value == NULL) {
    3273           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    3274           0 :                 return -1;
    3275             :         }
    3276           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    3277           0 :         return 0;
    3278             : }
    3279             : 
    3280             : static PyGetSetDef py_wbint_LookupSids_getsetters[] = {
    3281             :         {
    3282             :                 .name = discard_const_p(char, "in_sids"),
    3283             :                 .get = py_wbint_LookupSids_in_get_sids,
    3284             :                 .set = py_wbint_LookupSids_in_set_sids,
    3285             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
    3286             :         },
    3287             :         {
    3288             :                 .name = discard_const_p(char, "out_domains"),
    3289             :                 .get = py_wbint_LookupSids_out_get_domains,
    3290             :                 .set = py_wbint_LookupSids_out_set_domains,
    3291             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
    3292             :         },
    3293             :         {
    3294             :                 .name = discard_const_p(char, "out_names"),
    3295             :                 .get = py_wbint_LookupSids_out_get_names,
    3296             :                 .set = py_wbint_LookupSids_out_set_names,
    3297             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray")
    3298             :         },
    3299             :         {
    3300             :                 .name = discard_const_p(char, "result"),
    3301             :                 .get = py_wbint_LookupSids_get_result,
    3302             :                 .set = py_wbint_LookupSids_set_result,
    3303             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    3304             :         },
    3305             :         { .name = NULL }
    3306             : };
    3307             : 
    3308           0 : static PyObject *py_wbint_LookupSids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3309             : {
    3310           0 :         PyObject *self = pytalloc_new(struct wbint_LookupSids, type);
    3311           0 :         struct wbint_LookupSids *_self = (struct wbint_LookupSids *)pytalloc_get_ptr(self);
    3312           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    3313           0 :         _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
    3314           0 :         _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList);
    3315           0 :         _self->out.names = talloc_zero(mem_ctx, struct lsa_TransNameArray);
    3316           0 :         return self;
    3317             : }
    3318             : 
    3319           0 : static PyObject *py_wbint_LookupSids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    3320             : {
    3321             : 
    3322             : 
    3323           0 :         return PyLong_FromLong(2);
    3324             : }
    3325             : 
    3326           0 : static PyObject *py_wbint_LookupSids_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    3327             : {
    3328           0 :         const struct ndr_interface_call *call = NULL;
    3329           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    3330           0 :         PyObject *ret = NULL;
    3331           0 :         struct ndr_push *push = NULL;
    3332             :         DATA_BLOB blob;
    3333             :         enum ndr_err_code err;
    3334             : 
    3335           0 :         if (ndr_table_winbind.num_calls < 3) {
    3336           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSids_ndr_pack");
    3337           0 :                 return NULL;
    3338             :         }
    3339           0 :         call = &ndr_table_winbind.calls[2];
    3340             : 
    3341           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    3342           0 :         if (push == NULL) {
    3343           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3344           0 :                 return NULL;
    3345             :         }
    3346             : 
    3347           0 :         push->flags |= ndr_push_flags;
    3348             : 
    3349           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    3350           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3351           0 :                 TALLOC_FREE(push);
    3352           0 :                 PyErr_SetNdrError(err);
    3353           0 :                 return NULL;
    3354             :         }
    3355           0 :         blob = ndr_push_blob(push);
    3356           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3357           0 :         TALLOC_FREE(push);
    3358           0 :         return ret;
    3359             : }
    3360             : 
    3361           0 : static PyObject *py_wbint_LookupSids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3362             : {
    3363           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3364           0 :         PyObject *bigendian_obj = NULL;
    3365           0 :         PyObject *ndr64_obj = NULL;
    3366           0 :         uint32_t ndr_push_flags = 0;
    3367             : 
    3368           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    3369             :                 discard_const_p(char *, kwnames),
    3370             :                 &bigendian_obj,
    3371             :                 &ndr64_obj)) {
    3372           0 :                 return NULL;
    3373             :         }
    3374             : 
    3375           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3376           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3377             :         }
    3378           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3379           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3380             :         }
    3381             : 
    3382           0 :         return py_wbint_LookupSids_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    3383             : }
    3384             : 
    3385           0 : static PyObject *py_wbint_LookupSids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3386             : {
    3387           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3388           0 :         PyObject *bigendian_obj = NULL;
    3389           0 :         PyObject *ndr64_obj = NULL;
    3390           0 :         uint32_t ndr_push_flags = 0;
    3391             : 
    3392           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    3393             :                 discard_const_p(char *, kwnames),
    3394             :                 &bigendian_obj,
    3395             :                 &ndr64_obj)) {
    3396           0 :                 return NULL;
    3397             :         }
    3398             : 
    3399           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3400           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3401             :         }
    3402           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3403           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3404             :         }
    3405             : 
    3406           0 :         return py_wbint_LookupSids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    3407             : }
    3408             : 
    3409           0 : static PyObject *py_wbint_LookupSids_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    3410             : {
    3411           0 :         const struct ndr_interface_call *call = NULL;
    3412           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    3413           0 :         struct ndr_pull *pull = NULL;
    3414             :         enum ndr_err_code err;
    3415             : 
    3416           0 :         if (ndr_table_winbind.num_calls < 3) {
    3417           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSids_ndr_unpack");
    3418           0 :                 return NULL;
    3419             :         }
    3420           0 :         call = &ndr_table_winbind.calls[2];
    3421             : 
    3422           0 :         pull = ndr_pull_init_blob(blob, object);
    3423           0 :         if (pull == NULL) {
    3424           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3425           0 :                 return NULL;
    3426             :         }
    3427             : 
    3428           0 :         pull->flags |= ndr_pull_flags;
    3429             : 
    3430           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    3431           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3432           0 :                 TALLOC_FREE(pull);
    3433           0 :                 PyErr_SetNdrError(err);
    3434           0 :                 return NULL;
    3435             :         }
    3436           0 :         if (!allow_remaining) {
    3437             :                 uint32_t highest_ofs;
    3438             : 
    3439           0 :                 if (pull->offset > pull->relative_highest_offset) {
    3440           0 :                         highest_ofs = pull->offset;
    3441             :                 } else {
    3442           0 :                         highest_ofs = pull->relative_highest_offset;
    3443             :                 }
    3444           0 :                 if (highest_ofs < pull->data_size) {
    3445           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    3446             :                                 "not all bytes consumed ofs[%u] size[%u]",
    3447             :                                 highest_ofs, pull->data_size);
    3448           0 :                         TALLOC_FREE(pull);
    3449           0 :                         PyErr_SetNdrError(err);
    3450           0 :                         return NULL;
    3451             :                 }
    3452             :         }
    3453             : 
    3454           0 :         TALLOC_FREE(pull);
    3455           0 :         Py_RETURN_NONE;
    3456             : }
    3457             : 
    3458           0 : static PyObject *py_wbint_LookupSids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3459             : {
    3460             :         DATA_BLOB blob;
    3461           0 :         Py_ssize_t blob_length = 0;
    3462           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3463           0 :         PyObject *bigendian_obj = NULL;
    3464           0 :         PyObject *ndr64_obj = NULL;
    3465           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3466           0 :         PyObject *allow_remaining_obj = NULL;
    3467           0 :         bool allow_remaining = false;
    3468             : 
    3469           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    3470             :                 discard_const_p(char *, kwnames),
    3471             :                 &blob.data, &blob_length,
    3472             :                 &bigendian_obj,
    3473             :                 &ndr64_obj,
    3474             :                 &allow_remaining_obj)) {
    3475           0 :                 return NULL;
    3476             :         }
    3477           0 :         blob.length = blob_length;
    3478             : 
    3479           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3480           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3481             :         }
    3482           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3483           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3484             :         }
    3485             : 
    3486           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3487           0 :                 allow_remaining = true;
    3488             :         }
    3489             : 
    3490           0 :         return py_wbint_LookupSids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    3491             : }
    3492             : 
    3493           0 : static PyObject *py_wbint_LookupSids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3494             : {
    3495             :         DATA_BLOB blob;
    3496           0 :         Py_ssize_t blob_length = 0;
    3497           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3498           0 :         PyObject *bigendian_obj = NULL;
    3499           0 :         PyObject *ndr64_obj = NULL;
    3500           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3501           0 :         PyObject *allow_remaining_obj = NULL;
    3502           0 :         bool allow_remaining = false;
    3503             : 
    3504           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    3505             :                 discard_const_p(char *, kwnames),
    3506             :                 &blob.data, &blob_length,
    3507             :                 &bigendian_obj,
    3508             :                 &ndr64_obj,
    3509             :                 &allow_remaining_obj)) {
    3510           0 :                 return NULL;
    3511             :         }
    3512           0 :         blob.length = blob_length;
    3513             : 
    3514           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3515           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3516             :         }
    3517           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3518           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3519             :         }
    3520             : 
    3521           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3522           0 :                 allow_remaining = true;
    3523             :         }
    3524             : 
    3525           0 :         return py_wbint_LookupSids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    3526             : }
    3527             : 
    3528           0 : static PyObject *py_wbint_LookupSids_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    3529             : {
    3530           0 :         const struct ndr_interface_call *call = NULL;
    3531           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    3532             :         PyObject *ret;
    3533             :         char *retstr;
    3534             : 
    3535           0 :         if (ndr_table_winbind.num_calls < 3) {
    3536           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSids_ndr_print");
    3537           0 :                 return NULL;
    3538             :         }
    3539           0 :         call = &ndr_table_winbind.calls[2];
    3540             : 
    3541           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    3542           0 :         ret = PyUnicode_FromString(retstr);
    3543           0 :         TALLOC_FREE(retstr);
    3544             : 
    3545           0 :         return ret;
    3546             : }
    3547             : 
    3548           0 : static PyObject *py_wbint_LookupSids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3549             : {
    3550           0 :         return py_wbint_LookupSids_ndr_print(py_obj, "wbint_LookupSids_in", NDR_IN);
    3551             : }
    3552             : 
    3553           0 : static PyObject *py_wbint_LookupSids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3554             : {
    3555           0 :         return py_wbint_LookupSids_ndr_print(py_obj, "wbint_LookupSids_out", NDR_OUT);
    3556             : }
    3557             : 
    3558             : static PyMethodDef py_wbint_LookupSids_methods[] = {
    3559             :         { "opnum", (PyCFunction)py_wbint_LookupSids_ndr_opnum, METH_NOARGS|METH_CLASS,
    3560             :                 "winbind.wbint_LookupSids.opnum() -> 2 (0x02) " },
    3561             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    3562             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    3563             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    3564             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    3565             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    3566             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    3567             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    3568             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    3569             :         { "__ndr_print_in__", (PyCFunction)py_wbint_LookupSids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    3570             :         { "__ndr_print_out__", (PyCFunction)py_wbint_LookupSids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    3571             :         { NULL, NULL, 0, NULL }
    3572             : };
    3573             : 
    3574             : 
    3575             : static PyTypeObject wbint_LookupSids_Type = {
    3576             :         PyVarObject_HEAD_INIT(NULL, 0)
    3577             :         .tp_name = "winbind.wbint_LookupSids",
    3578             :         .tp_getset = py_wbint_LookupSids_getsetters,
    3579             :         .tp_methods = py_wbint_LookupSids_methods,
    3580             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3581             :         .tp_new = py_wbint_LookupSids_new,
    3582             : };
    3583             : 
    3584           0 : static bool pack_py_wbint_LookupSids_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupSids *r)
    3585             : {
    3586             :         PyObject *py_sids;
    3587           0 :         const char *kwnames[] = {
    3588             :                 "sids", NULL
    3589             :         };
    3590             : 
    3591           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupSids", discard_const_p(char *, kwnames), &py_sids)) {
    3592           0 :                 return false;
    3593             :         }
    3594             : 
    3595           0 :         if (py_sids == NULL) {
    3596           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
    3597           0 :                 return false;
    3598             :         }
    3599           0 :         r->in.sids = talloc_ptrtype(r, r->in.sids);
    3600           0 :         if (r->in.sids == NULL) {
    3601           0 :                 PyErr_NoMemory();
    3602           0 :                 return false;
    3603             :         }
    3604           0 :         PY_CHECK_TYPE(lsa_SidArray_Type, py_sids, return false;);
    3605           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
    3606           0 :                 PyErr_NoMemory();
    3607           0 :                 return false;
    3608             :         }
    3609           0 :         r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
    3610           0 :         return true;
    3611             : }
    3612             : 
    3613           0 : static PyObject *unpack_py_wbint_LookupSids_args_out(struct wbint_LookupSids *r)
    3614             : {
    3615             :         PyObject *result;
    3616             :         PyObject *py_domains;
    3617             :         PyObject *py_names;
    3618           0 :         result = PyTuple_New(2);
    3619           0 :         py_domains = pytalloc_reference_ex(lsa_RefDomainList_Type, r->out.domains, r->out.domains);
    3620           0 :         PyTuple_SetItem(result, 0, py_domains);
    3621           0 :         py_names = pytalloc_reference_ex(lsa_TransNameArray_Type, r->out.names, r->out.names);
    3622           0 :         PyTuple_SetItem(result, 1, py_names);
    3623           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    3624           0 :                 PyErr_SetNTSTATUS(r->out.result);
    3625           0 :                 return NULL;
    3626             :         }
    3627             : 
    3628           0 :         return result;
    3629             : }
    3630             : 
    3631             : 
    3632           0 : static PyObject *py_wbint_LookupName_in_get_domain(PyObject *obj, void *closure)
    3633             : {
    3634           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj);
    3635             :         PyObject *py_domain;
    3636           0 :         if (object->in.domain == NULL) {
    3637           0 :                 Py_RETURN_NONE;
    3638             :         }
    3639           0 :         if (object->in.domain == NULL) {
    3640           0 :                 py_domain = Py_None;
    3641           0 :                 Py_INCREF(py_domain);
    3642             :         } else {
    3643           0 :                 py_domain = PyUnicode_Decode(object->in.domain, strlen(object->in.domain), "utf-8", "ignore");
    3644             :         }
    3645           0 :         return py_domain;
    3646             : }
    3647             : 
    3648           0 : static int py_wbint_LookupName_in_set_domain(PyObject *py_obj, PyObject *value, void *closure)
    3649             : {
    3650           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    3651           0 :         if (value == NULL) {
    3652           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain");
    3653           0 :                 return -1;
    3654             :         }
    3655           0 :         object->in.domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain);
    3656           0 :         if (object->in.domain == NULL) {
    3657           0 :                 PyErr_NoMemory();
    3658           0 :                 return -1;
    3659             :         }
    3660             :         {
    3661             :                 const char *test_str;
    3662             :                 const char *talloc_str;
    3663           0 :                 PyObject *unicode = NULL;
    3664           0 :                 if (PyUnicode_Check(value)) {
    3665           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    3666           0 :                         if (unicode == NULL) {
    3667           0 :                                 PyErr_NoMemory();
    3668           0 :                                 return -1;
    3669             :                         }
    3670           0 :                         test_str = PyBytes_AS_STRING(unicode);
    3671           0 :                 } else if (PyBytes_Check(value)) {
    3672           0 :                         test_str = PyBytes_AS_STRING(value);
    3673             :                 } else {
    3674           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    3675           0 :                         return -1;
    3676             :                 }
    3677           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    3678           0 :                 if (unicode != NULL) {
    3679           0 :                         Py_DECREF(unicode);
    3680             :                 }
    3681           0 :                 if (talloc_str == NULL) {
    3682           0 :                         PyErr_NoMemory();
    3683           0 :                         return -1;
    3684             :                 }
    3685           0 :                 object->in.domain = talloc_str;
    3686             :         }
    3687           0 :         return 0;
    3688             : }
    3689             : 
    3690           0 : static PyObject *py_wbint_LookupName_in_get_name(PyObject *obj, void *closure)
    3691             : {
    3692           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj);
    3693             :         PyObject *py_name;
    3694           0 :         if (object->in.name == NULL) {
    3695           0 :                 Py_RETURN_NONE;
    3696             :         }
    3697           0 :         if (object->in.name == NULL) {
    3698           0 :                 py_name = Py_None;
    3699           0 :                 Py_INCREF(py_name);
    3700             :         } else {
    3701           0 :                 py_name = PyUnicode_Decode(object->in.name, strlen(object->in.name), "utf-8", "ignore");
    3702             :         }
    3703           0 :         return py_name;
    3704             : }
    3705             : 
    3706           0 : static int py_wbint_LookupName_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
    3707             : {
    3708           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    3709           0 :         if (value == NULL) {
    3710           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
    3711           0 :                 return -1;
    3712             :         }
    3713           0 :         object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
    3714           0 :         if (object->in.name == NULL) {
    3715           0 :                 PyErr_NoMemory();
    3716           0 :                 return -1;
    3717             :         }
    3718             :         {
    3719             :                 const char *test_str;
    3720             :                 const char *talloc_str;
    3721           0 :                 PyObject *unicode = NULL;
    3722           0 :                 if (PyUnicode_Check(value)) {
    3723           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    3724           0 :                         if (unicode == NULL) {
    3725           0 :                                 PyErr_NoMemory();
    3726           0 :                                 return -1;
    3727             :                         }
    3728           0 :                         test_str = PyBytes_AS_STRING(unicode);
    3729           0 :                 } else if (PyBytes_Check(value)) {
    3730           0 :                         test_str = PyBytes_AS_STRING(value);
    3731             :                 } else {
    3732           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    3733           0 :                         return -1;
    3734             :                 }
    3735           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    3736           0 :                 if (unicode != NULL) {
    3737           0 :                         Py_DECREF(unicode);
    3738             :                 }
    3739           0 :                 if (talloc_str == NULL) {
    3740           0 :                         PyErr_NoMemory();
    3741           0 :                         return -1;
    3742             :                 }
    3743           0 :                 object->in.name = talloc_str;
    3744             :         }
    3745           0 :         return 0;
    3746             : }
    3747             : 
    3748           0 : static PyObject *py_wbint_LookupName_in_get_flags(PyObject *obj, void *closure)
    3749             : {
    3750           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj);
    3751             :         PyObject *py_flags;
    3752           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
    3753           0 :         return py_flags;
    3754             : }
    3755             : 
    3756           0 : static int py_wbint_LookupName_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
    3757             : {
    3758           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    3759           0 :         if (value == NULL) {
    3760           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
    3761           0 :                 return -1;
    3762             :         }
    3763             :         {
    3764           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
    3765           0 :                 if (PyLong_Check(value)) {
    3766             :                         unsigned long long test_var;
    3767           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3768           0 :                         if (PyErr_Occurred() != NULL) {
    3769           0 :                                 return -1;
    3770             :                         }
    3771           0 :                         if (test_var > uint_max) {
    3772           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3773             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3774           0 :                                 return -1;
    3775             :                         }
    3776           0 :                         object->in.flags = test_var;
    3777             :                 } else {
    3778           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3779             :                           PyLong_Type.tp_name);
    3780           0 :                         return -1;
    3781             :                 }
    3782             :         }
    3783           0 :         return 0;
    3784             : }
    3785             : 
    3786           0 : static PyObject *py_wbint_LookupName_out_get_type(PyObject *obj, void *closure)
    3787             : {
    3788           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj);
    3789             :         PyObject *py_type;
    3790           0 :         if (object->out.type == NULL) {
    3791           0 :                 Py_RETURN_NONE;
    3792             :         }
    3793           0 :         py_type = PyLong_FromLong((uint16_t)*object->out.type);
    3794           0 :         return py_type;
    3795             : }
    3796             : 
    3797           0 : static int py_wbint_LookupName_out_set_type(PyObject *py_obj, PyObject *value, void *closure)
    3798             : {
    3799           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    3800           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.type));
    3801           0 :         if (value == NULL) {
    3802           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.type");
    3803           0 :                 return -1;
    3804             :         }
    3805           0 :         object->out.type = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.type);
    3806           0 :         if (object->out.type == NULL) {
    3807           0 :                 PyErr_NoMemory();
    3808           0 :                 return -1;
    3809             :         }
    3810             :         {
    3811           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.type));
    3812           0 :                 if (PyLong_Check(value)) {
    3813             :                         unsigned long long test_var;
    3814           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3815           0 :                         if (PyErr_Occurred() != NULL) {
    3816           0 :                                 return -1;
    3817             :                         }
    3818           0 :                         if (test_var > uint_max) {
    3819           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3820             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3821           0 :                                 return -1;
    3822             :                         }
    3823           0 :                         *object->out.type = test_var;
    3824             :                 } else {
    3825           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3826             :                           PyLong_Type.tp_name);
    3827           0 :                         return -1;
    3828             :                 }
    3829             :         }
    3830           0 :         return 0;
    3831             : }
    3832             : 
    3833           0 : static PyObject *py_wbint_LookupName_out_get_sid(PyObject *obj, void *closure)
    3834             : {
    3835           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj);
    3836             :         PyObject *py_sid;
    3837           0 :         if (object->out.sid == NULL) {
    3838           0 :                 Py_RETURN_NONE;
    3839             :         }
    3840           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, object->out.sid, object->out.sid);
    3841           0 :         return py_sid;
    3842             : }
    3843             : 
    3844           0 : static int py_wbint_LookupName_out_set_sid(PyObject *py_obj, PyObject *value, void *closure)
    3845             : {
    3846           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    3847           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sid));
    3848           0 :         if (value == NULL) {
    3849           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sid");
    3850           0 :                 return -1;
    3851             :         }
    3852           0 :         object->out.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sid);
    3853           0 :         if (object->out.sid == NULL) {
    3854           0 :                 PyErr_NoMemory();
    3855           0 :                 return -1;
    3856             :         }
    3857           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    3858           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3859           0 :                 PyErr_NoMemory();
    3860           0 :                 return -1;
    3861             :         }
    3862           0 :         object->out.sid = (struct dom_sid *)pytalloc_get_ptr(value);
    3863           0 :         return 0;
    3864             : }
    3865             : 
    3866           0 : static PyObject *py_wbint_LookupName_get_result(PyObject *obj, void *closure)
    3867             : {
    3868           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj);
    3869             :         PyObject *py_result;
    3870           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    3871           0 :         return py_result;
    3872             : }
    3873             : 
    3874           0 : static int py_wbint_LookupName_set_result(PyObject *py_obj, PyObject *value, void *closure)
    3875             : {
    3876           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    3877           0 :         if (value == NULL) {
    3878           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    3879           0 :                 return -1;
    3880             :         }
    3881           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    3882           0 :         return 0;
    3883             : }
    3884             : 
    3885             : static PyGetSetDef py_wbint_LookupName_getsetters[] = {
    3886             :         {
    3887             :                 .name = discard_const_p(char, "in_domain"),
    3888             :                 .get = py_wbint_LookupName_in_get_domain,
    3889             :                 .set = py_wbint_LookupName_in_set_domain,
    3890             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    3891             :         },
    3892             :         {
    3893             :                 .name = discard_const_p(char, "in_name"),
    3894             :                 .get = py_wbint_LookupName_in_get_name,
    3895             :                 .set = py_wbint_LookupName_in_set_name,
    3896             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    3897             :         },
    3898             :         {
    3899             :                 .name = discard_const_p(char, "in_flags"),
    3900             :                 .get = py_wbint_LookupName_in_get_flags,
    3901             :                 .set = py_wbint_LookupName_in_set_flags,
    3902             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3903             :         },
    3904             :         {
    3905             :                 .name = discard_const_p(char, "out_type"),
    3906             :                 .get = py_wbint_LookupName_out_get_type,
    3907             :                 .set = py_wbint_LookupName_out_set_type,
    3908             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
    3909             :         },
    3910             :         {
    3911             :                 .name = discard_const_p(char, "out_sid"),
    3912             :                 .get = py_wbint_LookupName_out_get_sid,
    3913             :                 .set = py_wbint_LookupName_out_set_sid,
    3914             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    3915             :         },
    3916             :         {
    3917             :                 .name = discard_const_p(char, "result"),
    3918             :                 .get = py_wbint_LookupName_get_result,
    3919             :                 .set = py_wbint_LookupName_set_result,
    3920             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    3921             :         },
    3922             :         { .name = NULL }
    3923             : };
    3924             : 
    3925           0 : static PyObject *py_wbint_LookupName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3926             : {
    3927           0 :         PyObject *self = pytalloc_new(struct wbint_LookupName, type);
    3928           0 :         struct wbint_LookupName *_self = (struct wbint_LookupName *)pytalloc_get_ptr(self);
    3929           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    3930           0 :         _self->out.type = talloc_zero(mem_ctx, enum lsa_SidType);
    3931           0 :         _self->out.sid = talloc_zero(mem_ctx, struct dom_sid);
    3932           0 :         return self;
    3933             : }
    3934             : 
    3935           0 : static PyObject *py_wbint_LookupName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    3936             : {
    3937             : 
    3938             : 
    3939           0 :         return PyLong_FromLong(3);
    3940             : }
    3941             : 
    3942           0 : static PyObject *py_wbint_LookupName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    3943             : {
    3944           0 :         const struct ndr_interface_call *call = NULL;
    3945           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    3946           0 :         PyObject *ret = NULL;
    3947           0 :         struct ndr_push *push = NULL;
    3948             :         DATA_BLOB blob;
    3949             :         enum ndr_err_code err;
    3950             : 
    3951           0 :         if (ndr_table_winbind.num_calls < 4) {
    3952           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupName_ndr_pack");
    3953           0 :                 return NULL;
    3954             :         }
    3955           0 :         call = &ndr_table_winbind.calls[3];
    3956             : 
    3957           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    3958           0 :         if (push == NULL) {
    3959           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3960           0 :                 return NULL;
    3961             :         }
    3962             : 
    3963           0 :         push->flags |= ndr_push_flags;
    3964             : 
    3965           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    3966           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3967           0 :                 TALLOC_FREE(push);
    3968           0 :                 PyErr_SetNdrError(err);
    3969           0 :                 return NULL;
    3970             :         }
    3971           0 :         blob = ndr_push_blob(push);
    3972           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3973           0 :         TALLOC_FREE(push);
    3974           0 :         return ret;
    3975             : }
    3976             : 
    3977           0 : static PyObject *py_wbint_LookupName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3978             : {
    3979           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3980           0 :         PyObject *bigendian_obj = NULL;
    3981           0 :         PyObject *ndr64_obj = NULL;
    3982           0 :         uint32_t ndr_push_flags = 0;
    3983             : 
    3984           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    3985             :                 discard_const_p(char *, kwnames),
    3986             :                 &bigendian_obj,
    3987             :                 &ndr64_obj)) {
    3988           0 :                 return NULL;
    3989             :         }
    3990             : 
    3991           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3992           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3993             :         }
    3994           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3995           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3996             :         }
    3997             : 
    3998           0 :         return py_wbint_LookupName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    3999             : }
    4000             : 
    4001           0 : static PyObject *py_wbint_LookupName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4002             : {
    4003           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    4004           0 :         PyObject *bigendian_obj = NULL;
    4005           0 :         PyObject *ndr64_obj = NULL;
    4006           0 :         uint32_t ndr_push_flags = 0;
    4007             : 
    4008           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    4009             :                 discard_const_p(char *, kwnames),
    4010             :                 &bigendian_obj,
    4011             :                 &ndr64_obj)) {
    4012           0 :                 return NULL;
    4013             :         }
    4014             : 
    4015           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4016           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4017             :         }
    4018           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4019           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4020             :         }
    4021             : 
    4022           0 :         return py_wbint_LookupName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    4023             : }
    4024             : 
    4025           0 : static PyObject *py_wbint_LookupName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    4026             : {
    4027           0 :         const struct ndr_interface_call *call = NULL;
    4028           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    4029           0 :         struct ndr_pull *pull = NULL;
    4030             :         enum ndr_err_code err;
    4031             : 
    4032           0 :         if (ndr_table_winbind.num_calls < 4) {
    4033           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupName_ndr_unpack");
    4034           0 :                 return NULL;
    4035             :         }
    4036           0 :         call = &ndr_table_winbind.calls[3];
    4037             : 
    4038           0 :         pull = ndr_pull_init_blob(blob, object);
    4039           0 :         if (pull == NULL) {
    4040           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4041           0 :                 return NULL;
    4042             :         }
    4043             : 
    4044           0 :         pull->flags |= ndr_pull_flags;
    4045             : 
    4046           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    4047           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4048           0 :                 TALLOC_FREE(pull);
    4049           0 :                 PyErr_SetNdrError(err);
    4050           0 :                 return NULL;
    4051             :         }
    4052           0 :         if (!allow_remaining) {
    4053             :                 uint32_t highest_ofs;
    4054             : 
    4055           0 :                 if (pull->offset > pull->relative_highest_offset) {
    4056           0 :                         highest_ofs = pull->offset;
    4057             :                 } else {
    4058           0 :                         highest_ofs = pull->relative_highest_offset;
    4059             :                 }
    4060           0 :                 if (highest_ofs < pull->data_size) {
    4061           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    4062             :                                 "not all bytes consumed ofs[%u] size[%u]",
    4063             :                                 highest_ofs, pull->data_size);
    4064           0 :                         TALLOC_FREE(pull);
    4065           0 :                         PyErr_SetNdrError(err);
    4066           0 :                         return NULL;
    4067             :                 }
    4068             :         }
    4069             : 
    4070           0 :         TALLOC_FREE(pull);
    4071           0 :         Py_RETURN_NONE;
    4072             : }
    4073             : 
    4074           0 : static PyObject *py_wbint_LookupName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4075             : {
    4076             :         DATA_BLOB blob;
    4077           0 :         Py_ssize_t blob_length = 0;
    4078           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4079           0 :         PyObject *bigendian_obj = NULL;
    4080           0 :         PyObject *ndr64_obj = NULL;
    4081           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4082           0 :         PyObject *allow_remaining_obj = NULL;
    4083           0 :         bool allow_remaining = false;
    4084             : 
    4085           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    4086             :                 discard_const_p(char *, kwnames),
    4087             :                 &blob.data, &blob_length,
    4088             :                 &bigendian_obj,
    4089             :                 &ndr64_obj,
    4090             :                 &allow_remaining_obj)) {
    4091           0 :                 return NULL;
    4092             :         }
    4093           0 :         blob.length = blob_length;
    4094             : 
    4095           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4096           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4097             :         }
    4098           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4099           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4100             :         }
    4101             : 
    4102           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4103           0 :                 allow_remaining = true;
    4104             :         }
    4105             : 
    4106           0 :         return py_wbint_LookupName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    4107             : }
    4108             : 
    4109           0 : static PyObject *py_wbint_LookupName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4110             : {
    4111             :         DATA_BLOB blob;
    4112           0 :         Py_ssize_t blob_length = 0;
    4113           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4114           0 :         PyObject *bigendian_obj = NULL;
    4115           0 :         PyObject *ndr64_obj = NULL;
    4116           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4117           0 :         PyObject *allow_remaining_obj = NULL;
    4118           0 :         bool allow_remaining = false;
    4119             : 
    4120           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    4121             :                 discard_const_p(char *, kwnames),
    4122             :                 &blob.data, &blob_length,
    4123             :                 &bigendian_obj,
    4124             :                 &ndr64_obj,
    4125             :                 &allow_remaining_obj)) {
    4126           0 :                 return NULL;
    4127             :         }
    4128           0 :         blob.length = blob_length;
    4129             : 
    4130           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4131           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4132             :         }
    4133           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4134           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4135             :         }
    4136             : 
    4137           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4138           0 :                 allow_remaining = true;
    4139             :         }
    4140             : 
    4141           0 :         return py_wbint_LookupName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    4142             : }
    4143             : 
    4144           0 : static PyObject *py_wbint_LookupName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    4145             : {
    4146           0 :         const struct ndr_interface_call *call = NULL;
    4147           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    4148             :         PyObject *ret;
    4149             :         char *retstr;
    4150             : 
    4151           0 :         if (ndr_table_winbind.num_calls < 4) {
    4152           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupName_ndr_print");
    4153           0 :                 return NULL;
    4154             :         }
    4155           0 :         call = &ndr_table_winbind.calls[3];
    4156             : 
    4157           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    4158           0 :         ret = PyUnicode_FromString(retstr);
    4159           0 :         TALLOC_FREE(retstr);
    4160             : 
    4161           0 :         return ret;
    4162             : }
    4163             : 
    4164           0 : static PyObject *py_wbint_LookupName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4165             : {
    4166           0 :         return py_wbint_LookupName_ndr_print(py_obj, "wbint_LookupName_in", NDR_IN);
    4167             : }
    4168             : 
    4169           0 : static PyObject *py_wbint_LookupName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4170             : {
    4171           0 :         return py_wbint_LookupName_ndr_print(py_obj, "wbint_LookupName_out", NDR_OUT);
    4172             : }
    4173             : 
    4174             : static PyMethodDef py_wbint_LookupName_methods[] = {
    4175             :         { "opnum", (PyCFunction)py_wbint_LookupName_ndr_opnum, METH_NOARGS|METH_CLASS,
    4176             :                 "winbind.wbint_LookupName.opnum() -> 3 (0x03) " },
    4177             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    4178             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    4179             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    4180             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    4181             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    4182             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    4183             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    4184             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    4185             :         { "__ndr_print_in__", (PyCFunction)py_wbint_LookupName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    4186             :         { "__ndr_print_out__", (PyCFunction)py_wbint_LookupName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    4187             :         { NULL, NULL, 0, NULL }
    4188             : };
    4189             : 
    4190             : 
    4191             : static PyTypeObject wbint_LookupName_Type = {
    4192             :         PyVarObject_HEAD_INIT(NULL, 0)
    4193             :         .tp_name = "winbind.wbint_LookupName",
    4194             :         .tp_getset = py_wbint_LookupName_getsetters,
    4195             :         .tp_methods = py_wbint_LookupName_methods,
    4196             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4197             :         .tp_new = py_wbint_LookupName_new,
    4198             : };
    4199             : 
    4200           0 : static bool pack_py_wbint_LookupName_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupName *r)
    4201             : {
    4202             :         PyObject *py_domain;
    4203             :         PyObject *py_name;
    4204             :         PyObject *py_flags;
    4205           0 :         const char *kwnames[] = {
    4206             :                 "domain", "name", "flags", NULL
    4207             :         };
    4208             : 
    4209           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:wbint_LookupName", discard_const_p(char *, kwnames), &py_domain, &py_name, &py_flags)) {
    4210           0 :                 return false;
    4211             :         }
    4212             : 
    4213           0 :         if (py_domain == NULL) {
    4214           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain");
    4215           0 :                 return false;
    4216             :         }
    4217           0 :         r->in.domain = talloc_ptrtype(r, r->in.domain);
    4218           0 :         if (r->in.domain == NULL) {
    4219           0 :                 PyErr_NoMemory();
    4220           0 :                 return false;
    4221             :         }
    4222             :         {
    4223             :                 const char *test_str;
    4224             :                 const char *talloc_str;
    4225           0 :                 PyObject *unicode = NULL;
    4226           0 :                 if (PyUnicode_Check(py_domain)) {
    4227           0 :                         unicode = PyUnicode_AsEncodedString(py_domain, "utf-8", "ignore");
    4228           0 :                         if (unicode == NULL) {
    4229           0 :                                 PyErr_NoMemory();
    4230           0 :                                 return false;
    4231             :                         }
    4232           0 :                         test_str = PyBytes_AS_STRING(unicode);
    4233           0 :                 } else if (PyBytes_Check(py_domain)) {
    4234           0 :                         test_str = PyBytes_AS_STRING(py_domain);
    4235             :                 } else {
    4236           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain)->tp_name);
    4237           0 :                         return false;
    4238             :                 }
    4239           0 :                 talloc_str = talloc_strdup(r, test_str);
    4240           0 :                 if (unicode != NULL) {
    4241           0 :                         Py_DECREF(unicode);
    4242             :                 }
    4243           0 :                 if (talloc_str == NULL) {
    4244           0 :                         PyErr_NoMemory();
    4245           0 :                         return false;
    4246             :                 }
    4247           0 :                 r->in.domain = talloc_str;
    4248             :         }
    4249           0 :         if (py_name == NULL) {
    4250           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
    4251           0 :                 return false;
    4252             :         }
    4253           0 :         r->in.name = talloc_ptrtype(r, r->in.name);
    4254           0 :         if (r->in.name == NULL) {
    4255           0 :                 PyErr_NoMemory();
    4256           0 :                 return false;
    4257             :         }
    4258             :         {
    4259             :                 const char *test_str;
    4260             :                 const char *talloc_str;
    4261           0 :                 PyObject *unicode = NULL;
    4262           0 :                 if (PyUnicode_Check(py_name)) {
    4263           0 :                         unicode = PyUnicode_AsEncodedString(py_name, "utf-8", "ignore");
    4264           0 :                         if (unicode == NULL) {
    4265           0 :                                 PyErr_NoMemory();
    4266           0 :                                 return false;
    4267             :                         }
    4268           0 :                         test_str = PyBytes_AS_STRING(unicode);
    4269           0 :                 } else if (PyBytes_Check(py_name)) {
    4270           0 :                         test_str = PyBytes_AS_STRING(py_name);
    4271             :                 } else {
    4272           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_name)->tp_name);
    4273           0 :                         return false;
    4274             :                 }
    4275           0 :                 talloc_str = talloc_strdup(r, test_str);
    4276           0 :                 if (unicode != NULL) {
    4277           0 :                         Py_DECREF(unicode);
    4278             :                 }
    4279           0 :                 if (talloc_str == NULL) {
    4280           0 :                         PyErr_NoMemory();
    4281           0 :                         return false;
    4282             :                 }
    4283           0 :                 r->in.name = talloc_str;
    4284             :         }
    4285           0 :         if (py_flags == NULL) {
    4286           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
    4287           0 :                 return false;
    4288             :         }
    4289             :         {
    4290           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
    4291           0 :                 if (PyLong_Check(py_flags)) {
    4292             :                         unsigned long long test_var;
    4293           0 :                         test_var = PyLong_AsUnsignedLongLong(py_flags);
    4294           0 :                         if (PyErr_Occurred() != NULL) {
    4295           0 :                                 return false;
    4296             :                         }
    4297           0 :                         if (test_var > uint_max) {
    4298           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4299             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4300           0 :                                 return false;
    4301             :                         }
    4302           0 :                         r->in.flags = test_var;
    4303             :                 } else {
    4304           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4305             :                           PyLong_Type.tp_name);
    4306           0 :                         return false;
    4307             :                 }
    4308             :         }
    4309           0 :         return true;
    4310             : }
    4311             : 
    4312           0 : static PyObject *unpack_py_wbint_LookupName_args_out(struct wbint_LookupName *r)
    4313             : {
    4314             :         PyObject *result;
    4315             :         PyObject *py_type;
    4316             :         PyObject *py_sid;
    4317           0 :         result = PyTuple_New(2);
    4318           0 :         py_type = PyLong_FromLong((uint16_t)*r->out.type);
    4319           0 :         PyTuple_SetItem(result, 0, py_type);
    4320           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, r->out.sid, r->out.sid);
    4321           0 :         PyTuple_SetItem(result, 1, py_sid);
    4322           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    4323           0 :                 PyErr_SetNTSTATUS(r->out.result);
    4324           0 :                 return NULL;
    4325             :         }
    4326             : 
    4327           0 :         return result;
    4328             : }
    4329             : 
    4330             : 
    4331           0 : static PyObject *py_wbint_Sids2UnixIDs_in_get_domains(PyObject *obj, void *closure)
    4332             : {
    4333           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(obj);
    4334             :         PyObject *py_domains;
    4335           0 :         if (object->in.domains == NULL) {
    4336           0 :                 Py_RETURN_NONE;
    4337             :         }
    4338           0 :         py_domains = pytalloc_reference_ex(lsa_RefDomainList_Type, object->in.domains, object->in.domains);
    4339           0 :         return py_domains;
    4340             : }
    4341             : 
    4342           0 : static int py_wbint_Sids2UnixIDs_in_set_domains(PyObject *py_obj, PyObject *value, void *closure)
    4343             : {
    4344           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    4345           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domains));
    4346           0 :         if (value == NULL) {
    4347           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domains");
    4348           0 :                 return -1;
    4349             :         }
    4350           0 :         object->in.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domains);
    4351           0 :         if (object->in.domains == NULL) {
    4352           0 :                 PyErr_NoMemory();
    4353           0 :                 return -1;
    4354             :         }
    4355           0 :         PY_CHECK_TYPE(lsa_RefDomainList_Type, value, return -1;);
    4356           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4357           0 :                 PyErr_NoMemory();
    4358           0 :                 return -1;
    4359             :         }
    4360           0 :         object->in.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
    4361           0 :         return 0;
    4362             : }
    4363             : 
    4364           0 : static PyObject *py_wbint_Sids2UnixIDs_in_get_ids(PyObject *obj, void *closure)
    4365             : {
    4366           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(obj);
    4367             :         PyObject *py_ids;
    4368           0 :         if (object->in.ids == NULL) {
    4369           0 :                 Py_RETURN_NONE;
    4370             :         }
    4371           0 :         py_ids = pytalloc_reference_ex(&wbint_TransIDArray_Type, object->in.ids, object->in.ids);
    4372           0 :         return py_ids;
    4373             : }
    4374             : 
    4375           0 : static int py_wbint_Sids2UnixIDs_in_set_ids(PyObject *py_obj, PyObject *value, void *closure)
    4376             : {
    4377           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    4378           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.ids));
    4379           0 :         if (value == NULL) {
    4380           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ids");
    4381           0 :                 return -1;
    4382             :         }
    4383           0 :         object->in.ids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.ids);
    4384           0 :         if (object->in.ids == NULL) {
    4385           0 :                 PyErr_NoMemory();
    4386           0 :                 return -1;
    4387             :         }
    4388           0 :         PY_CHECK_TYPE(&wbint_TransIDArray_Type, value, return -1;);
    4389           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4390           0 :                 PyErr_NoMemory();
    4391           0 :                 return -1;
    4392             :         }
    4393           0 :         object->in.ids = (struct wbint_TransIDArray *)pytalloc_get_ptr(value);
    4394           0 :         return 0;
    4395             : }
    4396             : 
    4397           0 : static PyObject *py_wbint_Sids2UnixIDs_out_get_ids(PyObject *obj, void *closure)
    4398             : {
    4399           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(obj);
    4400             :         PyObject *py_ids;
    4401           0 :         if (object->out.ids == NULL) {
    4402           0 :                 Py_RETURN_NONE;
    4403             :         }
    4404           0 :         py_ids = pytalloc_reference_ex(&wbint_TransIDArray_Type, object->out.ids, object->out.ids);
    4405           0 :         return py_ids;
    4406             : }
    4407             : 
    4408           0 : static int py_wbint_Sids2UnixIDs_out_set_ids(PyObject *py_obj, PyObject *value, void *closure)
    4409             : {
    4410           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    4411           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ids));
    4412           0 :         if (value == NULL) {
    4413           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ids");
    4414           0 :                 return -1;
    4415             :         }
    4416           0 :         object->out.ids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ids);
    4417           0 :         if (object->out.ids == NULL) {
    4418           0 :                 PyErr_NoMemory();
    4419           0 :                 return -1;
    4420             :         }
    4421           0 :         PY_CHECK_TYPE(&wbint_TransIDArray_Type, value, return -1;);
    4422           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4423           0 :                 PyErr_NoMemory();
    4424           0 :                 return -1;
    4425             :         }
    4426           0 :         object->out.ids = (struct wbint_TransIDArray *)pytalloc_get_ptr(value);
    4427           0 :         return 0;
    4428             : }
    4429             : 
    4430           0 : static PyObject *py_wbint_Sids2UnixIDs_get_result(PyObject *obj, void *closure)
    4431             : {
    4432           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(obj);
    4433             :         PyObject *py_result;
    4434           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    4435           0 :         return py_result;
    4436             : }
    4437             : 
    4438           0 : static int py_wbint_Sids2UnixIDs_set_result(PyObject *py_obj, PyObject *value, void *closure)
    4439             : {
    4440           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    4441           0 :         if (value == NULL) {
    4442           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    4443           0 :                 return -1;
    4444             :         }
    4445           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    4446           0 :         return 0;
    4447             : }
    4448             : 
    4449             : static PyGetSetDef py_wbint_Sids2UnixIDs_getsetters[] = {
    4450             :         {
    4451             :                 .name = discard_const_p(char, "in_domains"),
    4452             :                 .get = py_wbint_Sids2UnixIDs_in_get_domains,
    4453             :                 .set = py_wbint_Sids2UnixIDs_in_set_domains,
    4454             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
    4455             :         },
    4456             :         {
    4457             :                 .name = discard_const_p(char, "in_ids"),
    4458             :                 .get = py_wbint_Sids2UnixIDs_in_get_ids,
    4459             :                 .set = py_wbint_Sids2UnixIDs_in_set_ids,
    4460             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_TransIDArray")
    4461             :         },
    4462             :         {
    4463             :                 .name = discard_const_p(char, "out_ids"),
    4464             :                 .get = py_wbint_Sids2UnixIDs_out_get_ids,
    4465             :                 .set = py_wbint_Sids2UnixIDs_out_set_ids,
    4466             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_TransIDArray")
    4467             :         },
    4468             :         {
    4469             :                 .name = discard_const_p(char, "result"),
    4470             :                 .get = py_wbint_Sids2UnixIDs_get_result,
    4471             :                 .set = py_wbint_Sids2UnixIDs_set_result,
    4472             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    4473             :         },
    4474             :         { .name = NULL }
    4475             : };
    4476             : 
    4477           0 : static PyObject *py_wbint_Sids2UnixIDs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4478             : {
    4479           0 :         PyObject *self = pytalloc_new(struct wbint_Sids2UnixIDs, type);
    4480           0 :         struct wbint_Sids2UnixIDs *_self = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(self);
    4481           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    4482           0 :         _self->in.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList);
    4483           0 :         _self->in.ids = talloc_zero(mem_ctx, struct wbint_TransIDArray);
    4484           0 :         _self->out.ids = talloc_zero(mem_ctx, struct wbint_TransIDArray);
    4485           0 :         return self;
    4486             : }
    4487             : 
    4488           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    4489             : {
    4490             : 
    4491             : 
    4492           0 :         return PyLong_FromLong(4);
    4493             : }
    4494             : 
    4495           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    4496             : {
    4497           0 :         const struct ndr_interface_call *call = NULL;
    4498           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    4499           0 :         PyObject *ret = NULL;
    4500           0 :         struct ndr_push *push = NULL;
    4501             :         DATA_BLOB blob;
    4502             :         enum ndr_err_code err;
    4503             : 
    4504           0 :         if (ndr_table_winbind.num_calls < 5) {
    4505           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Sids2UnixIDs_ndr_pack");
    4506           0 :                 return NULL;
    4507             :         }
    4508           0 :         call = &ndr_table_winbind.calls[4];
    4509             : 
    4510           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    4511           0 :         if (push == NULL) {
    4512           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4513           0 :                 return NULL;
    4514             :         }
    4515             : 
    4516           0 :         push->flags |= ndr_push_flags;
    4517             : 
    4518           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    4519           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4520           0 :                 TALLOC_FREE(push);
    4521           0 :                 PyErr_SetNdrError(err);
    4522           0 :                 return NULL;
    4523             :         }
    4524           0 :         blob = ndr_push_blob(push);
    4525           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    4526           0 :         TALLOC_FREE(push);
    4527           0 :         return ret;
    4528             : }
    4529             : 
    4530           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4531             : {
    4532           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    4533           0 :         PyObject *bigendian_obj = NULL;
    4534           0 :         PyObject *ndr64_obj = NULL;
    4535           0 :         uint32_t ndr_push_flags = 0;
    4536             : 
    4537           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    4538             :                 discard_const_p(char *, kwnames),
    4539             :                 &bigendian_obj,
    4540             :                 &ndr64_obj)) {
    4541           0 :                 return NULL;
    4542             :         }
    4543             : 
    4544           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4545           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4546             :         }
    4547           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4548           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4549             :         }
    4550             : 
    4551           0 :         return py_wbint_Sids2UnixIDs_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    4552             : }
    4553             : 
    4554           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4555             : {
    4556           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    4557           0 :         PyObject *bigendian_obj = NULL;
    4558           0 :         PyObject *ndr64_obj = NULL;
    4559           0 :         uint32_t ndr_push_flags = 0;
    4560             : 
    4561           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    4562             :                 discard_const_p(char *, kwnames),
    4563             :                 &bigendian_obj,
    4564             :                 &ndr64_obj)) {
    4565           0 :                 return NULL;
    4566             :         }
    4567             : 
    4568           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4569           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4570             :         }
    4571           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4572           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4573             :         }
    4574             : 
    4575           0 :         return py_wbint_Sids2UnixIDs_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    4576             : }
    4577             : 
    4578           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    4579             : {
    4580           0 :         const struct ndr_interface_call *call = NULL;
    4581           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    4582           0 :         struct ndr_pull *pull = NULL;
    4583             :         enum ndr_err_code err;
    4584             : 
    4585           0 :         if (ndr_table_winbind.num_calls < 5) {
    4586           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Sids2UnixIDs_ndr_unpack");
    4587           0 :                 return NULL;
    4588             :         }
    4589           0 :         call = &ndr_table_winbind.calls[4];
    4590             : 
    4591           0 :         pull = ndr_pull_init_blob(blob, object);
    4592           0 :         if (pull == NULL) {
    4593           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4594           0 :                 return NULL;
    4595             :         }
    4596             : 
    4597           0 :         pull->flags |= ndr_pull_flags;
    4598             : 
    4599           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    4600           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4601           0 :                 TALLOC_FREE(pull);
    4602           0 :                 PyErr_SetNdrError(err);
    4603           0 :                 return NULL;
    4604             :         }
    4605           0 :         if (!allow_remaining) {
    4606             :                 uint32_t highest_ofs;
    4607             : 
    4608           0 :                 if (pull->offset > pull->relative_highest_offset) {
    4609           0 :                         highest_ofs = pull->offset;
    4610             :                 } else {
    4611           0 :                         highest_ofs = pull->relative_highest_offset;
    4612             :                 }
    4613           0 :                 if (highest_ofs < pull->data_size) {
    4614           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    4615             :                                 "not all bytes consumed ofs[%u] size[%u]",
    4616             :                                 highest_ofs, pull->data_size);
    4617           0 :                         TALLOC_FREE(pull);
    4618           0 :                         PyErr_SetNdrError(err);
    4619           0 :                         return NULL;
    4620             :                 }
    4621             :         }
    4622             : 
    4623           0 :         TALLOC_FREE(pull);
    4624           0 :         Py_RETURN_NONE;
    4625             : }
    4626             : 
    4627           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4628             : {
    4629             :         DATA_BLOB blob;
    4630           0 :         Py_ssize_t blob_length = 0;
    4631           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4632           0 :         PyObject *bigendian_obj = NULL;
    4633           0 :         PyObject *ndr64_obj = NULL;
    4634           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4635           0 :         PyObject *allow_remaining_obj = NULL;
    4636           0 :         bool allow_remaining = false;
    4637             : 
    4638           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    4639             :                 discard_const_p(char *, kwnames),
    4640             :                 &blob.data, &blob_length,
    4641             :                 &bigendian_obj,
    4642             :                 &ndr64_obj,
    4643             :                 &allow_remaining_obj)) {
    4644           0 :                 return NULL;
    4645             :         }
    4646           0 :         blob.length = blob_length;
    4647             : 
    4648           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4649           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4650             :         }
    4651           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4652           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4653             :         }
    4654             : 
    4655           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4656           0 :                 allow_remaining = true;
    4657             :         }
    4658             : 
    4659           0 :         return py_wbint_Sids2UnixIDs_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    4660             : }
    4661             : 
    4662           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4663             : {
    4664             :         DATA_BLOB blob;
    4665           0 :         Py_ssize_t blob_length = 0;
    4666           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4667           0 :         PyObject *bigendian_obj = NULL;
    4668           0 :         PyObject *ndr64_obj = NULL;
    4669           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4670           0 :         PyObject *allow_remaining_obj = NULL;
    4671           0 :         bool allow_remaining = false;
    4672             : 
    4673           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    4674             :                 discard_const_p(char *, kwnames),
    4675             :                 &blob.data, &blob_length,
    4676             :                 &bigendian_obj,
    4677             :                 &ndr64_obj,
    4678             :                 &allow_remaining_obj)) {
    4679           0 :                 return NULL;
    4680             :         }
    4681           0 :         blob.length = blob_length;
    4682             : 
    4683           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4684           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4685             :         }
    4686           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4687           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4688             :         }
    4689             : 
    4690           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4691           0 :                 allow_remaining = true;
    4692             :         }
    4693             : 
    4694           0 :         return py_wbint_Sids2UnixIDs_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    4695             : }
    4696             : 
    4697           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    4698             : {
    4699           0 :         const struct ndr_interface_call *call = NULL;
    4700           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    4701             :         PyObject *ret;
    4702             :         char *retstr;
    4703             : 
    4704           0 :         if (ndr_table_winbind.num_calls < 5) {
    4705           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Sids2UnixIDs_ndr_print");
    4706           0 :                 return NULL;
    4707             :         }
    4708           0 :         call = &ndr_table_winbind.calls[4];
    4709             : 
    4710           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    4711           0 :         ret = PyUnicode_FromString(retstr);
    4712           0 :         TALLOC_FREE(retstr);
    4713             : 
    4714           0 :         return ret;
    4715             : }
    4716             : 
    4717           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4718             : {
    4719           0 :         return py_wbint_Sids2UnixIDs_ndr_print(py_obj, "wbint_Sids2UnixIDs_in", NDR_IN);
    4720             : }
    4721             : 
    4722           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4723             : {
    4724           0 :         return py_wbint_Sids2UnixIDs_ndr_print(py_obj, "wbint_Sids2UnixIDs_out", NDR_OUT);
    4725             : }
    4726             : 
    4727             : static PyMethodDef py_wbint_Sids2UnixIDs_methods[] = {
    4728             :         { "opnum", (PyCFunction)py_wbint_Sids2UnixIDs_ndr_opnum, METH_NOARGS|METH_CLASS,
    4729             :                 "winbind.wbint_Sids2UnixIDs.opnum() -> 4 (0x04) " },
    4730             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    4731             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    4732             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    4733             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    4734             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    4735             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    4736             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    4737             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    4738             :         { "__ndr_print_in__", (PyCFunction)py_wbint_Sids2UnixIDs_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    4739             :         { "__ndr_print_out__", (PyCFunction)py_wbint_Sids2UnixIDs_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    4740             :         { NULL, NULL, 0, NULL }
    4741             : };
    4742             : 
    4743             : 
    4744             : static PyTypeObject wbint_Sids2UnixIDs_Type = {
    4745             :         PyVarObject_HEAD_INIT(NULL, 0)
    4746             :         .tp_name = "winbind.wbint_Sids2UnixIDs",
    4747             :         .tp_getset = py_wbint_Sids2UnixIDs_getsetters,
    4748             :         .tp_methods = py_wbint_Sids2UnixIDs_methods,
    4749             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4750             :         .tp_new = py_wbint_Sids2UnixIDs_new,
    4751             : };
    4752             : 
    4753           0 : static bool pack_py_wbint_Sids2UnixIDs_args_in(PyObject *args, PyObject *kwargs, struct wbint_Sids2UnixIDs *r)
    4754             : {
    4755             :         PyObject *py_domains;
    4756             :         PyObject *py_ids;
    4757           0 :         const char *kwnames[] = {
    4758             :                 "domains", "ids", NULL
    4759             :         };
    4760             : 
    4761           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_Sids2UnixIDs", discard_const_p(char *, kwnames), &py_domains, &py_ids)) {
    4762           0 :                 return false;
    4763             :         }
    4764             : 
    4765           0 :         if (py_domains == NULL) {
    4766           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domains");
    4767           0 :                 return false;
    4768             :         }
    4769           0 :         r->in.domains = talloc_ptrtype(r, r->in.domains);
    4770           0 :         if (r->in.domains == NULL) {
    4771           0 :                 PyErr_NoMemory();
    4772           0 :                 return false;
    4773             :         }
    4774           0 :         PY_CHECK_TYPE(lsa_RefDomainList_Type, py_domains, return false;);
    4775           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_domains)) == NULL) {
    4776           0 :                 PyErr_NoMemory();
    4777           0 :                 return false;
    4778             :         }
    4779           0 :         r->in.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_domains);
    4780           0 :         if (py_ids == NULL) {
    4781           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ids");
    4782           0 :                 return false;
    4783             :         }
    4784           0 :         r->in.ids = talloc_ptrtype(r, r->in.ids);
    4785           0 :         if (r->in.ids == NULL) {
    4786           0 :                 PyErr_NoMemory();
    4787           0 :                 return false;
    4788             :         }
    4789           0 :         PY_CHECK_TYPE(&wbint_TransIDArray_Type, py_ids, return false;);
    4790           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_ids)) == NULL) {
    4791           0 :                 PyErr_NoMemory();
    4792           0 :                 return false;
    4793             :         }
    4794           0 :         r->in.ids = (struct wbint_TransIDArray *)pytalloc_get_ptr(py_ids);
    4795           0 :         return true;
    4796             : }
    4797             : 
    4798           0 : static PyObject *unpack_py_wbint_Sids2UnixIDs_args_out(struct wbint_Sids2UnixIDs *r)
    4799             : {
    4800             :         PyObject *result;
    4801             :         PyObject *py_ids;
    4802           0 :         py_ids = pytalloc_reference_ex(&wbint_TransIDArray_Type, r->out.ids, r->out.ids);
    4803           0 :         result = py_ids;
    4804           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    4805           0 :                 PyErr_SetNTSTATUS(r->out.result);
    4806           0 :                 return NULL;
    4807             :         }
    4808             : 
    4809           0 :         return result;
    4810             : }
    4811             : 
    4812             : 
    4813           0 : static PyObject *py_wbint_UnixIDs2Sids_in_get_domain_name(PyObject *obj, void *closure)
    4814             : {
    4815           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    4816             :         PyObject *py_domain_name;
    4817           0 :         if (object->in.domain_name == NULL) {
    4818           0 :                 Py_RETURN_NONE;
    4819             :         }
    4820           0 :         if (object->in.domain_name == NULL) {
    4821           0 :                 py_domain_name = Py_None;
    4822           0 :                 Py_INCREF(py_domain_name);
    4823             :         } else {
    4824           0 :                 py_domain_name = PyUnicode_Decode(object->in.domain_name, strlen(object->in.domain_name), "utf-8", "ignore");
    4825             :         }
    4826           0 :         return py_domain_name;
    4827             : }
    4828             : 
    4829           0 : static int py_wbint_UnixIDs2Sids_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
    4830             : {
    4831           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    4832           0 :         if (value == NULL) {
    4833           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name");
    4834           0 :                 return -1;
    4835             :         }
    4836           0 :         object->in.domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_name);
    4837           0 :         if (object->in.domain_name == NULL) {
    4838           0 :                 PyErr_NoMemory();
    4839           0 :                 return -1;
    4840             :         }
    4841             :         {
    4842             :                 const char *test_str;
    4843             :                 const char *talloc_str;
    4844           0 :                 PyObject *unicode = NULL;
    4845           0 :                 if (PyUnicode_Check(value)) {
    4846           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    4847           0 :                         if (unicode == NULL) {
    4848           0 :                                 PyErr_NoMemory();
    4849           0 :                                 return -1;
    4850             :                         }
    4851           0 :                         test_str = PyBytes_AS_STRING(unicode);
    4852           0 :                 } else if (PyBytes_Check(value)) {
    4853           0 :                         test_str = PyBytes_AS_STRING(value);
    4854             :                 } else {
    4855           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    4856           0 :                         return -1;
    4857             :                 }
    4858           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    4859           0 :                 if (unicode != NULL) {
    4860           0 :                         Py_DECREF(unicode);
    4861             :                 }
    4862           0 :                 if (talloc_str == NULL) {
    4863           0 :                         PyErr_NoMemory();
    4864           0 :                         return -1;
    4865             :                 }
    4866           0 :                 object->in.domain_name = talloc_str;
    4867             :         }
    4868           0 :         return 0;
    4869             : }
    4870             : 
    4871           0 : static PyObject *py_wbint_UnixIDs2Sids_in_get_domain_sid(PyObject *obj, void *closure)
    4872             : {
    4873           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    4874             :         PyObject *py_domain_sid;
    4875           0 :         py_domain_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->in.domain_sid);
    4876           0 :         return py_domain_sid;
    4877             : }
    4878             : 
    4879           0 : static int py_wbint_UnixIDs2Sids_in_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
    4880             : {
    4881           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    4882           0 :         if (value == NULL) {
    4883           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_sid");
    4884           0 :                 return -1;
    4885             :         }
    4886           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    4887           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4888           0 :                 PyErr_NoMemory();
    4889           0 :                 return -1;
    4890             :         }
    4891           0 :         object->in.domain_sid = *(struct dom_sid *)pytalloc_get_ptr(value);
    4892           0 :         return 0;
    4893             : }
    4894             : 
    4895           0 : static PyObject *py_wbint_UnixIDs2Sids_in_get_num_ids(PyObject *obj, void *closure)
    4896             : {
    4897           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    4898             :         PyObject *py_num_ids;
    4899           0 :         py_num_ids = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_ids);
    4900           0 :         return py_num_ids;
    4901             : }
    4902             : 
    4903           0 : static int py_wbint_UnixIDs2Sids_in_set_num_ids(PyObject *py_obj, PyObject *value, void *closure)
    4904             : {
    4905           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    4906           0 :         if (value == NULL) {
    4907           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_ids");
    4908           0 :                 return -1;
    4909             :         }
    4910             :         {
    4911           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_ids));
    4912           0 :                 if (PyLong_Check(value)) {
    4913             :                         unsigned long long test_var;
    4914           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4915           0 :                         if (PyErr_Occurred() != NULL) {
    4916           0 :                                 return -1;
    4917             :                         }
    4918           0 :                         if (test_var > uint_max) {
    4919           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4920             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4921           0 :                                 return -1;
    4922             :                         }
    4923           0 :                         object->in.num_ids = test_var;
    4924             :                 } else {
    4925           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4926             :                           PyLong_Type.tp_name);
    4927           0 :                         return -1;
    4928             :                 }
    4929             :         }
    4930           0 :         return 0;
    4931             : }
    4932             : 
    4933           0 : static PyObject *py_wbint_UnixIDs2Sids_in_get_xids(PyObject *obj, void *closure)
    4934             : {
    4935           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    4936             :         PyObject *py_xids;
    4937           0 :         py_xids = PyList_New(object->in.num_ids);
    4938           0 :         if (py_xids == NULL) {
    4939           0 :                 return NULL;
    4940             :         }
    4941             :         {
    4942             :                 int xids_cntr_0;
    4943           0 :                 for (xids_cntr_0 = 0; xids_cntr_0 < (object->in.num_ids); xids_cntr_0++) {
    4944             :                         PyObject *py_xids_0;
    4945           0 :                         py_xids_0 = pytalloc_reference_ex(unixid_Type, object->in.xids, &object->in.xids[xids_cntr_0]);
    4946           0 :                         PyList_SetItem(py_xids, xids_cntr_0, py_xids_0);
    4947             :                 }
    4948             :         }
    4949           0 :         return py_xids;
    4950             : }
    4951             : 
    4952           0 : static int py_wbint_UnixIDs2Sids_in_set_xids(PyObject *py_obj, PyObject *value, void *closure)
    4953             : {
    4954           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    4955           0 :         if (value == NULL) {
    4956           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.xids");
    4957           0 :                 return -1;
    4958             :         }
    4959           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    4960             :         {
    4961             :                 int xids_cntr_0;
    4962           0 :                 object->in.xids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.xids, PyList_GET_SIZE(value));
    4963           0 :                 if (!object->in.xids) { return -1;; }
    4964           0 :                 talloc_set_name_const(object->in.xids, "ARRAY: object->in.xids");
    4965           0 :                 for (xids_cntr_0 = 0; xids_cntr_0 < PyList_GET_SIZE(value); xids_cntr_0++) {
    4966           0 :                         if (PyList_GET_ITEM(value, xids_cntr_0) == NULL) {
    4967           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.xids[xids_cntr_0]");
    4968           0 :                                 return -1;
    4969             :                         }
    4970           0 :                         PY_CHECK_TYPE(unixid_Type, PyList_GET_ITEM(value, xids_cntr_0), return -1;);
    4971           0 :                         if (talloc_reference(object->in.xids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, xids_cntr_0))) == NULL) {
    4972           0 :                                 PyErr_NoMemory();
    4973           0 :                                 return -1;
    4974             :                         }
    4975           0 :                         object->in.xids[xids_cntr_0] = *(struct unixid *)pytalloc_get_ptr(PyList_GET_ITEM(value, xids_cntr_0));
    4976             :                 }
    4977             :         }
    4978           0 :         return 0;
    4979             : }
    4980             : 
    4981           0 : static PyObject *py_wbint_UnixIDs2Sids_out_get_xids(PyObject *obj, void *closure)
    4982             : {
    4983           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    4984             :         PyObject *py_xids;
    4985           0 :         py_xids = PyList_New(object->in.num_ids);
    4986           0 :         if (py_xids == NULL) {
    4987           0 :                 return NULL;
    4988             :         }
    4989             :         {
    4990             :                 int xids_cntr_0;
    4991           0 :                 for (xids_cntr_0 = 0; xids_cntr_0 < (object->in.num_ids); xids_cntr_0++) {
    4992             :                         PyObject *py_xids_0;
    4993           0 :                         py_xids_0 = pytalloc_reference_ex(unixid_Type, object->out.xids, &object->out.xids[xids_cntr_0]);
    4994           0 :                         PyList_SetItem(py_xids, xids_cntr_0, py_xids_0);
    4995             :                 }
    4996             :         }
    4997           0 :         return py_xids;
    4998             : }
    4999             : 
    5000           0 : static int py_wbint_UnixIDs2Sids_out_set_xids(PyObject *py_obj, PyObject *value, void *closure)
    5001             : {
    5002           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    5003           0 :         if (value == NULL) {
    5004           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.xids");
    5005           0 :                 return -1;
    5006             :         }
    5007           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    5008             :         {
    5009             :                 int xids_cntr_0;
    5010           0 :                 object->out.xids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.xids, PyList_GET_SIZE(value));
    5011           0 :                 if (!object->out.xids) { return -1;; }
    5012           0 :                 talloc_set_name_const(object->out.xids, "ARRAY: object->out.xids");
    5013           0 :                 for (xids_cntr_0 = 0; xids_cntr_0 < PyList_GET_SIZE(value); xids_cntr_0++) {
    5014           0 :                         if (PyList_GET_ITEM(value, xids_cntr_0) == NULL) {
    5015           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.xids[xids_cntr_0]");
    5016           0 :                                 return -1;
    5017             :                         }
    5018           0 :                         PY_CHECK_TYPE(unixid_Type, PyList_GET_ITEM(value, xids_cntr_0), return -1;);
    5019           0 :                         if (talloc_reference(object->out.xids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, xids_cntr_0))) == NULL) {
    5020           0 :                                 PyErr_NoMemory();
    5021           0 :                                 return -1;
    5022             :                         }
    5023           0 :                         object->out.xids[xids_cntr_0] = *(struct unixid *)pytalloc_get_ptr(PyList_GET_ITEM(value, xids_cntr_0));
    5024             :                 }
    5025             :         }
    5026           0 :         return 0;
    5027             : }
    5028             : 
    5029           0 : static PyObject *py_wbint_UnixIDs2Sids_out_get_sids(PyObject *obj, void *closure)
    5030             : {
    5031           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    5032             :         PyObject *py_sids;
    5033           0 :         py_sids = PyList_New(object->in.num_ids);
    5034           0 :         if (py_sids == NULL) {
    5035           0 :                 return NULL;
    5036             :         }
    5037             :         {
    5038             :                 int sids_cntr_0;
    5039           0 :                 for (sids_cntr_0 = 0; sids_cntr_0 < (object->in.num_ids); sids_cntr_0++) {
    5040             :                         PyObject *py_sids_0;
    5041           0 :                         py_sids_0 = pytalloc_reference_ex(dom_sid_Type, object->out.sids, &object->out.sids[sids_cntr_0]);
    5042           0 :                         PyList_SetItem(py_sids, sids_cntr_0, py_sids_0);
    5043             :                 }
    5044             :         }
    5045           0 :         return py_sids;
    5046             : }
    5047             : 
    5048           0 : static int py_wbint_UnixIDs2Sids_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
    5049             : {
    5050           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    5051           0 :         if (value == NULL) {
    5052           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
    5053           0 :                 return -1;
    5054             :         }
    5055           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    5056             :         {
    5057             :                 int sids_cntr_0;
    5058           0 :                 object->out.sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids, PyList_GET_SIZE(value));
    5059           0 :                 if (!object->out.sids) { return -1;; }
    5060           0 :                 talloc_set_name_const(object->out.sids, "ARRAY: object->out.sids");
    5061           0 :                 for (sids_cntr_0 = 0; sids_cntr_0 < PyList_GET_SIZE(value); sids_cntr_0++) {
    5062           0 :                         if (PyList_GET_ITEM(value, sids_cntr_0) == NULL) {
    5063           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids[sids_cntr_0]");
    5064           0 :                                 return -1;
    5065             :                         }
    5066           0 :                         PY_CHECK_TYPE(dom_sid_Type, PyList_GET_ITEM(value, sids_cntr_0), return -1;);
    5067           0 :                         if (talloc_reference(object->out.sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_0))) == NULL) {
    5068           0 :                                 PyErr_NoMemory();
    5069           0 :                                 return -1;
    5070             :                         }
    5071           0 :                         object->out.sids[sids_cntr_0] = *(struct dom_sid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_0));
    5072             :                 }
    5073             :         }
    5074           0 :         return 0;
    5075             : }
    5076             : 
    5077           0 : static PyObject *py_wbint_UnixIDs2Sids_get_result(PyObject *obj, void *closure)
    5078             : {
    5079           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    5080             :         PyObject *py_result;
    5081           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    5082           0 :         return py_result;
    5083             : }
    5084             : 
    5085           0 : static int py_wbint_UnixIDs2Sids_set_result(PyObject *py_obj, PyObject *value, void *closure)
    5086             : {
    5087           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    5088           0 :         if (value == NULL) {
    5089           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    5090           0 :                 return -1;
    5091             :         }
    5092           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    5093           0 :         return 0;
    5094             : }
    5095             : 
    5096             : static PyGetSetDef py_wbint_UnixIDs2Sids_getsetters[] = {
    5097             :         {
    5098             :                 .name = discard_const_p(char, "in_domain_name"),
    5099             :                 .get = py_wbint_UnixIDs2Sids_in_get_domain_name,
    5100             :                 .set = py_wbint_UnixIDs2Sids_in_set_domain_name,
    5101             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    5102             :         },
    5103             :         {
    5104             :                 .name = discard_const_p(char, "in_domain_sid"),
    5105             :                 .get = py_wbint_UnixIDs2Sids_in_get_domain_sid,
    5106             :                 .set = py_wbint_UnixIDs2Sids_in_set_domain_sid,
    5107             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    5108             :         },
    5109             :         {
    5110             :                 .name = discard_const_p(char, "in_num_ids"),
    5111             :                 .get = py_wbint_UnixIDs2Sids_in_get_num_ids,
    5112             :                 .set = py_wbint_UnixIDs2Sids_in_set_num_ids,
    5113             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5114             :         },
    5115             :         {
    5116             :                 .name = discard_const_p(char, "in_xids"),
    5117             :                 .get = py_wbint_UnixIDs2Sids_in_get_xids,
    5118             :                 .set = py_wbint_UnixIDs2Sids_in_set_xids,
    5119             :                 .doc = discard_const_p(char, "PIDL-generated element of base type unixid")
    5120             :         },
    5121             :         {
    5122             :                 .name = discard_const_p(char, "out_xids"),
    5123             :                 .get = py_wbint_UnixIDs2Sids_out_get_xids,
    5124             :                 .set = py_wbint_UnixIDs2Sids_out_set_xids,
    5125             :                 .doc = discard_const_p(char, "PIDL-generated element of base type unixid")
    5126             :         },
    5127             :         {
    5128             :                 .name = discard_const_p(char, "out_sids"),
    5129             :                 .get = py_wbint_UnixIDs2Sids_out_get_sids,
    5130             :                 .set = py_wbint_UnixIDs2Sids_out_set_sids,
    5131             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    5132             :         },
    5133             :         {
    5134             :                 .name = discard_const_p(char, "result"),
    5135             :                 .get = py_wbint_UnixIDs2Sids_get_result,
    5136             :                 .set = py_wbint_UnixIDs2Sids_set_result,
    5137             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    5138             :         },
    5139             :         { .name = NULL }
    5140             : };
    5141             : 
    5142           0 : static PyObject *py_wbint_UnixIDs2Sids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5143             : {
    5144           0 :         PyObject *self = pytalloc_new(struct wbint_UnixIDs2Sids, type);
    5145           0 :         return self;
    5146             : }
    5147             : 
    5148           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    5149             : {
    5150             : 
    5151             : 
    5152           0 :         return PyLong_FromLong(5);
    5153             : }
    5154             : 
    5155           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    5156             : {
    5157           0 :         const struct ndr_interface_call *call = NULL;
    5158           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    5159           0 :         PyObject *ret = NULL;
    5160           0 :         struct ndr_push *push = NULL;
    5161             :         DATA_BLOB blob;
    5162             :         enum ndr_err_code err;
    5163             : 
    5164           0 :         if (ndr_table_winbind.num_calls < 6) {
    5165           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_UnixIDs2Sids_ndr_pack");
    5166           0 :                 return NULL;
    5167             :         }
    5168           0 :         call = &ndr_table_winbind.calls[5];
    5169             : 
    5170           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    5171           0 :         if (push == NULL) {
    5172           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5173           0 :                 return NULL;
    5174             :         }
    5175             : 
    5176           0 :         push->flags |= ndr_push_flags;
    5177             : 
    5178           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    5179           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5180           0 :                 TALLOC_FREE(push);
    5181           0 :                 PyErr_SetNdrError(err);
    5182           0 :                 return NULL;
    5183             :         }
    5184           0 :         blob = ndr_push_blob(push);
    5185           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    5186           0 :         TALLOC_FREE(push);
    5187           0 :         return ret;
    5188             : }
    5189             : 
    5190           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5191             : {
    5192           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5193           0 :         PyObject *bigendian_obj = NULL;
    5194           0 :         PyObject *ndr64_obj = NULL;
    5195           0 :         uint32_t ndr_push_flags = 0;
    5196             : 
    5197           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    5198             :                 discard_const_p(char *, kwnames),
    5199             :                 &bigendian_obj,
    5200             :                 &ndr64_obj)) {
    5201           0 :                 return NULL;
    5202             :         }
    5203             : 
    5204           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5205           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5206             :         }
    5207           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5208           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5209             :         }
    5210             : 
    5211           0 :         return py_wbint_UnixIDs2Sids_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    5212             : }
    5213             : 
    5214           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5215             : {
    5216           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5217           0 :         PyObject *bigendian_obj = NULL;
    5218           0 :         PyObject *ndr64_obj = NULL;
    5219           0 :         uint32_t ndr_push_flags = 0;
    5220             : 
    5221           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    5222             :                 discard_const_p(char *, kwnames),
    5223             :                 &bigendian_obj,
    5224             :                 &ndr64_obj)) {
    5225           0 :                 return NULL;
    5226             :         }
    5227             : 
    5228           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5229           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5230             :         }
    5231           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5232           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5233             :         }
    5234             : 
    5235           0 :         return py_wbint_UnixIDs2Sids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    5236             : }
    5237             : 
    5238           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    5239             : {
    5240           0 :         const struct ndr_interface_call *call = NULL;
    5241           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    5242           0 :         struct ndr_pull *pull = NULL;
    5243             :         enum ndr_err_code err;
    5244             : 
    5245           0 :         if (ndr_table_winbind.num_calls < 6) {
    5246           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_UnixIDs2Sids_ndr_unpack");
    5247           0 :                 return NULL;
    5248             :         }
    5249           0 :         call = &ndr_table_winbind.calls[5];
    5250             : 
    5251           0 :         pull = ndr_pull_init_blob(blob, object);
    5252           0 :         if (pull == NULL) {
    5253           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5254           0 :                 return NULL;
    5255             :         }
    5256             : 
    5257           0 :         pull->flags |= ndr_pull_flags;
    5258             : 
    5259           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    5260           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5261           0 :                 TALLOC_FREE(pull);
    5262           0 :                 PyErr_SetNdrError(err);
    5263           0 :                 return NULL;
    5264             :         }
    5265           0 :         if (!allow_remaining) {
    5266             :                 uint32_t highest_ofs;
    5267             : 
    5268           0 :                 if (pull->offset > pull->relative_highest_offset) {
    5269           0 :                         highest_ofs = pull->offset;
    5270             :                 } else {
    5271           0 :                         highest_ofs = pull->relative_highest_offset;
    5272             :                 }
    5273           0 :                 if (highest_ofs < pull->data_size) {
    5274           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    5275             :                                 "not all bytes consumed ofs[%u] size[%u]",
    5276             :                                 highest_ofs, pull->data_size);
    5277           0 :                         TALLOC_FREE(pull);
    5278           0 :                         PyErr_SetNdrError(err);
    5279           0 :                         return NULL;
    5280             :                 }
    5281             :         }
    5282             : 
    5283           0 :         TALLOC_FREE(pull);
    5284           0 :         Py_RETURN_NONE;
    5285             : }
    5286             : 
    5287           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5288             : {
    5289             :         DATA_BLOB blob;
    5290           0 :         Py_ssize_t blob_length = 0;
    5291           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    5292           0 :         PyObject *bigendian_obj = NULL;
    5293           0 :         PyObject *ndr64_obj = NULL;
    5294           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    5295           0 :         PyObject *allow_remaining_obj = NULL;
    5296           0 :         bool allow_remaining = false;
    5297             : 
    5298           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    5299             :                 discard_const_p(char *, kwnames),
    5300             :                 &blob.data, &blob_length,
    5301             :                 &bigendian_obj,
    5302             :                 &ndr64_obj,
    5303             :                 &allow_remaining_obj)) {
    5304           0 :                 return NULL;
    5305             :         }
    5306           0 :         blob.length = blob_length;
    5307             : 
    5308           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5309           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    5310             :         }
    5311           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5312           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    5313             :         }
    5314             : 
    5315           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5316           0 :                 allow_remaining = true;
    5317             :         }
    5318             : 
    5319           0 :         return py_wbint_UnixIDs2Sids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    5320             : }
    5321             : 
    5322           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5323             : {
    5324             :         DATA_BLOB blob;
    5325           0 :         Py_ssize_t blob_length = 0;
    5326           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    5327           0 :         PyObject *bigendian_obj = NULL;
    5328           0 :         PyObject *ndr64_obj = NULL;
    5329           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    5330           0 :         PyObject *allow_remaining_obj = NULL;
    5331           0 :         bool allow_remaining = false;
    5332             : 
    5333           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    5334             :                 discard_const_p(char *, kwnames),
    5335             :                 &blob.data, &blob_length,
    5336             :                 &bigendian_obj,
    5337             :                 &ndr64_obj,
    5338             :                 &allow_remaining_obj)) {
    5339           0 :                 return NULL;
    5340             :         }
    5341           0 :         blob.length = blob_length;
    5342             : 
    5343           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5344           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    5345             :         }
    5346           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5347           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    5348             :         }
    5349             : 
    5350           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5351           0 :                 allow_remaining = true;
    5352             :         }
    5353             : 
    5354           0 :         return py_wbint_UnixIDs2Sids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    5355             : }
    5356             : 
    5357           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    5358             : {
    5359           0 :         const struct ndr_interface_call *call = NULL;
    5360           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    5361             :         PyObject *ret;
    5362             :         char *retstr;
    5363             : 
    5364           0 :         if (ndr_table_winbind.num_calls < 6) {
    5365           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_UnixIDs2Sids_ndr_print");
    5366           0 :                 return NULL;
    5367             :         }
    5368           0 :         call = &ndr_table_winbind.calls[5];
    5369             : 
    5370           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    5371           0 :         ret = PyUnicode_FromString(retstr);
    5372           0 :         TALLOC_FREE(retstr);
    5373             : 
    5374           0 :         return ret;
    5375             : }
    5376             : 
    5377           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5378             : {
    5379           0 :         return py_wbint_UnixIDs2Sids_ndr_print(py_obj, "wbint_UnixIDs2Sids_in", NDR_IN);
    5380             : }
    5381             : 
    5382           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5383             : {
    5384           0 :         return py_wbint_UnixIDs2Sids_ndr_print(py_obj, "wbint_UnixIDs2Sids_out", NDR_OUT);
    5385             : }
    5386             : 
    5387             : static PyMethodDef py_wbint_UnixIDs2Sids_methods[] = {
    5388             :         { "opnum", (PyCFunction)py_wbint_UnixIDs2Sids_ndr_opnum, METH_NOARGS|METH_CLASS,
    5389             :                 "winbind.wbint_UnixIDs2Sids.opnum() -> 5 (0x05) " },
    5390             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    5391             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    5392             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    5393             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    5394             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    5395             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    5396             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    5397             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    5398             :         { "__ndr_print_in__", (PyCFunction)py_wbint_UnixIDs2Sids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    5399             :         { "__ndr_print_out__", (PyCFunction)py_wbint_UnixIDs2Sids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    5400             :         { NULL, NULL, 0, NULL }
    5401             : };
    5402             : 
    5403             : 
    5404             : static PyTypeObject wbint_UnixIDs2Sids_Type = {
    5405             :         PyVarObject_HEAD_INIT(NULL, 0)
    5406             :         .tp_name = "winbind.wbint_UnixIDs2Sids",
    5407             :         .tp_getset = py_wbint_UnixIDs2Sids_getsetters,
    5408             :         .tp_methods = py_wbint_UnixIDs2Sids_methods,
    5409             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5410             :         .tp_new = py_wbint_UnixIDs2Sids_new,
    5411             : };
    5412             : 
    5413           0 : static bool pack_py_wbint_UnixIDs2Sids_args_in(PyObject *args, PyObject *kwargs, struct wbint_UnixIDs2Sids *r)
    5414             : {
    5415             :         PyObject *py_domain_name;
    5416             :         PyObject *py_domain_sid;
    5417             :         PyObject *py_num_ids;
    5418             :         PyObject *py_xids;
    5419           0 :         const char *kwnames[] = {
    5420             :                 "domain_name", "domain_sid", "num_ids", "xids", NULL
    5421             :         };
    5422             : 
    5423           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:wbint_UnixIDs2Sids", discard_const_p(char *, kwnames), &py_domain_name, &py_domain_sid, &py_num_ids, &py_xids)) {
    5424           0 :                 return false;
    5425             :         }
    5426             : 
    5427           0 :         if (py_domain_name == NULL) {
    5428           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name");
    5429           0 :                 return false;
    5430             :         }
    5431           0 :         r->in.domain_name = talloc_ptrtype(r, r->in.domain_name);
    5432           0 :         if (r->in.domain_name == NULL) {
    5433           0 :                 PyErr_NoMemory();
    5434           0 :                 return false;
    5435             :         }
    5436             :         {
    5437             :                 const char *test_str;
    5438             :                 const char *talloc_str;
    5439           0 :                 PyObject *unicode = NULL;
    5440           0 :                 if (PyUnicode_Check(py_domain_name)) {
    5441           0 :                         unicode = PyUnicode_AsEncodedString(py_domain_name, "utf-8", "ignore");
    5442           0 :                         if (unicode == NULL) {
    5443           0 :                                 PyErr_NoMemory();
    5444           0 :                                 return false;
    5445             :                         }
    5446           0 :                         test_str = PyBytes_AS_STRING(unicode);
    5447           0 :                 } else if (PyBytes_Check(py_domain_name)) {
    5448           0 :                         test_str = PyBytes_AS_STRING(py_domain_name);
    5449             :                 } else {
    5450           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain_name)->tp_name);
    5451           0 :                         return false;
    5452             :                 }
    5453           0 :                 talloc_str = talloc_strdup(r, test_str);
    5454           0 :                 if (unicode != NULL) {
    5455           0 :                         Py_DECREF(unicode);
    5456             :                 }
    5457           0 :                 if (talloc_str == NULL) {
    5458           0 :                         PyErr_NoMemory();
    5459           0 :                         return false;
    5460             :                 }
    5461           0 :                 r->in.domain_name = talloc_str;
    5462             :         }
    5463           0 :         if (py_domain_sid == NULL) {
    5464           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_sid");
    5465           0 :                 return false;
    5466             :         }
    5467           0 :         PY_CHECK_TYPE(dom_sid_Type, py_domain_sid, return false;);
    5468           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_sid)) == NULL) {
    5469           0 :                 PyErr_NoMemory();
    5470           0 :                 return false;
    5471             :         }
    5472           0 :         r->in.domain_sid = *(struct dom_sid *)pytalloc_get_ptr(py_domain_sid);
    5473           0 :         if (py_num_ids == NULL) {
    5474           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.num_ids");
    5475           0 :                 return false;
    5476             :         }
    5477             :         {
    5478           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.num_ids));
    5479           0 :                 if (PyLong_Check(py_num_ids)) {
    5480             :                         unsigned long long test_var;
    5481           0 :                         test_var = PyLong_AsUnsignedLongLong(py_num_ids);
    5482           0 :                         if (PyErr_Occurred() != NULL) {
    5483           0 :                                 return false;
    5484             :                         }
    5485           0 :                         if (test_var > uint_max) {
    5486           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5487             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5488           0 :                                 return false;
    5489             :                         }
    5490           0 :                         r->in.num_ids = test_var;
    5491             :                 } else {
    5492           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5493             :                           PyLong_Type.tp_name);
    5494           0 :                         return false;
    5495             :                 }
    5496             :         }
    5497           0 :         if (py_xids == NULL) {
    5498           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.xids");
    5499           0 :                 return false;
    5500             :         }
    5501           0 :         PY_CHECK_TYPE(&PyList_Type, py_xids, return false;);
    5502             :         {
    5503             :                 int xids_cntr_0;
    5504           0 :                 r->in.xids = talloc_array_ptrtype(r, r->in.xids, PyList_GET_SIZE(py_xids));
    5505           0 :                 if (!r->in.xids) { return false;; }
    5506           0 :                 talloc_set_name_const(r->in.xids, "ARRAY: r->in.xids");
    5507           0 :                 for (xids_cntr_0 = 0; xids_cntr_0 < PyList_GET_SIZE(py_xids); xids_cntr_0++) {
    5508           0 :                         if (PyList_GET_ITEM(py_xids, xids_cntr_0) == NULL) {
    5509           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.xids[xids_cntr_0]");
    5510           0 :                                 return false;
    5511             :                         }
    5512           0 :                         PY_CHECK_TYPE(unixid_Type, PyList_GET_ITEM(py_xids, xids_cntr_0), return false;);
    5513           0 :                         if (talloc_reference(r->in.xids, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_xids, xids_cntr_0))) == NULL) {
    5514           0 :                                 PyErr_NoMemory();
    5515           0 :                                 return false;
    5516             :                         }
    5517           0 :                         r->in.xids[xids_cntr_0] = *(struct unixid *)pytalloc_get_ptr(PyList_GET_ITEM(py_xids, xids_cntr_0));
    5518             :                 }
    5519             :         }
    5520           0 :         return true;
    5521             : }
    5522             : 
    5523           0 : static PyObject *unpack_py_wbint_UnixIDs2Sids_args_out(struct wbint_UnixIDs2Sids *r)
    5524             : {
    5525             :         PyObject *result;
    5526             :         PyObject *py_xids;
    5527             :         PyObject *py_sids;
    5528           0 :         result = PyTuple_New(2);
    5529           0 :         py_xids = PyList_New(r->in.num_ids);
    5530           0 :         if (py_xids == NULL) {
    5531           0 :                 return NULL;
    5532             :         }
    5533             :         {
    5534             :                 int xids_cntr_0;
    5535           0 :                 for (xids_cntr_0 = 0; xids_cntr_0 < (r->in.num_ids); xids_cntr_0++) {
    5536             :                         PyObject *py_xids_0;
    5537           0 :                         py_xids_0 = pytalloc_reference_ex(unixid_Type, r->out.xids, &r->out.xids[xids_cntr_0]);
    5538           0 :                         PyList_SetItem(py_xids, xids_cntr_0, py_xids_0);
    5539             :                 }
    5540             :         }
    5541           0 :         PyTuple_SetItem(result, 0, py_xids);
    5542           0 :         py_sids = PyList_New(r->in.num_ids);
    5543           0 :         if (py_sids == NULL) {
    5544           0 :                 return NULL;
    5545             :         }
    5546             :         {
    5547             :                 int sids_cntr_0;
    5548           0 :                 for (sids_cntr_0 = 0; sids_cntr_0 < (r->in.num_ids); sids_cntr_0++) {
    5549             :                         PyObject *py_sids_0;
    5550           0 :                         py_sids_0 = pytalloc_reference_ex(dom_sid_Type, r->out.sids, &r->out.sids[sids_cntr_0]);
    5551           0 :                         PyList_SetItem(py_sids, sids_cntr_0, py_sids_0);
    5552             :                 }
    5553             :         }
    5554           0 :         PyTuple_SetItem(result, 1, py_sids);
    5555           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    5556           0 :                 PyErr_SetNTSTATUS(r->out.result);
    5557           0 :                 return NULL;
    5558             :         }
    5559             : 
    5560           0 :         return result;
    5561             : }
    5562             : 
    5563             : 
    5564           0 : static PyObject *py_wbint_AllocateUid_out_get_uid(PyObject *obj, void *closure)
    5565             : {
    5566           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(obj);
    5567             :         PyObject *py_uid;
    5568           0 :         if (object->out.uid == NULL) {
    5569           0 :                 Py_RETURN_NONE;
    5570             :         }
    5571           0 :         py_uid = PyLong_FromUnsignedLongLong(*object->out.uid);
    5572           0 :         return py_uid;
    5573             : }
    5574             : 
    5575           0 : static int py_wbint_AllocateUid_out_set_uid(PyObject *py_obj, PyObject *value, void *closure)
    5576             : {
    5577           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj);
    5578           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.uid));
    5579           0 :         if (value == NULL) {
    5580           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.uid");
    5581           0 :                 return -1;
    5582             :         }
    5583           0 :         object->out.uid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.uid);
    5584           0 :         if (object->out.uid == NULL) {
    5585           0 :                 PyErr_NoMemory();
    5586           0 :                 return -1;
    5587             :         }
    5588             :         {
    5589           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.uid));
    5590           0 :                 if (PyLong_Check(value)) {
    5591             :                         unsigned long long test_var;
    5592           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5593           0 :                         if (PyErr_Occurred() != NULL) {
    5594           0 :                                 return -1;
    5595             :                         }
    5596           0 :                         if (test_var > uint_max) {
    5597           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5598             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5599           0 :                                 return -1;
    5600             :                         }
    5601           0 :                         *object->out.uid = test_var;
    5602             :                 } else {
    5603           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5604             :                           PyLong_Type.tp_name);
    5605           0 :                         return -1;
    5606             :                 }
    5607             :         }
    5608           0 :         return 0;
    5609             : }
    5610             : 
    5611           0 : static PyObject *py_wbint_AllocateUid_get_result(PyObject *obj, void *closure)
    5612             : {
    5613           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(obj);
    5614             :         PyObject *py_result;
    5615           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    5616           0 :         return py_result;
    5617             : }
    5618             : 
    5619           0 : static int py_wbint_AllocateUid_set_result(PyObject *py_obj, PyObject *value, void *closure)
    5620             : {
    5621           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj);
    5622           0 :         if (value == NULL) {
    5623           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    5624           0 :                 return -1;
    5625             :         }
    5626           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    5627           0 :         return 0;
    5628             : }
    5629             : 
    5630             : static PyGetSetDef py_wbint_AllocateUid_getsetters[] = {
    5631             :         {
    5632             :                 .name = discard_const_p(char, "out_uid"),
    5633             :                 .get = py_wbint_AllocateUid_out_get_uid,
    5634             :                 .set = py_wbint_AllocateUid_out_set_uid,
    5635             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
    5636             :         },
    5637             :         {
    5638             :                 .name = discard_const_p(char, "result"),
    5639             :                 .get = py_wbint_AllocateUid_get_result,
    5640             :                 .set = py_wbint_AllocateUid_set_result,
    5641             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    5642             :         },
    5643             :         { .name = NULL }
    5644             : };
    5645             : 
    5646           0 : static PyObject *py_wbint_AllocateUid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5647             : {
    5648           0 :         PyObject *self = pytalloc_new(struct wbint_AllocateUid, type);
    5649           0 :         struct wbint_AllocateUid *_self = (struct wbint_AllocateUid *)pytalloc_get_ptr(self);
    5650           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    5651           0 :         _self->out.uid = talloc_zero(mem_ctx, uint64_t);
    5652           0 :         return self;
    5653             : }
    5654             : 
    5655           0 : static PyObject *py_wbint_AllocateUid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    5656             : {
    5657             : 
    5658             : 
    5659           0 :         return PyLong_FromLong(6);
    5660             : }
    5661             : 
    5662           0 : static PyObject *py_wbint_AllocateUid_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    5663             : {
    5664           0 :         const struct ndr_interface_call *call = NULL;
    5665           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj);
    5666           0 :         PyObject *ret = NULL;
    5667           0 :         struct ndr_push *push = NULL;
    5668             :         DATA_BLOB blob;
    5669             :         enum ndr_err_code err;
    5670             : 
    5671           0 :         if (ndr_table_winbind.num_calls < 7) {
    5672           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateUid_ndr_pack");
    5673           0 :                 return NULL;
    5674             :         }
    5675           0 :         call = &ndr_table_winbind.calls[6];
    5676             : 
    5677           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    5678           0 :         if (push == NULL) {
    5679           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5680           0 :                 return NULL;
    5681             :         }
    5682             : 
    5683           0 :         push->flags |= ndr_push_flags;
    5684             : 
    5685           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    5686           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5687           0 :                 TALLOC_FREE(push);
    5688           0 :                 PyErr_SetNdrError(err);
    5689           0 :                 return NULL;
    5690             :         }
    5691           0 :         blob = ndr_push_blob(push);
    5692           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    5693           0 :         TALLOC_FREE(push);
    5694           0 :         return ret;
    5695             : }
    5696             : 
    5697           0 : static PyObject *py_wbint_AllocateUid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5698             : {
    5699           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5700           0 :         PyObject *bigendian_obj = NULL;
    5701           0 :         PyObject *ndr64_obj = NULL;
    5702           0 :         uint32_t ndr_push_flags = 0;
    5703             : 
    5704           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    5705             :                 discard_const_p(char *, kwnames),
    5706             :                 &bigendian_obj,
    5707             :                 &ndr64_obj)) {
    5708           0 :                 return NULL;
    5709             :         }
    5710             : 
    5711           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5712           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5713             :         }
    5714           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5715           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5716             :         }
    5717             : 
    5718           0 :         return py_wbint_AllocateUid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    5719             : }
    5720             : 
    5721           0 : static PyObject *py_wbint_AllocateUid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5722             : {
    5723           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5724           0 :         PyObject *bigendian_obj = NULL;
    5725           0 :         PyObject *ndr64_obj = NULL;
    5726           0 :         uint32_t ndr_push_flags = 0;
    5727             : 
    5728           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    5729             :                 discard_const_p(char *, kwnames),
    5730             :                 &bigendian_obj,
    5731             :                 &ndr64_obj)) {
    5732           0 :                 return NULL;
    5733             :         }
    5734             : 
    5735           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5736           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5737             :         }
    5738           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5739           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5740             :         }
    5741             : 
    5742           0 :         return py_wbint_AllocateUid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    5743             : }
    5744             : 
    5745           0 : static PyObject *py_wbint_AllocateUid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    5746             : {
    5747           0 :         const struct ndr_interface_call *call = NULL;
    5748           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj);
    5749           0 :         struct ndr_pull *pull = NULL;
    5750             :         enum ndr_err_code err;
    5751             : 
    5752           0 :         if (ndr_table_winbind.num_calls < 7) {
    5753           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateUid_ndr_unpack");
    5754           0 :                 return NULL;
    5755             :         }
    5756           0 :         call = &ndr_table_winbind.calls[6];
    5757             : 
    5758           0 :         pull = ndr_pull_init_blob(blob, object);
    5759           0 :         if (pull == NULL) {
    5760           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5761           0 :                 return NULL;
    5762             :         }
    5763             : 
    5764           0 :         pull->flags |= ndr_pull_flags;
    5765             : 
    5766           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    5767           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5768           0 :                 TALLOC_FREE(pull);
    5769           0 :                 PyErr_SetNdrError(err);
    5770           0 :                 return NULL;
    5771             :         }
    5772           0 :         if (!allow_remaining) {
    5773             :                 uint32_t highest_ofs;
    5774             : 
    5775           0 :                 if (pull->offset > pull->relative_highest_offset) {
    5776           0 :                         highest_ofs = pull->offset;
    5777             :                 } else {
    5778           0 :                         highest_ofs = pull->relative_highest_offset;
    5779             :                 }
    5780           0 :                 if (highest_ofs < pull->data_size) {
    5781           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    5782             :                                 "not all bytes consumed ofs[%u] size[%u]",
    5783             :                                 highest_ofs, pull->data_size);
    5784           0 :                         TALLOC_FREE(pull);
    5785           0 :                         PyErr_SetNdrError(err);
    5786           0 :                         return NULL;
    5787             :                 }
    5788             :         }
    5789             : 
    5790           0 :         TALLOC_FREE(pull);
    5791           0 :         Py_RETURN_NONE;
    5792             : }
    5793             : 
    5794           0 : static PyObject *py_wbint_AllocateUid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5795             : {
    5796             :         DATA_BLOB blob;
    5797           0 :         Py_ssize_t blob_length = 0;
    5798           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    5799           0 :         PyObject *bigendian_obj = NULL;
    5800           0 :         PyObject *ndr64_obj = NULL;
    5801           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    5802           0 :         PyObject *allow_remaining_obj = NULL;
    5803           0 :         bool allow_remaining = false;
    5804             : 
    5805           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    5806             :                 discard_const_p(char *, kwnames),
    5807             :                 &blob.data, &blob_length,
    5808             :                 &bigendian_obj,
    5809             :                 &ndr64_obj,
    5810             :                 &allow_remaining_obj)) {
    5811           0 :                 return NULL;
    5812             :         }
    5813           0 :         blob.length = blob_length;
    5814             : 
    5815           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5816           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    5817             :         }
    5818           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5819           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    5820             :         }
    5821             : 
    5822           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5823           0 :                 allow_remaining = true;
    5824             :         }
    5825             : 
    5826           0 :         return py_wbint_AllocateUid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    5827             : }
    5828             : 
    5829           0 : static PyObject *py_wbint_AllocateUid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5830             : {
    5831             :         DATA_BLOB blob;
    5832           0 :         Py_ssize_t blob_length = 0;
    5833           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    5834           0 :         PyObject *bigendian_obj = NULL;
    5835           0 :         PyObject *ndr64_obj = NULL;
    5836           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    5837           0 :         PyObject *allow_remaining_obj = NULL;
    5838           0 :         bool allow_remaining = false;
    5839             : 
    5840           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    5841             :                 discard_const_p(char *, kwnames),
    5842             :                 &blob.data, &blob_length,
    5843             :                 &bigendian_obj,
    5844             :                 &ndr64_obj,
    5845             :                 &allow_remaining_obj)) {
    5846           0 :                 return NULL;
    5847             :         }
    5848           0 :         blob.length = blob_length;
    5849             : 
    5850           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5851           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    5852             :         }
    5853           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5854           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    5855             :         }
    5856             : 
    5857           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5858           0 :                 allow_remaining = true;
    5859             :         }
    5860             : 
    5861           0 :         return py_wbint_AllocateUid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    5862             : }
    5863             : 
    5864           0 : static PyObject *py_wbint_AllocateUid_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    5865             : {
    5866           0 :         const struct ndr_interface_call *call = NULL;
    5867           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj);
    5868             :         PyObject *ret;
    5869             :         char *retstr;
    5870             : 
    5871           0 :         if (ndr_table_winbind.num_calls < 7) {
    5872           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateUid_ndr_print");
    5873           0 :                 return NULL;
    5874             :         }
    5875           0 :         call = &ndr_table_winbind.calls[6];
    5876             : 
    5877           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    5878           0 :         ret = PyUnicode_FromString(retstr);
    5879           0 :         TALLOC_FREE(retstr);
    5880             : 
    5881           0 :         return ret;
    5882             : }
    5883             : 
    5884           0 : static PyObject *py_wbint_AllocateUid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5885             : {
    5886           0 :         return py_wbint_AllocateUid_ndr_print(py_obj, "wbint_AllocateUid_in", NDR_IN);
    5887             : }
    5888             : 
    5889           0 : static PyObject *py_wbint_AllocateUid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5890             : {
    5891           0 :         return py_wbint_AllocateUid_ndr_print(py_obj, "wbint_AllocateUid_out", NDR_OUT);
    5892             : }
    5893             : 
    5894             : static PyMethodDef py_wbint_AllocateUid_methods[] = {
    5895             :         { "opnum", (PyCFunction)py_wbint_AllocateUid_ndr_opnum, METH_NOARGS|METH_CLASS,
    5896             :                 "winbind.wbint_AllocateUid.opnum() -> 6 (0x06) " },
    5897             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    5898             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    5899             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    5900             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    5901             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    5902             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    5903             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    5904             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    5905             :         { "__ndr_print_in__", (PyCFunction)py_wbint_AllocateUid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    5906             :         { "__ndr_print_out__", (PyCFunction)py_wbint_AllocateUid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    5907             :         { NULL, NULL, 0, NULL }
    5908             : };
    5909             : 
    5910             : 
    5911             : static PyTypeObject wbint_AllocateUid_Type = {
    5912             :         PyVarObject_HEAD_INIT(NULL, 0)
    5913             :         .tp_name = "winbind.wbint_AllocateUid",
    5914             :         .tp_getset = py_wbint_AllocateUid_getsetters,
    5915             :         .tp_methods = py_wbint_AllocateUid_methods,
    5916             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5917             :         .tp_new = py_wbint_AllocateUid_new,
    5918             : };
    5919             : 
    5920           0 : static bool pack_py_wbint_AllocateUid_args_in(PyObject *args, PyObject *kwargs, struct wbint_AllocateUid *r)
    5921             : {
    5922           0 :         const char *kwnames[] = {
    5923             :                 NULL
    5924             :         };
    5925             : 
    5926           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_AllocateUid", discard_const_p(char *, kwnames))) {
    5927           0 :                 return false;
    5928             :         }
    5929             : 
    5930           0 :         return true;
    5931             : }
    5932             : 
    5933           0 : static PyObject *unpack_py_wbint_AllocateUid_args_out(struct wbint_AllocateUid *r)
    5934             : {
    5935             :         PyObject *result;
    5936             :         PyObject *py_uid;
    5937           0 :         py_uid = PyLong_FromUnsignedLongLong(*r->out.uid);
    5938           0 :         result = py_uid;
    5939           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    5940           0 :                 PyErr_SetNTSTATUS(r->out.result);
    5941           0 :                 return NULL;
    5942             :         }
    5943             : 
    5944           0 :         return result;
    5945             : }
    5946             : 
    5947             : 
    5948           0 : static PyObject *py_wbint_AllocateGid_out_get_gid(PyObject *obj, void *closure)
    5949             : {
    5950           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(obj);
    5951             :         PyObject *py_gid;
    5952           0 :         if (object->out.gid == NULL) {
    5953           0 :                 Py_RETURN_NONE;
    5954             :         }
    5955           0 :         py_gid = PyLong_FromUnsignedLongLong(*object->out.gid);
    5956           0 :         return py_gid;
    5957             : }
    5958             : 
    5959           0 : static int py_wbint_AllocateGid_out_set_gid(PyObject *py_obj, PyObject *value, void *closure)
    5960             : {
    5961           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj);
    5962           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.gid));
    5963           0 :         if (value == NULL) {
    5964           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.gid");
    5965           0 :                 return -1;
    5966             :         }
    5967           0 :         object->out.gid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.gid);
    5968           0 :         if (object->out.gid == NULL) {
    5969           0 :                 PyErr_NoMemory();
    5970           0 :                 return -1;
    5971             :         }
    5972             :         {
    5973           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.gid));
    5974           0 :                 if (PyLong_Check(value)) {
    5975             :                         unsigned long long test_var;
    5976           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5977           0 :                         if (PyErr_Occurred() != NULL) {
    5978           0 :                                 return -1;
    5979             :                         }
    5980           0 :                         if (test_var > uint_max) {
    5981           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5982             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5983           0 :                                 return -1;
    5984             :                         }
    5985           0 :                         *object->out.gid = test_var;
    5986             :                 } else {
    5987           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5988             :                           PyLong_Type.tp_name);
    5989           0 :                         return -1;
    5990             :                 }
    5991             :         }
    5992           0 :         return 0;
    5993             : }
    5994             : 
    5995           0 : static PyObject *py_wbint_AllocateGid_get_result(PyObject *obj, void *closure)
    5996             : {
    5997           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(obj);
    5998             :         PyObject *py_result;
    5999           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    6000           0 :         return py_result;
    6001             : }
    6002             : 
    6003           0 : static int py_wbint_AllocateGid_set_result(PyObject *py_obj, PyObject *value, void *closure)
    6004             : {
    6005           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj);
    6006           0 :         if (value == NULL) {
    6007           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    6008           0 :                 return -1;
    6009             :         }
    6010           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    6011           0 :         return 0;
    6012             : }
    6013             : 
    6014             : static PyGetSetDef py_wbint_AllocateGid_getsetters[] = {
    6015             :         {
    6016             :                 .name = discard_const_p(char, "out_gid"),
    6017             :                 .get = py_wbint_AllocateGid_out_get_gid,
    6018             :                 .set = py_wbint_AllocateGid_out_set_gid,
    6019             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
    6020             :         },
    6021             :         {
    6022             :                 .name = discard_const_p(char, "result"),
    6023             :                 .get = py_wbint_AllocateGid_get_result,
    6024             :                 .set = py_wbint_AllocateGid_set_result,
    6025             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    6026             :         },
    6027             :         { .name = NULL }
    6028             : };
    6029             : 
    6030           0 : static PyObject *py_wbint_AllocateGid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6031             : {
    6032           0 :         PyObject *self = pytalloc_new(struct wbint_AllocateGid, type);
    6033           0 :         struct wbint_AllocateGid *_self = (struct wbint_AllocateGid *)pytalloc_get_ptr(self);
    6034           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    6035           0 :         _self->out.gid = talloc_zero(mem_ctx, uint64_t);
    6036           0 :         return self;
    6037             : }
    6038             : 
    6039           0 : static PyObject *py_wbint_AllocateGid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    6040             : {
    6041             : 
    6042             : 
    6043           0 :         return PyLong_FromLong(7);
    6044             : }
    6045             : 
    6046           0 : static PyObject *py_wbint_AllocateGid_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    6047             : {
    6048           0 :         const struct ndr_interface_call *call = NULL;
    6049           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj);
    6050           0 :         PyObject *ret = NULL;
    6051           0 :         struct ndr_push *push = NULL;
    6052             :         DATA_BLOB blob;
    6053             :         enum ndr_err_code err;
    6054             : 
    6055           0 :         if (ndr_table_winbind.num_calls < 8) {
    6056           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateGid_ndr_pack");
    6057           0 :                 return NULL;
    6058             :         }
    6059           0 :         call = &ndr_table_winbind.calls[7];
    6060             : 
    6061           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    6062           0 :         if (push == NULL) {
    6063           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6064           0 :                 return NULL;
    6065             :         }
    6066             : 
    6067           0 :         push->flags |= ndr_push_flags;
    6068             : 
    6069           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    6070           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6071           0 :                 TALLOC_FREE(push);
    6072           0 :                 PyErr_SetNdrError(err);
    6073           0 :                 return NULL;
    6074             :         }
    6075           0 :         blob = ndr_push_blob(push);
    6076           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    6077           0 :         TALLOC_FREE(push);
    6078           0 :         return ret;
    6079             : }
    6080             : 
    6081           0 : static PyObject *py_wbint_AllocateGid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6082             : {
    6083           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6084           0 :         PyObject *bigendian_obj = NULL;
    6085           0 :         PyObject *ndr64_obj = NULL;
    6086           0 :         uint32_t ndr_push_flags = 0;
    6087             : 
    6088           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    6089             :                 discard_const_p(char *, kwnames),
    6090             :                 &bigendian_obj,
    6091             :                 &ndr64_obj)) {
    6092           0 :                 return NULL;
    6093             :         }
    6094             : 
    6095           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6096           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6097             :         }
    6098           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6099           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6100             :         }
    6101             : 
    6102           0 :         return py_wbint_AllocateGid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    6103             : }
    6104             : 
    6105           0 : static PyObject *py_wbint_AllocateGid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6106             : {
    6107           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6108           0 :         PyObject *bigendian_obj = NULL;
    6109           0 :         PyObject *ndr64_obj = NULL;
    6110           0 :         uint32_t ndr_push_flags = 0;
    6111             : 
    6112           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    6113             :                 discard_const_p(char *, kwnames),
    6114             :                 &bigendian_obj,
    6115             :                 &ndr64_obj)) {
    6116           0 :                 return NULL;
    6117             :         }
    6118             : 
    6119           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6120           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6121             :         }
    6122           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6123           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6124             :         }
    6125             : 
    6126           0 :         return py_wbint_AllocateGid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    6127             : }
    6128             : 
    6129           0 : static PyObject *py_wbint_AllocateGid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    6130             : {
    6131           0 :         const struct ndr_interface_call *call = NULL;
    6132           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj);
    6133           0 :         struct ndr_pull *pull = NULL;
    6134             :         enum ndr_err_code err;
    6135             : 
    6136           0 :         if (ndr_table_winbind.num_calls < 8) {
    6137           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateGid_ndr_unpack");
    6138           0 :                 return NULL;
    6139             :         }
    6140           0 :         call = &ndr_table_winbind.calls[7];
    6141             : 
    6142           0 :         pull = ndr_pull_init_blob(blob, object);
    6143           0 :         if (pull == NULL) {
    6144           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6145           0 :                 return NULL;
    6146             :         }
    6147             : 
    6148           0 :         pull->flags |= ndr_pull_flags;
    6149             : 
    6150           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    6151           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6152           0 :                 TALLOC_FREE(pull);
    6153           0 :                 PyErr_SetNdrError(err);
    6154           0 :                 return NULL;
    6155             :         }
    6156           0 :         if (!allow_remaining) {
    6157             :                 uint32_t highest_ofs;
    6158             : 
    6159           0 :                 if (pull->offset > pull->relative_highest_offset) {
    6160           0 :                         highest_ofs = pull->offset;
    6161             :                 } else {
    6162           0 :                         highest_ofs = pull->relative_highest_offset;
    6163             :                 }
    6164           0 :                 if (highest_ofs < pull->data_size) {
    6165           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    6166             :                                 "not all bytes consumed ofs[%u] size[%u]",
    6167             :                                 highest_ofs, pull->data_size);
    6168           0 :                         TALLOC_FREE(pull);
    6169           0 :                         PyErr_SetNdrError(err);
    6170           0 :                         return NULL;
    6171             :                 }
    6172             :         }
    6173             : 
    6174           0 :         TALLOC_FREE(pull);
    6175           0 :         Py_RETURN_NONE;
    6176             : }
    6177             : 
    6178           0 : static PyObject *py_wbint_AllocateGid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6179             : {
    6180             :         DATA_BLOB blob;
    6181           0 :         Py_ssize_t blob_length = 0;
    6182           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6183           0 :         PyObject *bigendian_obj = NULL;
    6184           0 :         PyObject *ndr64_obj = NULL;
    6185           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6186           0 :         PyObject *allow_remaining_obj = NULL;
    6187           0 :         bool allow_remaining = false;
    6188             : 
    6189           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    6190             :                 discard_const_p(char *, kwnames),
    6191             :                 &blob.data, &blob_length,
    6192             :                 &bigendian_obj,
    6193             :                 &ndr64_obj,
    6194             :                 &allow_remaining_obj)) {
    6195           0 :                 return NULL;
    6196             :         }
    6197           0 :         blob.length = blob_length;
    6198             : 
    6199           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6200           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6201             :         }
    6202           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6203           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6204             :         }
    6205             : 
    6206           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6207           0 :                 allow_remaining = true;
    6208             :         }
    6209             : 
    6210           0 :         return py_wbint_AllocateGid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    6211             : }
    6212             : 
    6213           0 : static PyObject *py_wbint_AllocateGid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6214             : {
    6215             :         DATA_BLOB blob;
    6216           0 :         Py_ssize_t blob_length = 0;
    6217           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6218           0 :         PyObject *bigendian_obj = NULL;
    6219           0 :         PyObject *ndr64_obj = NULL;
    6220           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6221           0 :         PyObject *allow_remaining_obj = NULL;
    6222           0 :         bool allow_remaining = false;
    6223             : 
    6224           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    6225             :                 discard_const_p(char *, kwnames),
    6226             :                 &blob.data, &blob_length,
    6227             :                 &bigendian_obj,
    6228             :                 &ndr64_obj,
    6229             :                 &allow_remaining_obj)) {
    6230           0 :                 return NULL;
    6231             :         }
    6232           0 :         blob.length = blob_length;
    6233             : 
    6234           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6235           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6236             :         }
    6237           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6238           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6239             :         }
    6240             : 
    6241           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6242           0 :                 allow_remaining = true;
    6243             :         }
    6244             : 
    6245           0 :         return py_wbint_AllocateGid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    6246             : }
    6247             : 
    6248           0 : static PyObject *py_wbint_AllocateGid_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    6249             : {
    6250           0 :         const struct ndr_interface_call *call = NULL;
    6251           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj);
    6252             :         PyObject *ret;
    6253             :         char *retstr;
    6254             : 
    6255           0 :         if (ndr_table_winbind.num_calls < 8) {
    6256           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateGid_ndr_print");
    6257           0 :                 return NULL;
    6258             :         }
    6259           0 :         call = &ndr_table_winbind.calls[7];
    6260             : 
    6261           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    6262           0 :         ret = PyUnicode_FromString(retstr);
    6263           0 :         TALLOC_FREE(retstr);
    6264             : 
    6265           0 :         return ret;
    6266             : }
    6267             : 
    6268           0 : static PyObject *py_wbint_AllocateGid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6269             : {
    6270           0 :         return py_wbint_AllocateGid_ndr_print(py_obj, "wbint_AllocateGid_in", NDR_IN);
    6271             : }
    6272             : 
    6273           0 : static PyObject *py_wbint_AllocateGid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6274             : {
    6275           0 :         return py_wbint_AllocateGid_ndr_print(py_obj, "wbint_AllocateGid_out", NDR_OUT);
    6276             : }
    6277             : 
    6278             : static PyMethodDef py_wbint_AllocateGid_methods[] = {
    6279             :         { "opnum", (PyCFunction)py_wbint_AllocateGid_ndr_opnum, METH_NOARGS|METH_CLASS,
    6280             :                 "winbind.wbint_AllocateGid.opnum() -> 7 (0x07) " },
    6281             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    6282             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    6283             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    6284             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    6285             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    6286             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    6287             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    6288             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    6289             :         { "__ndr_print_in__", (PyCFunction)py_wbint_AllocateGid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    6290             :         { "__ndr_print_out__", (PyCFunction)py_wbint_AllocateGid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    6291             :         { NULL, NULL, 0, NULL }
    6292             : };
    6293             : 
    6294             : 
    6295             : static PyTypeObject wbint_AllocateGid_Type = {
    6296             :         PyVarObject_HEAD_INIT(NULL, 0)
    6297             :         .tp_name = "winbind.wbint_AllocateGid",
    6298             :         .tp_getset = py_wbint_AllocateGid_getsetters,
    6299             :         .tp_methods = py_wbint_AllocateGid_methods,
    6300             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6301             :         .tp_new = py_wbint_AllocateGid_new,
    6302             : };
    6303             : 
    6304           0 : static bool pack_py_wbint_AllocateGid_args_in(PyObject *args, PyObject *kwargs, struct wbint_AllocateGid *r)
    6305             : {
    6306           0 :         const char *kwnames[] = {
    6307             :                 NULL
    6308             :         };
    6309             : 
    6310           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_AllocateGid", discard_const_p(char *, kwnames))) {
    6311           0 :                 return false;
    6312             :         }
    6313             : 
    6314           0 :         return true;
    6315             : }
    6316             : 
    6317           0 : static PyObject *unpack_py_wbint_AllocateGid_args_out(struct wbint_AllocateGid *r)
    6318             : {
    6319             :         PyObject *result;
    6320             :         PyObject *py_gid;
    6321           0 :         py_gid = PyLong_FromUnsignedLongLong(*r->out.gid);
    6322           0 :         result = py_gid;
    6323           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    6324           0 :                 PyErr_SetNTSTATUS(r->out.result);
    6325           0 :                 return NULL;
    6326             :         }
    6327             : 
    6328           0 :         return result;
    6329             : }
    6330             : 
    6331             : 
    6332           0 : static PyObject *py_wbint_GetNssInfo_in_get_info(PyObject *obj, void *closure)
    6333             : {
    6334           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(obj);
    6335             :         PyObject *py_info;
    6336           0 :         if (object->in.info == NULL) {
    6337           0 :                 Py_RETURN_NONE;
    6338             :         }
    6339           0 :         py_info = pytalloc_reference_ex(&wbint_userinfo_Type, object->in.info, object->in.info);
    6340           0 :         return py_info;
    6341             : }
    6342             : 
    6343           0 : static int py_wbint_GetNssInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
    6344             : {
    6345           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj);
    6346           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
    6347           0 :         if (value == NULL) {
    6348           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
    6349           0 :                 return -1;
    6350             :         }
    6351           0 :         object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
    6352           0 :         if (object->in.info == NULL) {
    6353           0 :                 PyErr_NoMemory();
    6354           0 :                 return -1;
    6355             :         }
    6356           0 :         PY_CHECK_TYPE(&wbint_userinfo_Type, value, return -1;);
    6357           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    6358           0 :                 PyErr_NoMemory();
    6359           0 :                 return -1;
    6360             :         }
    6361           0 :         object->in.info = (struct wbint_userinfo *)pytalloc_get_ptr(value);
    6362           0 :         return 0;
    6363             : }
    6364             : 
    6365           0 : static PyObject *py_wbint_GetNssInfo_out_get_info(PyObject *obj, void *closure)
    6366             : {
    6367           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(obj);
    6368             :         PyObject *py_info;
    6369           0 :         if (object->out.info == NULL) {
    6370           0 :                 Py_RETURN_NONE;
    6371             :         }
    6372           0 :         py_info = pytalloc_reference_ex(&wbint_userinfo_Type, object->out.info, object->out.info);
    6373           0 :         return py_info;
    6374             : }
    6375             : 
    6376           0 : static int py_wbint_GetNssInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
    6377             : {
    6378           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj);
    6379           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
    6380           0 :         if (value == NULL) {
    6381           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
    6382           0 :                 return -1;
    6383             :         }
    6384           0 :         object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
    6385           0 :         if (object->out.info == NULL) {
    6386           0 :                 PyErr_NoMemory();
    6387           0 :                 return -1;
    6388             :         }
    6389           0 :         PY_CHECK_TYPE(&wbint_userinfo_Type, value, return -1;);
    6390           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    6391           0 :                 PyErr_NoMemory();
    6392           0 :                 return -1;
    6393             :         }
    6394           0 :         object->out.info = (struct wbint_userinfo *)pytalloc_get_ptr(value);
    6395           0 :         return 0;
    6396             : }
    6397             : 
    6398           0 : static PyObject *py_wbint_GetNssInfo_get_result(PyObject *obj, void *closure)
    6399             : {
    6400           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(obj);
    6401             :         PyObject *py_result;
    6402           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    6403           0 :         return py_result;
    6404             : }
    6405             : 
    6406           0 : static int py_wbint_GetNssInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
    6407             : {
    6408           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj);
    6409           0 :         if (value == NULL) {
    6410           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    6411           0 :                 return -1;
    6412             :         }
    6413           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    6414           0 :         return 0;
    6415             : }
    6416             : 
    6417             : static PyGetSetDef py_wbint_GetNssInfo_getsetters[] = {
    6418             :         {
    6419             :                 .name = discard_const_p(char, "in_info"),
    6420             :                 .get = py_wbint_GetNssInfo_in_get_info,
    6421             :                 .set = py_wbint_GetNssInfo_in_set_info,
    6422             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_userinfo")
    6423             :         },
    6424             :         {
    6425             :                 .name = discard_const_p(char, "out_info"),
    6426             :                 .get = py_wbint_GetNssInfo_out_get_info,
    6427             :                 .set = py_wbint_GetNssInfo_out_set_info,
    6428             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_userinfo")
    6429             :         },
    6430             :         {
    6431             :                 .name = discard_const_p(char, "result"),
    6432             :                 .get = py_wbint_GetNssInfo_get_result,
    6433             :                 .set = py_wbint_GetNssInfo_set_result,
    6434             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    6435             :         },
    6436             :         { .name = NULL }
    6437             : };
    6438             : 
    6439           0 : static PyObject *py_wbint_GetNssInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6440             : {
    6441           0 :         PyObject *self = pytalloc_new(struct wbint_GetNssInfo, type);
    6442           0 :         struct wbint_GetNssInfo *_self = (struct wbint_GetNssInfo *)pytalloc_get_ptr(self);
    6443           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    6444           0 :         _self->in.info = talloc_zero(mem_ctx, struct wbint_userinfo);
    6445           0 :         _self->out.info = talloc_zero(mem_ctx, struct wbint_userinfo);
    6446           0 :         return self;
    6447             : }
    6448             : 
    6449           0 : static PyObject *py_wbint_GetNssInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    6450             : {
    6451             : 
    6452             : 
    6453           0 :         return PyLong_FromLong(8);
    6454             : }
    6455             : 
    6456           0 : static PyObject *py_wbint_GetNssInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    6457             : {
    6458           0 :         const struct ndr_interface_call *call = NULL;
    6459           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj);
    6460           0 :         PyObject *ret = NULL;
    6461           0 :         struct ndr_push *push = NULL;
    6462             :         DATA_BLOB blob;
    6463             :         enum ndr_err_code err;
    6464             : 
    6465           0 :         if (ndr_table_winbind.num_calls < 9) {
    6466           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_GetNssInfo_ndr_pack");
    6467           0 :                 return NULL;
    6468             :         }
    6469           0 :         call = &ndr_table_winbind.calls[8];
    6470             : 
    6471           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    6472           0 :         if (push == NULL) {
    6473           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6474           0 :                 return NULL;
    6475             :         }
    6476             : 
    6477           0 :         push->flags |= ndr_push_flags;
    6478             : 
    6479           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    6480           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6481           0 :                 TALLOC_FREE(push);
    6482           0 :                 PyErr_SetNdrError(err);
    6483           0 :                 return NULL;
    6484             :         }
    6485           0 :         blob = ndr_push_blob(push);
    6486           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    6487           0 :         TALLOC_FREE(push);
    6488           0 :         return ret;
    6489             : }
    6490             : 
    6491           0 : static PyObject *py_wbint_GetNssInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6492             : {
    6493           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6494           0 :         PyObject *bigendian_obj = NULL;
    6495           0 :         PyObject *ndr64_obj = NULL;
    6496           0 :         uint32_t ndr_push_flags = 0;
    6497             : 
    6498           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    6499             :                 discard_const_p(char *, kwnames),
    6500             :                 &bigendian_obj,
    6501             :                 &ndr64_obj)) {
    6502           0 :                 return NULL;
    6503             :         }
    6504             : 
    6505           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6506           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6507             :         }
    6508           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6509           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6510             :         }
    6511             : 
    6512           0 :         return py_wbint_GetNssInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    6513             : }
    6514             : 
    6515           0 : static PyObject *py_wbint_GetNssInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6516             : {
    6517           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6518           0 :         PyObject *bigendian_obj = NULL;
    6519           0 :         PyObject *ndr64_obj = NULL;
    6520           0 :         uint32_t ndr_push_flags = 0;
    6521             : 
    6522           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    6523             :                 discard_const_p(char *, kwnames),
    6524             :                 &bigendian_obj,
    6525             :                 &ndr64_obj)) {
    6526           0 :                 return NULL;
    6527             :         }
    6528             : 
    6529           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6530           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6531             :         }
    6532           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6533           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6534             :         }
    6535             : 
    6536           0 :         return py_wbint_GetNssInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    6537             : }
    6538             : 
    6539           0 : static PyObject *py_wbint_GetNssInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    6540             : {
    6541           0 :         const struct ndr_interface_call *call = NULL;
    6542           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj);
    6543           0 :         struct ndr_pull *pull = NULL;
    6544             :         enum ndr_err_code err;
    6545             : 
    6546           0 :         if (ndr_table_winbind.num_calls < 9) {
    6547           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_GetNssInfo_ndr_unpack");
    6548           0 :                 return NULL;
    6549             :         }
    6550           0 :         call = &ndr_table_winbind.calls[8];
    6551             : 
    6552           0 :         pull = ndr_pull_init_blob(blob, object);
    6553           0 :         if (pull == NULL) {
    6554           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6555           0 :                 return NULL;
    6556             :         }
    6557             : 
    6558           0 :         pull->flags |= ndr_pull_flags;
    6559             : 
    6560           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    6561           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6562           0 :                 TALLOC_FREE(pull);
    6563           0 :                 PyErr_SetNdrError(err);
    6564           0 :                 return NULL;
    6565             :         }
    6566           0 :         if (!allow_remaining) {
    6567             :                 uint32_t highest_ofs;
    6568             : 
    6569           0 :                 if (pull->offset > pull->relative_highest_offset) {
    6570           0 :                         highest_ofs = pull->offset;
    6571             :                 } else {
    6572           0 :                         highest_ofs = pull->relative_highest_offset;
    6573             :                 }
    6574           0 :                 if (highest_ofs < pull->data_size) {
    6575           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    6576             :                                 "not all bytes consumed ofs[%u] size[%u]",
    6577             :                                 highest_ofs, pull->data_size);
    6578           0 :                         TALLOC_FREE(pull);
    6579           0 :                         PyErr_SetNdrError(err);
    6580           0 :                         return NULL;
    6581             :                 }
    6582             :         }
    6583             : 
    6584           0 :         TALLOC_FREE(pull);
    6585           0 :         Py_RETURN_NONE;
    6586             : }
    6587             : 
    6588           0 : static PyObject *py_wbint_GetNssInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6589             : {
    6590             :         DATA_BLOB blob;
    6591           0 :         Py_ssize_t blob_length = 0;
    6592           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6593           0 :         PyObject *bigendian_obj = NULL;
    6594           0 :         PyObject *ndr64_obj = NULL;
    6595           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6596           0 :         PyObject *allow_remaining_obj = NULL;
    6597           0 :         bool allow_remaining = false;
    6598             : 
    6599           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    6600             :                 discard_const_p(char *, kwnames),
    6601             :                 &blob.data, &blob_length,
    6602             :                 &bigendian_obj,
    6603             :                 &ndr64_obj,
    6604             :                 &allow_remaining_obj)) {
    6605           0 :                 return NULL;
    6606             :         }
    6607           0 :         blob.length = blob_length;
    6608             : 
    6609           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6610           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6611             :         }
    6612           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6613           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6614             :         }
    6615             : 
    6616           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6617           0 :                 allow_remaining = true;
    6618             :         }
    6619             : 
    6620           0 :         return py_wbint_GetNssInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    6621             : }
    6622             : 
    6623           0 : static PyObject *py_wbint_GetNssInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6624             : {
    6625             :         DATA_BLOB blob;
    6626           0 :         Py_ssize_t blob_length = 0;
    6627           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6628           0 :         PyObject *bigendian_obj = NULL;
    6629           0 :         PyObject *ndr64_obj = NULL;
    6630           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6631           0 :         PyObject *allow_remaining_obj = NULL;
    6632           0 :         bool allow_remaining = false;
    6633             : 
    6634           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    6635             :                 discard_const_p(char *, kwnames),
    6636             :                 &blob.data, &blob_length,
    6637             :                 &bigendian_obj,
    6638             :                 &ndr64_obj,
    6639             :                 &allow_remaining_obj)) {
    6640           0 :                 return NULL;
    6641             :         }
    6642           0 :         blob.length = blob_length;
    6643             : 
    6644           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6645           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6646             :         }
    6647           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6648           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6649             :         }
    6650             : 
    6651           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6652           0 :                 allow_remaining = true;
    6653             :         }
    6654             : 
    6655           0 :         return py_wbint_GetNssInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    6656             : }
    6657             : 
    6658           0 : static PyObject *py_wbint_GetNssInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    6659             : {
    6660           0 :         const struct ndr_interface_call *call = NULL;
    6661           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj);
    6662             :         PyObject *ret;
    6663             :         char *retstr;
    6664             : 
    6665           0 :         if (ndr_table_winbind.num_calls < 9) {
    6666           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_GetNssInfo_ndr_print");
    6667           0 :                 return NULL;
    6668             :         }
    6669           0 :         call = &ndr_table_winbind.calls[8];
    6670             : 
    6671           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    6672           0 :         ret = PyUnicode_FromString(retstr);
    6673           0 :         TALLOC_FREE(retstr);
    6674             : 
    6675           0 :         return ret;
    6676             : }
    6677             : 
    6678           0 : static PyObject *py_wbint_GetNssInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6679             : {
    6680           0 :         return py_wbint_GetNssInfo_ndr_print(py_obj, "wbint_GetNssInfo_in", NDR_IN);
    6681             : }
    6682             : 
    6683           0 : static PyObject *py_wbint_GetNssInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6684             : {
    6685           0 :         return py_wbint_GetNssInfo_ndr_print(py_obj, "wbint_GetNssInfo_out", NDR_OUT);
    6686             : }
    6687             : 
    6688             : static PyMethodDef py_wbint_GetNssInfo_methods[] = {
    6689             :         { "opnum", (PyCFunction)py_wbint_GetNssInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
    6690             :                 "winbind.wbint_GetNssInfo.opnum() -> 8 (0x08) " },
    6691             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    6692             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    6693             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    6694             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    6695             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    6696             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    6697             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    6698             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    6699             :         { "__ndr_print_in__", (PyCFunction)py_wbint_GetNssInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    6700             :         { "__ndr_print_out__", (PyCFunction)py_wbint_GetNssInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    6701             :         { NULL, NULL, 0, NULL }
    6702             : };
    6703             : 
    6704             : 
    6705             : static PyTypeObject wbint_GetNssInfo_Type = {
    6706             :         PyVarObject_HEAD_INIT(NULL, 0)
    6707             :         .tp_name = "winbind.wbint_GetNssInfo",
    6708             :         .tp_getset = py_wbint_GetNssInfo_getsetters,
    6709             :         .tp_methods = py_wbint_GetNssInfo_methods,
    6710             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6711             :         .tp_new = py_wbint_GetNssInfo_new,
    6712             : };
    6713             : 
    6714           0 : static bool pack_py_wbint_GetNssInfo_args_in(PyObject *args, PyObject *kwargs, struct wbint_GetNssInfo *r)
    6715             : {
    6716             :         PyObject *py_info;
    6717           0 :         const char *kwnames[] = {
    6718             :                 "info", NULL
    6719             :         };
    6720             : 
    6721           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_GetNssInfo", discard_const_p(char *, kwnames), &py_info)) {
    6722           0 :                 return false;
    6723             :         }
    6724             : 
    6725           0 :         if (py_info == NULL) {
    6726           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
    6727           0 :                 return false;
    6728             :         }
    6729           0 :         r->in.info = talloc_ptrtype(r, r->in.info);
    6730           0 :         if (r->in.info == NULL) {
    6731           0 :                 PyErr_NoMemory();
    6732           0 :                 return false;
    6733             :         }
    6734           0 :         PY_CHECK_TYPE(&wbint_userinfo_Type, py_info, return false;);
    6735           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
    6736           0 :                 PyErr_NoMemory();
    6737           0 :                 return false;
    6738             :         }
    6739           0 :         r->in.info = (struct wbint_userinfo *)pytalloc_get_ptr(py_info);
    6740           0 :         return true;
    6741             : }
    6742             : 
    6743           0 : static PyObject *unpack_py_wbint_GetNssInfo_args_out(struct wbint_GetNssInfo *r)
    6744             : {
    6745             :         PyObject *result;
    6746             :         PyObject *py_info;
    6747           0 :         py_info = pytalloc_reference_ex(&wbint_userinfo_Type, r->out.info, r->out.info);
    6748           0 :         result = py_info;
    6749           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    6750           0 :                 PyErr_SetNTSTATUS(r->out.result);
    6751           0 :                 return NULL;
    6752             :         }
    6753             : 
    6754           0 :         return result;
    6755             : }
    6756             : 
    6757             : 
    6758           0 : static PyObject *py_wbint_LookupUserAliases_in_get_sids(PyObject *obj, void *closure)
    6759             : {
    6760           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(obj);
    6761             :         PyObject *py_sids;
    6762           0 :         if (object->in.sids == NULL) {
    6763           0 :                 Py_RETURN_NONE;
    6764             :         }
    6765           0 :         py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, object->in.sids, object->in.sids);
    6766           0 :         return py_sids;
    6767             : }
    6768             : 
    6769           0 : static int py_wbint_LookupUserAliases_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
    6770             : {
    6771           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj);
    6772           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
    6773           0 :         if (value == NULL) {
    6774           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
    6775           0 :                 return -1;
    6776             :         }
    6777           0 :         object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
    6778           0 :         if (object->in.sids == NULL) {
    6779           0 :                 PyErr_NoMemory();
    6780           0 :                 return -1;
    6781             :         }
    6782           0 :         PY_CHECK_TYPE(&wbint_SidArray_Type, value, return -1;);
    6783           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    6784           0 :                 PyErr_NoMemory();
    6785           0 :                 return -1;
    6786             :         }
    6787           0 :         object->in.sids = (struct wbint_SidArray *)pytalloc_get_ptr(value);
    6788           0 :         return 0;
    6789             : }
    6790             : 
    6791           0 : static PyObject *py_wbint_LookupUserAliases_out_get_rids(PyObject *obj, void *closure)
    6792             : {
    6793           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(obj);
    6794             :         PyObject *py_rids;
    6795           0 :         if (object->out.rids == NULL) {
    6796           0 :                 Py_RETURN_NONE;
    6797             :         }
    6798           0 :         py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, object->out.rids, object->out.rids);
    6799           0 :         return py_rids;
    6800             : }
    6801             : 
    6802           0 : static int py_wbint_LookupUserAliases_out_set_rids(PyObject *py_obj, PyObject *value, void *closure)
    6803             : {
    6804           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj);
    6805           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids));
    6806           0 :         if (value == NULL) {
    6807           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids");
    6808           0 :                 return -1;
    6809             :         }
    6810           0 :         object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids);
    6811           0 :         if (object->out.rids == NULL) {
    6812           0 :                 PyErr_NoMemory();
    6813           0 :                 return -1;
    6814             :         }
    6815           0 :         PY_CHECK_TYPE(&wbint_RidArray_Type, value, return -1;);
    6816           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    6817           0 :                 PyErr_NoMemory();
    6818           0 :                 return -1;
    6819             :         }
    6820           0 :         object->out.rids = (struct wbint_RidArray *)pytalloc_get_ptr(value);
    6821           0 :         return 0;
    6822             : }
    6823             : 
    6824           0 : static PyObject *py_wbint_LookupUserAliases_get_result(PyObject *obj, void *closure)
    6825             : {
    6826           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(obj);
    6827             :         PyObject *py_result;
    6828           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    6829           0 :         return py_result;
    6830             : }
    6831             : 
    6832           0 : static int py_wbint_LookupUserAliases_set_result(PyObject *py_obj, PyObject *value, void *closure)
    6833             : {
    6834           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj);
    6835           0 :         if (value == NULL) {
    6836           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    6837           0 :                 return -1;
    6838             :         }
    6839           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    6840           0 :         return 0;
    6841             : }
    6842             : 
    6843             : static PyGetSetDef py_wbint_LookupUserAliases_getsetters[] = {
    6844             :         {
    6845             :                 .name = discard_const_p(char, "in_sids"),
    6846             :                 .get = py_wbint_LookupUserAliases_in_get_sids,
    6847             :                 .set = py_wbint_LookupUserAliases_in_set_sids,
    6848             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_SidArray")
    6849             :         },
    6850             :         {
    6851             :                 .name = discard_const_p(char, "out_rids"),
    6852             :                 .get = py_wbint_LookupUserAliases_out_get_rids,
    6853             :                 .set = py_wbint_LookupUserAliases_out_set_rids,
    6854             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_RidArray")
    6855             :         },
    6856             :         {
    6857             :                 .name = discard_const_p(char, "result"),
    6858             :                 .get = py_wbint_LookupUserAliases_get_result,
    6859             :                 .set = py_wbint_LookupUserAliases_set_result,
    6860             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    6861             :         },
    6862             :         { .name = NULL }
    6863             : };
    6864             : 
    6865           0 : static PyObject *py_wbint_LookupUserAliases_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6866             : {
    6867           0 :         PyObject *self = pytalloc_new(struct wbint_LookupUserAliases, type);
    6868           0 :         struct wbint_LookupUserAliases *_self = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(self);
    6869           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    6870           0 :         _self->in.sids = talloc_zero(mem_ctx, struct wbint_SidArray);
    6871           0 :         _self->out.rids = talloc_zero(mem_ctx, struct wbint_RidArray);
    6872           0 :         return self;
    6873             : }
    6874             : 
    6875           0 : static PyObject *py_wbint_LookupUserAliases_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    6876             : {
    6877             : 
    6878             : 
    6879           0 :         return PyLong_FromLong(9);
    6880             : }
    6881             : 
    6882           0 : static PyObject *py_wbint_LookupUserAliases_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    6883             : {
    6884           0 :         const struct ndr_interface_call *call = NULL;
    6885           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj);
    6886           0 :         PyObject *ret = NULL;
    6887           0 :         struct ndr_push *push = NULL;
    6888             :         DATA_BLOB blob;
    6889             :         enum ndr_err_code err;
    6890             : 
    6891           0 :         if (ndr_table_winbind.num_calls < 10) {
    6892           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserAliases_ndr_pack");
    6893           0 :                 return NULL;
    6894             :         }
    6895           0 :         call = &ndr_table_winbind.calls[9];
    6896             : 
    6897           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    6898           0 :         if (push == NULL) {
    6899           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6900           0 :                 return NULL;
    6901             :         }
    6902             : 
    6903           0 :         push->flags |= ndr_push_flags;
    6904             : 
    6905           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    6906           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6907           0 :                 TALLOC_FREE(push);
    6908           0 :                 PyErr_SetNdrError(err);
    6909           0 :                 return NULL;
    6910             :         }
    6911           0 :         blob = ndr_push_blob(push);
    6912           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    6913           0 :         TALLOC_FREE(push);
    6914           0 :         return ret;
    6915             : }
    6916             : 
    6917           0 : static PyObject *py_wbint_LookupUserAliases_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6918             : {
    6919           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6920           0 :         PyObject *bigendian_obj = NULL;
    6921           0 :         PyObject *ndr64_obj = NULL;
    6922           0 :         uint32_t ndr_push_flags = 0;
    6923             : 
    6924           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    6925             :                 discard_const_p(char *, kwnames),
    6926             :                 &bigendian_obj,
    6927             :                 &ndr64_obj)) {
    6928           0 :                 return NULL;
    6929             :         }
    6930             : 
    6931           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6932           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6933             :         }
    6934           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6935           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6936             :         }
    6937             : 
    6938           0 :         return py_wbint_LookupUserAliases_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    6939             : }
    6940             : 
    6941           0 : static PyObject *py_wbint_LookupUserAliases_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6942             : {
    6943           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6944           0 :         PyObject *bigendian_obj = NULL;
    6945           0 :         PyObject *ndr64_obj = NULL;
    6946           0 :         uint32_t ndr_push_flags = 0;
    6947             : 
    6948           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    6949             :                 discard_const_p(char *, kwnames),
    6950             :                 &bigendian_obj,
    6951             :                 &ndr64_obj)) {
    6952           0 :                 return NULL;
    6953             :         }
    6954             : 
    6955           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6956           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6957             :         }
    6958           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6959           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6960             :         }
    6961             : 
    6962           0 :         return py_wbint_LookupUserAliases_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    6963             : }
    6964             : 
    6965           0 : static PyObject *py_wbint_LookupUserAliases_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    6966             : {
    6967           0 :         const struct ndr_interface_call *call = NULL;
    6968           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj);
    6969           0 :         struct ndr_pull *pull = NULL;
    6970             :         enum ndr_err_code err;
    6971             : 
    6972           0 :         if (ndr_table_winbind.num_calls < 10) {
    6973           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserAliases_ndr_unpack");
    6974           0 :                 return NULL;
    6975             :         }
    6976           0 :         call = &ndr_table_winbind.calls[9];
    6977             : 
    6978           0 :         pull = ndr_pull_init_blob(blob, object);
    6979           0 :         if (pull == NULL) {
    6980           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6981           0 :                 return NULL;
    6982             :         }
    6983             : 
    6984           0 :         pull->flags |= ndr_pull_flags;
    6985             : 
    6986           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    6987           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6988           0 :                 TALLOC_FREE(pull);
    6989           0 :                 PyErr_SetNdrError(err);
    6990           0 :                 return NULL;
    6991             :         }
    6992           0 :         if (!allow_remaining) {
    6993             :                 uint32_t highest_ofs;
    6994             : 
    6995           0 :                 if (pull->offset > pull->relative_highest_offset) {
    6996           0 :                         highest_ofs = pull->offset;
    6997             :                 } else {
    6998           0 :                         highest_ofs = pull->relative_highest_offset;
    6999             :                 }
    7000           0 :                 if (highest_ofs < pull->data_size) {
    7001           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    7002             :                                 "not all bytes consumed ofs[%u] size[%u]",
    7003             :                                 highest_ofs, pull->data_size);
    7004           0 :                         TALLOC_FREE(pull);
    7005           0 :                         PyErr_SetNdrError(err);
    7006           0 :                         return NULL;
    7007             :                 }
    7008             :         }
    7009             : 
    7010           0 :         TALLOC_FREE(pull);
    7011           0 :         Py_RETURN_NONE;
    7012             : }
    7013             : 
    7014           0 : static PyObject *py_wbint_LookupUserAliases_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7015             : {
    7016             :         DATA_BLOB blob;
    7017           0 :         Py_ssize_t blob_length = 0;
    7018           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    7019           0 :         PyObject *bigendian_obj = NULL;
    7020           0 :         PyObject *ndr64_obj = NULL;
    7021           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    7022           0 :         PyObject *allow_remaining_obj = NULL;
    7023           0 :         bool allow_remaining = false;
    7024             : 
    7025           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    7026             :                 discard_const_p(char *, kwnames),
    7027             :                 &blob.data, &blob_length,
    7028             :                 &bigendian_obj,
    7029             :                 &ndr64_obj,
    7030             :                 &allow_remaining_obj)) {
    7031           0 :                 return NULL;
    7032             :         }
    7033           0 :         blob.length = blob_length;
    7034             : 
    7035           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7036           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    7037             :         }
    7038           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7039           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    7040             :         }
    7041             : 
    7042           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    7043           0 :                 allow_remaining = true;
    7044             :         }
    7045             : 
    7046           0 :         return py_wbint_LookupUserAliases_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    7047             : }
    7048             : 
    7049           0 : static PyObject *py_wbint_LookupUserAliases_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7050             : {
    7051             :         DATA_BLOB blob;
    7052           0 :         Py_ssize_t blob_length = 0;
    7053           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    7054           0 :         PyObject *bigendian_obj = NULL;
    7055           0 :         PyObject *ndr64_obj = NULL;
    7056           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    7057           0 :         PyObject *allow_remaining_obj = NULL;
    7058           0 :         bool allow_remaining = false;
    7059             : 
    7060           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    7061             :                 discard_const_p(char *, kwnames),
    7062             :                 &blob.data, &blob_length,
    7063             :                 &bigendian_obj,
    7064             :                 &ndr64_obj,
    7065             :                 &allow_remaining_obj)) {
    7066           0 :                 return NULL;
    7067             :         }
    7068           0 :         blob.length = blob_length;
    7069             : 
    7070           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7071           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    7072             :         }
    7073           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7074           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    7075             :         }
    7076             : 
    7077           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    7078           0 :                 allow_remaining = true;
    7079             :         }
    7080             : 
    7081           0 :         return py_wbint_LookupUserAliases_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    7082             : }
    7083             : 
    7084           0 : static PyObject *py_wbint_LookupUserAliases_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    7085             : {
    7086           0 :         const struct ndr_interface_call *call = NULL;
    7087           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj);
    7088             :         PyObject *ret;
    7089             :         char *retstr;
    7090             : 
    7091           0 :         if (ndr_table_winbind.num_calls < 10) {
    7092           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserAliases_ndr_print");
    7093           0 :                 return NULL;
    7094             :         }
    7095           0 :         call = &ndr_table_winbind.calls[9];
    7096             : 
    7097           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    7098           0 :         ret = PyUnicode_FromString(retstr);
    7099           0 :         TALLOC_FREE(retstr);
    7100             : 
    7101           0 :         return ret;
    7102             : }
    7103             : 
    7104           0 : static PyObject *py_wbint_LookupUserAliases_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7105             : {
    7106           0 :         return py_wbint_LookupUserAliases_ndr_print(py_obj, "wbint_LookupUserAliases_in", NDR_IN);
    7107             : }
    7108             : 
    7109           0 : static PyObject *py_wbint_LookupUserAliases_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7110             : {
    7111           0 :         return py_wbint_LookupUserAliases_ndr_print(py_obj, "wbint_LookupUserAliases_out", NDR_OUT);
    7112             : }
    7113             : 
    7114             : static PyMethodDef py_wbint_LookupUserAliases_methods[] = {
    7115             :         { "opnum", (PyCFunction)py_wbint_LookupUserAliases_ndr_opnum, METH_NOARGS|METH_CLASS,
    7116             :                 "winbind.wbint_LookupUserAliases.opnum() -> 9 (0x09) " },
    7117             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    7118             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    7119             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    7120             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    7121             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    7122             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    7123             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    7124             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    7125             :         { "__ndr_print_in__", (PyCFunction)py_wbint_LookupUserAliases_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    7126             :         { "__ndr_print_out__", (PyCFunction)py_wbint_LookupUserAliases_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    7127             :         { NULL, NULL, 0, NULL }
    7128             : };
    7129             : 
    7130             : 
    7131             : static PyTypeObject wbint_LookupUserAliases_Type = {
    7132             :         PyVarObject_HEAD_INIT(NULL, 0)
    7133             :         .tp_name = "winbind.wbint_LookupUserAliases",
    7134             :         .tp_getset = py_wbint_LookupUserAliases_getsetters,
    7135             :         .tp_methods = py_wbint_LookupUserAliases_methods,
    7136             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    7137             :         .tp_new = py_wbint_LookupUserAliases_new,
    7138             : };
    7139             : 
    7140           0 : static bool pack_py_wbint_LookupUserAliases_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupUserAliases *r)
    7141             : {
    7142             :         PyObject *py_sids;
    7143           0 :         const char *kwnames[] = {
    7144             :                 "sids", NULL
    7145             :         };
    7146             : 
    7147           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupUserAliases", discard_const_p(char *, kwnames), &py_sids)) {
    7148           0 :                 return false;
    7149             :         }
    7150             : 
    7151           0 :         if (py_sids == NULL) {
    7152           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
    7153           0 :                 return false;
    7154             :         }
    7155           0 :         r->in.sids = talloc_ptrtype(r, r->in.sids);
    7156           0 :         if (r->in.sids == NULL) {
    7157           0 :                 PyErr_NoMemory();
    7158           0 :                 return false;
    7159             :         }
    7160           0 :         PY_CHECK_TYPE(&wbint_SidArray_Type, py_sids, return false;);
    7161           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
    7162           0 :                 PyErr_NoMemory();
    7163           0 :                 return false;
    7164             :         }
    7165           0 :         r->in.sids = (struct wbint_SidArray *)pytalloc_get_ptr(py_sids);
    7166           0 :         return true;
    7167             : }
    7168             : 
    7169           0 : static PyObject *unpack_py_wbint_LookupUserAliases_args_out(struct wbint_LookupUserAliases *r)
    7170             : {
    7171             :         PyObject *result;
    7172             :         PyObject *py_rids;
    7173           0 :         py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, r->out.rids, r->out.rids);
    7174           0 :         result = py_rids;
    7175           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    7176           0 :                 PyErr_SetNTSTATUS(r->out.result);
    7177           0 :                 return NULL;
    7178             :         }
    7179             : 
    7180           0 :         return result;
    7181             : }
    7182             : 
    7183             : 
    7184           0 : static PyObject *py_wbint_LookupUserGroups_in_get_sid(PyObject *obj, void *closure)
    7185             : {
    7186           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(obj);
    7187             :         PyObject *py_sid;
    7188           0 :         if (object->in.sid == NULL) {
    7189           0 :                 Py_RETURN_NONE;
    7190             :         }
    7191           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
    7192           0 :         return py_sid;
    7193             : }
    7194             : 
    7195           0 : static int py_wbint_LookupUserGroups_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
    7196             : {
    7197           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj);
    7198           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
    7199           0 :         if (value == NULL) {
    7200           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
    7201           0 :                 return -1;
    7202             :         }
    7203           0 :         object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
    7204           0 :         if (object->in.sid == NULL) {
    7205           0 :                 PyErr_NoMemory();
    7206           0 :                 return -1;
    7207             :         }
    7208           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    7209           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    7210           0 :                 PyErr_NoMemory();
    7211           0 :                 return -1;
    7212             :         }
    7213           0 :         object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
    7214           0 :         return 0;
    7215             : }
    7216             : 
    7217           0 : static PyObject *py_wbint_LookupUserGroups_out_get_sids(PyObject *obj, void *closure)
    7218             : {
    7219           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(obj);
    7220             :         PyObject *py_sids;
    7221           0 :         if (object->out.sids == NULL) {
    7222           0 :                 Py_RETURN_NONE;
    7223             :         }
    7224           0 :         py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, object->out.sids, object->out.sids);
    7225           0 :         return py_sids;
    7226             : }
    7227             : 
    7228           0 : static int py_wbint_LookupUserGroups_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
    7229             : {
    7230           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj);
    7231           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
    7232           0 :         if (value == NULL) {
    7233           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
    7234           0 :                 return -1;
    7235             :         }
    7236           0 :         object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
    7237           0 :         if (object->out.sids == NULL) {
    7238           0 :                 PyErr_NoMemory();
    7239           0 :                 return -1;
    7240             :         }
    7241           0 :         PY_CHECK_TYPE(&wbint_SidArray_Type, value, return -1;);
    7242           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    7243           0 :                 PyErr_NoMemory();
    7244           0 :                 return -1;
    7245             :         }
    7246           0 :         object->out.sids = (struct wbint_SidArray *)pytalloc_get_ptr(value);
    7247           0 :         return 0;
    7248             : }
    7249             : 
    7250           0 : static PyObject *py_wbint_LookupUserGroups_get_result(PyObject *obj, void *closure)
    7251             : {
    7252           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(obj);
    7253             :         PyObject *py_result;
    7254           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    7255           0 :         return py_result;
    7256             : }
    7257             : 
    7258           0 : static int py_wbint_LookupUserGroups_set_result(PyObject *py_obj, PyObject *value, void *closure)
    7259             : {
    7260           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj);
    7261           0 :         if (value == NULL) {
    7262           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    7263           0 :                 return -1;
    7264             :         }
    7265           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    7266           0 :         return 0;
    7267             : }
    7268             : 
    7269             : static PyGetSetDef py_wbint_LookupUserGroups_getsetters[] = {
    7270             :         {
    7271             :                 .name = discard_const_p(char, "in_sid"),
    7272             :                 .get = py_wbint_LookupUserGroups_in_get_sid,
    7273             :                 .set = py_wbint_LookupUserGroups_in_set_sid,
    7274             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    7275             :         },
    7276             :         {
    7277             :                 .name = discard_const_p(char, "out_sids"),
    7278             :                 .get = py_wbint_LookupUserGroups_out_get_sids,
    7279             :                 .set = py_wbint_LookupUserGroups_out_set_sids,
    7280             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_SidArray")
    7281             :         },
    7282             :         {
    7283             :                 .name = discard_const_p(char, "result"),
    7284             :                 .get = py_wbint_LookupUserGroups_get_result,
    7285             :                 .set = py_wbint_LookupUserGroups_set_result,
    7286             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    7287             :         },
    7288             :         { .name = NULL }
    7289             : };
    7290             : 
    7291           0 : static PyObject *py_wbint_LookupUserGroups_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    7292             : {
    7293           0 :         PyObject *self = pytalloc_new(struct wbint_LookupUserGroups, type);
    7294           0 :         struct wbint_LookupUserGroups *_self = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(self);
    7295           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    7296           0 :         _self->in.sid = talloc_zero(mem_ctx, struct dom_sid);
    7297           0 :         _self->out.sids = talloc_zero(mem_ctx, struct wbint_SidArray);
    7298           0 :         return self;
    7299             : }
    7300             : 
    7301           0 : static PyObject *py_wbint_LookupUserGroups_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    7302             : {
    7303             : 
    7304             : 
    7305           0 :         return PyLong_FromLong(10);
    7306             : }
    7307             : 
    7308           0 : static PyObject *py_wbint_LookupUserGroups_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    7309             : {
    7310           0 :         const struct ndr_interface_call *call = NULL;
    7311           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj);
    7312           0 :         PyObject *ret = NULL;
    7313           0 :         struct ndr_push *push = NULL;
    7314             :         DATA_BLOB blob;
    7315             :         enum ndr_err_code err;
    7316             : 
    7317           0 :         if (ndr_table_winbind.num_calls < 11) {
    7318           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserGroups_ndr_pack");
    7319           0 :                 return NULL;
    7320             :         }
    7321           0 :         call = &ndr_table_winbind.calls[10];
    7322             : 
    7323           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    7324           0 :         if (push == NULL) {
    7325           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    7326           0 :                 return NULL;
    7327             :         }
    7328             : 
    7329           0 :         push->flags |= ndr_push_flags;
    7330             : 
    7331           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    7332           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    7333           0 :                 TALLOC_FREE(push);
    7334           0 :                 PyErr_SetNdrError(err);
    7335           0 :                 return NULL;
    7336             :         }
    7337           0 :         blob = ndr_push_blob(push);
    7338           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    7339           0 :         TALLOC_FREE(push);
    7340           0 :         return ret;
    7341             : }
    7342             : 
    7343           0 : static PyObject *py_wbint_LookupUserGroups_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7344             : {
    7345           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    7346           0 :         PyObject *bigendian_obj = NULL;
    7347           0 :         PyObject *ndr64_obj = NULL;
    7348           0 :         uint32_t ndr_push_flags = 0;
    7349             : 
    7350           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    7351             :                 discard_const_p(char *, kwnames),
    7352             :                 &bigendian_obj,
    7353             :                 &ndr64_obj)) {
    7354           0 :                 return NULL;
    7355             :         }
    7356             : 
    7357           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7358           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    7359             :         }
    7360           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7361           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    7362             :         }
    7363             : 
    7364           0 :         return py_wbint_LookupUserGroups_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    7365             : }
    7366             : 
    7367           0 : static PyObject *py_wbint_LookupUserGroups_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7368             : {
    7369           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    7370           0 :         PyObject *bigendian_obj = NULL;
    7371           0 :         PyObject *ndr64_obj = NULL;
    7372           0 :         uint32_t ndr_push_flags = 0;
    7373             : 
    7374           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    7375             :                 discard_const_p(char *, kwnames),
    7376             :                 &bigendian_obj,
    7377             :                 &ndr64_obj)) {
    7378           0 :                 return NULL;
    7379             :         }
    7380             : 
    7381           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7382           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    7383             :         }
    7384           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7385           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    7386             :         }
    7387             : 
    7388           0 :         return py_wbint_LookupUserGroups_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    7389             : }
    7390             : 
    7391           0 : static PyObject *py_wbint_LookupUserGroups_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    7392             : {
    7393           0 :         const struct ndr_interface_call *call = NULL;
    7394           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj);
    7395           0 :         struct ndr_pull *pull = NULL;
    7396             :         enum ndr_err_code err;
    7397             : 
    7398           0 :         if (ndr_table_winbind.num_calls < 11) {
    7399           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserGroups_ndr_unpack");
    7400           0 :                 return NULL;
    7401             :         }
    7402           0 :         call = &ndr_table_winbind.calls[10];
    7403             : 
    7404           0 :         pull = ndr_pull_init_blob(blob, object);
    7405           0 :         if (pull == NULL) {
    7406           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    7407           0 :                 return NULL;
    7408             :         }
    7409             : 
    7410           0 :         pull->flags |= ndr_pull_flags;
    7411             : 
    7412           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    7413           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    7414           0 :                 TALLOC_FREE(pull);
    7415           0 :                 PyErr_SetNdrError(err);
    7416           0 :                 return NULL;
    7417             :         }
    7418           0 :         if (!allow_remaining) {
    7419             :                 uint32_t highest_ofs;
    7420             : 
    7421           0 :                 if (pull->offset > pull->relative_highest_offset) {
    7422           0 :                         highest_ofs = pull->offset;
    7423             :                 } else {
    7424           0 :                         highest_ofs = pull->relative_highest_offset;
    7425             :                 }
    7426           0 :                 if (highest_ofs < pull->data_size) {
    7427           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    7428             :                                 "not all bytes consumed ofs[%u] size[%u]",
    7429             :                                 highest_ofs, pull->data_size);
    7430           0 :                         TALLOC_FREE(pull);
    7431           0 :                         PyErr_SetNdrError(err);
    7432           0 :                         return NULL;
    7433             :                 }
    7434             :         }
    7435             : 
    7436           0 :         TALLOC_FREE(pull);
    7437           0 :         Py_RETURN_NONE;
    7438             : }
    7439             : 
    7440           0 : static PyObject *py_wbint_LookupUserGroups_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7441             : {
    7442             :         DATA_BLOB blob;
    7443           0 :         Py_ssize_t blob_length = 0;
    7444           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    7445           0 :         PyObject *bigendian_obj = NULL;
    7446           0 :         PyObject *ndr64_obj = NULL;
    7447           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    7448           0 :         PyObject *allow_remaining_obj = NULL;
    7449           0 :         bool allow_remaining = false;
    7450             : 
    7451           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    7452             :                 discard_const_p(char *, kwnames),
    7453             :                 &blob.data, &blob_length,
    7454             :                 &bigendian_obj,
    7455             :                 &ndr64_obj,
    7456             :                 &allow_remaining_obj)) {
    7457           0 :                 return NULL;
    7458             :         }
    7459           0 :         blob.length = blob_length;
    7460             : 
    7461           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7462           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    7463             :         }
    7464           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7465           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    7466             :         }
    7467             : 
    7468           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    7469           0 :                 allow_remaining = true;
    7470             :         }
    7471             : 
    7472           0 :         return py_wbint_LookupUserGroups_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    7473             : }
    7474             : 
    7475           0 : static PyObject *py_wbint_LookupUserGroups_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7476             : {
    7477             :         DATA_BLOB blob;
    7478           0 :         Py_ssize_t blob_length = 0;
    7479           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    7480           0 :         PyObject *bigendian_obj = NULL;
    7481           0 :         PyObject *ndr64_obj = NULL;
    7482           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    7483           0 :         PyObject *allow_remaining_obj = NULL;
    7484           0 :         bool allow_remaining = false;
    7485             : 
    7486           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    7487             :                 discard_const_p(char *, kwnames),
    7488             :                 &blob.data, &blob_length,
    7489             :                 &bigendian_obj,
    7490             :                 &ndr64_obj,
    7491             :                 &allow_remaining_obj)) {
    7492           0 :                 return NULL;
    7493             :         }
    7494           0 :         blob.length = blob_length;
    7495             : 
    7496           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7497           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    7498             :         }
    7499           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7500           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    7501             :         }
    7502             : 
    7503           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    7504           0 :                 allow_remaining = true;
    7505             :         }
    7506             : 
    7507           0 :         return py_wbint_LookupUserGroups_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    7508             : }
    7509             : 
    7510           0 : static PyObject *py_wbint_LookupUserGroups_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    7511             : {
    7512           0 :         const struct ndr_interface_call *call = NULL;
    7513           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj);
    7514             :         PyObject *ret;
    7515             :         char *retstr;
    7516             : 
    7517           0 :         if (ndr_table_winbind.num_calls < 11) {
    7518           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserGroups_ndr_print");
    7519           0 :                 return NULL;
    7520             :         }
    7521           0 :         call = &ndr_table_winbind.calls[10];
    7522             : 
    7523           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    7524           0 :         ret = PyUnicode_FromString(retstr);
    7525           0 :         TALLOC_FREE(retstr);
    7526             : 
    7527           0 :         return ret;
    7528             : }
    7529             : 
    7530           0 : static PyObject *py_wbint_LookupUserGroups_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7531             : {
    7532           0 :         return py_wbint_LookupUserGroups_ndr_print(py_obj, "wbint_LookupUserGroups_in", NDR_IN);
    7533             : }
    7534             : 
    7535           0 : static PyObject *py_wbint_LookupUserGroups_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7536             : {
    7537           0 :         return py_wbint_LookupUserGroups_ndr_print(py_obj, "wbint_LookupUserGroups_out", NDR_OUT);
    7538             : }
    7539             : 
    7540             : static PyMethodDef py_wbint_LookupUserGroups_methods[] = {
    7541             :         { "opnum", (PyCFunction)py_wbint_LookupUserGroups_ndr_opnum, METH_NOARGS|METH_CLASS,
    7542             :                 "winbind.wbint_LookupUserGroups.opnum() -> 10 (0x0a) " },
    7543             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    7544             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    7545             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    7546             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    7547             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    7548             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    7549             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    7550             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    7551             :         { "__ndr_print_in__", (PyCFunction)py_wbint_LookupUserGroups_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    7552             :         { "__ndr_print_out__", (PyCFunction)py_wbint_LookupUserGroups_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    7553             :         { NULL, NULL, 0, NULL }
    7554             : };
    7555             : 
    7556             : 
    7557             : static PyTypeObject wbint_LookupUserGroups_Type = {
    7558             :         PyVarObject_HEAD_INIT(NULL, 0)
    7559             :         .tp_name = "winbind.wbint_LookupUserGroups",
    7560             :         .tp_getset = py_wbint_LookupUserGroups_getsetters,
    7561             :         .tp_methods = py_wbint_LookupUserGroups_methods,
    7562             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    7563             :         .tp_new = py_wbint_LookupUserGroups_new,
    7564             : };
    7565             : 
    7566           0 : static bool pack_py_wbint_LookupUserGroups_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupUserGroups *r)
    7567             : {
    7568             :         PyObject *py_sid;
    7569           0 :         const char *kwnames[] = {
    7570             :                 "sid", NULL
    7571             :         };
    7572             : 
    7573           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupUserGroups", discard_const_p(char *, kwnames), &py_sid)) {
    7574           0 :                 return false;
    7575             :         }
    7576             : 
    7577           0 :         if (py_sid == NULL) {
    7578           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
    7579           0 :                 return false;
    7580             :         }
    7581           0 :         r->in.sid = talloc_ptrtype(r, r->in.sid);
    7582           0 :         if (r->in.sid == NULL) {
    7583           0 :                 PyErr_NoMemory();
    7584           0 :                 return false;
    7585             :         }
    7586           0 :         PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
    7587           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
    7588           0 :                 PyErr_NoMemory();
    7589           0 :                 return false;
    7590             :         }
    7591           0 :         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
    7592           0 :         return true;
    7593             : }
    7594             : 
    7595           0 : static PyObject *unpack_py_wbint_LookupUserGroups_args_out(struct wbint_LookupUserGroups *r)
    7596             : {
    7597             :         PyObject *result;
    7598             :         PyObject *py_sids;
    7599           0 :         py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, r->out.sids, r->out.sids);
    7600           0 :         result = py_sids;
    7601           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    7602           0 :                 PyErr_SetNTSTATUS(r->out.result);
    7603           0 :                 return NULL;
    7604             :         }
    7605             : 
    7606           0 :         return result;
    7607             : }
    7608             : 
    7609             : 
    7610           0 : static PyObject *py_wbint_QuerySequenceNumber_out_get_sequence(PyObject *obj, void *closure)
    7611             : {
    7612           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(obj);
    7613             :         PyObject *py_sequence;
    7614           0 :         if (object->out.sequence == NULL) {
    7615           0 :                 Py_RETURN_NONE;
    7616             :         }
    7617           0 :         py_sequence = PyLong_FromUnsignedLongLong((uint32_t)*object->out.sequence);
    7618           0 :         return py_sequence;
    7619             : }
    7620             : 
    7621           0 : static int py_wbint_QuerySequenceNumber_out_set_sequence(PyObject *py_obj, PyObject *value, void *closure)
    7622             : {
    7623           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj);
    7624           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sequence));
    7625           0 :         if (value == NULL) {
    7626           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sequence");
    7627           0 :                 return -1;
    7628             :         }
    7629           0 :         object->out.sequence = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sequence);
    7630           0 :         if (object->out.sequence == NULL) {
    7631           0 :                 PyErr_NoMemory();
    7632           0 :                 return -1;
    7633             :         }
    7634             :         {
    7635           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.sequence));
    7636           0 :                 if (PyLong_Check(value)) {
    7637             :                         unsigned long long test_var;
    7638           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7639           0 :                         if (PyErr_Occurred() != NULL) {
    7640           0 :                                 return -1;
    7641             :                         }
    7642           0 :                         if (test_var > uint_max) {
    7643           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7644             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7645           0 :                                 return -1;
    7646             :                         }
    7647           0 :                         *object->out.sequence = test_var;
    7648             :                 } else {
    7649           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7650             :                           PyLong_Type.tp_name);
    7651           0 :                         return -1;
    7652             :                 }
    7653             :         }
    7654           0 :         return 0;
    7655             : }
    7656             : 
    7657           0 : static PyObject *py_wbint_QuerySequenceNumber_get_result(PyObject *obj, void *closure)
    7658             : {
    7659           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(obj);
    7660             :         PyObject *py_result;
    7661           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    7662           0 :         return py_result;
    7663             : }
    7664             : 
    7665           0 : static int py_wbint_QuerySequenceNumber_set_result(PyObject *py_obj, PyObject *value, void *closure)
    7666             : {
    7667           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj);
    7668           0 :         if (value == NULL) {
    7669           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    7670           0 :                 return -1;
    7671             :         }
    7672           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    7673           0 :         return 0;
    7674             : }
    7675             : 
    7676             : static PyGetSetDef py_wbint_QuerySequenceNumber_getsetters[] = {
    7677             :         {
    7678             :                 .name = discard_const_p(char, "out_sequence"),
    7679             :                 .get = py_wbint_QuerySequenceNumber_out_get_sequence,
    7680             :                 .set = py_wbint_QuerySequenceNumber_out_set_sequence,
    7681             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    7682             :         },
    7683             :         {
    7684             :                 .name = discard_const_p(char, "result"),
    7685             :                 .get = py_wbint_QuerySequenceNumber_get_result,
    7686             :                 .set = py_wbint_QuerySequenceNumber_set_result,
    7687             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    7688             :         },
    7689             :         { .name = NULL }
    7690             : };
    7691             : 
    7692           0 : static PyObject *py_wbint_QuerySequenceNumber_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    7693             : {
    7694           0 :         PyObject *self = pytalloc_new(struct wbint_QuerySequenceNumber, type);
    7695           0 :         struct wbint_QuerySequenceNumber *_self = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(self);
    7696           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    7697           0 :         _self->out.sequence = talloc_zero(mem_ctx, uint32_t);
    7698           0 :         return self;
    7699             : }
    7700             : 
    7701           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    7702             : {
    7703             : 
    7704             : 
    7705           0 :         return PyLong_FromLong(11);
    7706             : }
    7707             : 
    7708           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    7709             : {
    7710           0 :         const struct ndr_interface_call *call = NULL;
    7711           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj);
    7712           0 :         PyObject *ret = NULL;
    7713           0 :         struct ndr_push *push = NULL;
    7714             :         DATA_BLOB blob;
    7715             :         enum ndr_err_code err;
    7716             : 
    7717           0 :         if (ndr_table_winbind.num_calls < 12) {
    7718           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QuerySequenceNumber_ndr_pack");
    7719           0 :                 return NULL;
    7720             :         }
    7721           0 :         call = &ndr_table_winbind.calls[11];
    7722             : 
    7723           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    7724           0 :         if (push == NULL) {
    7725           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    7726           0 :                 return NULL;
    7727             :         }
    7728             : 
    7729           0 :         push->flags |= ndr_push_flags;
    7730             : 
    7731           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    7732           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    7733           0 :                 TALLOC_FREE(push);
    7734           0 :                 PyErr_SetNdrError(err);
    7735           0 :                 return NULL;
    7736             :         }
    7737           0 :         blob = ndr_push_blob(push);
    7738           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    7739           0 :         TALLOC_FREE(push);
    7740           0 :         return ret;
    7741             : }
    7742             : 
    7743           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7744             : {
    7745           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    7746           0 :         PyObject *bigendian_obj = NULL;
    7747           0 :         PyObject *ndr64_obj = NULL;
    7748           0 :         uint32_t ndr_push_flags = 0;
    7749             : 
    7750           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    7751             :                 discard_const_p(char *, kwnames),
    7752             :                 &bigendian_obj,
    7753             :                 &ndr64_obj)) {
    7754           0 :                 return NULL;
    7755             :         }
    7756             : 
    7757           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7758           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    7759             :         }
    7760           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7761           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    7762             :         }
    7763             : 
    7764           0 :         return py_wbint_QuerySequenceNumber_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    7765             : }
    7766             : 
    7767           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7768             : {
    7769           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    7770           0 :         PyObject *bigendian_obj = NULL;
    7771           0 :         PyObject *ndr64_obj = NULL;
    7772           0 :         uint32_t ndr_push_flags = 0;
    7773             : 
    7774           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    7775             :                 discard_const_p(char *, kwnames),
    7776             :                 &bigendian_obj,
    7777             :                 &ndr64_obj)) {
    7778           0 :                 return NULL;
    7779             :         }
    7780             : 
    7781           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7782           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    7783             :         }
    7784           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7785           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    7786             :         }
    7787             : 
    7788           0 :         return py_wbint_QuerySequenceNumber_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    7789             : }
    7790             : 
    7791           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    7792             : {
    7793           0 :         const struct ndr_interface_call *call = NULL;
    7794           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj);
    7795           0 :         struct ndr_pull *pull = NULL;
    7796             :         enum ndr_err_code err;
    7797             : 
    7798           0 :         if (ndr_table_winbind.num_calls < 12) {
    7799           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QuerySequenceNumber_ndr_unpack");
    7800           0 :                 return NULL;
    7801             :         }
    7802           0 :         call = &ndr_table_winbind.calls[11];
    7803             : 
    7804           0 :         pull = ndr_pull_init_blob(blob, object);
    7805           0 :         if (pull == NULL) {
    7806           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    7807           0 :                 return NULL;
    7808             :         }
    7809             : 
    7810           0 :         pull->flags |= ndr_pull_flags;
    7811             : 
    7812           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    7813           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    7814           0 :                 TALLOC_FREE(pull);
    7815           0 :                 PyErr_SetNdrError(err);
    7816           0 :                 return NULL;
    7817             :         }
    7818           0 :         if (!allow_remaining) {
    7819             :                 uint32_t highest_ofs;
    7820             : 
    7821           0 :                 if (pull->offset > pull->relative_highest_offset) {
    7822           0 :                         highest_ofs = pull->offset;
    7823             :                 } else {
    7824           0 :                         highest_ofs = pull->relative_highest_offset;
    7825             :                 }
    7826           0 :                 if (highest_ofs < pull->data_size) {
    7827           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    7828             :                                 "not all bytes consumed ofs[%u] size[%u]",
    7829             :                                 highest_ofs, pull->data_size);
    7830           0 :                         TALLOC_FREE(pull);
    7831           0 :                         PyErr_SetNdrError(err);
    7832           0 :                         return NULL;
    7833             :                 }
    7834             :         }
    7835             : 
    7836           0 :         TALLOC_FREE(pull);
    7837           0 :         Py_RETURN_NONE;
    7838             : }
    7839             : 
    7840           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7841             : {
    7842             :         DATA_BLOB blob;
    7843           0 :         Py_ssize_t blob_length = 0;
    7844           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    7845           0 :         PyObject *bigendian_obj = NULL;
    7846           0 :         PyObject *ndr64_obj = NULL;
    7847           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    7848           0 :         PyObject *allow_remaining_obj = NULL;
    7849           0 :         bool allow_remaining = false;
    7850             : 
    7851           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    7852             :                 discard_const_p(char *, kwnames),
    7853             :                 &blob.data, &blob_length,
    7854             :                 &bigendian_obj,
    7855             :                 &ndr64_obj,
    7856             :                 &allow_remaining_obj)) {
    7857           0 :                 return NULL;
    7858             :         }
    7859           0 :         blob.length = blob_length;
    7860             : 
    7861           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7862           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    7863             :         }
    7864           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7865           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    7866             :         }
    7867             : 
    7868           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    7869           0 :                 allow_remaining = true;
    7870             :         }
    7871             : 
    7872           0 :         return py_wbint_QuerySequenceNumber_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    7873             : }
    7874             : 
    7875           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7876             : {
    7877             :         DATA_BLOB blob;
    7878           0 :         Py_ssize_t blob_length = 0;
    7879           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    7880           0 :         PyObject *bigendian_obj = NULL;
    7881           0 :         PyObject *ndr64_obj = NULL;
    7882           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    7883           0 :         PyObject *allow_remaining_obj = NULL;
    7884           0 :         bool allow_remaining = false;
    7885             : 
    7886           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    7887             :                 discard_const_p(char *, kwnames),
    7888             :                 &blob.data, &blob_length,
    7889             :                 &bigendian_obj,
    7890             :                 &ndr64_obj,
    7891             :                 &allow_remaining_obj)) {
    7892           0 :                 return NULL;
    7893             :         }
    7894           0 :         blob.length = blob_length;
    7895             : 
    7896           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7897           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    7898             :         }
    7899           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7900           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    7901             :         }
    7902             : 
    7903           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    7904           0 :                 allow_remaining = true;
    7905             :         }
    7906             : 
    7907           0 :         return py_wbint_QuerySequenceNumber_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    7908             : }
    7909             : 
    7910           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    7911             : {
    7912           0 :         const struct ndr_interface_call *call = NULL;
    7913           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj);
    7914             :         PyObject *ret;
    7915             :         char *retstr;
    7916             : 
    7917           0 :         if (ndr_table_winbind.num_calls < 12) {
    7918           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QuerySequenceNumber_ndr_print");
    7919           0 :                 return NULL;
    7920             :         }
    7921           0 :         call = &ndr_table_winbind.calls[11];
    7922             : 
    7923           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    7924           0 :         ret = PyUnicode_FromString(retstr);
    7925           0 :         TALLOC_FREE(retstr);
    7926             : 
    7927           0 :         return ret;
    7928             : }
    7929             : 
    7930           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7931             : {
    7932           0 :         return py_wbint_QuerySequenceNumber_ndr_print(py_obj, "wbint_QuerySequenceNumber_in", NDR_IN);
    7933             : }
    7934             : 
    7935           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7936             : {
    7937           0 :         return py_wbint_QuerySequenceNumber_ndr_print(py_obj, "wbint_QuerySequenceNumber_out", NDR_OUT);
    7938             : }
    7939             : 
    7940             : static PyMethodDef py_wbint_QuerySequenceNumber_methods[] = {
    7941             :         { "opnum", (PyCFunction)py_wbint_QuerySequenceNumber_ndr_opnum, METH_NOARGS|METH_CLASS,
    7942             :                 "winbind.wbint_QuerySequenceNumber.opnum() -> 11 (0x0b) " },
    7943             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    7944             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    7945             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    7946             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    7947             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    7948             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    7949             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    7950             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    7951             :         { "__ndr_print_in__", (PyCFunction)py_wbint_QuerySequenceNumber_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    7952             :         { "__ndr_print_out__", (PyCFunction)py_wbint_QuerySequenceNumber_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    7953             :         { NULL, NULL, 0, NULL }
    7954             : };
    7955             : 
    7956             : 
    7957             : static PyTypeObject wbint_QuerySequenceNumber_Type = {
    7958             :         PyVarObject_HEAD_INIT(NULL, 0)
    7959             :         .tp_name = "winbind.wbint_QuerySequenceNumber",
    7960             :         .tp_getset = py_wbint_QuerySequenceNumber_getsetters,
    7961             :         .tp_methods = py_wbint_QuerySequenceNumber_methods,
    7962             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    7963             :         .tp_new = py_wbint_QuerySequenceNumber_new,
    7964             : };
    7965             : 
    7966           0 : static bool pack_py_wbint_QuerySequenceNumber_args_in(PyObject *args, PyObject *kwargs, struct wbint_QuerySequenceNumber *r)
    7967             : {
    7968           0 :         const char *kwnames[] = {
    7969             :                 NULL
    7970             :         };
    7971             : 
    7972           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_QuerySequenceNumber", discard_const_p(char *, kwnames))) {
    7973           0 :                 return false;
    7974             :         }
    7975             : 
    7976           0 :         return true;
    7977             : }
    7978             : 
    7979           0 : static PyObject *unpack_py_wbint_QuerySequenceNumber_args_out(struct wbint_QuerySequenceNumber *r)
    7980             : {
    7981             :         PyObject *result;
    7982             :         PyObject *py_sequence;
    7983           0 :         py_sequence = PyLong_FromUnsignedLongLong((uint32_t)*r->out.sequence);
    7984           0 :         result = py_sequence;
    7985           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    7986           0 :                 PyErr_SetNTSTATUS(r->out.result);
    7987           0 :                 return NULL;
    7988             :         }
    7989             : 
    7990           0 :         return result;
    7991             : }
    7992             : 
    7993             : 
    7994           0 : static PyObject *py_wbint_LookupGroupMembers_in_get_sid(PyObject *obj, void *closure)
    7995             : {
    7996           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(obj);
    7997             :         PyObject *py_sid;
    7998           0 :         if (object->in.sid == NULL) {
    7999           0 :                 Py_RETURN_NONE;
    8000             :         }
    8001           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
    8002           0 :         return py_sid;
    8003             : }
    8004             : 
    8005           0 : static int py_wbint_LookupGroupMembers_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
    8006             : {
    8007           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    8008           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
    8009           0 :         if (value == NULL) {
    8010           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
    8011           0 :                 return -1;
    8012             :         }
    8013           0 :         object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
    8014           0 :         if (object->in.sid == NULL) {
    8015           0 :                 PyErr_NoMemory();
    8016           0 :                 return -1;
    8017             :         }
    8018           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    8019           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    8020           0 :                 PyErr_NoMemory();
    8021           0 :                 return -1;
    8022             :         }
    8023           0 :         object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
    8024           0 :         return 0;
    8025             : }
    8026             : 
    8027           0 : static PyObject *py_wbint_LookupGroupMembers_in_get_type(PyObject *obj, void *closure)
    8028             : {
    8029           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(obj);
    8030             :         PyObject *py_type;
    8031           0 :         py_type = PyLong_FromLong((uint16_t)object->in.type);
    8032           0 :         return py_type;
    8033             : }
    8034             : 
    8035           0 : static int py_wbint_LookupGroupMembers_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
    8036             : {
    8037           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    8038           0 :         if (value == NULL) {
    8039           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
    8040           0 :                 return -1;
    8041             :         }
    8042             :         {
    8043           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
    8044           0 :                 if (PyLong_Check(value)) {
    8045             :                         unsigned long long test_var;
    8046           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8047           0 :                         if (PyErr_Occurred() != NULL) {
    8048           0 :                                 return -1;
    8049             :                         }
    8050           0 :                         if (test_var > uint_max) {
    8051           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8052             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8053           0 :                                 return -1;
    8054             :                         }
    8055           0 :                         object->in.type = test_var;
    8056             :                 } else {
    8057           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8058             :                           PyLong_Type.tp_name);
    8059           0 :                         return -1;
    8060             :                 }
    8061             :         }
    8062           0 :         return 0;
    8063             : }
    8064             : 
    8065           0 : static PyObject *py_wbint_LookupGroupMembers_out_get_members(PyObject *obj, void *closure)
    8066             : {
    8067           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(obj);
    8068             :         PyObject *py_members;
    8069           0 :         if (object->out.members == NULL) {
    8070           0 :                 Py_RETURN_NONE;
    8071             :         }
    8072           0 :         py_members = pytalloc_reference_ex(&wbint_Principals_Type, object->out.members, object->out.members);
    8073           0 :         return py_members;
    8074             : }
    8075             : 
    8076           0 : static int py_wbint_LookupGroupMembers_out_set_members(PyObject *py_obj, PyObject *value, void *closure)
    8077             : {
    8078           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    8079           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.members));
    8080           0 :         if (value == NULL) {
    8081           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.members");
    8082           0 :                 return -1;
    8083             :         }
    8084           0 :         object->out.members = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.members);
    8085           0 :         if (object->out.members == NULL) {
    8086           0 :                 PyErr_NoMemory();
    8087           0 :                 return -1;
    8088             :         }
    8089           0 :         PY_CHECK_TYPE(&wbint_Principals_Type, value, return -1;);
    8090           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    8091           0 :                 PyErr_NoMemory();
    8092           0 :                 return -1;
    8093             :         }
    8094           0 :         object->out.members = (struct wbint_Principals *)pytalloc_get_ptr(value);
    8095           0 :         return 0;
    8096             : }
    8097             : 
    8098           0 : static PyObject *py_wbint_LookupGroupMembers_get_result(PyObject *obj, void *closure)
    8099             : {
    8100           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(obj);
    8101             :         PyObject *py_result;
    8102           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    8103           0 :         return py_result;
    8104             : }
    8105             : 
    8106           0 : static int py_wbint_LookupGroupMembers_set_result(PyObject *py_obj, PyObject *value, void *closure)
    8107             : {
    8108           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    8109           0 :         if (value == NULL) {
    8110           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    8111           0 :                 return -1;
    8112             :         }
    8113           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    8114           0 :         return 0;
    8115             : }
    8116             : 
    8117             : static PyGetSetDef py_wbint_LookupGroupMembers_getsetters[] = {
    8118             :         {
    8119             :                 .name = discard_const_p(char, "in_sid"),
    8120             :                 .get = py_wbint_LookupGroupMembers_in_get_sid,
    8121             :                 .set = py_wbint_LookupGroupMembers_in_set_sid,
    8122             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    8123             :         },
    8124             :         {
    8125             :                 .name = discard_const_p(char, "in_type"),
    8126             :                 .get = py_wbint_LookupGroupMembers_in_get_type,
    8127             :                 .set = py_wbint_LookupGroupMembers_in_set_type,
    8128             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
    8129             :         },
    8130             :         {
    8131             :                 .name = discard_const_p(char, "out_members"),
    8132             :                 .get = py_wbint_LookupGroupMembers_out_get_members,
    8133             :                 .set = py_wbint_LookupGroupMembers_out_set_members,
    8134             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principals")
    8135             :         },
    8136             :         {
    8137             :                 .name = discard_const_p(char, "result"),
    8138             :                 .get = py_wbint_LookupGroupMembers_get_result,
    8139             :                 .set = py_wbint_LookupGroupMembers_set_result,
    8140             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    8141             :         },
    8142             :         { .name = NULL }
    8143             : };
    8144             : 
    8145           0 : static PyObject *py_wbint_LookupGroupMembers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    8146             : {
    8147           0 :         PyObject *self = pytalloc_new(struct wbint_LookupGroupMembers, type);
    8148           0 :         struct wbint_LookupGroupMembers *_self = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(self);
    8149           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    8150           0 :         _self->in.sid = talloc_zero(mem_ctx, struct dom_sid);
    8151           0 :         _self->out.members = talloc_zero(mem_ctx, struct wbint_Principals);
    8152           0 :         return self;
    8153             : }
    8154             : 
    8155           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    8156             : {
    8157             : 
    8158             : 
    8159           0 :         return PyLong_FromLong(12);
    8160             : }
    8161             : 
    8162           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    8163             : {
    8164           0 :         const struct ndr_interface_call *call = NULL;
    8165           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    8166           0 :         PyObject *ret = NULL;
    8167           0 :         struct ndr_push *push = NULL;
    8168             :         DATA_BLOB blob;
    8169             :         enum ndr_err_code err;
    8170             : 
    8171           0 :         if (ndr_table_winbind.num_calls < 13) {
    8172           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupGroupMembers_ndr_pack");
    8173           0 :                 return NULL;
    8174             :         }
    8175           0 :         call = &ndr_table_winbind.calls[12];
    8176             : 
    8177           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    8178           0 :         if (push == NULL) {
    8179           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    8180           0 :                 return NULL;
    8181             :         }
    8182             : 
    8183           0 :         push->flags |= ndr_push_flags;
    8184             : 
    8185           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    8186           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8187           0 :                 TALLOC_FREE(push);
    8188           0 :                 PyErr_SetNdrError(err);
    8189           0 :                 return NULL;
    8190             :         }
    8191           0 :         blob = ndr_push_blob(push);
    8192           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    8193           0 :         TALLOC_FREE(push);
    8194           0 :         return ret;
    8195             : }
    8196             : 
    8197           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8198             : {
    8199           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    8200           0 :         PyObject *bigendian_obj = NULL;
    8201           0 :         PyObject *ndr64_obj = NULL;
    8202           0 :         uint32_t ndr_push_flags = 0;
    8203             : 
    8204           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    8205             :                 discard_const_p(char *, kwnames),
    8206             :                 &bigendian_obj,
    8207             :                 &ndr64_obj)) {
    8208           0 :                 return NULL;
    8209             :         }
    8210             : 
    8211           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8212           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    8213             :         }
    8214           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8215           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    8216             :         }
    8217             : 
    8218           0 :         return py_wbint_LookupGroupMembers_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    8219             : }
    8220             : 
    8221           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8222             : {
    8223           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    8224           0 :         PyObject *bigendian_obj = NULL;
    8225           0 :         PyObject *ndr64_obj = NULL;
    8226           0 :         uint32_t ndr_push_flags = 0;
    8227             : 
    8228           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    8229             :                 discard_const_p(char *, kwnames),
    8230             :                 &bigendian_obj,
    8231             :                 &ndr64_obj)) {
    8232           0 :                 return NULL;
    8233             :         }
    8234             : 
    8235           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8236           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    8237             :         }
    8238           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8239           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    8240             :         }
    8241             : 
    8242           0 :         return py_wbint_LookupGroupMembers_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    8243             : }
    8244             : 
    8245           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    8246             : {
    8247           0 :         const struct ndr_interface_call *call = NULL;
    8248           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    8249           0 :         struct ndr_pull *pull = NULL;
    8250             :         enum ndr_err_code err;
    8251             : 
    8252           0 :         if (ndr_table_winbind.num_calls < 13) {
    8253           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupGroupMembers_ndr_unpack");
    8254           0 :                 return NULL;
    8255             :         }
    8256           0 :         call = &ndr_table_winbind.calls[12];
    8257             : 
    8258           0 :         pull = ndr_pull_init_blob(blob, object);
    8259           0 :         if (pull == NULL) {
    8260           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    8261           0 :                 return NULL;
    8262             :         }
    8263             : 
    8264           0 :         pull->flags |= ndr_pull_flags;
    8265             : 
    8266           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    8267           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8268           0 :                 TALLOC_FREE(pull);
    8269           0 :                 PyErr_SetNdrError(err);
    8270           0 :                 return NULL;
    8271             :         }
    8272           0 :         if (!allow_remaining) {
    8273             :                 uint32_t highest_ofs;
    8274             : 
    8275           0 :                 if (pull->offset > pull->relative_highest_offset) {
    8276           0 :                         highest_ofs = pull->offset;
    8277             :                 } else {
    8278           0 :                         highest_ofs = pull->relative_highest_offset;
    8279             :                 }
    8280           0 :                 if (highest_ofs < pull->data_size) {
    8281           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    8282             :                                 "not all bytes consumed ofs[%u] size[%u]",
    8283             :                                 highest_ofs, pull->data_size);
    8284           0 :                         TALLOC_FREE(pull);
    8285           0 :                         PyErr_SetNdrError(err);
    8286           0 :                         return NULL;
    8287             :                 }
    8288             :         }
    8289             : 
    8290           0 :         TALLOC_FREE(pull);
    8291           0 :         Py_RETURN_NONE;
    8292             : }
    8293             : 
    8294           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8295             : {
    8296             :         DATA_BLOB blob;
    8297           0 :         Py_ssize_t blob_length = 0;
    8298           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    8299           0 :         PyObject *bigendian_obj = NULL;
    8300           0 :         PyObject *ndr64_obj = NULL;
    8301           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    8302           0 :         PyObject *allow_remaining_obj = NULL;
    8303           0 :         bool allow_remaining = false;
    8304             : 
    8305           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    8306             :                 discard_const_p(char *, kwnames),
    8307             :                 &blob.data, &blob_length,
    8308             :                 &bigendian_obj,
    8309             :                 &ndr64_obj,
    8310             :                 &allow_remaining_obj)) {
    8311           0 :                 return NULL;
    8312             :         }
    8313           0 :         blob.length = blob_length;
    8314             : 
    8315           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8316           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    8317             :         }
    8318           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8319           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    8320             :         }
    8321             : 
    8322           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    8323           0 :                 allow_remaining = true;
    8324             :         }
    8325             : 
    8326           0 :         return py_wbint_LookupGroupMembers_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    8327             : }
    8328             : 
    8329           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8330             : {
    8331             :         DATA_BLOB blob;
    8332           0 :         Py_ssize_t blob_length = 0;
    8333           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    8334           0 :         PyObject *bigendian_obj = NULL;
    8335           0 :         PyObject *ndr64_obj = NULL;
    8336           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    8337           0 :         PyObject *allow_remaining_obj = NULL;
    8338           0 :         bool allow_remaining = false;
    8339             : 
    8340           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    8341             :                 discard_const_p(char *, kwnames),
    8342             :                 &blob.data, &blob_length,
    8343             :                 &bigendian_obj,
    8344             :                 &ndr64_obj,
    8345             :                 &allow_remaining_obj)) {
    8346           0 :                 return NULL;
    8347             :         }
    8348           0 :         blob.length = blob_length;
    8349             : 
    8350           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8351           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    8352             :         }
    8353           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8354           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    8355             :         }
    8356             : 
    8357           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    8358           0 :                 allow_remaining = true;
    8359             :         }
    8360             : 
    8361           0 :         return py_wbint_LookupGroupMembers_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    8362             : }
    8363             : 
    8364           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    8365             : {
    8366           0 :         const struct ndr_interface_call *call = NULL;
    8367           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    8368             :         PyObject *ret;
    8369             :         char *retstr;
    8370             : 
    8371           0 :         if (ndr_table_winbind.num_calls < 13) {
    8372           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupGroupMembers_ndr_print");
    8373           0 :                 return NULL;
    8374             :         }
    8375           0 :         call = &ndr_table_winbind.calls[12];
    8376             : 
    8377           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    8378           0 :         ret = PyUnicode_FromString(retstr);
    8379           0 :         TALLOC_FREE(retstr);
    8380             : 
    8381           0 :         return ret;
    8382             : }
    8383             : 
    8384           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    8385             : {
    8386           0 :         return py_wbint_LookupGroupMembers_ndr_print(py_obj, "wbint_LookupGroupMembers_in", NDR_IN);
    8387             : }
    8388             : 
    8389           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    8390             : {
    8391           0 :         return py_wbint_LookupGroupMembers_ndr_print(py_obj, "wbint_LookupGroupMembers_out", NDR_OUT);
    8392             : }
    8393             : 
    8394             : static PyMethodDef py_wbint_LookupGroupMembers_methods[] = {
    8395             :         { "opnum", (PyCFunction)py_wbint_LookupGroupMembers_ndr_opnum, METH_NOARGS|METH_CLASS,
    8396             :                 "winbind.wbint_LookupGroupMembers.opnum() -> 12 (0x0c) " },
    8397             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    8398             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    8399             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    8400             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    8401             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    8402             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    8403             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    8404             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    8405             :         { "__ndr_print_in__", (PyCFunction)py_wbint_LookupGroupMembers_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    8406             :         { "__ndr_print_out__", (PyCFunction)py_wbint_LookupGroupMembers_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    8407             :         { NULL, NULL, 0, NULL }
    8408             : };
    8409             : 
    8410             : 
    8411             : static PyTypeObject wbint_LookupGroupMembers_Type = {
    8412             :         PyVarObject_HEAD_INIT(NULL, 0)
    8413             :         .tp_name = "winbind.wbint_LookupGroupMembers",
    8414             :         .tp_getset = py_wbint_LookupGroupMembers_getsetters,
    8415             :         .tp_methods = py_wbint_LookupGroupMembers_methods,
    8416             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    8417             :         .tp_new = py_wbint_LookupGroupMembers_new,
    8418             : };
    8419             : 
    8420           0 : static bool pack_py_wbint_LookupGroupMembers_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupGroupMembers *r)
    8421             : {
    8422             :         PyObject *py_sid;
    8423             :         PyObject *py_type;
    8424           0 :         const char *kwnames[] = {
    8425             :                 "sid", "type", NULL
    8426             :         };
    8427             : 
    8428           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_LookupGroupMembers", discard_const_p(char *, kwnames), &py_sid, &py_type)) {
    8429           0 :                 return false;
    8430             :         }
    8431             : 
    8432           0 :         if (py_sid == NULL) {
    8433           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
    8434           0 :                 return false;
    8435             :         }
    8436           0 :         r->in.sid = talloc_ptrtype(r, r->in.sid);
    8437           0 :         if (r->in.sid == NULL) {
    8438           0 :                 PyErr_NoMemory();
    8439           0 :                 return false;
    8440             :         }
    8441           0 :         PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
    8442           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
    8443           0 :                 PyErr_NoMemory();
    8444           0 :                 return false;
    8445             :         }
    8446           0 :         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
    8447           0 :         if (py_type == NULL) {
    8448           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
    8449           0 :                 return false;
    8450             :         }
    8451             :         {
    8452           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
    8453           0 :                 if (PyLong_Check(py_type)) {
    8454             :                         unsigned long long test_var;
    8455           0 :                         test_var = PyLong_AsUnsignedLongLong(py_type);
    8456           0 :                         if (PyErr_Occurred() != NULL) {
    8457           0 :                                 return false;
    8458             :                         }
    8459           0 :                         if (test_var > uint_max) {
    8460           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8461             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8462           0 :                                 return false;
    8463             :                         }
    8464           0 :                         r->in.type = test_var;
    8465             :                 } else {
    8466           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8467             :                           PyLong_Type.tp_name);
    8468           0 :                         return false;
    8469             :                 }
    8470             :         }
    8471           0 :         return true;
    8472             : }
    8473             : 
    8474           0 : static PyObject *unpack_py_wbint_LookupGroupMembers_args_out(struct wbint_LookupGroupMembers *r)
    8475             : {
    8476             :         PyObject *result;
    8477             :         PyObject *py_members;
    8478           0 :         py_members = pytalloc_reference_ex(&wbint_Principals_Type, r->out.members, r->out.members);
    8479           0 :         result = py_members;
    8480           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    8481           0 :                 PyErr_SetNTSTATUS(r->out.result);
    8482           0 :                 return NULL;
    8483             :         }
    8484             : 
    8485           0 :         return result;
    8486             : }
    8487             : 
    8488             : 
    8489           0 : static PyObject *py_wbint_QueryGroupList_out_get_groups(PyObject *obj, void *closure)
    8490             : {
    8491           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(obj);
    8492             :         PyObject *py_groups;
    8493           0 :         if (object->out.groups == NULL) {
    8494           0 :                 Py_RETURN_NONE;
    8495             :         }
    8496           0 :         py_groups = pytalloc_reference_ex(&wbint_Principals_Type, object->out.groups, object->out.groups);
    8497           0 :         return py_groups;
    8498             : }
    8499             : 
    8500           0 : static int py_wbint_QueryGroupList_out_set_groups(PyObject *py_obj, PyObject *value, void *closure)
    8501             : {
    8502           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj);
    8503           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.groups));
    8504           0 :         if (value == NULL) {
    8505           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.groups");
    8506           0 :                 return -1;
    8507             :         }
    8508           0 :         object->out.groups = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.groups);
    8509           0 :         if (object->out.groups == NULL) {
    8510           0 :                 PyErr_NoMemory();
    8511           0 :                 return -1;
    8512             :         }
    8513           0 :         PY_CHECK_TYPE(&wbint_Principals_Type, value, return -1;);
    8514           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    8515           0 :                 PyErr_NoMemory();
    8516           0 :                 return -1;
    8517             :         }
    8518           0 :         object->out.groups = (struct wbint_Principals *)pytalloc_get_ptr(value);
    8519           0 :         return 0;
    8520             : }
    8521             : 
    8522           0 : static PyObject *py_wbint_QueryGroupList_get_result(PyObject *obj, void *closure)
    8523             : {
    8524           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(obj);
    8525             :         PyObject *py_result;
    8526           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    8527           0 :         return py_result;
    8528             : }
    8529             : 
    8530           0 : static int py_wbint_QueryGroupList_set_result(PyObject *py_obj, PyObject *value, void *closure)
    8531             : {
    8532           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj);
    8533           0 :         if (value == NULL) {
    8534           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    8535           0 :                 return -1;
    8536             :         }
    8537           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    8538           0 :         return 0;
    8539             : }
    8540             : 
    8541             : static PyGetSetDef py_wbint_QueryGroupList_getsetters[] = {
    8542             :         {
    8543             :                 .name = discard_const_p(char, "out_groups"),
    8544             :                 .get = py_wbint_QueryGroupList_out_get_groups,
    8545             :                 .set = py_wbint_QueryGroupList_out_set_groups,
    8546             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principals")
    8547             :         },
    8548             :         {
    8549             :                 .name = discard_const_p(char, "result"),
    8550             :                 .get = py_wbint_QueryGroupList_get_result,
    8551             :                 .set = py_wbint_QueryGroupList_set_result,
    8552             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    8553             :         },
    8554             :         { .name = NULL }
    8555             : };
    8556             : 
    8557           0 : static PyObject *py_wbint_QueryGroupList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    8558             : {
    8559           0 :         PyObject *self = pytalloc_new(struct wbint_QueryGroupList, type);
    8560           0 :         struct wbint_QueryGroupList *_self = (struct wbint_QueryGroupList *)pytalloc_get_ptr(self);
    8561           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    8562           0 :         _self->out.groups = talloc_zero(mem_ctx, struct wbint_Principals);
    8563           0 :         return self;
    8564             : }
    8565             : 
    8566           0 : static PyObject *py_wbint_QueryGroupList_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    8567             : {
    8568             : 
    8569             : 
    8570           0 :         return PyLong_FromLong(13);
    8571             : }
    8572             : 
    8573           0 : static PyObject *py_wbint_QueryGroupList_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    8574             : {
    8575           0 :         const struct ndr_interface_call *call = NULL;
    8576           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj);
    8577           0 :         PyObject *ret = NULL;
    8578           0 :         struct ndr_push *push = NULL;
    8579             :         DATA_BLOB blob;
    8580             :         enum ndr_err_code err;
    8581             : 
    8582           0 :         if (ndr_table_winbind.num_calls < 14) {
    8583           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryGroupList_ndr_pack");
    8584           0 :                 return NULL;
    8585             :         }
    8586           0 :         call = &ndr_table_winbind.calls[13];
    8587             : 
    8588           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    8589           0 :         if (push == NULL) {
    8590           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    8591           0 :                 return NULL;
    8592             :         }
    8593             : 
    8594           0 :         push->flags |= ndr_push_flags;
    8595             : 
    8596           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    8597           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8598           0 :                 TALLOC_FREE(push);
    8599           0 :                 PyErr_SetNdrError(err);
    8600           0 :                 return NULL;
    8601             :         }
    8602           0 :         blob = ndr_push_blob(push);
    8603           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    8604           0 :         TALLOC_FREE(push);
    8605           0 :         return ret;
    8606             : }
    8607             : 
    8608           0 : static PyObject *py_wbint_QueryGroupList_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8609             : {
    8610           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    8611           0 :         PyObject *bigendian_obj = NULL;
    8612           0 :         PyObject *ndr64_obj = NULL;
    8613           0 :         uint32_t ndr_push_flags = 0;
    8614             : 
    8615           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    8616             :                 discard_const_p(char *, kwnames),
    8617             :                 &bigendian_obj,
    8618             :                 &ndr64_obj)) {
    8619           0 :                 return NULL;
    8620             :         }
    8621             : 
    8622           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8623           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    8624             :         }
    8625           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8626           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    8627             :         }
    8628             : 
    8629           0 :         return py_wbint_QueryGroupList_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    8630             : }
    8631             : 
    8632           0 : static PyObject *py_wbint_QueryGroupList_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8633             : {
    8634           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    8635           0 :         PyObject *bigendian_obj = NULL;
    8636           0 :         PyObject *ndr64_obj = NULL;
    8637           0 :         uint32_t ndr_push_flags = 0;
    8638             : 
    8639           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    8640             :                 discard_const_p(char *, kwnames),
    8641             :                 &bigendian_obj,
    8642             :                 &ndr64_obj)) {
    8643           0 :                 return NULL;
    8644             :         }
    8645             : 
    8646           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8647           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    8648             :         }
    8649           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8650           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    8651             :         }
    8652             : 
    8653           0 :         return py_wbint_QueryGroupList_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    8654             : }
    8655             : 
    8656           0 : static PyObject *py_wbint_QueryGroupList_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    8657             : {
    8658           0 :         const struct ndr_interface_call *call = NULL;
    8659           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj);
    8660           0 :         struct ndr_pull *pull = NULL;
    8661             :         enum ndr_err_code err;
    8662             : 
    8663           0 :         if (ndr_table_winbind.num_calls < 14) {
    8664           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryGroupList_ndr_unpack");
    8665           0 :                 return NULL;
    8666             :         }
    8667           0 :         call = &ndr_table_winbind.calls[13];
    8668             : 
    8669           0 :         pull = ndr_pull_init_blob(blob, object);
    8670           0 :         if (pull == NULL) {
    8671           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    8672           0 :                 return NULL;
    8673             :         }
    8674             : 
    8675           0 :         pull->flags |= ndr_pull_flags;
    8676             : 
    8677           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    8678           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8679           0 :                 TALLOC_FREE(pull);
    8680           0 :                 PyErr_SetNdrError(err);
    8681           0 :                 return NULL;
    8682             :         }
    8683           0 :         if (!allow_remaining) {
    8684             :                 uint32_t highest_ofs;
    8685             : 
    8686           0 :                 if (pull->offset > pull->relative_highest_offset) {
    8687           0 :                         highest_ofs = pull->offset;
    8688             :                 } else {
    8689           0 :                         highest_ofs = pull->relative_highest_offset;
    8690             :                 }
    8691           0 :                 if (highest_ofs < pull->data_size) {
    8692           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    8693             :                                 "not all bytes consumed ofs[%u] size[%u]",
    8694             :                                 highest_ofs, pull->data_size);
    8695           0 :                         TALLOC_FREE(pull);
    8696           0 :                         PyErr_SetNdrError(err);
    8697           0 :                         return NULL;
    8698             :                 }
    8699             :         }
    8700             : 
    8701           0 :         TALLOC_FREE(pull);
    8702           0 :         Py_RETURN_NONE;
    8703             : }
    8704             : 
    8705           0 : static PyObject *py_wbint_QueryGroupList_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8706             : {
    8707             :         DATA_BLOB blob;
    8708           0 :         Py_ssize_t blob_length = 0;
    8709           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    8710           0 :         PyObject *bigendian_obj = NULL;
    8711           0 :         PyObject *ndr64_obj = NULL;
    8712           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    8713           0 :         PyObject *allow_remaining_obj = NULL;
    8714           0 :         bool allow_remaining = false;
    8715             : 
    8716           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    8717             :                 discard_const_p(char *, kwnames),
    8718             :                 &blob.data, &blob_length,
    8719             :                 &bigendian_obj,
    8720             :                 &ndr64_obj,
    8721             :                 &allow_remaining_obj)) {
    8722           0 :                 return NULL;
    8723             :         }
    8724           0 :         blob.length = blob_length;
    8725             : 
    8726           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8727           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    8728             :         }
    8729           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8730           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    8731             :         }
    8732             : 
    8733           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    8734           0 :                 allow_remaining = true;
    8735             :         }
    8736             : 
    8737           0 :         return py_wbint_QueryGroupList_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    8738             : }
    8739             : 
    8740           0 : static PyObject *py_wbint_QueryGroupList_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8741             : {
    8742             :         DATA_BLOB blob;
    8743           0 :         Py_ssize_t blob_length = 0;
    8744           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    8745           0 :         PyObject *bigendian_obj = NULL;
    8746           0 :         PyObject *ndr64_obj = NULL;
    8747           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    8748           0 :         PyObject *allow_remaining_obj = NULL;
    8749           0 :         bool allow_remaining = false;
    8750             : 
    8751           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    8752             :                 discard_const_p(char *, kwnames),
    8753             :                 &blob.data, &blob_length,
    8754             :                 &bigendian_obj,
    8755             :                 &ndr64_obj,
    8756             :                 &allow_remaining_obj)) {
    8757           0 :                 return NULL;
    8758             :         }
    8759           0 :         blob.length = blob_length;
    8760             : 
    8761           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8762           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    8763             :         }
    8764           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8765           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    8766             :         }
    8767             : 
    8768           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    8769           0 :                 allow_remaining = true;
    8770             :         }
    8771             : 
    8772           0 :         return py_wbint_QueryGroupList_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    8773             : }
    8774             : 
    8775           0 : static PyObject *py_wbint_QueryGroupList_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    8776             : {
    8777           0 :         const struct ndr_interface_call *call = NULL;
    8778           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj);
    8779             :         PyObject *ret;
    8780             :         char *retstr;
    8781             : 
    8782           0 :         if (ndr_table_winbind.num_calls < 14) {
    8783           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryGroupList_ndr_print");
    8784           0 :                 return NULL;
    8785             :         }
    8786           0 :         call = &ndr_table_winbind.calls[13];
    8787             : 
    8788           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    8789           0 :         ret = PyUnicode_FromString(retstr);
    8790           0 :         TALLOC_FREE(retstr);
    8791             : 
    8792           0 :         return ret;
    8793             : }
    8794             : 
    8795           0 : static PyObject *py_wbint_QueryGroupList_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    8796             : {
    8797           0 :         return py_wbint_QueryGroupList_ndr_print(py_obj, "wbint_QueryGroupList_in", NDR_IN);
    8798             : }
    8799             : 
    8800           0 : static PyObject *py_wbint_QueryGroupList_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    8801             : {
    8802           0 :         return py_wbint_QueryGroupList_ndr_print(py_obj, "wbint_QueryGroupList_out", NDR_OUT);
    8803             : }
    8804             : 
    8805             : static PyMethodDef py_wbint_QueryGroupList_methods[] = {
    8806             :         { "opnum", (PyCFunction)py_wbint_QueryGroupList_ndr_opnum, METH_NOARGS|METH_CLASS,
    8807             :                 "winbind.wbint_QueryGroupList.opnum() -> 13 (0x0d) " },
    8808             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    8809             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    8810             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    8811             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    8812             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    8813             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    8814             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    8815             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    8816             :         { "__ndr_print_in__", (PyCFunction)py_wbint_QueryGroupList_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    8817             :         { "__ndr_print_out__", (PyCFunction)py_wbint_QueryGroupList_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    8818             :         { NULL, NULL, 0, NULL }
    8819             : };
    8820             : 
    8821             : 
    8822             : static PyTypeObject wbint_QueryGroupList_Type = {
    8823             :         PyVarObject_HEAD_INIT(NULL, 0)
    8824             :         .tp_name = "winbind.wbint_QueryGroupList",
    8825             :         .tp_getset = py_wbint_QueryGroupList_getsetters,
    8826             :         .tp_methods = py_wbint_QueryGroupList_methods,
    8827             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    8828             :         .tp_new = py_wbint_QueryGroupList_new,
    8829             : };
    8830             : 
    8831           0 : static bool pack_py_wbint_QueryGroupList_args_in(PyObject *args, PyObject *kwargs, struct wbint_QueryGroupList *r)
    8832             : {
    8833           0 :         const char *kwnames[] = {
    8834             :                 NULL
    8835             :         };
    8836             : 
    8837           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_QueryGroupList", discard_const_p(char *, kwnames))) {
    8838           0 :                 return false;
    8839             :         }
    8840             : 
    8841           0 :         return true;
    8842             : }
    8843             : 
    8844           0 : static PyObject *unpack_py_wbint_QueryGroupList_args_out(struct wbint_QueryGroupList *r)
    8845             : {
    8846             :         PyObject *result;
    8847             :         PyObject *py_groups;
    8848           0 :         py_groups = pytalloc_reference_ex(&wbint_Principals_Type, r->out.groups, r->out.groups);
    8849           0 :         result = py_groups;
    8850           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    8851           0 :                 PyErr_SetNTSTATUS(r->out.result);
    8852           0 :                 return NULL;
    8853             :         }
    8854             : 
    8855           0 :         return result;
    8856             : }
    8857             : 
    8858             : 
    8859           0 : static PyObject *py_wbint_QueryUserRidList_out_get_rids(PyObject *obj, void *closure)
    8860             : {
    8861           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(obj);
    8862             :         PyObject *py_rids;
    8863           0 :         if (object->out.rids == NULL) {
    8864           0 :                 Py_RETURN_NONE;
    8865             :         }
    8866           0 :         py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, object->out.rids, object->out.rids);
    8867           0 :         return py_rids;
    8868             : }
    8869             : 
    8870           0 : static int py_wbint_QueryUserRidList_out_set_rids(PyObject *py_obj, PyObject *value, void *closure)
    8871             : {
    8872           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj);
    8873           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids));
    8874           0 :         if (value == NULL) {
    8875           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids");
    8876           0 :                 return -1;
    8877             :         }
    8878           0 :         object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids);
    8879           0 :         if (object->out.rids == NULL) {
    8880           0 :                 PyErr_NoMemory();
    8881           0 :                 return -1;
    8882             :         }
    8883           0 :         PY_CHECK_TYPE(&wbint_RidArray_Type, value, return -1;);
    8884           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    8885           0 :                 PyErr_NoMemory();
    8886           0 :                 return -1;
    8887             :         }
    8888           0 :         object->out.rids = (struct wbint_RidArray *)pytalloc_get_ptr(value);
    8889           0 :         return 0;
    8890             : }
    8891             : 
    8892           0 : static PyObject *py_wbint_QueryUserRidList_get_result(PyObject *obj, void *closure)
    8893             : {
    8894           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(obj);
    8895             :         PyObject *py_result;
    8896           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    8897           0 :         return py_result;
    8898             : }
    8899             : 
    8900           0 : static int py_wbint_QueryUserRidList_set_result(PyObject *py_obj, PyObject *value, void *closure)
    8901             : {
    8902           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj);
    8903           0 :         if (value == NULL) {
    8904           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    8905           0 :                 return -1;
    8906             :         }
    8907           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    8908           0 :         return 0;
    8909             : }
    8910             : 
    8911             : static PyGetSetDef py_wbint_QueryUserRidList_getsetters[] = {
    8912             :         {
    8913             :                 .name = discard_const_p(char, "out_rids"),
    8914             :                 .get = py_wbint_QueryUserRidList_out_get_rids,
    8915             :                 .set = py_wbint_QueryUserRidList_out_set_rids,
    8916             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_RidArray")
    8917             :         },
    8918             :         {
    8919             :                 .name = discard_const_p(char, "result"),
    8920             :                 .get = py_wbint_QueryUserRidList_get_result,
    8921             :                 .set = py_wbint_QueryUserRidList_set_result,
    8922             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    8923             :         },
    8924             :         { .name = NULL }
    8925             : };
    8926             : 
    8927           0 : static PyObject *py_wbint_QueryUserRidList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    8928             : {
    8929           0 :         PyObject *self = pytalloc_new(struct wbint_QueryUserRidList, type);
    8930           0 :         struct wbint_QueryUserRidList *_self = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(self);
    8931           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    8932           0 :         _self->out.rids = talloc_zero(mem_ctx, struct wbint_RidArray);
    8933           0 :         return self;
    8934             : }
    8935             : 
    8936           0 : static PyObject *py_wbint_QueryUserRidList_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    8937             : {
    8938             : 
    8939             : 
    8940           0 :         return PyLong_FromLong(14);
    8941             : }
    8942             : 
    8943           0 : static PyObject *py_wbint_QueryUserRidList_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    8944             : {
    8945           0 :         const struct ndr_interface_call *call = NULL;
    8946           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj);
    8947           0 :         PyObject *ret = NULL;
    8948           0 :         struct ndr_push *push = NULL;
    8949             :         DATA_BLOB blob;
    8950             :         enum ndr_err_code err;
    8951             : 
    8952           0 :         if (ndr_table_winbind.num_calls < 15) {
    8953           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryUserRidList_ndr_pack");
    8954           0 :                 return NULL;
    8955             :         }
    8956           0 :         call = &ndr_table_winbind.calls[14];
    8957             : 
    8958           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    8959           0 :         if (push == NULL) {
    8960           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    8961           0 :                 return NULL;
    8962             :         }
    8963             : 
    8964           0 :         push->flags |= ndr_push_flags;
    8965             : 
    8966           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    8967           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8968           0 :                 TALLOC_FREE(push);
    8969           0 :                 PyErr_SetNdrError(err);
    8970           0 :                 return NULL;
    8971             :         }
    8972           0 :         blob = ndr_push_blob(push);
    8973           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    8974           0 :         TALLOC_FREE(push);
    8975           0 :         return ret;
    8976             : }
    8977             : 
    8978           0 : static PyObject *py_wbint_QueryUserRidList_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8979             : {
    8980           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    8981           0 :         PyObject *bigendian_obj = NULL;
    8982           0 :         PyObject *ndr64_obj = NULL;
    8983           0 :         uint32_t ndr_push_flags = 0;
    8984             : 
    8985           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    8986             :                 discard_const_p(char *, kwnames),
    8987             :                 &bigendian_obj,
    8988             :                 &ndr64_obj)) {
    8989           0 :                 return NULL;
    8990             :         }
    8991             : 
    8992           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8993           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    8994             :         }
    8995           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8996           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    8997             :         }
    8998             : 
    8999           0 :         return py_wbint_QueryUserRidList_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    9000             : }
    9001             : 
    9002           0 : static PyObject *py_wbint_QueryUserRidList_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9003             : {
    9004           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    9005           0 :         PyObject *bigendian_obj = NULL;
    9006           0 :         PyObject *ndr64_obj = NULL;
    9007           0 :         uint32_t ndr_push_flags = 0;
    9008             : 
    9009           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    9010             :                 discard_const_p(char *, kwnames),
    9011             :                 &bigendian_obj,
    9012             :                 &ndr64_obj)) {
    9013           0 :                 return NULL;
    9014             :         }
    9015             : 
    9016           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9017           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    9018             :         }
    9019           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9020           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    9021             :         }
    9022             : 
    9023           0 :         return py_wbint_QueryUserRidList_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    9024             : }
    9025             : 
    9026           0 : static PyObject *py_wbint_QueryUserRidList_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
    9027             : {
    9028           0 :         const struct ndr_interface_call *call = NULL;
    9029           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj);
    9030           0 :         struct ndr_pull *pull = NULL;
    9031             :         enum ndr_err_code err;
    9032             : 
    9033           0 :         if (ndr_table_winbind.num_calls < 15) {
    9034           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryUserRidList_ndr_unpack");
    9035           0 :                 return NULL;
    9036             :         }
    9037           0 :         call = &ndr_table_winbind.calls[14];
    9038             : 
    9039           0 :         pull = ndr_pull_init_blob(blob, object);
    9040           0 :         if (pull == NULL) {
    9041           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    9042           0 :                 return NULL;
    9043             :         }
    9044             : 
    9045           0 :         pull->flags |= ndr_pull_flags;
    9046             : 
    9047           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    9048           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    9049           0 :                 TALLOC_FREE(pull);
    9050           0 :                 PyErr_SetNdrError(err);
    9051           0 :                 return NULL;
    9052             :         }
    9053           0 :         if (!allow_remaining) {
    9054             :                 uint32_t highest_ofs;
    9055             : 
    9056           0 :                 if (pull->offset > pull->relative_highest_offset) {
    9057           0 :                         highest_ofs = pull->offset;
    9058             :                 } else {
    9059           0 :                         highest_ofs = pull->relative_highest_offset;
    9060             :                 }
    9061           0 :                 if (highest_ofs < pull->data_size) {
    9062           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    9063             :                                 "not all bytes consumed ofs[%u] size[%u]",
    9064             :                                 highest_ofs, pull->data_size);
    9065           0 :                         TALLOC_FREE(pull);
    9066           0 :                         PyErr_SetNdrError(err);
    9067           0 :                         return NULL;
    9068             :                 }
    9069             :         }
    9070             : 
    9071           0 :         TALLOC_FREE(pull);
    9072           0 :         Py_RETURN_NONE;
    9073             : }
    9074             : 
    9075           0 : static PyObject *py_wbint_QueryUserRidList_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9076             : {
    9077             :         DATA_BLOB blob;
    9078           0 :         Py_ssize_t blob_length = 0;
    9079           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    9080           0 :         PyObject *bigendian_obj = NULL;
    9081           0 :         PyObject *ndr64_obj = NULL;
    9082           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    9083           0 :         PyObject *allow_remaining_obj = NULL;
    9084           0 :         bool allow_remaining = false;
    9085             : 
    9086           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    9087             :                 discard_const_p(char *, kwnames),
    9088             :                 &blob.data, &blob_length,
    9089             :                 &bigendian_obj,
    9090             :                 &ndr64_obj,
    9091             :                 &allow_remaining_obj)) {
    9092           0 :                 return NULL;
    9093             :         }
    9094           0 :         blob.length = blob_length;
    9095             : 
    9096           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9097           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    9098             :         }
    9099           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9100           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    9101             :         }
    9102             : 
    9103           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    9104           0 :                 allow_remaining = true;
    9105             :         }
    9106             : 
    9107           0 :         return py_wbint_QueryUserRidList_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    9108             : }
    9109             : 
    9110           0 : static PyObject *py_wbint_QueryUserRidList_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9111             : {
    9112             :         DATA_BLOB blob;
    9113           0 :         Py_ssize_t blob_length = 0;
    9114           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    9115           0 :         PyObject *bigendian_obj = NULL;
    9116           0 :         PyObject *ndr64_obj = NULL;
    9117           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    9118           0 :         PyObject *allow_remaining_obj = NULL;
    9119           0 :         bool allow_remaining = false;
    9120             : 
    9121           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    9122             :                 discard_const_p(char *, kwnames),
    9123             :                 &blob.data, &blob_length,
    9124             :                 &bigendian_obj,
    9125             :                 &ndr64_obj,
    9126             :                 &allow_remaining_obj)) {
    9127           0 :                 return NULL;
    9128             :         }
    9129           0 :         blob.length = blob_length;
    9130             : 
    9131           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9132           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    9133             :         }
    9134           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9135           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    9136             :         }
    9137             : 
    9138           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    9139           0 :                 allow_remaining = true;
    9140             :         }
    9141             : 
    9142           0 :         return py_wbint_QueryUserRidList_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    9143             : }
    9144             : 
    9145           0 : static PyObject *py_wbint_QueryUserRidList_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    9146             : {
    9147           0 :         const struct ndr_interface_call *call = NULL;
    9148           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj);
    9149             :         PyObject *ret;
    9150             :         char *retstr;
    9151             : 
    9152           0 :         if (ndr_table_winbind.num_calls < 15) {
    9153           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryUserRidList_ndr_print");
    9154           0 :                 return NULL;
    9155             :         }
    9156           0 :         call = &ndr_table_winbind.calls[14];
    9157             : 
    9158           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    9159           0 :         ret = PyUnicode_FromString(retstr);
    9160           0 :         TALLOC_FREE(retstr);
    9161             : 
    9162           0 :         return ret;
    9163             : }
    9164             : 
    9165           0 : static PyObject *py_wbint_QueryUserRidList_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    9166             : {
    9167           0 :         return py_wbint_QueryUserRidList_ndr_print(py_obj, "wbint_QueryUserRidList_in", NDR_IN);
    9168             : }
    9169             : 
    9170           0 : static PyObject *py_wbint_QueryUserRidList_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    9171             : {
    9172           0 :         return py_wbint_QueryUserRidList_ndr_print(py_obj, "wbint_QueryUserRidList_out", NDR_OUT);
    9173             : }
    9174             : 
    9175             : static PyMethodDef py_wbint_QueryUserRidList_methods[] = {
    9176             :         { "opnum", (PyCFunction)py_wbint_QueryUserRidList_ndr_opnum, METH_NOARGS|METH_CLASS,
    9177             :                 "winbind.wbint_QueryUserRidList.opnum() -> 14 (0x0e) " },
    9178             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    9179             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    9180             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    9181             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    9182             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    9183             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    9184             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    9185             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    9186             :         { "__ndr_print_in__", (PyCFunction)py_wbint_QueryUserRidList_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    9187             :         { "__ndr_print_out__", (PyCFunction)py_wbint_QueryUserRidList_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    9188             :         { NULL, NULL, 0, NULL }
    9189             : };
    9190             : 
    9191             : 
    9192             : static PyTypeObject wbint_QueryUserRidList_Type = {
    9193             :         PyVarObject_HEAD_INIT(NULL, 0)
    9194             :         .tp_name = "winbind.wbint_QueryUserRidList",
    9195             :         .tp_getset = py_wbint_QueryUserRidList_getsetters,
    9196             :         .tp_methods = py_wbint_QueryUserRidList_methods,
    9197             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    9198             :         .tp_new = py_wbint_QueryUserRidList_new,
    9199             : };
    9200             : 
    9201           0 : static bool pack_py_wbint_QueryUserRidList_args_in(PyObject *args, PyObject *kwargs, struct wbint_QueryUserRidList *r)
    9202             : {
    9203           0 :         const char *kwnames[] = {
    9204             :                 NULL
    9205             :         };
    9206             : 
    9207           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_QueryUserRidList", discard_const_p(char *, kwnames))) {
    9208           0 :                 return false;
    9209             :         }
    9210             : 
    9211           0 :         return true;
    9212             : }
    9213             : 
    9214           0 : static PyObject *unpack_py_wbint_QueryUserRidList_args_out(struct wbint_QueryUserRidList *r)
    9215             : {
    9216             :         PyObject *result;
    9217             :         PyObject *py_rids;
    9218           0 :         py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, r->out.rids, r->out.rids);
    9219           0 :         result = py_rids;
    9220           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    9221           0 :                 PyErr_SetNTSTATUS(r->out.result);
    9222           0 :                 return NULL;
    9223             :         }
    9224             : 
    9225           0 :         return result;
    9226             : }
    9227             : 
    9228             : 
    9229           0 : static PyObject *py_wbint_DsGetDcName_in_get_domain_name(PyObject *obj, void *closure)
    9230             : {
    9231           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj);
    9232             :         PyObject *py_domain_name;
    9233           0 :         if (object->in.domain_name == NULL) {
    9234           0 :                 Py_RETURN_NONE;
    9235             :         }
    9236           0 :         if (object->in.domain_name == NULL) {
    9237           0 :                 py_domain_name = Py_None;
    9238           0 :                 Py_INCREF(py_domain_name);
    9239             :         } else {
    9240           0 :                 py_domain_name = PyUnicode_Decode(object->in.domain_name, strlen(object->in.domain_name), "utf-8", "ignore");
    9241             :         }
    9242           0 :         return py_domain_name;
    9243             : }
    9244             : 
    9245           0 : static int py_wbint_DsGetDcName_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
    9246             : {
    9247           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj);
    9248           0 :         if (value == NULL) {
    9249           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name");
    9250           0 :                 return -1;
    9251             :         }
    9252           0 :         object->in.domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_name);
    9253           0 :         if (object->in.domain_name == NULL) {
    9254           0 :                 PyErr_NoMemory();
    9255           0 :                 return -1;
    9256             :         }
    9257             :         {
    9258             :                 const char *test_str;
    9259             :                 const char *talloc_str;
    9260           0 :                 PyObject *unicode = NULL;
    9261           0 :                 if (PyUnicode_Check(value)) {
    9262           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    9263           0 :                         if (unicode == NULL) {
    9264           0 :                                 PyErr_NoMemory();
    9265           0 :                                 return -1;
    9266             :                         }
    9267           0 :                         test_str = PyBytes_AS_STRING(unicode);
    9268           0 :                 } else if (PyBytes_Check(value)) {
    9269           0 :                         test_str = PyBytes_AS_STRING(value);
    9270             :                 } else {
    9271           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    9272           0 :                         return -1;
    9273             :                 }
    9274           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    9275           0 :                 if (unicode != NULL) {
    9276           0 :                         Py_DECREF(unicode);
    9277             :                 }
    9278           0 :                 if (talloc_str == NULL) {
    9279           0 :                         PyErr_NoMemory();
    9280           0 :                         return -1;
    9281             :                 }
    9282           0 :                 object->in.domain_name = talloc_str;
    9283             :         }
    9284           0 :         return 0;
    9285             : }
    9286             : 
    9287           0 : static PyObject *py_wbint_DsGetDcName_in_get_domain_guid(PyObject *obj, void *closure)
    9288             : {
    9289           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj);
    9290             :         PyObject *py_domain_guid;
    9291           0 :         if (object->in.domain_guid == NULL) {
    9292           0 :                 Py_RETURN_NONE;
    9293             :         }
    9294           0 :         if (object->in.domain_guid == NULL) {
    9295           0 :                 py_domain_guid = Py_None;
    9296           0 :                 Py_INCREF(py_domain_guid);
    9297             :         } else {
    9298           0 :                 py_domain_guid = pytalloc_reference_ex(GUID_Type, object->in.domain_guid, object->in.domain_guid);
    9299             :         }
    9300           0 :         return py_domain_guid;
    9301             : }
    9302             : 
    9303           0 : static int py_wbint_DsGetDcName_in_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
    9304             : {
    9305           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj);
    9306           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_guid));
    9307           0 :         if (value == NULL) {
    9308           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_guid");
    9309           0 :                 return -1;
    9310             :         }
    9311           0 :         if (value == Py_None) {
    9312           0 :                 object->in.domain_guid = NULL;
    9313             :         } else {
    9314           0 :                 object->in.domain_guid = NULL;
    9315           0 :                 PY_CHECK_TYPE(GUID_Type, value, return -1;);
    9316           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    9317           0 :                         PyErr_NoMemory();
    9318           0 :                         return -1;
    9319             :                 }
    9320           0 :                 object->in.domain_guid = (struct GUID *)pytalloc_get_ptr(value);
    9321             :         }
    9322           0 :         return 0;
    9323             : }
    9324             : 
    9325           0 : static PyObject *py_wbint_DsGetDcName_in_get_site_name(PyObject *obj, void *closure)
    9326             : {
    9327           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj);
    9328             :         PyObject *py_site_name;
    9329           0 :         if (object->in.site_name == NULL) {
    9330           0 :                 Py_RETURN_NONE;
    9331             :         }
    9332           0 :         if (object->in.site_name == NULL) {
    9333           0 :                 py_site_name = Py_None;
    9334           0 :                 Py_INCREF(py_site_name);
    9335             :         } else {
    9336           0 :                 if (object->in.site_name == NULL) {
    9337           0 :                         py_site_name = Py_None;
    9338           0 :                         Py_INCREF(py_site_name);
    9339             :                 } else {
    9340           0 :                         py_site_name = PyUnicode_Decode(object->in.site_name, strlen(object->in.site_name), "utf-8", "ignore");
    9341             :                 }
    9342             :         }
    9343           0 :         return py_site_name;
    9344             : }
    9345             : 
    9346           0 : static int py_wbint_DsGetDcName_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure)
    9347             : {
    9348           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj);
    9349           0 :         if (value == NULL) {
    9350           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.site_name");
    9351           0 :                 return -1;
    9352             :         }
    9353           0 :         if (value == Py_None) {
    9354           0 :                 object->in.site_name = NULL;
    9355             :         } else {
    9356           0 :                 object->in.site_name = NULL;
    9357             :                 {
    9358             :                         const char *test_str;
    9359             :                         const char *talloc_str;
    9360           0 :                         PyObject *unicode = NULL;
    9361           0 :                         if (PyUnicode_Check(value)) {
    9362           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    9363           0 :                                 if (unicode == NULL) {
    9364           0 :                                         PyErr_NoMemory();
    9365           0 :                                         return -1;
    9366             :                                 }
    9367           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    9368           0 :                         } else if (PyBytes_Check(value)) {
    9369           0 :                                 test_str = PyBytes_AS_STRING(value);
    9370             :                         } else {
    9371           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    9372           0 :                                 return -1;
    9373             :                         }
    9374           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    9375           0 :                         if (unicode != NULL) {
    9376           0 :                                 Py_DECREF(unicode);
    9377             :                         }
    9378           0 :                         if (talloc_str == NULL) {
    9379           0 :                                 PyErr_NoMemory();
    9380           0 :                                 return -1;
    9381             :                         }
    9382           0 :                         object->in.site_name = talloc_str;
    9383             :                 }
    9384             :         }
    9385           0 :         return 0;
    9386             : }
    9387             : 
    9388           0 : static PyObject *py_wbint_DsGetDcName_in_get_flags(PyObject *obj, void *closure)
    9389             : {
    9390           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj);
    9391             :         PyObject *py_flags;
    9392           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
    9393           0 :         return py_flags;
    9394             : }
    9395             : 
    9396           0 : static int py_wbint_DsGetDcName_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
    9397             : {
    9398           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj);
    9399           0 :         if (value == NULL) {
    9400           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
    9401           0 :                 return -1;
    9402