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 recycleplus df22b230 Lines: 349 11092 3.1 %
Date: 2024-02-14 10:14:15 Functions: 5 822 0.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           5 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
      33             : {
      34           5 :         switch (var_size) {
      35           0 :         case 8:
      36           0 :                 return UINT64_MAX;
      37           5 :         case 4:
      38           5 :                 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/samr.h"
      67             : #include "librpc/gen_ndr/misc.h"
      68             : #include "librpc/gen_ndr/security.h"
      69             : #include "librpc/gen_ndr/idmap.h"
      70             : static PyTypeObject wbint_TransID_Type;
      71             : static PyTypeObject wbint_TransIDArray_Type;
      72             : static PyTypeObject wbint_userinfo_Type;
      73             : static PyTypeObject wbint_SidArray_Type;
      74             : static PyTypeObject wbint_RidArray_Type;
      75             : static PyTypeObject wbint_Principal_Type;
      76             : static PyTypeObject wbint_Principals_Type;
      77             : static PyTypeObject wbint_userinfos_Type;
      78             : static PyTypeObject wbint_Validation_Type;
      79             : static PyTypeObject wbint_AuthUserInfo_Type;
      80             : static PyTypeObject wbint_PamAuthCrapValidation_Type;
      81             : static PyTypeObject winbind_InterfaceType;
      82             : static PyTypeObject wbint_Ping_Type;
      83             : static PyTypeObject wbint_LookupSid_Type;
      84             : static PyTypeObject wbint_LookupSids_Type;
      85             : static PyTypeObject wbint_LookupName_Type;
      86             : static PyTypeObject wbint_Sids2UnixIDs_Type;
      87             : static PyTypeObject wbint_UnixIDs2Sids_Type;
      88             : static PyTypeObject wbint_AllocateUid_Type;
      89             : static PyTypeObject wbint_AllocateGid_Type;
      90             : static PyTypeObject wbint_GetNssInfo_Type;
      91             : static PyTypeObject wbint_LookupUserAliases_Type;
      92             : static PyTypeObject wbint_LookupUserGroups_Type;
      93             : static PyTypeObject wbint_QuerySequenceNumber_Type;
      94             : static PyTypeObject wbint_LookupGroupMembers_Type;
      95             : static PyTypeObject wbint_QueryGroupList_Type;
      96             : static PyTypeObject wbint_QueryUserRidList_Type;
      97             : static PyTypeObject wbint_DsGetDcName_Type;
      98             : static PyTypeObject wbint_LookupRids_Type;
      99             : static PyTypeObject wbint_CheckMachineAccount_Type;
     100             : static PyTypeObject wbint_ChangeMachineAccount_Type;
     101             : static PyTypeObject wbint_PingDc_Type;
     102             : static PyTypeObject wbint_ListTrustedDomains_Type;
     103             : static PyTypeObject wbint_PamAuth_Type;
     104             : static PyTypeObject wbint_PamAuthCrap_Type;
     105             : static PyTypeObject wbint_PamLogOff_Type;
     106             : static PyTypeObject wbint_PamAuthCrapChangePassword_Type;
     107             : static PyTypeObject wbint_PamAuthChangePassword_Type;
     108             : static PyTypeObject wbint_InitConnection_Type;
     109             : static PyTypeObject winbind_SamLogon_Type;
     110             : static PyTypeObject winbind_DsrUpdateReadOnlyServerDnsRecords_Type;
     111             : static PyTypeObject winbind_LogonControl_Type;
     112             : static PyTypeObject winbind_GetForestTrustInformation_Type;
     113             : static PyTypeObject winbind_SendToSam_Type;
     114             : 
     115             : static PyTypeObject *unixid_Type;
     116             : static PyTypeObject *BaseObject_Type;
     117             : static PyTypeObject *dom_sid_Type;
     118             : static PyTypeObject *netr_Validation_Type;
     119             : static PyTypeObject *lsa_SidArray_Type;
     120             : static PyTypeObject *lsa_RefDomainList_Type;
     121             : static PyTypeObject *lsa_TransNameArray_Type;
     122             : static PyTypeObject *GUID_Type;
     123             : static PyTypeObject *netr_DsRGetDCNameInfo_Type;
     124             : static PyTypeObject *netr_DomainTrustList_Type;
     125             : static PyTypeObject *samr_DomInfo1_Type;
     126             : static PyTypeObject *netr_LogonLevel_Type;
     127             : static PyTypeObject *NL_DNS_NAME_INFO_ARRAY_Type;
     128             : static PyTypeObject *netr_CONTROL_DATA_INFORMATION_Type;
     129             : static PyTypeObject *netr_CONTROL_QUERY_INFORMATION_Type;
     130             : static PyTypeObject *lsa_ForestTrustInformation_Type;
     131             : static PyTypeObject *netr_SendToSamBase_Type;
     132             : static PyTypeObject *ClientConnection_Type;
     133             : static PyTypeObject *ndr_syntax_id_Type;
     134             : 
     135           0 : static PyObject *py_wbint_TransID_get_type_hint(PyObject *obj, void *closure)
     136             : {
     137           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(obj);
     138             :         PyObject *py_type_hint;
     139           0 :         py_type_hint = PyLong_FromLong((uint16_t)object->type_hint);
     140           0 :         return py_type_hint;
     141             : }
     142             : 
     143           0 : static int py_wbint_TransID_set_type_hint(PyObject *py_obj, PyObject *value, void *closure)
     144             : {
     145           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(py_obj);
     146           0 :         if (value == NULL) {
     147           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type_hint");
     148           0 :                 return -1;
     149             :         }
     150             :         {
     151           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type_hint));
     152           0 :                 if (PyLong_Check(value)) {
     153             :                         unsigned long long test_var;
     154           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     155           0 :                         if (PyErr_Occurred() != NULL) {
     156           0 :                                 return -1;
     157             :                         }
     158           0 :                         if (test_var > uint_max) {
     159           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     160             :                                   PyLong_Type.tp_name, uint_max, test_var);
     161           0 :                                 return -1;
     162             :                         }
     163           0 :                         object->type_hint = test_var;
     164             :                 } else {
     165           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     166             :                           PyLong_Type.tp_name);
     167           0 :                         return -1;
     168             :                 }
     169             :         }
     170           0 :         return 0;
     171             : }
     172             : 
     173           0 : static PyObject *py_wbint_TransID_get_domain_index(PyObject *obj, void *closure)
     174             : {
     175           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(obj);
     176             :         PyObject *py_domain_index;
     177           0 :         py_domain_index = PyLong_FromUnsignedLongLong((uint32_t)object->domain_index);
     178           0 :         return py_domain_index;
     179             : }
     180             : 
     181           0 : static int py_wbint_TransID_set_domain_index(PyObject *py_obj, PyObject *value, void *closure)
     182             : {
     183           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(py_obj);
     184           0 :         if (value == NULL) {
     185           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_index");
     186           0 :                 return -1;
     187             :         }
     188             :         {
     189           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_index));
     190           0 :                 if (PyLong_Check(value)) {
     191             :                         unsigned long long test_var;
     192           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     193           0 :                         if (PyErr_Occurred() != NULL) {
     194           0 :                                 return -1;
     195             :                         }
     196           0 :                         if (test_var > uint_max) {
     197           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     198             :                                   PyLong_Type.tp_name, uint_max, test_var);
     199           0 :                                 return -1;
     200             :                         }
     201           0 :                         object->domain_index = test_var;
     202             :                 } else {
     203           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     204             :                           PyLong_Type.tp_name);
     205           0 :                         return -1;
     206             :                 }
     207             :         }
     208           0 :         return 0;
     209             : }
     210             : 
     211           0 : static PyObject *py_wbint_TransID_get_rid(PyObject *obj, void *closure)
     212             : {
     213           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(obj);
     214             :         PyObject *py_rid;
     215           0 :         py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
     216           0 :         return py_rid;
     217             : }
     218             : 
     219           0 : static int py_wbint_TransID_set_rid(PyObject *py_obj, PyObject *value, void *closure)
     220             : {
     221           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(py_obj);
     222           0 :         if (value == NULL) {
     223           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
     224           0 :                 return -1;
     225             :         }
     226             :         {
     227           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
     228           0 :                 if (PyLong_Check(value)) {
     229             :                         unsigned long long test_var;
     230           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     231           0 :                         if (PyErr_Occurred() != NULL) {
     232           0 :                                 return -1;
     233             :                         }
     234           0 :                         if (test_var > uint_max) {
     235           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     236             :                                   PyLong_Type.tp_name, uint_max, test_var);
     237           0 :                                 return -1;
     238             :                         }
     239           0 :                         object->rid = test_var;
     240             :                 } else {
     241           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     242             :                           PyLong_Type.tp_name);
     243           0 :                         return -1;
     244             :                 }
     245             :         }
     246           0 :         return 0;
     247             : }
     248             : 
     249           0 : static PyObject *py_wbint_TransID_get_xid(PyObject *obj, void *closure)
     250             : {
     251           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(obj);
     252             :         PyObject *py_xid;
     253           0 :         py_xid = pytalloc_reference_ex(unixid_Type, pytalloc_get_mem_ctx(obj), &object->xid);
     254           0 :         return py_xid;
     255             : }
     256             : 
     257           0 : static int py_wbint_TransID_set_xid(PyObject *py_obj, PyObject *value, void *closure)
     258             : {
     259           0 :         struct wbint_TransID *object = (struct wbint_TransID *)pytalloc_get_ptr(py_obj);
     260           0 :         if (value == NULL) {
     261           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->xid");
     262           0 :                 return -1;
     263             :         }
     264           0 :         PY_CHECK_TYPE(unixid_Type, value, return -1;);
     265           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     266           0 :                 PyErr_NoMemory();
     267           0 :                 return -1;
     268             :         }
     269           0 :         object->xid = *(struct unixid *)pytalloc_get_ptr(value);
     270           0 :         return 0;
     271             : }
     272             : 
     273             : static PyGetSetDef py_wbint_TransID_getsetters[] = {
     274             :         {
     275             :                 .name = discard_const_p(char, "type_hint"),
     276             :                 .get = py_wbint_TransID_get_type_hint,
     277             :                 .set = py_wbint_TransID_set_type_hint,
     278             :                 .doc = discard_const_p(char, "PIDL-generated element of base type id_type")
     279             :         },
     280             :         {
     281             :                 .name = discard_const_p(char, "domain_index"),
     282             :                 .get = py_wbint_TransID_get_domain_index,
     283             :                 .set = py_wbint_TransID_set_domain_index,
     284             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     285             :         },
     286             :         {
     287             :                 .name = discard_const_p(char, "rid"),
     288             :                 .get = py_wbint_TransID_get_rid,
     289             :                 .set = py_wbint_TransID_set_rid,
     290             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     291             :         },
     292             :         {
     293             :                 .name = discard_const_p(char, "xid"),
     294             :                 .get = py_wbint_TransID_get_xid,
     295             :                 .set = py_wbint_TransID_set_xid,
     296             :                 .doc = discard_const_p(char, "PIDL-generated element of base type unixid")
     297             :         },
     298             :         { .name = NULL }
     299             : };
     300             : 
     301           0 : static PyObject *py_wbint_TransID_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     302             : {
     303           0 :         return pytalloc_new(struct wbint_TransID, type);
     304             : }
     305             : 
     306             : 
     307             : static PyTypeObject wbint_TransID_Type = {
     308             :         PyVarObject_HEAD_INIT(NULL, 0)
     309             :         .tp_name = "winbind.wbint_TransID",
     310             :         .tp_getset = py_wbint_TransID_getsetters,
     311             :         .tp_methods = NULL,
     312             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     313             :         .tp_new = py_wbint_TransID_new,
     314             : };
     315             : 
     316             : 
     317           0 : static PyObject *py_wbint_TransIDArray_get_num_ids(PyObject *obj, void *closure)
     318             : {
     319           0 :         struct wbint_TransIDArray *object = (struct wbint_TransIDArray *)pytalloc_get_ptr(obj);
     320             :         PyObject *py_num_ids;
     321           0 :         py_num_ids = PyLong_FromUnsignedLongLong((uint32_t)object->num_ids);
     322           0 :         return py_num_ids;
     323             : }
     324             : 
     325           0 : static int py_wbint_TransIDArray_set_num_ids(PyObject *py_obj, PyObject *value, void *closure)
     326             : {
     327           0 :         struct wbint_TransIDArray *object = (struct wbint_TransIDArray *)pytalloc_get_ptr(py_obj);
     328           0 :         if (value == NULL) {
     329           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_ids");
     330           0 :                 return -1;
     331             :         }
     332             :         {
     333           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_ids));
     334           0 :                 if (PyLong_Check(value)) {
     335             :                         unsigned long long test_var;
     336           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     337           0 :                         if (PyErr_Occurred() != NULL) {
     338           0 :                                 return -1;
     339             :                         }
     340           0 :                         if (test_var > uint_max) {
     341           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     342             :                                   PyLong_Type.tp_name, uint_max, test_var);
     343           0 :                                 return -1;
     344             :                         }
     345           0 :                         object->num_ids = test_var;
     346             :                 } else {
     347           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     348             :                           PyLong_Type.tp_name);
     349           0 :                         return -1;
     350             :                 }
     351             :         }
     352           0 :         return 0;
     353             : }
     354             : 
     355           0 : static PyObject *py_wbint_TransIDArray_get_ids(PyObject *obj, void *closure)
     356             : {
     357           0 :         struct wbint_TransIDArray *object = (struct wbint_TransIDArray *)pytalloc_get_ptr(obj);
     358             :         PyObject *py_ids;
     359           0 :         py_ids = PyList_New(object->num_ids);
     360           0 :         if (py_ids == NULL) {
     361           0 :                 return NULL;
     362             :         }
     363             :         {
     364             :                 int ids_cntr_0;
     365           0 :                 for (ids_cntr_0 = 0; ids_cntr_0 < (object->num_ids); ids_cntr_0++) {
     366             :                         PyObject *py_ids_0;
     367           0 :                         py_ids_0 = pytalloc_reference_ex(&wbint_TransID_Type, object->ids, &object->ids[ids_cntr_0]);
     368           0 :                         PyList_SetItem(py_ids, ids_cntr_0, py_ids_0);
     369             :                 }
     370             :         }
     371           0 :         return py_ids;
     372             : }
     373             : 
     374           0 : static int py_wbint_TransIDArray_set_ids(PyObject *py_obj, PyObject *value, void *closure)
     375             : {
     376           0 :         struct wbint_TransIDArray *object = (struct wbint_TransIDArray *)pytalloc_get_ptr(py_obj);
     377           0 :         if (value == NULL) {
     378           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ids");
     379           0 :                 return -1;
     380             :         }
     381           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
     382             :         {
     383             :                 int ids_cntr_0;
     384           0 :                 object->ids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->ids, PyList_GET_SIZE(value));
     385           0 :                 if (!object->ids) { return -1;; }
     386           0 :                 talloc_set_name_const(object->ids, "ARRAY: object->ids");
     387           0 :                 for (ids_cntr_0 = 0; ids_cntr_0 < PyList_GET_SIZE(value); ids_cntr_0++) {
     388           0 :                         if (PyList_GET_ITEM(value, ids_cntr_0) == NULL) {
     389           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ids[ids_cntr_0]");
     390           0 :                                 return -1;
     391             :                         }
     392           0 :                         PY_CHECK_TYPE(&wbint_TransID_Type, PyList_GET_ITEM(value, ids_cntr_0), return -1;);
     393           0 :                         if (talloc_reference(object->ids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, ids_cntr_0))) == NULL) {
     394           0 :                                 PyErr_NoMemory();
     395           0 :                                 return -1;
     396             :                         }
     397           0 :                         object->ids[ids_cntr_0] = *(struct wbint_TransID *)pytalloc_get_ptr(PyList_GET_ITEM(value, ids_cntr_0));
     398             :                 }
     399             :         }
     400           0 :         return 0;
     401             : }
     402             : 
     403             : static PyGetSetDef py_wbint_TransIDArray_getsetters[] = {
     404             :         {
     405             :                 .name = discard_const_p(char, "num_ids"),
     406             :                 .get = py_wbint_TransIDArray_get_num_ids,
     407             :                 .set = py_wbint_TransIDArray_set_num_ids,
     408             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     409             :         },
     410             :         {
     411             :                 .name = discard_const_p(char, "ids"),
     412             :                 .get = py_wbint_TransIDArray_get_ids,
     413             :                 .set = py_wbint_TransIDArray_set_ids,
     414             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_TransID")
     415             :         },
     416             :         { .name = NULL }
     417             : };
     418             : 
     419           0 : static PyObject *py_wbint_TransIDArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     420             : {
     421           0 :         return pytalloc_new(struct wbint_TransIDArray, type);
     422             : }
     423             : 
     424             : 
     425             : static PyTypeObject wbint_TransIDArray_Type = {
     426             :         PyVarObject_HEAD_INIT(NULL, 0)
     427             :         .tp_name = "winbind.wbint_TransIDArray",
     428             :         .tp_getset = py_wbint_TransIDArray_getsetters,
     429             :         .tp_methods = NULL,
     430             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     431             :         .tp_new = py_wbint_TransIDArray_new,
     432             : };
     433             : 
     434             : 
     435           0 : static PyObject *py_wbint_userinfo_get_domain_name(PyObject *obj, void *closure)
     436             : {
     437           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     438             :         PyObject *py_domain_name;
     439           0 :         if (object->domain_name == NULL) {
     440           0 :                 Py_RETURN_NONE;
     441             :         }
     442           0 :         if (object->domain_name == NULL) {
     443           0 :                 py_domain_name = Py_None;
     444           0 :                 Py_INCREF(py_domain_name);
     445             :         } else {
     446           0 :                 if (object->domain_name == NULL) {
     447           0 :                         py_domain_name = Py_None;
     448           0 :                         Py_INCREF(py_domain_name);
     449             :                 } else {
     450           0 :                         py_domain_name = PyUnicode_Decode(object->domain_name, strlen(object->domain_name), "utf-8", "ignore");
     451             :                 }
     452             :         }
     453           0 :         return py_domain_name;
     454             : }
     455             : 
     456           0 : static int py_wbint_userinfo_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
     457             : {
     458           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     459           0 :         if (value == NULL) {
     460           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
     461           0 :                 return -1;
     462             :         }
     463           0 :         if (value == Py_None) {
     464           0 :                 object->domain_name = NULL;
     465             :         } else {
     466           0 :                 object->domain_name = NULL;
     467             :                 {
     468             :                         const char *test_str;
     469             :                         const char *talloc_str;
     470           0 :                         PyObject *unicode = NULL;
     471           0 :                         if (PyUnicode_Check(value)) {
     472           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     473           0 :                                 if (unicode == NULL) {
     474           0 :                                         PyErr_NoMemory();
     475           0 :                                         return -1;
     476             :                                 }
     477           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     478           0 :                         } else if (PyBytes_Check(value)) {
     479           0 :                                 test_str = PyBytes_AS_STRING(value);
     480             :                         } else {
     481           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     482           0 :                                 return -1;
     483             :                         }
     484           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     485           0 :                         if (unicode != NULL) {
     486           0 :                                 Py_DECREF(unicode);
     487             :                         }
     488           0 :                         if (talloc_str == NULL) {
     489           0 :                                 PyErr_NoMemory();
     490           0 :                                 return -1;
     491             :                         }
     492           0 :                         object->domain_name = talloc_str;
     493             :                 }
     494             :         }
     495           0 :         return 0;
     496             : }
     497             : 
     498           0 : static PyObject *py_wbint_userinfo_get_acct_name(PyObject *obj, void *closure)
     499             : {
     500           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     501             :         PyObject *py_acct_name;
     502           0 :         if (object->acct_name == NULL) {
     503           0 :                 Py_RETURN_NONE;
     504             :         }
     505           0 :         if (object->acct_name == NULL) {
     506           0 :                 py_acct_name = Py_None;
     507           0 :                 Py_INCREF(py_acct_name);
     508             :         } else {
     509           0 :                 if (object->acct_name == NULL) {
     510           0 :                         py_acct_name = Py_None;
     511           0 :                         Py_INCREF(py_acct_name);
     512             :                 } else {
     513           0 :                         py_acct_name = PyUnicode_Decode(object->acct_name, strlen(object->acct_name), "utf-8", "ignore");
     514             :                 }
     515             :         }
     516           0 :         return py_acct_name;
     517             : }
     518             : 
     519           0 : static int py_wbint_userinfo_set_acct_name(PyObject *py_obj, PyObject *value, void *closure)
     520             : {
     521           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     522           0 :         if (value == NULL) {
     523           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_name");
     524           0 :                 return -1;
     525             :         }
     526           0 :         if (value == Py_None) {
     527           0 :                 object->acct_name = NULL;
     528             :         } else {
     529           0 :                 object->acct_name = NULL;
     530             :                 {
     531             :                         const char *test_str;
     532             :                         const char *talloc_str;
     533           0 :                         PyObject *unicode = NULL;
     534           0 :                         if (PyUnicode_Check(value)) {
     535           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     536           0 :                                 if (unicode == NULL) {
     537           0 :                                         PyErr_NoMemory();
     538           0 :                                         return -1;
     539             :                                 }
     540           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     541           0 :                         } else if (PyBytes_Check(value)) {
     542           0 :                                 test_str = PyBytes_AS_STRING(value);
     543             :                         } else {
     544           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     545           0 :                                 return -1;
     546             :                         }
     547           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     548           0 :                         if (unicode != NULL) {
     549           0 :                                 Py_DECREF(unicode);
     550             :                         }
     551           0 :                         if (talloc_str == NULL) {
     552           0 :                                 PyErr_NoMemory();
     553           0 :                                 return -1;
     554             :                         }
     555           0 :                         object->acct_name = talloc_str;
     556             :                 }
     557             :         }
     558           0 :         return 0;
     559             : }
     560             : 
     561           0 : static PyObject *py_wbint_userinfo_get_full_name(PyObject *obj, void *closure)
     562             : {
     563           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     564             :         PyObject *py_full_name;
     565           0 :         if (object->full_name == NULL) {
     566           0 :                 Py_RETURN_NONE;
     567             :         }
     568           0 :         if (object->full_name == NULL) {
     569           0 :                 py_full_name = Py_None;
     570           0 :                 Py_INCREF(py_full_name);
     571             :         } else {
     572           0 :                 if (object->full_name == NULL) {
     573           0 :                         py_full_name = Py_None;
     574           0 :                         Py_INCREF(py_full_name);
     575             :                 } else {
     576           0 :                         py_full_name = PyUnicode_Decode(object->full_name, strlen(object->full_name), "utf-8", "ignore");
     577             :                 }
     578             :         }
     579           0 :         return py_full_name;
     580             : }
     581             : 
     582           0 : static int py_wbint_userinfo_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
     583             : {
     584           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     585           0 :         if (value == NULL) {
     586           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name");
     587           0 :                 return -1;
     588             :         }
     589           0 :         if (value == Py_None) {
     590           0 :                 object->full_name = NULL;
     591             :         } else {
     592           0 :                 object->full_name = NULL;
     593             :                 {
     594             :                         const char *test_str;
     595             :                         const char *talloc_str;
     596           0 :                         PyObject *unicode = NULL;
     597           0 :                         if (PyUnicode_Check(value)) {
     598           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     599           0 :                                 if (unicode == NULL) {
     600           0 :                                         PyErr_NoMemory();
     601           0 :                                         return -1;
     602             :                                 }
     603           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     604           0 :                         } else if (PyBytes_Check(value)) {
     605           0 :                                 test_str = PyBytes_AS_STRING(value);
     606             :                         } else {
     607           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     608           0 :                                 return -1;
     609             :                         }
     610           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     611           0 :                         if (unicode != NULL) {
     612           0 :                                 Py_DECREF(unicode);
     613             :                         }
     614           0 :                         if (talloc_str == NULL) {
     615           0 :                                 PyErr_NoMemory();
     616           0 :                                 return -1;
     617             :                         }
     618           0 :                         object->full_name = talloc_str;
     619             :                 }
     620             :         }
     621           0 :         return 0;
     622             : }
     623             : 
     624           0 : static PyObject *py_wbint_userinfo_get_homedir(PyObject *obj, void *closure)
     625             : {
     626           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     627             :         PyObject *py_homedir;
     628           0 :         if (object->homedir == NULL) {
     629           0 :                 Py_RETURN_NONE;
     630             :         }
     631           0 :         if (object->homedir == NULL) {
     632           0 :                 py_homedir = Py_None;
     633           0 :                 Py_INCREF(py_homedir);
     634             :         } else {
     635           0 :                 if (object->homedir == NULL) {
     636           0 :                         py_homedir = Py_None;
     637           0 :                         Py_INCREF(py_homedir);
     638             :                 } else {
     639           0 :                         py_homedir = PyUnicode_Decode(object->homedir, strlen(object->homedir), "utf-8", "ignore");
     640             :                 }
     641             :         }
     642           0 :         return py_homedir;
     643             : }
     644             : 
     645           0 : static int py_wbint_userinfo_set_homedir(PyObject *py_obj, PyObject *value, void *closure)
     646             : {
     647           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     648           0 :         if (value == NULL) {
     649           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->homedir");
     650           0 :                 return -1;
     651             :         }
     652           0 :         if (value == Py_None) {
     653           0 :                 object->homedir = NULL;
     654             :         } else {
     655           0 :                 object->homedir = NULL;
     656             :                 {
     657             :                         const char *test_str;
     658             :                         const char *talloc_str;
     659           0 :                         PyObject *unicode = NULL;
     660           0 :                         if (PyUnicode_Check(value)) {
     661           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     662           0 :                                 if (unicode == NULL) {
     663           0 :                                         PyErr_NoMemory();
     664           0 :                                         return -1;
     665             :                                 }
     666           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     667           0 :                         } else if (PyBytes_Check(value)) {
     668           0 :                                 test_str = PyBytes_AS_STRING(value);
     669             :                         } else {
     670           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     671           0 :                                 return -1;
     672             :                         }
     673           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     674           0 :                         if (unicode != NULL) {
     675           0 :                                 Py_DECREF(unicode);
     676             :                         }
     677           0 :                         if (talloc_str == NULL) {
     678           0 :                                 PyErr_NoMemory();
     679           0 :                                 return -1;
     680             :                         }
     681           0 :                         object->homedir = talloc_str;
     682             :                 }
     683             :         }
     684           0 :         return 0;
     685             : }
     686             : 
     687           0 : static PyObject *py_wbint_userinfo_get_shell(PyObject *obj, void *closure)
     688             : {
     689           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     690             :         PyObject *py_shell;
     691           0 :         if (object->shell == NULL) {
     692           0 :                 Py_RETURN_NONE;
     693             :         }
     694           0 :         if (object->shell == NULL) {
     695           0 :                 py_shell = Py_None;
     696           0 :                 Py_INCREF(py_shell);
     697             :         } else {
     698           0 :                 if (object->shell == NULL) {
     699           0 :                         py_shell = Py_None;
     700           0 :                         Py_INCREF(py_shell);
     701             :                 } else {
     702           0 :                         py_shell = PyUnicode_Decode(object->shell, strlen(object->shell), "utf-8", "ignore");
     703             :                 }
     704             :         }
     705           0 :         return py_shell;
     706             : }
     707             : 
     708           0 : static int py_wbint_userinfo_set_shell(PyObject *py_obj, PyObject *value, void *closure)
     709             : {
     710           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     711           0 :         if (value == NULL) {
     712           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->shell");
     713           0 :                 return -1;
     714             :         }
     715           0 :         if (value == Py_None) {
     716           0 :                 object->shell = NULL;
     717             :         } else {
     718           0 :                 object->shell = NULL;
     719             :                 {
     720             :                         const char *test_str;
     721             :                         const char *talloc_str;
     722           0 :                         PyObject *unicode = NULL;
     723           0 :                         if (PyUnicode_Check(value)) {
     724           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     725           0 :                                 if (unicode == NULL) {
     726           0 :                                         PyErr_NoMemory();
     727           0 :                                         return -1;
     728             :                                 }
     729           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     730           0 :                         } else if (PyBytes_Check(value)) {
     731           0 :                                 test_str = PyBytes_AS_STRING(value);
     732             :                         } else {
     733           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     734           0 :                                 return -1;
     735             :                         }
     736           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     737           0 :                         if (unicode != NULL) {
     738           0 :                                 Py_DECREF(unicode);
     739             :                         }
     740           0 :                         if (talloc_str == NULL) {
     741           0 :                                 PyErr_NoMemory();
     742           0 :                                 return -1;
     743             :                         }
     744           0 :                         object->shell = talloc_str;
     745             :                 }
     746             :         }
     747           0 :         return 0;
     748             : }
     749             : 
     750           0 : static PyObject *py_wbint_userinfo_get_uid(PyObject *obj, void *closure)
     751             : {
     752           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     753             :         PyObject *py_uid;
     754           0 :         py_uid = PyLong_FromUnsignedLongLong(object->uid);
     755           0 :         return py_uid;
     756             : }
     757             : 
     758           0 : static int py_wbint_userinfo_set_uid(PyObject *py_obj, PyObject *value, void *closure)
     759             : {
     760           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     761           0 :         if (value == NULL) {
     762           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->uid");
     763           0 :                 return -1;
     764             :         }
     765             :         {
     766           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->uid));
     767           0 :                 if (PyLong_Check(value)) {
     768             :                         unsigned long long test_var;
     769           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     770           0 :                         if (PyErr_Occurred() != NULL) {
     771           0 :                                 return -1;
     772             :                         }
     773           0 :                         if (test_var > uint_max) {
     774           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     775             :                                   PyLong_Type.tp_name, uint_max, test_var);
     776           0 :                                 return -1;
     777             :                         }
     778           0 :                         object->uid = test_var;
     779             :                 } else {
     780           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     781             :                           PyLong_Type.tp_name);
     782           0 :                         return -1;
     783             :                 }
     784             :         }
     785           0 :         return 0;
     786             : }
     787             : 
     788           0 : static PyObject *py_wbint_userinfo_get_primary_gid(PyObject *obj, void *closure)
     789             : {
     790           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     791             :         PyObject *py_primary_gid;
     792           0 :         py_primary_gid = PyLong_FromUnsignedLongLong(object->primary_gid);
     793           0 :         return py_primary_gid;
     794             : }
     795             : 
     796           0 : static int py_wbint_userinfo_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
     797             : {
     798           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     799           0 :         if (value == NULL) {
     800           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid");
     801           0 :                 return -1;
     802             :         }
     803             :         {
     804           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid));
     805           0 :                 if (PyLong_Check(value)) {
     806             :                         unsigned long long test_var;
     807           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     808           0 :                         if (PyErr_Occurred() != NULL) {
     809           0 :                                 return -1;
     810             :                         }
     811           0 :                         if (test_var > uint_max) {
     812           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     813             :                                   PyLong_Type.tp_name, uint_max, test_var);
     814           0 :                                 return -1;
     815             :                         }
     816           0 :                         object->primary_gid = test_var;
     817             :                 } else {
     818           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     819             :                           PyLong_Type.tp_name);
     820           0 :                         return -1;
     821             :                 }
     822             :         }
     823           0 :         return 0;
     824             : }
     825             : 
     826           0 : static PyObject *py_wbint_userinfo_get_primary_group_name(PyObject *obj, void *closure)
     827             : {
     828           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     829             :         PyObject *py_primary_group_name;
     830           0 :         if (object->primary_group_name == NULL) {
     831           0 :                 Py_RETURN_NONE;
     832             :         }
     833           0 :         if (object->primary_group_name == NULL) {
     834           0 :                 py_primary_group_name = Py_None;
     835           0 :                 Py_INCREF(py_primary_group_name);
     836             :         } else {
     837           0 :                 if (object->primary_group_name == NULL) {
     838           0 :                         py_primary_group_name = Py_None;
     839           0 :                         Py_INCREF(py_primary_group_name);
     840             :                 } else {
     841           0 :                         py_primary_group_name = PyUnicode_Decode(object->primary_group_name, strlen(object->primary_group_name), "utf-8", "ignore");
     842             :                 }
     843             :         }
     844           0 :         return py_primary_group_name;
     845             : }
     846             : 
     847           0 : static int py_wbint_userinfo_set_primary_group_name(PyObject *py_obj, PyObject *value, void *closure)
     848             : {
     849           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     850           0 :         if (value == NULL) {
     851           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_group_name");
     852           0 :                 return -1;
     853             :         }
     854           0 :         if (value == Py_None) {
     855           0 :                 object->primary_group_name = NULL;
     856             :         } else {
     857           0 :                 object->primary_group_name = NULL;
     858             :                 {
     859             :                         const char *test_str;
     860             :                         const char *talloc_str;
     861           0 :                         PyObject *unicode = NULL;
     862           0 :                         if (PyUnicode_Check(value)) {
     863           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     864           0 :                                 if (unicode == NULL) {
     865           0 :                                         PyErr_NoMemory();
     866           0 :                                         return -1;
     867             :                                 }
     868           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     869           0 :                         } else if (PyBytes_Check(value)) {
     870           0 :                                 test_str = PyBytes_AS_STRING(value);
     871             :                         } else {
     872           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     873           0 :                                 return -1;
     874             :                         }
     875           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     876           0 :                         if (unicode != NULL) {
     877           0 :                                 Py_DECREF(unicode);
     878             :                         }
     879           0 :                         if (talloc_str == NULL) {
     880           0 :                                 PyErr_NoMemory();
     881           0 :                                 return -1;
     882             :                         }
     883           0 :                         object->primary_group_name = talloc_str;
     884             :                 }
     885             :         }
     886           0 :         return 0;
     887             : }
     888             : 
     889           0 : static PyObject *py_wbint_userinfo_get_user_sid(PyObject *obj, void *closure)
     890             : {
     891           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     892             :         PyObject *py_user_sid;
     893           0 :         py_user_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->user_sid);
     894           0 :         return py_user_sid;
     895             : }
     896             : 
     897           0 : static int py_wbint_userinfo_set_user_sid(PyObject *py_obj, PyObject *value, void *closure)
     898             : {
     899           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     900           0 :         if (value == NULL) {
     901           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_sid");
     902           0 :                 return -1;
     903             :         }
     904           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
     905           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     906           0 :                 PyErr_NoMemory();
     907           0 :                 return -1;
     908             :         }
     909           0 :         object->user_sid = *(struct dom_sid *)pytalloc_get_ptr(value);
     910           0 :         return 0;
     911             : }
     912             : 
     913           0 : static PyObject *py_wbint_userinfo_get_group_sid(PyObject *obj, void *closure)
     914             : {
     915           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(obj);
     916             :         PyObject *py_group_sid;
     917           0 :         py_group_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->group_sid);
     918           0 :         return py_group_sid;
     919             : }
     920             : 
     921           0 : static int py_wbint_userinfo_set_group_sid(PyObject *py_obj, PyObject *value, void *closure)
     922             : {
     923           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
     924           0 :         if (value == NULL) {
     925           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->group_sid");
     926           0 :                 return -1;
     927             :         }
     928           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
     929           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     930           0 :                 PyErr_NoMemory();
     931           0 :                 return -1;
     932             :         }
     933           0 :         object->group_sid = *(struct dom_sid *)pytalloc_get_ptr(value);
     934           0 :         return 0;
     935             : }
     936             : 
     937             : static PyGetSetDef py_wbint_userinfo_getsetters[] = {
     938             :         {
     939             :                 .name = discard_const_p(char, "domain_name"),
     940             :                 .get = py_wbint_userinfo_get_domain_name,
     941             :                 .set = py_wbint_userinfo_set_domain_name,
     942             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     943             :         },
     944             :         {
     945             :                 .name = discard_const_p(char, "acct_name"),
     946             :                 .get = py_wbint_userinfo_get_acct_name,
     947             :                 .set = py_wbint_userinfo_set_acct_name,
     948             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     949             :         },
     950             :         {
     951             :                 .name = discard_const_p(char, "full_name"),
     952             :                 .get = py_wbint_userinfo_get_full_name,
     953             :                 .set = py_wbint_userinfo_set_full_name,
     954             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     955             :         },
     956             :         {
     957             :                 .name = discard_const_p(char, "homedir"),
     958             :                 .get = py_wbint_userinfo_get_homedir,
     959             :                 .set = py_wbint_userinfo_set_homedir,
     960             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     961             :         },
     962             :         {
     963             :                 .name = discard_const_p(char, "shell"),
     964             :                 .get = py_wbint_userinfo_get_shell,
     965             :                 .set = py_wbint_userinfo_set_shell,
     966             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     967             :         },
     968             :         {
     969             :                 .name = discard_const_p(char, "uid"),
     970             :                 .get = py_wbint_userinfo_get_uid,
     971             :                 .set = py_wbint_userinfo_set_uid,
     972             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
     973             :         },
     974             :         {
     975             :                 .name = discard_const_p(char, "primary_gid"),
     976             :                 .get = py_wbint_userinfo_get_primary_gid,
     977             :                 .set = py_wbint_userinfo_set_primary_gid,
     978             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
     979             :         },
     980             :         {
     981             :                 .name = discard_const_p(char, "primary_group_name"),
     982             :                 .get = py_wbint_userinfo_get_primary_group_name,
     983             :                 .set = py_wbint_userinfo_set_primary_group_name,
     984             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     985             :         },
     986             :         {
     987             :                 .name = discard_const_p(char, "user_sid"),
     988             :                 .get = py_wbint_userinfo_get_user_sid,
     989             :                 .set = py_wbint_userinfo_set_user_sid,
     990             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
     991             :         },
     992             :         {
     993             :                 .name = discard_const_p(char, "group_sid"),
     994             :                 .get = py_wbint_userinfo_get_group_sid,
     995             :                 .set = py_wbint_userinfo_set_group_sid,
     996             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
     997             :         },
     998             :         { .name = NULL }
     999             : };
    1000             : 
    1001           0 : static PyObject *py_wbint_userinfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1002             : {
    1003           0 :         return pytalloc_new(struct wbint_userinfo, type);
    1004             : }
    1005             : 
    1006           0 : static PyObject *py_wbint_userinfo_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1007             : {
    1008           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
    1009           0 :         PyObject *ret = NULL;
    1010             :         DATA_BLOB blob;
    1011             :         enum ndr_err_code err;
    1012           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1013           0 :         if (tmp_ctx == NULL) {
    1014           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1015           0 :                 return NULL;
    1016             :         }
    1017           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_userinfo);
    1018           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1019           0 :                 TALLOC_FREE(tmp_ctx);
    1020           0 :                 PyErr_SetNdrError(err);
    1021           0 :                 return NULL;
    1022             :         }
    1023             : 
    1024           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1025           0 :         TALLOC_FREE(tmp_ctx);
    1026           0 :         return ret;
    1027             : }
    1028             : 
    1029           0 : static PyObject *py_wbint_userinfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1030             : {
    1031           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
    1032           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1033           0 :         Py_ssize_t blob_length = 0;
    1034             :         enum ndr_err_code err;
    1035           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1036           0 :         PyObject *allow_remaining_obj = NULL;
    1037           0 :         bool allow_remaining = false;
    1038             : 
    1039           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1040             :                 discard_const_p(char *, kwnames),
    1041             :                 &blob.data, &blob_length,
    1042             :                 &allow_remaining_obj)) {
    1043           0 :                 return NULL;
    1044             :         }
    1045           0 :         blob.length = blob_length;
    1046             : 
    1047           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1048           0 :                 allow_remaining = true;
    1049             :         }
    1050             : 
    1051           0 :         if (allow_remaining) {
    1052           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfo);
    1053             :         } else {
    1054           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfo);
    1055             :         }
    1056           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1057           0 :                 PyErr_SetNdrError(err);
    1058           0 :                 return NULL;
    1059             :         }
    1060             : 
    1061           0 :         Py_RETURN_NONE;
    1062             : }
    1063             : 
    1064           0 : static PyObject *py_wbint_userinfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1065             : {
    1066           0 :         struct wbint_userinfo *object = (struct wbint_userinfo *)pytalloc_get_ptr(py_obj);
    1067             :         PyObject *ret;
    1068             :         char *retstr;
    1069             : 
    1070           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_userinfo, "wbint_userinfo", object);
    1071           0 :         ret = PyUnicode_FromString(retstr);
    1072           0 :         talloc_free(retstr);
    1073             : 
    1074           0 :         return ret;
    1075             : }
    1076             : 
    1077             : static PyMethodDef py_wbint_userinfo_methods[] = {
    1078             :         { "__ndr_pack__", (PyCFunction)py_wbint_userinfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1079             :         { "__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" },
    1080             :         { "__ndr_print__", (PyCFunction)py_wbint_userinfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1081             :         { NULL, NULL, 0, NULL }
    1082             : };
    1083             : 
    1084             : 
    1085             : static PyTypeObject wbint_userinfo_Type = {
    1086             :         PyVarObject_HEAD_INIT(NULL, 0)
    1087             :         .tp_name = "winbind.wbint_userinfo",
    1088             :         .tp_getset = py_wbint_userinfo_getsetters,
    1089             :         .tp_methods = py_wbint_userinfo_methods,
    1090             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1091             :         .tp_new = py_wbint_userinfo_new,
    1092             : };
    1093             : 
    1094             : 
    1095           0 : static PyObject *py_wbint_SidArray_get_num_sids(PyObject *obj, void *closure)
    1096             : {
    1097           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(obj);
    1098             :         PyObject *py_num_sids;
    1099           0 :         py_num_sids = PyLong_FromUnsignedLongLong((uint32_t)object->num_sids);
    1100           0 :         return py_num_sids;
    1101             : }
    1102             : 
    1103           0 : static int py_wbint_SidArray_set_num_sids(PyObject *py_obj, PyObject *value, void *closure)
    1104             : {
    1105           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj);
    1106           0 :         if (value == NULL) {
    1107           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_sids");
    1108           0 :                 return -1;
    1109             :         }
    1110             :         {
    1111           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sids));
    1112           0 :                 if (PyLong_Check(value)) {
    1113             :                         unsigned long long test_var;
    1114           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1115           0 :                         if (PyErr_Occurred() != NULL) {
    1116           0 :                                 return -1;
    1117             :                         }
    1118           0 :                         if (test_var > uint_max) {
    1119           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1120             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1121           0 :                                 return -1;
    1122             :                         }
    1123           0 :                         object->num_sids = test_var;
    1124             :                 } else {
    1125           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1126             :                           PyLong_Type.tp_name);
    1127           0 :                         return -1;
    1128             :                 }
    1129             :         }
    1130           0 :         return 0;
    1131             : }
    1132             : 
    1133           0 : static PyObject *py_wbint_SidArray_get_sids(PyObject *obj, void *closure)
    1134             : {
    1135           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(obj);
    1136             :         PyObject *py_sids;
    1137           0 :         py_sids = PyList_New(object->num_sids);
    1138           0 :         if (py_sids == NULL) {
    1139           0 :                 return NULL;
    1140             :         }
    1141             :         {
    1142             :                 int sids_cntr_0;
    1143           0 :                 for (sids_cntr_0 = 0; sids_cntr_0 < (object->num_sids); sids_cntr_0++) {
    1144             :                         PyObject *py_sids_0;
    1145           0 :                         py_sids_0 = pytalloc_reference_ex(dom_sid_Type, object->sids, &object->sids[sids_cntr_0]);
    1146           0 :                         PyList_SetItem(py_sids, sids_cntr_0, py_sids_0);
    1147             :                 }
    1148             :         }
    1149           0 :         return py_sids;
    1150             : }
    1151             : 
    1152           0 : static int py_wbint_SidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure)
    1153             : {
    1154           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj);
    1155           0 :         if (value == NULL) {
    1156           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
    1157           0 :                 return -1;
    1158             :         }
    1159           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1160             :         {
    1161             :                 int sids_cntr_0;
    1162           0 :                 object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
    1163           0 :                 if (!object->sids) { return -1;; }
    1164           0 :                 talloc_set_name_const(object->sids, "ARRAY: object->sids");
    1165           0 :                 for (sids_cntr_0 = 0; sids_cntr_0 < PyList_GET_SIZE(value); sids_cntr_0++) {
    1166           0 :                         if (PyList_GET_ITEM(value, sids_cntr_0) == NULL) {
    1167           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_0]");
    1168           0 :                                 return -1;
    1169             :                         }
    1170           0 :                         PY_CHECK_TYPE(dom_sid_Type, PyList_GET_ITEM(value, sids_cntr_0), return -1;);
    1171           0 :                         if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_0))) == NULL) {
    1172           0 :                                 PyErr_NoMemory();
    1173           0 :                                 return -1;
    1174             :                         }
    1175           0 :                         object->sids[sids_cntr_0] = *(struct dom_sid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_0));
    1176             :                 }
    1177             :         }
    1178           0 :         return 0;
    1179             : }
    1180             : 
    1181             : static PyGetSetDef py_wbint_SidArray_getsetters[] = {
    1182             :         {
    1183             :                 .name = discard_const_p(char, "num_sids"),
    1184             :                 .get = py_wbint_SidArray_get_num_sids,
    1185             :                 .set = py_wbint_SidArray_set_num_sids,
    1186             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1187             :         },
    1188             :         {
    1189             :                 .name = discard_const_p(char, "sids"),
    1190             :                 .get = py_wbint_SidArray_get_sids,
    1191             :                 .set = py_wbint_SidArray_set_sids,
    1192             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    1193             :         },
    1194             :         { .name = NULL }
    1195             : };
    1196             : 
    1197           0 : static PyObject *py_wbint_SidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1198             : {
    1199           0 :         return pytalloc_new(struct wbint_SidArray, type);
    1200             : }
    1201             : 
    1202           0 : static PyObject *py_wbint_SidArray_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1203             : {
    1204           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj);
    1205           0 :         PyObject *ret = NULL;
    1206             :         DATA_BLOB blob;
    1207             :         enum ndr_err_code err;
    1208           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1209           0 :         if (tmp_ctx == NULL) {
    1210           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1211           0 :                 return NULL;
    1212             :         }
    1213           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_SidArray);
    1214           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1215           0 :                 TALLOC_FREE(tmp_ctx);
    1216           0 :                 PyErr_SetNdrError(err);
    1217           0 :                 return NULL;
    1218             :         }
    1219             : 
    1220           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1221           0 :         TALLOC_FREE(tmp_ctx);
    1222           0 :         return ret;
    1223             : }
    1224             : 
    1225           0 : static PyObject *py_wbint_SidArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1226             : {
    1227           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj);
    1228           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1229           0 :         Py_ssize_t blob_length = 0;
    1230             :         enum ndr_err_code err;
    1231           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1232           0 :         PyObject *allow_remaining_obj = NULL;
    1233           0 :         bool allow_remaining = false;
    1234             : 
    1235           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1236             :                 discard_const_p(char *, kwnames),
    1237             :                 &blob.data, &blob_length,
    1238             :                 &allow_remaining_obj)) {
    1239           0 :                 return NULL;
    1240             :         }
    1241           0 :         blob.length = blob_length;
    1242             : 
    1243           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1244           0 :                 allow_remaining = true;
    1245             :         }
    1246             : 
    1247           0 :         if (allow_remaining) {
    1248           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_SidArray);
    1249             :         } else {
    1250           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_SidArray);
    1251             :         }
    1252           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1253           0 :                 PyErr_SetNdrError(err);
    1254           0 :                 return NULL;
    1255             :         }
    1256             : 
    1257           0 :         Py_RETURN_NONE;
    1258             : }
    1259             : 
    1260           0 : static PyObject *py_wbint_SidArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1261             : {
    1262           0 :         struct wbint_SidArray *object = (struct wbint_SidArray *)pytalloc_get_ptr(py_obj);
    1263             :         PyObject *ret;
    1264             :         char *retstr;
    1265             : 
    1266           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_SidArray, "wbint_SidArray", object);
    1267           0 :         ret = PyUnicode_FromString(retstr);
    1268           0 :         talloc_free(retstr);
    1269             : 
    1270           0 :         return ret;
    1271             : }
    1272             : 
    1273             : static PyMethodDef py_wbint_SidArray_methods[] = {
    1274             :         { "__ndr_pack__", (PyCFunction)py_wbint_SidArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1275             :         { "__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" },
    1276             :         { "__ndr_print__", (PyCFunction)py_wbint_SidArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1277             :         { NULL, NULL, 0, NULL }
    1278             : };
    1279             : 
    1280             : 
    1281             : static PyTypeObject wbint_SidArray_Type = {
    1282             :         PyVarObject_HEAD_INIT(NULL, 0)
    1283             :         .tp_name = "winbind.wbint_SidArray",
    1284             :         .tp_getset = py_wbint_SidArray_getsetters,
    1285             :         .tp_methods = py_wbint_SidArray_methods,
    1286             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1287             :         .tp_new = py_wbint_SidArray_new,
    1288             : };
    1289             : 
    1290             : 
    1291           0 : static PyObject *py_wbint_RidArray_get_num_rids(PyObject *obj, void *closure)
    1292             : {
    1293           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(obj);
    1294             :         PyObject *py_num_rids;
    1295           0 :         py_num_rids = PyLong_FromUnsignedLongLong((uint32_t)object->num_rids);
    1296           0 :         return py_num_rids;
    1297             : }
    1298             : 
    1299           0 : static int py_wbint_RidArray_set_num_rids(PyObject *py_obj, PyObject *value, void *closure)
    1300             : {
    1301           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj);
    1302           0 :         if (value == NULL) {
    1303           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_rids");
    1304           0 :                 return -1;
    1305             :         }
    1306             :         {
    1307           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_rids));
    1308           0 :                 if (PyLong_Check(value)) {
    1309             :                         unsigned long long test_var;
    1310           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1311           0 :                         if (PyErr_Occurred() != NULL) {
    1312           0 :                                 return -1;
    1313             :                         }
    1314           0 :                         if (test_var > uint_max) {
    1315           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1316             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1317           0 :                                 return -1;
    1318             :                         }
    1319           0 :                         object->num_rids = test_var;
    1320             :                 } else {
    1321           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1322             :                           PyLong_Type.tp_name);
    1323           0 :                         return -1;
    1324             :                 }
    1325             :         }
    1326           0 :         return 0;
    1327             : }
    1328             : 
    1329           0 : static PyObject *py_wbint_RidArray_get_rids(PyObject *obj, void *closure)
    1330             : {
    1331           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(obj);
    1332             :         PyObject *py_rids;
    1333           0 :         py_rids = PyList_New(object->num_rids);
    1334           0 :         if (py_rids == NULL) {
    1335           0 :                 return NULL;
    1336             :         }
    1337             :         {
    1338             :                 int rids_cntr_0;
    1339           0 :                 for (rids_cntr_0 = 0; rids_cntr_0 < (object->num_rids); rids_cntr_0++) {
    1340             :                         PyObject *py_rids_0;
    1341           0 :                         py_rids_0 = PyLong_FromUnsignedLongLong((uint32_t)object->rids[rids_cntr_0]);
    1342           0 :                         PyList_SetItem(py_rids, rids_cntr_0, py_rids_0);
    1343             :                 }
    1344             :         }
    1345           0 :         return py_rids;
    1346             : }
    1347             : 
    1348           0 : static int py_wbint_RidArray_set_rids(PyObject *py_obj, PyObject *value, void *closure)
    1349             : {
    1350           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj);
    1351           0 :         if (value == NULL) {
    1352           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids");
    1353           0 :                 return -1;
    1354             :         }
    1355           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1356             :         {
    1357             :                 int rids_cntr_0;
    1358           0 :                 object->rids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->rids, PyList_GET_SIZE(value));
    1359           0 :                 if (!object->rids) { return -1;; }
    1360           0 :                 talloc_set_name_const(object->rids, "ARRAY: object->rids");
    1361           0 :                 for (rids_cntr_0 = 0; rids_cntr_0 < PyList_GET_SIZE(value); rids_cntr_0++) {
    1362           0 :                         if (PyList_GET_ITEM(value, rids_cntr_0) == NULL) {
    1363           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids[rids_cntr_0]");
    1364           0 :                                 return -1;
    1365             :                         }
    1366             :                         {
    1367           0 :                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rids[rids_cntr_0]));
    1368           0 :                                 if (PyLong_Check(PyList_GET_ITEM(value, rids_cntr_0))) {
    1369             :                                         unsigned long long test_var;
    1370           0 :                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, rids_cntr_0));
    1371           0 :                                         if (PyErr_Occurred() != NULL) {
    1372           0 :                                                 return -1;
    1373             :                                         }
    1374           0 :                                         if (test_var > uint_max) {
    1375           0 :                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1376             :                                                   PyLong_Type.tp_name, uint_max, test_var);
    1377           0 :                                                 return -1;
    1378             :                                         }
    1379           0 :                                         object->rids[rids_cntr_0] = test_var;
    1380             :                                 } else {
    1381           0 :                                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1382             :                                           PyLong_Type.tp_name);
    1383           0 :                                         return -1;
    1384             :                                 }
    1385             :                         }
    1386             :                 }
    1387             :         }
    1388           0 :         return 0;
    1389             : }
    1390             : 
    1391             : static PyGetSetDef py_wbint_RidArray_getsetters[] = {
    1392             :         {
    1393             :                 .name = discard_const_p(char, "num_rids"),
    1394             :                 .get = py_wbint_RidArray_get_num_rids,
    1395             :                 .set = py_wbint_RidArray_set_num_rids,
    1396             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1397             :         },
    1398             :         {
    1399             :                 .name = discard_const_p(char, "rids"),
    1400             :                 .get = py_wbint_RidArray_get_rids,
    1401             :                 .set = py_wbint_RidArray_set_rids,
    1402             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1403             :         },
    1404             :         { .name = NULL }
    1405             : };
    1406             : 
    1407           0 : static PyObject *py_wbint_RidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1408             : {
    1409           0 :         return pytalloc_new(struct wbint_RidArray, type);
    1410             : }
    1411             : 
    1412           0 : static PyObject *py_wbint_RidArray_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1413             : {
    1414           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj);
    1415           0 :         PyObject *ret = NULL;
    1416             :         DATA_BLOB blob;
    1417             :         enum ndr_err_code err;
    1418           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1419           0 :         if (tmp_ctx == NULL) {
    1420           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1421           0 :                 return NULL;
    1422             :         }
    1423           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_RidArray);
    1424           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1425           0 :                 TALLOC_FREE(tmp_ctx);
    1426           0 :                 PyErr_SetNdrError(err);
    1427           0 :                 return NULL;
    1428             :         }
    1429             : 
    1430           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1431           0 :         TALLOC_FREE(tmp_ctx);
    1432           0 :         return ret;
    1433             : }
    1434             : 
    1435           0 : static PyObject *py_wbint_RidArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1436             : {
    1437           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj);
    1438           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1439           0 :         Py_ssize_t blob_length = 0;
    1440             :         enum ndr_err_code err;
    1441           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1442           0 :         PyObject *allow_remaining_obj = NULL;
    1443           0 :         bool allow_remaining = false;
    1444             : 
    1445           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1446             :                 discard_const_p(char *, kwnames),
    1447             :                 &blob.data, &blob_length,
    1448             :                 &allow_remaining_obj)) {
    1449           0 :                 return NULL;
    1450             :         }
    1451           0 :         blob.length = blob_length;
    1452             : 
    1453           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1454           0 :                 allow_remaining = true;
    1455             :         }
    1456             : 
    1457           0 :         if (allow_remaining) {
    1458           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_RidArray);
    1459             :         } else {
    1460           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_RidArray);
    1461             :         }
    1462           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1463           0 :                 PyErr_SetNdrError(err);
    1464           0 :                 return NULL;
    1465             :         }
    1466             : 
    1467           0 :         Py_RETURN_NONE;
    1468             : }
    1469             : 
    1470           0 : static PyObject *py_wbint_RidArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1471             : {
    1472           0 :         struct wbint_RidArray *object = (struct wbint_RidArray *)pytalloc_get_ptr(py_obj);
    1473             :         PyObject *ret;
    1474             :         char *retstr;
    1475             : 
    1476           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_RidArray, "wbint_RidArray", object);
    1477           0 :         ret = PyUnicode_FromString(retstr);
    1478           0 :         talloc_free(retstr);
    1479             : 
    1480           0 :         return ret;
    1481             : }
    1482             : 
    1483             : static PyMethodDef py_wbint_RidArray_methods[] = {
    1484             :         { "__ndr_pack__", (PyCFunction)py_wbint_RidArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1485             :         { "__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" },
    1486             :         { "__ndr_print__", (PyCFunction)py_wbint_RidArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1487             :         { NULL, NULL, 0, NULL }
    1488             : };
    1489             : 
    1490             : 
    1491             : static PyTypeObject wbint_RidArray_Type = {
    1492             :         PyVarObject_HEAD_INIT(NULL, 0)
    1493             :         .tp_name = "winbind.wbint_RidArray",
    1494             :         .tp_getset = py_wbint_RidArray_getsetters,
    1495             :         .tp_methods = py_wbint_RidArray_methods,
    1496             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1497             :         .tp_new = py_wbint_RidArray_new,
    1498             : };
    1499             : 
    1500             : 
    1501           0 : static PyObject *py_wbint_Principal_get_sid(PyObject *obj, void *closure)
    1502             : {
    1503           0 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(obj);
    1504             :         PyObject *py_sid;
    1505           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid);
    1506           0 :         return py_sid;
    1507             : }
    1508             : 
    1509           0 : static int py_wbint_Principal_set_sid(PyObject *py_obj, PyObject *value, void *closure)
    1510             : {
    1511           0 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj);
    1512           0 :         if (value == NULL) {
    1513           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
    1514           0 :                 return -1;
    1515             :         }
    1516           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    1517           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1518           0 :                 PyErr_NoMemory();
    1519           0 :                 return -1;
    1520             :         }
    1521           0 :         object->sid = *(struct dom_sid *)pytalloc_get_ptr(value);
    1522           0 :         return 0;
    1523             : }
    1524             : 
    1525           0 : static PyObject *py_wbint_Principal_get_type(PyObject *obj, void *closure)
    1526             : {
    1527           0 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(obj);
    1528             :         PyObject *py_type;
    1529           0 :         py_type = PyLong_FromLong((uint16_t)object->type);
    1530           0 :         return py_type;
    1531             : }
    1532             : 
    1533           0 : static int py_wbint_Principal_set_type(PyObject *py_obj, PyObject *value, void *closure)
    1534             : {
    1535           0 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj);
    1536           0 :         if (value == NULL) {
    1537           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    1538           0 :                 return -1;
    1539             :         }
    1540             :         {
    1541           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    1542           0 :                 if (PyLong_Check(value)) {
    1543             :                         unsigned long long test_var;
    1544           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1545           0 :                         if (PyErr_Occurred() != NULL) {
    1546           0 :                                 return -1;
    1547             :                         }
    1548           0 :                         if (test_var > uint_max) {
    1549           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1550             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1551           0 :                                 return -1;
    1552             :                         }
    1553           0 :                         object->type = test_var;
    1554             :                 } else {
    1555           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1556             :                           PyLong_Type.tp_name);
    1557           0 :                         return -1;
    1558             :                 }
    1559             :         }
    1560           0 :         return 0;
    1561             : }
    1562             : 
    1563           0 : static PyObject *py_wbint_Principal_get_name(PyObject *obj, void *closure)
    1564             : {
    1565           0 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(obj);
    1566             :         PyObject *py_name;
    1567           0 :         if (object->name == NULL) {
    1568           0 :                 Py_RETURN_NONE;
    1569             :         }
    1570           0 :         if (object->name == NULL) {
    1571           0 :                 py_name = Py_None;
    1572           0 :                 Py_INCREF(py_name);
    1573             :         } else {
    1574           0 :                 if (object->name == NULL) {
    1575           0 :                         py_name = Py_None;
    1576           0 :                         Py_INCREF(py_name);
    1577             :                 } else {
    1578           0 :                         py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
    1579             :                 }
    1580             :         }
    1581           0 :         return py_name;
    1582             : }
    1583             : 
    1584           0 : static int py_wbint_Principal_set_name(PyObject *py_obj, PyObject *value, void *closure)
    1585             : {
    1586           0 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj);
    1587           0 :         if (value == NULL) {
    1588           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
    1589           0 :                 return -1;
    1590             :         }
    1591           0 :         if (value == Py_None) {
    1592           0 :                 object->name = NULL;
    1593             :         } else {
    1594           0 :                 object->name = NULL;
    1595             :                 {
    1596             :                         const char *test_str;
    1597             :                         const char *talloc_str;
    1598           0 :                         PyObject *unicode = NULL;
    1599           0 :                         if (PyUnicode_Check(value)) {
    1600           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1601           0 :                                 if (unicode == NULL) {
    1602           0 :                                         PyErr_NoMemory();
    1603           0 :                                         return -1;
    1604             :                                 }
    1605           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    1606           0 :                         } else if (PyBytes_Check(value)) {
    1607           0 :                                 test_str = PyBytes_AS_STRING(value);
    1608             :                         } else {
    1609           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1610           0 :                                 return -1;
    1611             :                         }
    1612           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1613           0 :                         if (unicode != NULL) {
    1614           0 :                                 Py_DECREF(unicode);
    1615             :                         }
    1616           0 :                         if (talloc_str == NULL) {
    1617           0 :                                 PyErr_NoMemory();
    1618           0 :                                 return -1;
    1619             :                         }
    1620           0 :                         object->name = talloc_str;
    1621             :                 }
    1622             :         }
    1623           0 :         return 0;
    1624             : }
    1625             : 
    1626             : static PyGetSetDef py_wbint_Principal_getsetters[] = {
    1627             :         {
    1628             :                 .name = discard_const_p(char, "sid"),
    1629             :                 .get = py_wbint_Principal_get_sid,
    1630             :                 .set = py_wbint_Principal_set_sid,
    1631             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    1632             :         },
    1633             :         {
    1634             :                 .name = discard_const_p(char, "type"),
    1635             :                 .get = py_wbint_Principal_get_type,
    1636             :                 .set = py_wbint_Principal_set_type,
    1637             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
    1638             :         },
    1639             :         {
    1640             :                 .name = discard_const_p(char, "name"),
    1641             :                 .get = py_wbint_Principal_get_name,
    1642             :                 .set = py_wbint_Principal_set_name,
    1643             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    1644             :         },
    1645             :         { .name = NULL }
    1646             : };
    1647             : 
    1648           0 : static PyObject *py_wbint_Principal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1649             : {
    1650           0 :         return pytalloc_new(struct wbint_Principal, type);
    1651             : }
    1652             : 
    1653           0 : static PyObject *py_wbint_Principal_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1654             : {
    1655           0 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj);
    1656           0 :         PyObject *ret = NULL;
    1657             :         DATA_BLOB blob;
    1658             :         enum ndr_err_code err;
    1659           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1660           0 :         if (tmp_ctx == NULL) {
    1661           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1662           0 :                 return NULL;
    1663             :         }
    1664           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_Principal);
    1665           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1666           0 :                 TALLOC_FREE(tmp_ctx);
    1667           0 :                 PyErr_SetNdrError(err);
    1668           0 :                 return NULL;
    1669             :         }
    1670             : 
    1671           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1672           0 :         TALLOC_FREE(tmp_ctx);
    1673           0 :         return ret;
    1674             : }
    1675             : 
    1676           0 : static PyObject *py_wbint_Principal_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1677             : {
    1678           0 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj);
    1679           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1680           0 :         Py_ssize_t blob_length = 0;
    1681             :         enum ndr_err_code err;
    1682           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1683           0 :         PyObject *allow_remaining_obj = NULL;
    1684           0 :         bool allow_remaining = false;
    1685             : 
    1686           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1687             :                 discard_const_p(char *, kwnames),
    1688             :                 &blob.data, &blob_length,
    1689             :                 &allow_remaining_obj)) {
    1690           0 :                 return NULL;
    1691             :         }
    1692           0 :         blob.length = blob_length;
    1693             : 
    1694           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1695           0 :                 allow_remaining = true;
    1696             :         }
    1697             : 
    1698           0 :         if (allow_remaining) {
    1699           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principal);
    1700             :         } else {
    1701           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principal);
    1702             :         }
    1703           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1704           0 :                 PyErr_SetNdrError(err);
    1705           0 :                 return NULL;
    1706             :         }
    1707             : 
    1708           0 :         Py_RETURN_NONE;
    1709             : }
    1710             : 
    1711           0 : static PyObject *py_wbint_Principal_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1712             : {
    1713           0 :         struct wbint_Principal *object = (struct wbint_Principal *)pytalloc_get_ptr(py_obj);
    1714             :         PyObject *ret;
    1715             :         char *retstr;
    1716             : 
    1717           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_Principal, "wbint_Principal", object);
    1718           0 :         ret = PyUnicode_FromString(retstr);
    1719           0 :         talloc_free(retstr);
    1720             : 
    1721           0 :         return ret;
    1722             : }
    1723             : 
    1724             : static PyMethodDef py_wbint_Principal_methods[] = {
    1725             :         { "__ndr_pack__", (PyCFunction)py_wbint_Principal_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1726             :         { "__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" },
    1727             :         { "__ndr_print__", (PyCFunction)py_wbint_Principal_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1728             :         { NULL, NULL, 0, NULL }
    1729             : };
    1730             : 
    1731             : 
    1732             : static PyTypeObject wbint_Principal_Type = {
    1733             :         PyVarObject_HEAD_INIT(NULL, 0)
    1734             :         .tp_name = "winbind.wbint_Principal",
    1735             :         .tp_getset = py_wbint_Principal_getsetters,
    1736             :         .tp_methods = py_wbint_Principal_methods,
    1737             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1738             :         .tp_new = py_wbint_Principal_new,
    1739             : };
    1740             : 
    1741             : 
    1742           0 : static PyObject *py_wbint_Principals_get_num_principals(PyObject *obj, void *closure)
    1743             : {
    1744           0 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(obj);
    1745             :         PyObject *py_num_principals;
    1746           0 :         py_num_principals = PyLong_FromUnsignedLongLong((uint32_t)object->num_principals);
    1747           0 :         return py_num_principals;
    1748             : }
    1749             : 
    1750           0 : static int py_wbint_Principals_set_num_principals(PyObject *py_obj, PyObject *value, void *closure)
    1751             : {
    1752           0 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj);
    1753           0 :         if (value == NULL) {
    1754           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_principals");
    1755           0 :                 return -1;
    1756             :         }
    1757             :         {
    1758           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_principals));
    1759           0 :                 if (PyLong_Check(value)) {
    1760             :                         unsigned long long test_var;
    1761           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1762           0 :                         if (PyErr_Occurred() != NULL) {
    1763           0 :                                 return -1;
    1764             :                         }
    1765           0 :                         if (test_var > uint_max) {
    1766           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1767             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1768           0 :                                 return -1;
    1769             :                         }
    1770           0 :                         object->num_principals = test_var;
    1771             :                 } else {
    1772           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1773             :                           PyLong_Type.tp_name);
    1774           0 :                         return -1;
    1775             :                 }
    1776             :         }
    1777           0 :         return 0;
    1778             : }
    1779             : 
    1780           0 : static PyObject *py_wbint_Principals_get_principals(PyObject *obj, void *closure)
    1781             : {
    1782           0 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(obj);
    1783             :         PyObject *py_principals;
    1784           0 :         py_principals = PyList_New(object->num_principals);
    1785           0 :         if (py_principals == NULL) {
    1786           0 :                 return NULL;
    1787             :         }
    1788             :         {
    1789             :                 int principals_cntr_0;
    1790           0 :                 for (principals_cntr_0 = 0; principals_cntr_0 < (object->num_principals); principals_cntr_0++) {
    1791             :                         PyObject *py_principals_0;
    1792           0 :                         py_principals_0 = pytalloc_reference_ex(&wbint_Principal_Type, object->principals, &object->principals[principals_cntr_0]);
    1793           0 :                         PyList_SetItem(py_principals, principals_cntr_0, py_principals_0);
    1794             :                 }
    1795             :         }
    1796           0 :         return py_principals;
    1797             : }
    1798             : 
    1799           0 : static int py_wbint_Principals_set_principals(PyObject *py_obj, PyObject *value, void *closure)
    1800             : {
    1801           0 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj);
    1802           0 :         if (value == NULL) {
    1803           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->principals");
    1804           0 :                 return -1;
    1805             :         }
    1806           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1807             :         {
    1808             :                 int principals_cntr_0;
    1809           0 :                 object->principals = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->principals, PyList_GET_SIZE(value));
    1810           0 :                 if (!object->principals) { return -1;; }
    1811           0 :                 talloc_set_name_const(object->principals, "ARRAY: object->principals");
    1812           0 :                 for (principals_cntr_0 = 0; principals_cntr_0 < PyList_GET_SIZE(value); principals_cntr_0++) {
    1813           0 :                         if (PyList_GET_ITEM(value, principals_cntr_0) == NULL) {
    1814           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->principals[principals_cntr_0]");
    1815           0 :                                 return -1;
    1816             :                         }
    1817           0 :                         PY_CHECK_TYPE(&wbint_Principal_Type, PyList_GET_ITEM(value, principals_cntr_0), return -1;);
    1818           0 :                         if (talloc_reference(object->principals, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, principals_cntr_0))) == NULL) {
    1819           0 :                                 PyErr_NoMemory();
    1820           0 :                                 return -1;
    1821             :                         }
    1822           0 :                         object->principals[principals_cntr_0] = *(struct wbint_Principal *)pytalloc_get_ptr(PyList_GET_ITEM(value, principals_cntr_0));
    1823             :                 }
    1824             :         }
    1825           0 :         return 0;
    1826             : }
    1827             : 
    1828             : static PyGetSetDef py_wbint_Principals_getsetters[] = {
    1829             :         {
    1830             :                 .name = discard_const_p(char, "num_principals"),
    1831             :                 .get = py_wbint_Principals_get_num_principals,
    1832             :                 .set = py_wbint_Principals_set_num_principals,
    1833             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1834             :         },
    1835             :         {
    1836             :                 .name = discard_const_p(char, "principals"),
    1837             :                 .get = py_wbint_Principals_get_principals,
    1838             :                 .set = py_wbint_Principals_set_principals,
    1839             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principal")
    1840             :         },
    1841             :         { .name = NULL }
    1842             : };
    1843             : 
    1844           0 : static PyObject *py_wbint_Principals_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1845             : {
    1846           0 :         return pytalloc_new(struct wbint_Principals, type);
    1847             : }
    1848             : 
    1849           0 : static PyObject *py_wbint_Principals_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1850             : {
    1851           0 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj);
    1852           0 :         PyObject *ret = NULL;
    1853             :         DATA_BLOB blob;
    1854             :         enum ndr_err_code err;
    1855           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1856           0 :         if (tmp_ctx == NULL) {
    1857           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1858           0 :                 return NULL;
    1859             :         }
    1860           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_Principals);
    1861           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1862           0 :                 TALLOC_FREE(tmp_ctx);
    1863           0 :                 PyErr_SetNdrError(err);
    1864           0 :                 return NULL;
    1865             :         }
    1866             : 
    1867           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1868           0 :         TALLOC_FREE(tmp_ctx);
    1869           0 :         return ret;
    1870             : }
    1871             : 
    1872           0 : static PyObject *py_wbint_Principals_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1873             : {
    1874           0 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj);
    1875           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1876           0 :         Py_ssize_t blob_length = 0;
    1877             :         enum ndr_err_code err;
    1878           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1879           0 :         PyObject *allow_remaining_obj = NULL;
    1880           0 :         bool allow_remaining = false;
    1881             : 
    1882           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1883             :                 discard_const_p(char *, kwnames),
    1884             :                 &blob.data, &blob_length,
    1885             :                 &allow_remaining_obj)) {
    1886           0 :                 return NULL;
    1887             :         }
    1888           0 :         blob.length = blob_length;
    1889             : 
    1890           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1891           0 :                 allow_remaining = true;
    1892             :         }
    1893             : 
    1894           0 :         if (allow_remaining) {
    1895           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principals);
    1896             :         } else {
    1897           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principals);
    1898             :         }
    1899           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1900           0 :                 PyErr_SetNdrError(err);
    1901           0 :                 return NULL;
    1902             :         }
    1903             : 
    1904           0 :         Py_RETURN_NONE;
    1905             : }
    1906             : 
    1907           0 : static PyObject *py_wbint_Principals_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1908             : {
    1909           0 :         struct wbint_Principals *object = (struct wbint_Principals *)pytalloc_get_ptr(py_obj);
    1910             :         PyObject *ret;
    1911             :         char *retstr;
    1912             : 
    1913           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_Principals, "wbint_Principals", object);
    1914           0 :         ret = PyUnicode_FromString(retstr);
    1915           0 :         talloc_free(retstr);
    1916             : 
    1917           0 :         return ret;
    1918             : }
    1919             : 
    1920             : static PyMethodDef py_wbint_Principals_methods[] = {
    1921             :         { "__ndr_pack__", (PyCFunction)py_wbint_Principals_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1922             :         { "__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" },
    1923             :         { "__ndr_print__", (PyCFunction)py_wbint_Principals_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1924             :         { NULL, NULL, 0, NULL }
    1925             : };
    1926             : 
    1927             : 
    1928             : static PyTypeObject wbint_Principals_Type = {
    1929             :         PyVarObject_HEAD_INIT(NULL, 0)
    1930             :         .tp_name = "winbind.wbint_Principals",
    1931             :         .tp_getset = py_wbint_Principals_getsetters,
    1932             :         .tp_methods = py_wbint_Principals_methods,
    1933             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1934             :         .tp_new = py_wbint_Principals_new,
    1935             : };
    1936             : 
    1937             : 
    1938           0 : static PyObject *py_wbint_userinfos_get_num_userinfos(PyObject *obj, void *closure)
    1939             : {
    1940           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(obj);
    1941             :         PyObject *py_num_userinfos;
    1942           0 :         py_num_userinfos = PyLong_FromUnsignedLongLong((uint32_t)object->num_userinfos);
    1943           0 :         return py_num_userinfos;
    1944             : }
    1945             : 
    1946           0 : static int py_wbint_userinfos_set_num_userinfos(PyObject *py_obj, PyObject *value, void *closure)
    1947             : {
    1948           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj);
    1949           0 :         if (value == NULL) {
    1950           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_userinfos");
    1951           0 :                 return -1;
    1952             :         }
    1953             :         {
    1954           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_userinfos));
    1955           0 :                 if (PyLong_Check(value)) {
    1956             :                         unsigned long long test_var;
    1957           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1958           0 :                         if (PyErr_Occurred() != NULL) {
    1959           0 :                                 return -1;
    1960             :                         }
    1961           0 :                         if (test_var > uint_max) {
    1962           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1963             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1964           0 :                                 return -1;
    1965             :                         }
    1966           0 :                         object->num_userinfos = test_var;
    1967             :                 } else {
    1968           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1969             :                           PyLong_Type.tp_name);
    1970           0 :                         return -1;
    1971             :                 }
    1972             :         }
    1973           0 :         return 0;
    1974             : }
    1975             : 
    1976           0 : static PyObject *py_wbint_userinfos_get_userinfos(PyObject *obj, void *closure)
    1977             : {
    1978           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(obj);
    1979             :         PyObject *py_userinfos;
    1980           0 :         py_userinfos = PyList_New(object->num_userinfos);
    1981           0 :         if (py_userinfos == NULL) {
    1982           0 :                 return NULL;
    1983             :         }
    1984             :         {
    1985             :                 int userinfos_cntr_0;
    1986           0 :                 for (userinfos_cntr_0 = 0; userinfos_cntr_0 < (object->num_userinfos); userinfos_cntr_0++) {
    1987             :                         PyObject *py_userinfos_0;
    1988           0 :                         py_userinfos_0 = pytalloc_reference_ex(&wbint_userinfo_Type, object->userinfos, &object->userinfos[userinfos_cntr_0]);
    1989           0 :                         PyList_SetItem(py_userinfos, userinfos_cntr_0, py_userinfos_0);
    1990             :                 }
    1991             :         }
    1992           0 :         return py_userinfos;
    1993             : }
    1994             : 
    1995           0 : static int py_wbint_userinfos_set_userinfos(PyObject *py_obj, PyObject *value, void *closure)
    1996             : {
    1997           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj);
    1998           0 :         if (value == NULL) {
    1999           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->userinfos");
    2000           0 :                 return -1;
    2001             :         }
    2002           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    2003             :         {
    2004             :                 int userinfos_cntr_0;
    2005           0 :                 object->userinfos = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->userinfos, PyList_GET_SIZE(value));
    2006           0 :                 if (!object->userinfos) { return -1;; }
    2007           0 :                 talloc_set_name_const(object->userinfos, "ARRAY: object->userinfos");
    2008           0 :                 for (userinfos_cntr_0 = 0; userinfos_cntr_0 < PyList_GET_SIZE(value); userinfos_cntr_0++) {
    2009           0 :                         if (PyList_GET_ITEM(value, userinfos_cntr_0) == NULL) {
    2010           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->userinfos[userinfos_cntr_0]");
    2011           0 :                                 return -1;
    2012             :                         }
    2013           0 :                         PY_CHECK_TYPE(&wbint_userinfo_Type, PyList_GET_ITEM(value, userinfos_cntr_0), return -1;);
    2014           0 :                         if (talloc_reference(object->userinfos, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, userinfos_cntr_0))) == NULL) {
    2015           0 :                                 PyErr_NoMemory();
    2016           0 :                                 return -1;
    2017             :                         }
    2018           0 :                         object->userinfos[userinfos_cntr_0] = *(struct wbint_userinfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, userinfos_cntr_0));
    2019             :                 }
    2020             :         }
    2021           0 :         return 0;
    2022             : }
    2023             : 
    2024             : static PyGetSetDef py_wbint_userinfos_getsetters[] = {
    2025             :         {
    2026             :                 .name = discard_const_p(char, "num_userinfos"),
    2027             :                 .get = py_wbint_userinfos_get_num_userinfos,
    2028             :                 .set = py_wbint_userinfos_set_num_userinfos,
    2029             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2030             :         },
    2031             :         {
    2032             :                 .name = discard_const_p(char, "userinfos"),
    2033             :                 .get = py_wbint_userinfos_get_userinfos,
    2034             :                 .set = py_wbint_userinfos_set_userinfos,
    2035             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_userinfo")
    2036             :         },
    2037             :         { .name = NULL }
    2038             : };
    2039             : 
    2040           0 : static PyObject *py_wbint_userinfos_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2041             : {
    2042           0 :         return pytalloc_new(struct wbint_userinfos, type);
    2043             : }
    2044             : 
    2045           0 : static PyObject *py_wbint_userinfos_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2046             : {
    2047           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj);
    2048           0 :         PyObject *ret = NULL;
    2049             :         DATA_BLOB blob;
    2050             :         enum ndr_err_code err;
    2051           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2052           0 :         if (tmp_ctx == NULL) {
    2053           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2054           0 :                 return NULL;
    2055             :         }
    2056           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_userinfos);
    2057           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2058           0 :                 TALLOC_FREE(tmp_ctx);
    2059           0 :                 PyErr_SetNdrError(err);
    2060           0 :                 return NULL;
    2061             :         }
    2062             : 
    2063           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2064           0 :         TALLOC_FREE(tmp_ctx);
    2065           0 :         return ret;
    2066             : }
    2067             : 
    2068           0 : static PyObject *py_wbint_userinfos_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2069             : {
    2070           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj);
    2071           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2072           0 :         Py_ssize_t blob_length = 0;
    2073             :         enum ndr_err_code err;
    2074           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2075           0 :         PyObject *allow_remaining_obj = NULL;
    2076           0 :         bool allow_remaining = false;
    2077             : 
    2078           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2079             :                 discard_const_p(char *, kwnames),
    2080             :                 &blob.data, &blob_length,
    2081             :                 &allow_remaining_obj)) {
    2082           0 :                 return NULL;
    2083             :         }
    2084           0 :         blob.length = blob_length;
    2085             : 
    2086           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2087           0 :                 allow_remaining = true;
    2088             :         }
    2089             : 
    2090           0 :         if (allow_remaining) {
    2091           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfos);
    2092             :         } else {
    2093           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfos);
    2094             :         }
    2095           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2096           0 :                 PyErr_SetNdrError(err);
    2097           0 :                 return NULL;
    2098             :         }
    2099             : 
    2100           0 :         Py_RETURN_NONE;
    2101             : }
    2102             : 
    2103           0 : static PyObject *py_wbint_userinfos_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2104             : {
    2105           0 :         struct wbint_userinfos *object = (struct wbint_userinfos *)pytalloc_get_ptr(py_obj);
    2106             :         PyObject *ret;
    2107             :         char *retstr;
    2108             : 
    2109           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_userinfos, "wbint_userinfos", object);
    2110           0 :         ret = PyUnicode_FromString(retstr);
    2111           0 :         talloc_free(retstr);
    2112             : 
    2113           0 :         return ret;
    2114             : }
    2115             : 
    2116             : static PyMethodDef py_wbint_userinfos_methods[] = {
    2117             :         { "__ndr_pack__", (PyCFunction)py_wbint_userinfos_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2118             :         { "__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" },
    2119             :         { "__ndr_print__", (PyCFunction)py_wbint_userinfos_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2120             :         { NULL, NULL, 0, NULL }
    2121             : };
    2122             : 
    2123             : 
    2124             : static PyTypeObject wbint_userinfos_Type = {
    2125             :         PyVarObject_HEAD_INIT(NULL, 0)
    2126             :         .tp_name = "winbind.wbint_userinfos",
    2127             :         .tp_getset = py_wbint_userinfos_getsetters,
    2128             :         .tp_methods = py_wbint_userinfos_methods,
    2129             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2130             :         .tp_new = py_wbint_userinfos_new,
    2131             : };
    2132             : 
    2133             : 
    2134           0 : static PyObject *py_wbint_Validation_get_level(PyObject *obj, void *closure)
    2135             : {
    2136           0 :         struct wbint_Validation *object = (struct wbint_Validation *)pytalloc_get_ptr(obj);
    2137             :         PyObject *py_level;
    2138           0 :         py_level = PyLong_FromLong((uint16_t)object->level);
    2139           0 :         return py_level;
    2140             : }
    2141             : 
    2142           0 : static int py_wbint_Validation_set_level(PyObject *py_obj, PyObject *value, void *closure)
    2143             : {
    2144           0 :         struct wbint_Validation *object = (struct wbint_Validation *)pytalloc_get_ptr(py_obj);
    2145           0 :         if (value == NULL) {
    2146           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->level");
    2147           0 :                 return -1;
    2148             :         }
    2149             :         {
    2150           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
    2151           0 :                 if (PyLong_Check(value)) {
    2152             :                         unsigned long long test_var;
    2153           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2154           0 :                         if (PyErr_Occurred() != NULL) {
    2155           0 :                                 return -1;
    2156             :                         }
    2157           0 :                         if (test_var > uint_max) {
    2158           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2159             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2160           0 :                                 return -1;
    2161             :                         }
    2162           0 :                         object->level = test_var;
    2163             :                 } else {
    2164           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2165             :                           PyLong_Type.tp_name);
    2166           0 :                         return -1;
    2167             :                 }
    2168             :         }
    2169           0 :         return 0;
    2170             : }
    2171             : 
    2172           0 : static PyObject *py_wbint_Validation_get_validation(PyObject *obj, void *closure)
    2173             : {
    2174           0 :         struct wbint_Validation *object = (struct wbint_Validation *)pytalloc_get_ptr(obj);
    2175             :         PyObject *py_validation;
    2176           0 :         if (object->validation == NULL) {
    2177           0 :                 Py_RETURN_NONE;
    2178             :         }
    2179           0 :         if (object->validation == NULL) {
    2180           0 :                 py_validation = Py_None;
    2181           0 :                 Py_INCREF(py_validation);
    2182             :         } else {
    2183           0 :                 py_validation = pyrpc_import_union(netr_Validation_Type, object->validation, object->level, object->validation, "union netr_Validation");
    2184           0 :                 if (py_validation == NULL) {
    2185           0 :                         return NULL;
    2186             :                 }
    2187             :         }
    2188           0 :         return py_validation;
    2189             : }
    2190             : 
    2191           0 : static int py_wbint_Validation_set_validation(PyObject *py_obj, PyObject *value, void *closure)
    2192             : {
    2193           0 :         struct wbint_Validation *object = (struct wbint_Validation *)pytalloc_get_ptr(py_obj);
    2194           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->validation));
    2195           0 :         if (value == NULL) {
    2196           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->validation");
    2197           0 :                 return -1;
    2198             :         }
    2199           0 :         if (value == Py_None) {
    2200           0 :                 object->validation = NULL;
    2201             :         } else {
    2202           0 :                 object->validation = NULL;
    2203             :                 {
    2204             :                         union netr_Validation *validation_switch_1;
    2205           0 :                         validation_switch_1 = (union netr_Validation *)pyrpc_export_union(netr_Validation_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union netr_Validation");
    2206           0 :                         if (validation_switch_1 == NULL) {
    2207           0 :                                 return -1;
    2208             :                         }
    2209           0 :                         object->validation = validation_switch_1;
    2210             :                 }
    2211             :         }
    2212           0 :         return 0;
    2213             : }
    2214             : 
    2215           0 : static PyObject *py_wbint_Validation_get_krb5ccname(PyObject *obj, void *closure)
    2216             : {
    2217           0 :         struct wbint_Validation *object = (struct wbint_Validation *)pytalloc_get_ptr(obj);
    2218             :         PyObject *py_krb5ccname;
    2219           0 :         if (object->krb5ccname == NULL) {
    2220           0 :                 Py_RETURN_NONE;
    2221             :         }
    2222           0 :         if (object->krb5ccname == NULL) {
    2223           0 :                 py_krb5ccname = Py_None;
    2224           0 :                 Py_INCREF(py_krb5ccname);
    2225             :         } else {
    2226           0 :                 if (object->krb5ccname == NULL) {
    2227           0 :                         py_krb5ccname = Py_None;
    2228           0 :                         Py_INCREF(py_krb5ccname);
    2229             :                 } else {
    2230           0 :                         py_krb5ccname = PyUnicode_Decode(object->krb5ccname, strlen(object->krb5ccname), "utf-8", "ignore");
    2231             :                 }
    2232             :         }
    2233           0 :         return py_krb5ccname;
    2234             : }
    2235             : 
    2236           0 : static int py_wbint_Validation_set_krb5ccname(PyObject *py_obj, PyObject *value, void *closure)
    2237             : {
    2238           0 :         struct wbint_Validation *object = (struct wbint_Validation *)pytalloc_get_ptr(py_obj);
    2239           0 :         if (value == NULL) {
    2240           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->krb5ccname");
    2241           0 :                 return -1;
    2242             :         }
    2243           0 :         if (value == Py_None) {
    2244           0 :                 object->krb5ccname = NULL;
    2245             :         } else {
    2246           0 :                 object->krb5ccname = NULL;
    2247             :                 {
    2248             :                         const char *test_str;
    2249             :                         const char *talloc_str;
    2250           0 :                         PyObject *unicode = NULL;
    2251           0 :                         if (PyUnicode_Check(value)) {
    2252           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2253           0 :                                 if (unicode == NULL) {
    2254           0 :                                         PyErr_NoMemory();
    2255           0 :                                         return -1;
    2256             :                                 }
    2257           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2258           0 :                         } else if (PyBytes_Check(value)) {
    2259           0 :                                 test_str = PyBytes_AS_STRING(value);
    2260             :                         } else {
    2261           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2262           0 :                                 return -1;
    2263             :                         }
    2264           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2265           0 :                         if (unicode != NULL) {
    2266           0 :                                 Py_DECREF(unicode);
    2267             :                         }
    2268           0 :                         if (talloc_str == NULL) {
    2269           0 :                                 PyErr_NoMemory();
    2270           0 :                                 return -1;
    2271             :                         }
    2272           0 :                         object->krb5ccname = talloc_str;
    2273             :                 }
    2274             :         }
    2275           0 :         return 0;
    2276             : }
    2277             : 
    2278             : static PyGetSetDef py_wbint_Validation_getsetters[] = {
    2279             :         {
    2280             :                 .name = discard_const_p(char, "level"),
    2281             :                 .get = py_wbint_Validation_get_level,
    2282             :                 .set = py_wbint_Validation_set_level,
    2283             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2284             :         },
    2285             :         {
    2286             :                 .name = discard_const_p(char, "validation"),
    2287             :                 .get = py_wbint_Validation_get_validation,
    2288             :                 .set = py_wbint_Validation_set_validation,
    2289             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_Validation")
    2290             :         },
    2291             :         {
    2292             :                 .name = discard_const_p(char, "krb5ccname"),
    2293             :                 .get = py_wbint_Validation_get_krb5ccname,
    2294             :                 .set = py_wbint_Validation_set_krb5ccname,
    2295             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    2296             :         },
    2297             :         { .name = NULL }
    2298             : };
    2299             : 
    2300           0 : static PyObject *py_wbint_Validation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2301             : {
    2302           0 :         return pytalloc_new(struct wbint_Validation, type);
    2303             : }
    2304             : 
    2305           0 : static PyObject *py_wbint_Validation_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2306             : {
    2307           0 :         struct wbint_Validation *object = (struct wbint_Validation *)pytalloc_get_ptr(py_obj);
    2308           0 :         PyObject *ret = NULL;
    2309             :         DATA_BLOB blob;
    2310             :         enum ndr_err_code err;
    2311           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2312           0 :         if (tmp_ctx == NULL) {
    2313           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2314           0 :                 return NULL;
    2315             :         }
    2316           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_Validation);
    2317           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2318           0 :                 TALLOC_FREE(tmp_ctx);
    2319           0 :                 PyErr_SetNdrError(err);
    2320           0 :                 return NULL;
    2321             :         }
    2322             : 
    2323           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2324           0 :         TALLOC_FREE(tmp_ctx);
    2325           0 :         return ret;
    2326             : }
    2327             : 
    2328           0 : static PyObject *py_wbint_Validation_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2329             : {
    2330           0 :         struct wbint_Validation *object = (struct wbint_Validation *)pytalloc_get_ptr(py_obj);
    2331           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2332           0 :         Py_ssize_t blob_length = 0;
    2333             :         enum ndr_err_code err;
    2334           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2335           0 :         PyObject *allow_remaining_obj = NULL;
    2336           0 :         bool allow_remaining = false;
    2337             : 
    2338           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2339             :                 discard_const_p(char *, kwnames),
    2340             :                 &blob.data, &blob_length,
    2341             :                 &allow_remaining_obj)) {
    2342           0 :                 return NULL;
    2343             :         }
    2344           0 :         blob.length = blob_length;
    2345             : 
    2346           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2347           0 :                 allow_remaining = true;
    2348             :         }
    2349             : 
    2350           0 :         if (allow_remaining) {
    2351           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Validation);
    2352             :         } else {
    2353           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Validation);
    2354             :         }
    2355           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2356           0 :                 PyErr_SetNdrError(err);
    2357           0 :                 return NULL;
    2358             :         }
    2359             : 
    2360           0 :         Py_RETURN_NONE;
    2361             : }
    2362             : 
    2363           0 : static PyObject *py_wbint_Validation_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2364             : {
    2365           0 :         struct wbint_Validation *object = (struct wbint_Validation *)pytalloc_get_ptr(py_obj);
    2366             :         PyObject *ret;
    2367             :         char *retstr;
    2368             : 
    2369           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_Validation, "wbint_Validation", object);
    2370           0 :         ret = PyUnicode_FromString(retstr);
    2371           0 :         talloc_free(retstr);
    2372             : 
    2373           0 :         return ret;
    2374             : }
    2375             : 
    2376             : static PyMethodDef py_wbint_Validation_methods[] = {
    2377             :         { "__ndr_pack__", (PyCFunction)py_wbint_Validation_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2378             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Validation_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2379             :         { "__ndr_print__", (PyCFunction)py_wbint_Validation_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2380             :         { NULL, NULL, 0, NULL }
    2381             : };
    2382             : 
    2383             : 
    2384             : static PyTypeObject wbint_Validation_Type = {
    2385             :         PyVarObject_HEAD_INIT(NULL, 0)
    2386             :         .tp_name = "winbind.wbint_Validation",
    2387             :         .tp_getset = py_wbint_Validation_getsetters,
    2388             :         .tp_methods = py_wbint_Validation_methods,
    2389             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2390             :         .tp_new = py_wbint_Validation_new,
    2391             : };
    2392             : 
    2393             : 
    2394           0 : static PyObject *py_wbint_AuthUserInfo_get_username(PyObject *obj, void *closure)
    2395             : {
    2396           0 :         struct wbint_AuthUserInfo *object = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(obj);
    2397             :         PyObject *py_username;
    2398           0 :         if (object->username == NULL) {
    2399           0 :                 Py_RETURN_NONE;
    2400             :         }
    2401           0 :         if (object->username == NULL) {
    2402           0 :                 py_username = Py_None;
    2403           0 :                 Py_INCREF(py_username);
    2404             :         } else {
    2405           0 :                 if (object->username == NULL) {
    2406           0 :                         py_username = Py_None;
    2407           0 :                         Py_INCREF(py_username);
    2408             :                 } else {
    2409           0 :                         py_username = PyUnicode_Decode(object->username, strlen(object->username), "utf-8", "ignore");
    2410             :                 }
    2411             :         }
    2412           0 :         return py_username;
    2413             : }
    2414             : 
    2415           0 : static int py_wbint_AuthUserInfo_set_username(PyObject *py_obj, PyObject *value, void *closure)
    2416             : {
    2417           0 :         struct wbint_AuthUserInfo *object = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(py_obj);
    2418           0 :         if (value == NULL) {
    2419           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->username");
    2420           0 :                 return -1;
    2421             :         }
    2422           0 :         if (value == Py_None) {
    2423           0 :                 object->username = NULL;
    2424             :         } else {
    2425           0 :                 object->username = NULL;
    2426             :                 {
    2427             :                         const char *test_str;
    2428             :                         const char *talloc_str;
    2429           0 :                         PyObject *unicode = NULL;
    2430           0 :                         if (PyUnicode_Check(value)) {
    2431           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2432           0 :                                 if (unicode == NULL) {
    2433           0 :                                         PyErr_NoMemory();
    2434           0 :                                         return -1;
    2435             :                                 }
    2436           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2437           0 :                         } else if (PyBytes_Check(value)) {
    2438           0 :                                 test_str = PyBytes_AS_STRING(value);
    2439             :                         } else {
    2440           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2441           0 :                                 return -1;
    2442             :                         }
    2443           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2444           0 :                         if (unicode != NULL) {
    2445           0 :                                 Py_DECREF(unicode);
    2446             :                         }
    2447           0 :                         if (talloc_str == NULL) {
    2448           0 :                                 PyErr_NoMemory();
    2449           0 :                                 return -1;
    2450             :                         }
    2451           0 :                         object->username = talloc_str;
    2452             :                 }
    2453             :         }
    2454           0 :         return 0;
    2455             : }
    2456             : 
    2457           0 : static PyObject *py_wbint_AuthUserInfo_get_password(PyObject *obj, void *closure)
    2458             : {
    2459           0 :         struct wbint_AuthUserInfo *object = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(obj);
    2460             :         PyObject *py_password;
    2461           0 :         if (object->password == NULL) {
    2462           0 :                 Py_RETURN_NONE;
    2463             :         }
    2464           0 :         if (object->password == NULL) {
    2465           0 :                 py_password = Py_None;
    2466           0 :                 Py_INCREF(py_password);
    2467             :         } else {
    2468           0 :                 if (object->password == NULL) {
    2469           0 :                         py_password = Py_None;
    2470           0 :                         Py_INCREF(py_password);
    2471             :                 } else {
    2472           0 :                         py_password = PyUnicode_Decode(object->password, strlen(object->password), "utf-8", "ignore");
    2473             :                 }
    2474             :         }
    2475           0 :         return py_password;
    2476             : }
    2477             : 
    2478           0 : static int py_wbint_AuthUserInfo_set_password(PyObject *py_obj, PyObject *value, void *closure)
    2479             : {
    2480           0 :         struct wbint_AuthUserInfo *object = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(py_obj);
    2481           0 :         if (value == NULL) {
    2482           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
    2483           0 :                 return -1;
    2484             :         }
    2485           0 :         if (value == Py_None) {
    2486           0 :                 object->password = NULL;
    2487             :         } else {
    2488           0 :                 object->password = NULL;
    2489             :                 {
    2490             :                         const char *test_str;
    2491             :                         const char *talloc_str;
    2492           0 :                         PyObject *unicode = NULL;
    2493           0 :                         if (PyUnicode_Check(value)) {
    2494           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2495           0 :                                 if (unicode == NULL) {
    2496           0 :                                         PyErr_NoMemory();
    2497           0 :                                         return -1;
    2498             :                                 }
    2499           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2500           0 :                         } else if (PyBytes_Check(value)) {
    2501           0 :                                 test_str = PyBytes_AS_STRING(value);
    2502             :                         } else {
    2503           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2504           0 :                                 return -1;
    2505             :                         }
    2506           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2507           0 :                         if (unicode != NULL) {
    2508           0 :                                 Py_DECREF(unicode);
    2509             :                         }
    2510           0 :                         if (talloc_str == NULL) {
    2511           0 :                                 PyErr_NoMemory();
    2512           0 :                                 return -1;
    2513             :                         }
    2514           0 :                         object->password = talloc_str;
    2515             :                 }
    2516             :         }
    2517           0 :         return 0;
    2518             : }
    2519             : 
    2520           0 : static PyObject *py_wbint_AuthUserInfo_get_krb5_cc_type(PyObject *obj, void *closure)
    2521             : {
    2522           0 :         struct wbint_AuthUserInfo *object = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(obj);
    2523             :         PyObject *py_krb5_cc_type;
    2524           0 :         if (object->krb5_cc_type == NULL) {
    2525           0 :                 Py_RETURN_NONE;
    2526             :         }
    2527           0 :         if (object->krb5_cc_type == NULL) {
    2528           0 :                 py_krb5_cc_type = Py_None;
    2529           0 :                 Py_INCREF(py_krb5_cc_type);
    2530             :         } else {
    2531           0 :                 if (object->krb5_cc_type == NULL) {
    2532           0 :                         py_krb5_cc_type = Py_None;
    2533           0 :                         Py_INCREF(py_krb5_cc_type);
    2534             :                 } else {
    2535           0 :                         py_krb5_cc_type = PyUnicode_Decode(object->krb5_cc_type, strlen(object->krb5_cc_type), "utf-8", "ignore");
    2536             :                 }
    2537             :         }
    2538           0 :         return py_krb5_cc_type;
    2539             : }
    2540             : 
    2541           0 : static int py_wbint_AuthUserInfo_set_krb5_cc_type(PyObject *py_obj, PyObject *value, void *closure)
    2542             : {
    2543           0 :         struct wbint_AuthUserInfo *object = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(py_obj);
    2544           0 :         if (value == NULL) {
    2545           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->krb5_cc_type");
    2546           0 :                 return -1;
    2547             :         }
    2548           0 :         if (value == Py_None) {
    2549           0 :                 object->krb5_cc_type = NULL;
    2550             :         } else {
    2551           0 :                 object->krb5_cc_type = NULL;
    2552             :                 {
    2553             :                         const char *test_str;
    2554             :                         const char *talloc_str;
    2555           0 :                         PyObject *unicode = NULL;
    2556           0 :                         if (PyUnicode_Check(value)) {
    2557           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2558           0 :                                 if (unicode == NULL) {
    2559           0 :                                         PyErr_NoMemory();
    2560           0 :                                         return -1;
    2561             :                                 }
    2562           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2563           0 :                         } else if (PyBytes_Check(value)) {
    2564           0 :                                 test_str = PyBytes_AS_STRING(value);
    2565             :                         } else {
    2566           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2567           0 :                                 return -1;
    2568             :                         }
    2569           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2570           0 :                         if (unicode != NULL) {
    2571           0 :                                 Py_DECREF(unicode);
    2572             :                         }
    2573           0 :                         if (talloc_str == NULL) {
    2574           0 :                                 PyErr_NoMemory();
    2575           0 :                                 return -1;
    2576             :                         }
    2577           0 :                         object->krb5_cc_type = talloc_str;
    2578             :                 }
    2579             :         }
    2580           0 :         return 0;
    2581             : }
    2582             : 
    2583           0 : static PyObject *py_wbint_AuthUserInfo_get_uid(PyObject *obj, void *closure)
    2584             : {
    2585           0 :         struct wbint_AuthUserInfo *object = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(obj);
    2586             :         PyObject *py_uid;
    2587           0 :         py_uid = PyLong_FromUnsignedLongLong(object->uid);
    2588           0 :         return py_uid;
    2589             : }
    2590             : 
    2591           0 : static int py_wbint_AuthUserInfo_set_uid(PyObject *py_obj, PyObject *value, void *closure)
    2592             : {
    2593           0 :         struct wbint_AuthUserInfo *object = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(py_obj);
    2594           0 :         if (value == NULL) {
    2595           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->uid");
    2596           0 :                 return -1;
    2597             :         }
    2598             :         {
    2599           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->uid));
    2600           0 :                 if (PyLong_Check(value)) {
    2601             :                         unsigned long long test_var;
    2602           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2603           0 :                         if (PyErr_Occurred() != NULL) {
    2604           0 :                                 return -1;
    2605             :                         }
    2606           0 :                         if (test_var > uint_max) {
    2607           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2608             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2609           0 :                                 return -1;
    2610             :                         }
    2611           0 :                         object->uid = test_var;
    2612             :                 } else {
    2613           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2614             :                           PyLong_Type.tp_name);
    2615           0 :                         return -1;
    2616             :                 }
    2617             :         }
    2618           0 :         return 0;
    2619             : }
    2620             : 
    2621             : static PyGetSetDef py_wbint_AuthUserInfo_getsetters[] = {
    2622             :         {
    2623             :                 .name = discard_const_p(char, "username"),
    2624             :                 .get = py_wbint_AuthUserInfo_get_username,
    2625             :                 .set = py_wbint_AuthUserInfo_set_username,
    2626             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    2627             :         },
    2628             :         {
    2629             :                 .name = discard_const_p(char, "password"),
    2630             :                 .get = py_wbint_AuthUserInfo_get_password,
    2631             :                 .set = py_wbint_AuthUserInfo_set_password,
    2632             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    2633             :         },
    2634             :         {
    2635             :                 .name = discard_const_p(char, "krb5_cc_type"),
    2636             :                 .get = py_wbint_AuthUserInfo_get_krb5_cc_type,
    2637             :                 .set = py_wbint_AuthUserInfo_set_krb5_cc_type,
    2638             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    2639             :         },
    2640             :         {
    2641             :                 .name = discard_const_p(char, "uid"),
    2642             :                 .get = py_wbint_AuthUserInfo_get_uid,
    2643             :                 .set = py_wbint_AuthUserInfo_set_uid,
    2644             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
    2645             :         },
    2646             :         { .name = NULL }
    2647             : };
    2648             : 
    2649           0 : static PyObject *py_wbint_AuthUserInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2650             : {
    2651           0 :         return pytalloc_new(struct wbint_AuthUserInfo, type);
    2652             : }
    2653             : 
    2654           0 : static PyObject *py_wbint_AuthUserInfo_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2655             : {
    2656           0 :         struct wbint_AuthUserInfo *object = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(py_obj);
    2657           0 :         PyObject *ret = NULL;
    2658             :         DATA_BLOB blob;
    2659             :         enum ndr_err_code err;
    2660           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2661           0 :         if (tmp_ctx == NULL) {
    2662           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2663           0 :                 return NULL;
    2664             :         }
    2665           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_AuthUserInfo);
    2666           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2667           0 :                 TALLOC_FREE(tmp_ctx);
    2668           0 :                 PyErr_SetNdrError(err);
    2669           0 :                 return NULL;
    2670             :         }
    2671             : 
    2672           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2673           0 :         TALLOC_FREE(tmp_ctx);
    2674           0 :         return ret;
    2675             : }
    2676             : 
    2677           0 : static PyObject *py_wbint_AuthUserInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2678             : {
    2679           0 :         struct wbint_AuthUserInfo *object = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(py_obj);
    2680           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2681           0 :         Py_ssize_t blob_length = 0;
    2682             :         enum ndr_err_code err;
    2683           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2684           0 :         PyObject *allow_remaining_obj = NULL;
    2685           0 :         bool allow_remaining = false;
    2686             : 
    2687           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2688             :                 discard_const_p(char *, kwnames),
    2689             :                 &blob.data, &blob_length,
    2690             :                 &allow_remaining_obj)) {
    2691           0 :                 return NULL;
    2692             :         }
    2693           0 :         blob.length = blob_length;
    2694             : 
    2695           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2696           0 :                 allow_remaining = true;
    2697             :         }
    2698             : 
    2699           0 :         if (allow_remaining) {
    2700           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_AuthUserInfo);
    2701             :         } else {
    2702           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_AuthUserInfo);
    2703             :         }
    2704           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2705           0 :                 PyErr_SetNdrError(err);
    2706           0 :                 return NULL;
    2707             :         }
    2708             : 
    2709           0 :         Py_RETURN_NONE;
    2710             : }
    2711             : 
    2712           0 : static PyObject *py_wbint_AuthUserInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2713             : {
    2714           0 :         struct wbint_AuthUserInfo *object = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(py_obj);
    2715             :         PyObject *ret;
    2716             :         char *retstr;
    2717             : 
    2718           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_AuthUserInfo, "wbint_AuthUserInfo", object);
    2719           0 :         ret = PyUnicode_FromString(retstr);
    2720           0 :         talloc_free(retstr);
    2721             : 
    2722           0 :         return ret;
    2723             : }
    2724             : 
    2725             : static PyMethodDef py_wbint_AuthUserInfo_methods[] = {
    2726             :         { "__ndr_pack__", (PyCFunction)py_wbint_AuthUserInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2727             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AuthUserInfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2728             :         { "__ndr_print__", (PyCFunction)py_wbint_AuthUserInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2729             :         { NULL, NULL, 0, NULL }
    2730             : };
    2731             : 
    2732             : 
    2733             : static PyTypeObject wbint_AuthUserInfo_Type = {
    2734             :         PyVarObject_HEAD_INIT(NULL, 0)
    2735             :         .tp_name = "winbind.wbint_AuthUserInfo",
    2736             :         .tp_getset = py_wbint_AuthUserInfo_getsetters,
    2737             :         .tp_methods = py_wbint_AuthUserInfo_methods,
    2738             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2739             :         .tp_new = py_wbint_AuthUserInfo_new,
    2740             : };
    2741             : 
    2742             : 
    2743           0 : static PyObject *py_wbint_PamAuthCrapValidation_get_level(PyObject *obj, void *closure)
    2744             : {
    2745           0 :         struct wbint_PamAuthCrapValidation *object = (struct wbint_PamAuthCrapValidation *)pytalloc_get_ptr(obj);
    2746             :         PyObject *py_level;
    2747           0 :         py_level = PyLong_FromLong((uint16_t)object->level);
    2748           0 :         return py_level;
    2749             : }
    2750             : 
    2751           0 : static int py_wbint_PamAuthCrapValidation_set_level(PyObject *py_obj, PyObject *value, void *closure)
    2752             : {
    2753           0 :         struct wbint_PamAuthCrapValidation *object = (struct wbint_PamAuthCrapValidation *)pytalloc_get_ptr(py_obj);
    2754           0 :         if (value == NULL) {
    2755           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->level");
    2756           0 :                 return -1;
    2757             :         }
    2758             :         {
    2759           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
    2760           0 :                 if (PyLong_Check(value)) {
    2761             :                         unsigned long long test_var;
    2762           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2763           0 :                         if (PyErr_Occurred() != NULL) {
    2764           0 :                                 return -1;
    2765             :                         }
    2766           0 :                         if (test_var > uint_max) {
    2767           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2768             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2769           0 :                                 return -1;
    2770             :                         }
    2771           0 :                         object->level = test_var;
    2772             :                 } else {
    2773           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2774             :                           PyLong_Type.tp_name);
    2775           0 :                         return -1;
    2776             :                 }
    2777             :         }
    2778           0 :         return 0;
    2779             : }
    2780             : 
    2781           0 : static PyObject *py_wbint_PamAuthCrapValidation_get_validation(PyObject *obj, void *closure)
    2782             : {
    2783           0 :         struct wbint_PamAuthCrapValidation *object = (struct wbint_PamAuthCrapValidation *)pytalloc_get_ptr(obj);
    2784             :         PyObject *py_validation;
    2785           0 :         if (object->validation == NULL) {
    2786           0 :                 Py_RETURN_NONE;
    2787             :         }
    2788           0 :         if (object->validation == NULL) {
    2789           0 :                 py_validation = Py_None;
    2790           0 :                 Py_INCREF(py_validation);
    2791             :         } else {
    2792           0 :                 py_validation = pyrpc_import_union(netr_Validation_Type, object->validation, object->level, object->validation, "union netr_Validation");
    2793           0 :                 if (py_validation == NULL) {
    2794           0 :                         return NULL;
    2795             :                 }
    2796             :         }
    2797           0 :         return py_validation;
    2798             : }
    2799             : 
    2800           0 : static int py_wbint_PamAuthCrapValidation_set_validation(PyObject *py_obj, PyObject *value, void *closure)
    2801             : {
    2802           0 :         struct wbint_PamAuthCrapValidation *object = (struct wbint_PamAuthCrapValidation *)pytalloc_get_ptr(py_obj);
    2803           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->validation));
    2804           0 :         if (value == NULL) {
    2805           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->validation");
    2806           0 :                 return -1;
    2807             :         }
    2808           0 :         if (value == Py_None) {
    2809           0 :                 object->validation = NULL;
    2810             :         } else {
    2811           0 :                 object->validation = NULL;
    2812             :                 {
    2813             :                         union netr_Validation *validation_switch_1;
    2814           0 :                         validation_switch_1 = (union netr_Validation *)pyrpc_export_union(netr_Validation_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union netr_Validation");
    2815           0 :                         if (validation_switch_1 == NULL) {
    2816           0 :                                 return -1;
    2817             :                         }
    2818           0 :                         object->validation = validation_switch_1;
    2819             :                 }
    2820             :         }
    2821           0 :         return 0;
    2822             : }
    2823             : 
    2824             : static PyGetSetDef py_wbint_PamAuthCrapValidation_getsetters[] = {
    2825             :         {
    2826             :                 .name = discard_const_p(char, "level"),
    2827             :                 .get = py_wbint_PamAuthCrapValidation_get_level,
    2828             :                 .set = py_wbint_PamAuthCrapValidation_set_level,
    2829             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2830             :         },
    2831             :         {
    2832             :                 .name = discard_const_p(char, "validation"),
    2833             :                 .get = py_wbint_PamAuthCrapValidation_get_validation,
    2834             :                 .set = py_wbint_PamAuthCrapValidation_set_validation,
    2835             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_Validation")
    2836             :         },
    2837             :         { .name = NULL }
    2838             : };
    2839             : 
    2840           0 : static PyObject *py_wbint_PamAuthCrapValidation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2841             : {
    2842           0 :         return pytalloc_new(struct wbint_PamAuthCrapValidation, type);
    2843             : }
    2844             : 
    2845           0 : static PyObject *py_wbint_PamAuthCrapValidation_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2846             : {
    2847           0 :         struct wbint_PamAuthCrapValidation *object = (struct wbint_PamAuthCrapValidation *)pytalloc_get_ptr(py_obj);
    2848           0 :         PyObject *ret = NULL;
    2849             :         DATA_BLOB blob;
    2850             :         enum ndr_err_code err;
    2851           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2852           0 :         if (tmp_ctx == NULL) {
    2853           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2854           0 :                 return NULL;
    2855             :         }
    2856           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_PamAuthCrapValidation);
    2857           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2858           0 :                 TALLOC_FREE(tmp_ctx);
    2859           0 :                 PyErr_SetNdrError(err);
    2860           0 :                 return NULL;
    2861             :         }
    2862             : 
    2863           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2864           0 :         TALLOC_FREE(tmp_ctx);
    2865           0 :         return ret;
    2866             : }
    2867             : 
    2868           0 : static PyObject *py_wbint_PamAuthCrapValidation_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2869             : {
    2870           0 :         struct wbint_PamAuthCrapValidation *object = (struct wbint_PamAuthCrapValidation *)pytalloc_get_ptr(py_obj);
    2871           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2872           0 :         Py_ssize_t blob_length = 0;
    2873             :         enum ndr_err_code err;
    2874           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2875           0 :         PyObject *allow_remaining_obj = NULL;
    2876           0 :         bool allow_remaining = false;
    2877             : 
    2878           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2879             :                 discard_const_p(char *, kwnames),
    2880             :                 &blob.data, &blob_length,
    2881             :                 &allow_remaining_obj)) {
    2882           0 :                 return NULL;
    2883             :         }
    2884           0 :         blob.length = blob_length;
    2885             : 
    2886           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2887           0 :                 allow_remaining = true;
    2888             :         }
    2889             : 
    2890           0 :         if (allow_remaining) {
    2891           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_PamAuthCrapValidation);
    2892             :         } else {
    2893           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_PamAuthCrapValidation);
    2894             :         }
    2895           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2896           0 :                 PyErr_SetNdrError(err);
    2897           0 :                 return NULL;
    2898             :         }
    2899             : 
    2900           0 :         Py_RETURN_NONE;
    2901             : }
    2902             : 
    2903           0 : static PyObject *py_wbint_PamAuthCrapValidation_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2904             : {
    2905           0 :         struct wbint_PamAuthCrapValidation *object = (struct wbint_PamAuthCrapValidation *)pytalloc_get_ptr(py_obj);
    2906             :         PyObject *ret;
    2907             :         char *retstr;
    2908             : 
    2909           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_PamAuthCrapValidation, "wbint_PamAuthCrapValidation", object);
    2910           0 :         ret = PyUnicode_FromString(retstr);
    2911           0 :         talloc_free(retstr);
    2912             : 
    2913           0 :         return ret;
    2914             : }
    2915             : 
    2916             : static PyMethodDef py_wbint_PamAuthCrapValidation_methods[] = {
    2917             :         { "__ndr_pack__", (PyCFunction)py_wbint_PamAuthCrapValidation_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2918             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrapValidation_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2919             :         { "__ndr_print__", (PyCFunction)py_wbint_PamAuthCrapValidation_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2920             :         { NULL, NULL, 0, NULL }
    2921             : };
    2922             : 
    2923             : 
    2924             : static PyTypeObject wbint_PamAuthCrapValidation_Type = {
    2925             :         PyVarObject_HEAD_INIT(NULL, 0)
    2926             :         .tp_name = "winbind.wbint_PamAuthCrapValidation",
    2927             :         .tp_getset = py_wbint_PamAuthCrapValidation_getsetters,
    2928             :         .tp_methods = py_wbint_PamAuthCrapValidation_methods,
    2929             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2930             :         .tp_new = py_wbint_PamAuthCrapValidation_new,
    2931             : };
    2932             : 
    2933             : 
    2934             : 
    2935           0 : static PyObject *py_wbint_Ping_in_get_in_data(PyObject *obj, void *closure)
    2936             : {
    2937           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(obj);
    2938             :         PyObject *py_in_data;
    2939           0 :         py_in_data = PyLong_FromUnsignedLongLong((uint32_t)object->in.in_data);
    2940           0 :         return py_in_data;
    2941             : }
    2942             : 
    2943           0 : static int py_wbint_Ping_in_set_in_data(PyObject *py_obj, PyObject *value, void *closure)
    2944             : {
    2945           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj);
    2946           0 :         if (value == NULL) {
    2947           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.in_data");
    2948           0 :                 return -1;
    2949             :         }
    2950             :         {
    2951           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.in_data));
    2952           0 :                 if (PyLong_Check(value)) {
    2953             :                         unsigned long long test_var;
    2954           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2955           0 :                         if (PyErr_Occurred() != NULL) {
    2956           0 :                                 return -1;
    2957             :                         }
    2958           0 :                         if (test_var > uint_max) {
    2959           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2960             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2961           0 :                                 return -1;
    2962             :                         }
    2963           0 :                         object->in.in_data = test_var;
    2964             :                 } else {
    2965           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2966             :                           PyLong_Type.tp_name);
    2967           0 :                         return -1;
    2968             :                 }
    2969             :         }
    2970           0 :         return 0;
    2971             : }
    2972             : 
    2973           0 : static PyObject *py_wbint_Ping_out_get_out_data(PyObject *obj, void *closure)
    2974             : {
    2975           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(obj);
    2976             :         PyObject *py_out_data;
    2977           0 :         if (object->out.out_data == NULL) {
    2978           0 :                 Py_RETURN_NONE;
    2979             :         }
    2980           0 :         py_out_data = PyLong_FromUnsignedLongLong((uint32_t)*object->out.out_data);
    2981           0 :         return py_out_data;
    2982             : }
    2983             : 
    2984           0 : static int py_wbint_Ping_out_set_out_data(PyObject *py_obj, PyObject *value, void *closure)
    2985             : {
    2986           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj);
    2987           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.out_data));
    2988           0 :         if (value == NULL) {
    2989           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.out_data");
    2990           0 :                 return -1;
    2991             :         }
    2992           0 :         object->out.out_data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.out_data);
    2993           0 :         if (object->out.out_data == NULL) {
    2994           0 :                 PyErr_NoMemory();
    2995           0 :                 return -1;
    2996             :         }
    2997             :         {
    2998           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.out_data));
    2999           0 :                 if (PyLong_Check(value)) {
    3000             :                         unsigned long long test_var;
    3001           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3002           0 :                         if (PyErr_Occurred() != NULL) {
    3003           0 :                                 return -1;
    3004             :                         }
    3005           0 :                         if (test_var > uint_max) {
    3006           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3007             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3008           0 :                                 return -1;
    3009             :                         }
    3010           0 :                         *object->out.out_data = test_var;
    3011             :                 } else {
    3012           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3013             :                           PyLong_Type.tp_name);
    3014           0 :                         return -1;
    3015             :                 }
    3016             :         }
    3017           0 :         return 0;
    3018             : }
    3019             : 
    3020           0 : static PyObject *py_wbint_Ping_get_result(PyObject *obj, void *closure)
    3021             : {
    3022           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(obj);
    3023             :         PyObject *py_result;
    3024           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    3025           0 :         return py_result;
    3026             : }
    3027             : 
    3028           0 : static int py_wbint_Ping_set_result(PyObject *py_obj, PyObject *value, void *closure)
    3029             : {
    3030           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj);
    3031           0 :         if (value == NULL) {
    3032           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    3033           0 :                 return -1;
    3034             :         }
    3035           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    3036           0 :         return 0;
    3037             : }
    3038             : 
    3039             : static PyGetSetDef py_wbint_Ping_getsetters[] = {
    3040             :         {
    3041             :                 .name = discard_const_p(char, "in_in_data"),
    3042             :                 .get = py_wbint_Ping_in_get_in_data,
    3043             :                 .set = py_wbint_Ping_in_set_in_data,
    3044             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3045             :         },
    3046             :         {
    3047             :                 .name = discard_const_p(char, "out_out_data"),
    3048             :                 .get = py_wbint_Ping_out_get_out_data,
    3049             :                 .set = py_wbint_Ping_out_set_out_data,
    3050             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3051             :         },
    3052             :         {
    3053             :                 .name = discard_const_p(char, "result"),
    3054             :                 .get = py_wbint_Ping_get_result,
    3055             :                 .set = py_wbint_Ping_set_result,
    3056             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    3057             :         },
    3058             :         { .name = NULL }
    3059             : };
    3060             : 
    3061           0 : static PyObject *py_wbint_Ping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3062             : {
    3063           0 :         PyObject *self = pytalloc_new(struct wbint_Ping, type);
    3064           0 :         struct wbint_Ping *_self = (struct wbint_Ping *)pytalloc_get_ptr(self);
    3065           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    3066           0 :         _self->out.out_data = talloc_zero(mem_ctx, uint32_t);
    3067           0 :         return self;
    3068             : }
    3069             : 
    3070           0 : static PyObject *py_wbint_Ping_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    3071             : {
    3072             : 
    3073             : 
    3074           0 :         return PyLong_FromLong(0);
    3075             : }
    3076             : 
    3077           0 : static PyObject *py_wbint_Ping_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    3078             : {
    3079           0 :         const struct ndr_interface_call *call = NULL;
    3080           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj);
    3081           0 :         PyObject *ret = NULL;
    3082           0 :         struct ndr_push *push = NULL;
    3083             :         DATA_BLOB blob;
    3084             :         enum ndr_err_code err;
    3085             : 
    3086           0 :         if (ndr_table_winbind.num_calls < 1) {
    3087           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Ping_ndr_pack");
    3088           0 :                 return NULL;
    3089             :         }
    3090           0 :         call = &ndr_table_winbind.calls[0];
    3091             : 
    3092           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    3093           0 :         if (push == NULL) {
    3094           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3095           0 :                 return NULL;
    3096             :         }
    3097             : 
    3098           0 :         push->flags |= ndr_push_flags;
    3099             : 
    3100           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    3101           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3102           0 :                 TALLOC_FREE(push);
    3103           0 :                 PyErr_SetNdrError(err);
    3104           0 :                 return NULL;
    3105             :         }
    3106           0 :         blob = ndr_push_blob(push);
    3107           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3108           0 :         TALLOC_FREE(push);
    3109           0 :         return ret;
    3110             : }
    3111             : 
    3112           0 : static PyObject *py_wbint_Ping_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3113             : {
    3114           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3115           0 :         PyObject *bigendian_obj = NULL;
    3116           0 :         PyObject *ndr64_obj = NULL;
    3117           0 :         uint32_t ndr_push_flags = 0;
    3118             : 
    3119           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    3120             :                 discard_const_p(char *, kwnames),
    3121             :                 &bigendian_obj,
    3122             :                 &ndr64_obj)) {
    3123           0 :                 return NULL;
    3124             :         }
    3125             : 
    3126           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3127           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3128             :         }
    3129           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3130           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3131             :         }
    3132             : 
    3133           0 :         return py_wbint_Ping_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    3134             : }
    3135             : 
    3136           0 : static PyObject *py_wbint_Ping_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3137             : {
    3138           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3139           0 :         PyObject *bigendian_obj = NULL;
    3140           0 :         PyObject *ndr64_obj = NULL;
    3141           0 :         uint32_t ndr_push_flags = 0;
    3142             : 
    3143           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    3144             :                 discard_const_p(char *, kwnames),
    3145             :                 &bigendian_obj,
    3146             :                 &ndr64_obj)) {
    3147           0 :                 return NULL;
    3148             :         }
    3149             : 
    3150           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3151           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3152             :         }
    3153           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3154           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3155             :         }
    3156             : 
    3157           0 :         return py_wbint_Ping_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    3158             : }
    3159             : 
    3160           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)
    3161             : {
    3162           0 :         const struct ndr_interface_call *call = NULL;
    3163           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj);
    3164           0 :         struct ndr_pull *pull = NULL;
    3165             :         enum ndr_err_code err;
    3166             : 
    3167           0 :         if (ndr_table_winbind.num_calls < 1) {
    3168           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Ping_ndr_unpack");
    3169           0 :                 return NULL;
    3170             :         }
    3171           0 :         call = &ndr_table_winbind.calls[0];
    3172             : 
    3173           0 :         pull = ndr_pull_init_blob(blob, object);
    3174           0 :         if (pull == NULL) {
    3175           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3176           0 :                 return NULL;
    3177             :         }
    3178             : 
    3179           0 :         pull->flags |= ndr_pull_flags;
    3180             : 
    3181           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    3182           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3183           0 :                 TALLOC_FREE(pull);
    3184           0 :                 PyErr_SetNdrError(err);
    3185           0 :                 return NULL;
    3186             :         }
    3187           0 :         if (!allow_remaining) {
    3188             :                 uint32_t highest_ofs;
    3189             : 
    3190           0 :                 if (pull->offset > pull->relative_highest_offset) {
    3191           0 :                         highest_ofs = pull->offset;
    3192             :                 } else {
    3193           0 :                         highest_ofs = pull->relative_highest_offset;
    3194             :                 }
    3195           0 :                 if (highest_ofs < pull->data_size) {
    3196           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    3197             :                                 "not all bytes consumed ofs[%u] size[%u]",
    3198             :                                 highest_ofs, pull->data_size);
    3199           0 :                         TALLOC_FREE(pull);
    3200           0 :                         PyErr_SetNdrError(err);
    3201           0 :                         return NULL;
    3202             :                 }
    3203             :         }
    3204             : 
    3205           0 :         TALLOC_FREE(pull);
    3206           0 :         Py_RETURN_NONE;
    3207             : }
    3208             : 
    3209           0 : static PyObject *py_wbint_Ping_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3210             : {
    3211             :         DATA_BLOB blob;
    3212           0 :         Py_ssize_t blob_length = 0;
    3213           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3214           0 :         PyObject *bigendian_obj = NULL;
    3215           0 :         PyObject *ndr64_obj = NULL;
    3216           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3217           0 :         PyObject *allow_remaining_obj = NULL;
    3218           0 :         bool allow_remaining = false;
    3219             : 
    3220           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    3221             :                 discard_const_p(char *, kwnames),
    3222             :                 &blob.data, &blob_length,
    3223             :                 &bigendian_obj,
    3224             :                 &ndr64_obj,
    3225             :                 &allow_remaining_obj)) {
    3226           0 :                 return NULL;
    3227             :         }
    3228           0 :         blob.length = blob_length;
    3229             : 
    3230           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3231           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3232             :         }
    3233           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3234           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3235             :         }
    3236             : 
    3237           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3238           0 :                 allow_remaining = true;
    3239             :         }
    3240             : 
    3241           0 :         return py_wbint_Ping_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    3242             : }
    3243             : 
    3244           0 : static PyObject *py_wbint_Ping_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3245             : {
    3246             :         DATA_BLOB blob;
    3247           0 :         Py_ssize_t blob_length = 0;
    3248           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3249           0 :         PyObject *bigendian_obj = NULL;
    3250           0 :         PyObject *ndr64_obj = NULL;
    3251           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3252           0 :         PyObject *allow_remaining_obj = NULL;
    3253           0 :         bool allow_remaining = false;
    3254             : 
    3255           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    3256             :                 discard_const_p(char *, kwnames),
    3257             :                 &blob.data, &blob_length,
    3258             :                 &bigendian_obj,
    3259             :                 &ndr64_obj,
    3260             :                 &allow_remaining_obj)) {
    3261           0 :                 return NULL;
    3262             :         }
    3263           0 :         blob.length = blob_length;
    3264             : 
    3265           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3266           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3267             :         }
    3268           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3269           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3270             :         }
    3271             : 
    3272           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3273           0 :                 allow_remaining = true;
    3274             :         }
    3275             : 
    3276           0 :         return py_wbint_Ping_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    3277             : }
    3278             : 
    3279           0 : static PyObject *py_wbint_Ping_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    3280             : {
    3281           0 :         const struct ndr_interface_call *call = NULL;
    3282           0 :         struct wbint_Ping *object = (struct wbint_Ping *)pytalloc_get_ptr(py_obj);
    3283             :         PyObject *ret;
    3284             :         char *retstr;
    3285             : 
    3286           0 :         if (ndr_table_winbind.num_calls < 1) {
    3287           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Ping_ndr_print");
    3288           0 :                 return NULL;
    3289             :         }
    3290           0 :         call = &ndr_table_winbind.calls[0];
    3291             : 
    3292           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    3293           0 :         ret = PyUnicode_FromString(retstr);
    3294           0 :         TALLOC_FREE(retstr);
    3295             : 
    3296           0 :         return ret;
    3297             : }
    3298             : 
    3299           0 : static PyObject *py_wbint_Ping_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3300             : {
    3301           0 :         return py_wbint_Ping_ndr_print(py_obj, "wbint_Ping_in", NDR_IN);
    3302             : }
    3303             : 
    3304           0 : static PyObject *py_wbint_Ping_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3305             : {
    3306           0 :         return py_wbint_Ping_ndr_print(py_obj, "wbint_Ping_out", NDR_OUT);
    3307             : }
    3308             : 
    3309             : static PyMethodDef py_wbint_Ping_methods[] = {
    3310             :         { "opnum", (PyCFunction)py_wbint_Ping_ndr_opnum, METH_NOARGS|METH_CLASS,
    3311             :                 "winbind.wbint_Ping.opnum() -> 0 (0x00) " },
    3312             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    3313             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    3314             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    3315             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    3316             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    3317             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    3318             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    3319             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    3320             :         { "__ndr_print_in__", (PyCFunction)py_wbint_Ping_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    3321             :         { "__ndr_print_out__", (PyCFunction)py_wbint_Ping_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    3322             :         { NULL, NULL, 0, NULL }
    3323             : };
    3324             : 
    3325             : 
    3326             : static PyTypeObject wbint_Ping_Type = {
    3327             :         PyVarObject_HEAD_INIT(NULL, 0)
    3328             :         .tp_name = "winbind.wbint_Ping",
    3329             :         .tp_getset = py_wbint_Ping_getsetters,
    3330             :         .tp_methods = py_wbint_Ping_methods,
    3331             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3332             :         .tp_new = py_wbint_Ping_new,
    3333             : };
    3334             : 
    3335           0 : static bool pack_py_wbint_Ping_args_in(PyObject *args, PyObject *kwargs, struct wbint_Ping *r)
    3336             : {
    3337             :         PyObject *py_in_data;
    3338           0 :         const char *kwnames[] = {
    3339             :                 "in_data", NULL
    3340             :         };
    3341             : 
    3342           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_Ping", discard_const_p(char *, kwnames), &py_in_data)) {
    3343           0 :                 return false;
    3344             :         }
    3345             : 
    3346           0 :         if (py_in_data == NULL) {
    3347           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.in_data");
    3348           0 :                 return false;
    3349             :         }
    3350             :         {
    3351           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.in_data));
    3352           0 :                 if (PyLong_Check(py_in_data)) {
    3353             :                         unsigned long long test_var;
    3354           0 :                         test_var = PyLong_AsUnsignedLongLong(py_in_data);
    3355           0 :                         if (PyErr_Occurred() != NULL) {
    3356           0 :                                 return false;
    3357             :                         }
    3358           0 :                         if (test_var > uint_max) {
    3359           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3360             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3361           0 :                                 return false;
    3362             :                         }
    3363           0 :                         r->in.in_data = test_var;
    3364             :                 } else {
    3365           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3366             :                           PyLong_Type.tp_name);
    3367           0 :                         return false;
    3368             :                 }
    3369             :         }
    3370           0 :         return true;
    3371             : }
    3372             : 
    3373           0 : static PyObject *unpack_py_wbint_Ping_args_out(struct wbint_Ping *r)
    3374             : {
    3375             :         PyObject *result;
    3376             :         PyObject *py_out_data;
    3377           0 :         py_out_data = PyLong_FromUnsignedLongLong((uint32_t)*r->out.out_data);
    3378           0 :         result = py_out_data;
    3379           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    3380           0 :                 PyErr_SetNTSTATUS(r->out.result);
    3381           0 :                 return NULL;
    3382             :         }
    3383             : 
    3384           0 :         return result;
    3385             : }
    3386             : 
    3387             : 
    3388           0 : static PyObject *py_wbint_LookupSid_in_get_sid(PyObject *obj, void *closure)
    3389             : {
    3390           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj);
    3391             :         PyObject *py_sid;
    3392           0 :         if (object->in.sid == NULL) {
    3393           0 :                 Py_RETURN_NONE;
    3394             :         }
    3395           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
    3396           0 :         return py_sid;
    3397             : }
    3398             : 
    3399           0 : static int py_wbint_LookupSid_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
    3400             : {
    3401           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    3402           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
    3403           0 :         if (value == NULL) {
    3404           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
    3405           0 :                 return -1;
    3406             :         }
    3407           0 :         object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
    3408           0 :         if (object->in.sid == NULL) {
    3409           0 :                 PyErr_NoMemory();
    3410           0 :                 return -1;
    3411             :         }
    3412           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    3413           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3414           0 :                 PyErr_NoMemory();
    3415           0 :                 return -1;
    3416             :         }
    3417           0 :         object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
    3418           0 :         return 0;
    3419             : }
    3420             : 
    3421           0 : static PyObject *py_wbint_LookupSid_out_get_type(PyObject *obj, void *closure)
    3422             : {
    3423           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj);
    3424             :         PyObject *py_type;
    3425           0 :         if (object->out.type == NULL) {
    3426           0 :                 Py_RETURN_NONE;
    3427             :         }
    3428           0 :         py_type = PyLong_FromLong((uint16_t)*object->out.type);
    3429           0 :         return py_type;
    3430             : }
    3431             : 
    3432           0 : static int py_wbint_LookupSid_out_set_type(PyObject *py_obj, PyObject *value, void *closure)
    3433             : {
    3434           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    3435           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.type));
    3436           0 :         if (value == NULL) {
    3437           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.type");
    3438           0 :                 return -1;
    3439             :         }
    3440           0 :         object->out.type = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.type);
    3441           0 :         if (object->out.type == NULL) {
    3442           0 :                 PyErr_NoMemory();
    3443           0 :                 return -1;
    3444             :         }
    3445             :         {
    3446           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.type));
    3447           0 :                 if (PyLong_Check(value)) {
    3448             :                         unsigned long long test_var;
    3449           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3450           0 :                         if (PyErr_Occurred() != NULL) {
    3451           0 :                                 return -1;
    3452             :                         }
    3453           0 :                         if (test_var > uint_max) {
    3454           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3455             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3456           0 :                                 return -1;
    3457             :                         }
    3458           0 :                         *object->out.type = test_var;
    3459             :                 } else {
    3460           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3461             :                           PyLong_Type.tp_name);
    3462           0 :                         return -1;
    3463             :                 }
    3464             :         }
    3465           0 :         return 0;
    3466             : }
    3467             : 
    3468           0 : static PyObject *py_wbint_LookupSid_out_get_domain(PyObject *obj, void *closure)
    3469             : {
    3470           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj);
    3471             :         PyObject *py_domain;
    3472           0 :         if (object->out.domain == NULL) {
    3473           0 :                 Py_RETURN_NONE;
    3474             :         }
    3475           0 :         if (*object->out.domain == NULL) {
    3476           0 :                 py_domain = Py_None;
    3477           0 :                 Py_INCREF(py_domain);
    3478             :         } else {
    3479           0 :                 if (*object->out.domain == NULL) {
    3480           0 :                         py_domain = Py_None;
    3481           0 :                         Py_INCREF(py_domain);
    3482             :                 } else {
    3483           0 :                         py_domain = PyUnicode_Decode(*object->out.domain, strlen(*object->out.domain), "utf-8", "ignore");
    3484             :                 }
    3485             :         }
    3486           0 :         return py_domain;
    3487             : }
    3488             : 
    3489           0 : static int py_wbint_LookupSid_out_set_domain(PyObject *py_obj, PyObject *value, void *closure)
    3490             : {
    3491           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    3492           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domain));
    3493           0 :         if (value == NULL) {
    3494           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domain");
    3495           0 :                 return -1;
    3496             :         }
    3497           0 :         object->out.domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domain);
    3498           0 :         if (object->out.domain == NULL) {
    3499           0 :                 PyErr_NoMemory();
    3500           0 :                 return -1;
    3501             :         }
    3502           0 :         if (value == Py_None) {
    3503           0 :                 *object->out.domain = NULL;
    3504             :         } else {
    3505           0 :                 *object->out.domain = NULL;
    3506             :                 {
    3507             :                         const char *test_str;
    3508             :                         const char *talloc_str;
    3509           0 :                         PyObject *unicode = NULL;
    3510           0 :                         if (PyUnicode_Check(value)) {
    3511           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    3512           0 :                                 if (unicode == NULL) {
    3513           0 :                                         PyErr_NoMemory();
    3514           0 :                                         return -1;
    3515             :                                 }
    3516           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    3517           0 :                         } else if (PyBytes_Check(value)) {
    3518           0 :                                 test_str = PyBytes_AS_STRING(value);
    3519             :                         } else {
    3520           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    3521           0 :                                 return -1;
    3522             :                         }
    3523           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    3524           0 :                         if (unicode != NULL) {
    3525           0 :                                 Py_DECREF(unicode);
    3526             :                         }
    3527           0 :                         if (talloc_str == NULL) {
    3528           0 :                                 PyErr_NoMemory();
    3529           0 :                                 return -1;
    3530             :                         }
    3531           0 :                         *object->out.domain = talloc_str;
    3532             :                 }
    3533             :         }
    3534           0 :         return 0;
    3535             : }
    3536             : 
    3537           0 : static PyObject *py_wbint_LookupSid_out_get_name(PyObject *obj, void *closure)
    3538             : {
    3539           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj);
    3540             :         PyObject *py_name;
    3541           0 :         if (object->out.name == NULL) {
    3542           0 :                 Py_RETURN_NONE;
    3543             :         }
    3544           0 :         if (*object->out.name == NULL) {
    3545           0 :                 py_name = Py_None;
    3546           0 :                 Py_INCREF(py_name);
    3547             :         } else {
    3548           0 :                 if (*object->out.name == NULL) {
    3549           0 :                         py_name = Py_None;
    3550           0 :                         Py_INCREF(py_name);
    3551             :                 } else {
    3552           0 :                         py_name = PyUnicode_Decode(*object->out.name, strlen(*object->out.name), "utf-8", "ignore");
    3553             :                 }
    3554             :         }
    3555           0 :         return py_name;
    3556             : }
    3557             : 
    3558           0 : static int py_wbint_LookupSid_out_set_name(PyObject *py_obj, PyObject *value, void *closure)
    3559             : {
    3560           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    3561           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.name));
    3562           0 :         if (value == NULL) {
    3563           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.name");
    3564           0 :                 return -1;
    3565             :         }
    3566           0 :         object->out.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.name);
    3567           0 :         if (object->out.name == NULL) {
    3568           0 :                 PyErr_NoMemory();
    3569           0 :                 return -1;
    3570             :         }
    3571           0 :         if (value == Py_None) {
    3572           0 :                 *object->out.name = NULL;
    3573             :         } else {
    3574           0 :                 *object->out.name = NULL;
    3575             :                 {
    3576             :                         const char *test_str;
    3577             :                         const char *talloc_str;
    3578           0 :                         PyObject *unicode = NULL;
    3579           0 :                         if (PyUnicode_Check(value)) {
    3580           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    3581           0 :                                 if (unicode == NULL) {
    3582           0 :                                         PyErr_NoMemory();
    3583           0 :                                         return -1;
    3584             :                                 }
    3585           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    3586           0 :                         } else if (PyBytes_Check(value)) {
    3587           0 :                                 test_str = PyBytes_AS_STRING(value);
    3588             :                         } else {
    3589           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    3590           0 :                                 return -1;
    3591             :                         }
    3592           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    3593           0 :                         if (unicode != NULL) {
    3594           0 :                                 Py_DECREF(unicode);
    3595             :                         }
    3596           0 :                         if (talloc_str == NULL) {
    3597           0 :                                 PyErr_NoMemory();
    3598           0 :                                 return -1;
    3599             :                         }
    3600           0 :                         *object->out.name = talloc_str;
    3601             :                 }
    3602             :         }
    3603           0 :         return 0;
    3604             : }
    3605             : 
    3606           0 : static PyObject *py_wbint_LookupSid_get_result(PyObject *obj, void *closure)
    3607             : {
    3608           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(obj);
    3609             :         PyObject *py_result;
    3610           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    3611           0 :         return py_result;
    3612             : }
    3613             : 
    3614           0 : static int py_wbint_LookupSid_set_result(PyObject *py_obj, PyObject *value, void *closure)
    3615             : {
    3616           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    3617           0 :         if (value == NULL) {
    3618           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    3619           0 :                 return -1;
    3620             :         }
    3621           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    3622           0 :         return 0;
    3623             : }
    3624             : 
    3625             : static PyGetSetDef py_wbint_LookupSid_getsetters[] = {
    3626             :         {
    3627             :                 .name = discard_const_p(char, "in_sid"),
    3628             :                 .get = py_wbint_LookupSid_in_get_sid,
    3629             :                 .set = py_wbint_LookupSid_in_set_sid,
    3630             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    3631             :         },
    3632             :         {
    3633             :                 .name = discard_const_p(char, "out_type"),
    3634             :                 .get = py_wbint_LookupSid_out_get_type,
    3635             :                 .set = py_wbint_LookupSid_out_set_type,
    3636             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
    3637             :         },
    3638             :         {
    3639             :                 .name = discard_const_p(char, "out_domain"),
    3640             :                 .get = py_wbint_LookupSid_out_get_domain,
    3641             :                 .set = py_wbint_LookupSid_out_set_domain,
    3642             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    3643             :         },
    3644             :         {
    3645             :                 .name = discard_const_p(char, "out_name"),
    3646             :                 .get = py_wbint_LookupSid_out_get_name,
    3647             :                 .set = py_wbint_LookupSid_out_set_name,
    3648             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    3649             :         },
    3650             :         {
    3651             :                 .name = discard_const_p(char, "result"),
    3652             :                 .get = py_wbint_LookupSid_get_result,
    3653             :                 .set = py_wbint_LookupSid_set_result,
    3654             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    3655             :         },
    3656             :         { .name = NULL }
    3657             : };
    3658             : 
    3659           0 : static PyObject *py_wbint_LookupSid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3660             : {
    3661           0 :         PyObject *self = pytalloc_new(struct wbint_LookupSid, type);
    3662           0 :         struct wbint_LookupSid *_self = (struct wbint_LookupSid *)pytalloc_get_ptr(self);
    3663           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    3664           0 :         _self->in.sid = talloc_zero(mem_ctx, struct dom_sid);
    3665           0 :         _self->out.type = talloc_zero(mem_ctx, enum lsa_SidType);
    3666           0 :         return self;
    3667             : }
    3668             : 
    3669           0 : static PyObject *py_wbint_LookupSid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    3670             : {
    3671             : 
    3672             : 
    3673           0 :         return PyLong_FromLong(1);
    3674             : }
    3675             : 
    3676           0 : static PyObject *py_wbint_LookupSid_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    3677             : {
    3678           0 :         const struct ndr_interface_call *call = NULL;
    3679           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    3680           0 :         PyObject *ret = NULL;
    3681           0 :         struct ndr_push *push = NULL;
    3682             :         DATA_BLOB blob;
    3683             :         enum ndr_err_code err;
    3684             : 
    3685           0 :         if (ndr_table_winbind.num_calls < 2) {
    3686           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSid_ndr_pack");
    3687           0 :                 return NULL;
    3688             :         }
    3689           0 :         call = &ndr_table_winbind.calls[1];
    3690             : 
    3691           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    3692           0 :         if (push == NULL) {
    3693           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3694           0 :                 return NULL;
    3695             :         }
    3696             : 
    3697           0 :         push->flags |= ndr_push_flags;
    3698             : 
    3699           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    3700           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3701           0 :                 TALLOC_FREE(push);
    3702           0 :                 PyErr_SetNdrError(err);
    3703           0 :                 return NULL;
    3704             :         }
    3705           0 :         blob = ndr_push_blob(push);
    3706           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3707           0 :         TALLOC_FREE(push);
    3708           0 :         return ret;
    3709             : }
    3710             : 
    3711           0 : static PyObject *py_wbint_LookupSid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3712             : {
    3713           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3714           0 :         PyObject *bigendian_obj = NULL;
    3715           0 :         PyObject *ndr64_obj = NULL;
    3716           0 :         uint32_t ndr_push_flags = 0;
    3717             : 
    3718           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    3719             :                 discard_const_p(char *, kwnames),
    3720             :                 &bigendian_obj,
    3721             :                 &ndr64_obj)) {
    3722           0 :                 return NULL;
    3723             :         }
    3724             : 
    3725           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3726           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3727             :         }
    3728           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3729           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3730             :         }
    3731             : 
    3732           0 :         return py_wbint_LookupSid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    3733             : }
    3734             : 
    3735           0 : static PyObject *py_wbint_LookupSid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3736             : {
    3737           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    3738           0 :         PyObject *bigendian_obj = NULL;
    3739           0 :         PyObject *ndr64_obj = NULL;
    3740           0 :         uint32_t ndr_push_flags = 0;
    3741             : 
    3742           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    3743             :                 discard_const_p(char *, kwnames),
    3744             :                 &bigendian_obj,
    3745             :                 &ndr64_obj)) {
    3746           0 :                 return NULL;
    3747             :         }
    3748             : 
    3749           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3750           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    3751             :         }
    3752           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3753           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    3754             :         }
    3755             : 
    3756           0 :         return py_wbint_LookupSid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    3757             : }
    3758             : 
    3759           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)
    3760             : {
    3761           0 :         const struct ndr_interface_call *call = NULL;
    3762           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    3763           0 :         struct ndr_pull *pull = NULL;
    3764             :         enum ndr_err_code err;
    3765             : 
    3766           0 :         if (ndr_table_winbind.num_calls < 2) {
    3767           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSid_ndr_unpack");
    3768           0 :                 return NULL;
    3769             :         }
    3770           0 :         call = &ndr_table_winbind.calls[1];
    3771             : 
    3772           0 :         pull = ndr_pull_init_blob(blob, object);
    3773           0 :         if (pull == NULL) {
    3774           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3775           0 :                 return NULL;
    3776             :         }
    3777             : 
    3778           0 :         pull->flags |= ndr_pull_flags;
    3779             : 
    3780           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    3781           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3782           0 :                 TALLOC_FREE(pull);
    3783           0 :                 PyErr_SetNdrError(err);
    3784           0 :                 return NULL;
    3785             :         }
    3786           0 :         if (!allow_remaining) {
    3787             :                 uint32_t highest_ofs;
    3788             : 
    3789           0 :                 if (pull->offset > pull->relative_highest_offset) {
    3790           0 :                         highest_ofs = pull->offset;
    3791             :                 } else {
    3792           0 :                         highest_ofs = pull->relative_highest_offset;
    3793             :                 }
    3794           0 :                 if (highest_ofs < pull->data_size) {
    3795           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    3796             :                                 "not all bytes consumed ofs[%u] size[%u]",
    3797             :                                 highest_ofs, pull->data_size);
    3798           0 :                         TALLOC_FREE(pull);
    3799           0 :                         PyErr_SetNdrError(err);
    3800           0 :                         return NULL;
    3801             :                 }
    3802             :         }
    3803             : 
    3804           0 :         TALLOC_FREE(pull);
    3805           0 :         Py_RETURN_NONE;
    3806             : }
    3807             : 
    3808           0 : static PyObject *py_wbint_LookupSid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3809             : {
    3810             :         DATA_BLOB blob;
    3811           0 :         Py_ssize_t blob_length = 0;
    3812           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3813           0 :         PyObject *bigendian_obj = NULL;
    3814           0 :         PyObject *ndr64_obj = NULL;
    3815           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3816           0 :         PyObject *allow_remaining_obj = NULL;
    3817           0 :         bool allow_remaining = false;
    3818             : 
    3819           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    3820             :                 discard_const_p(char *, kwnames),
    3821             :                 &blob.data, &blob_length,
    3822             :                 &bigendian_obj,
    3823             :                 &ndr64_obj,
    3824             :                 &allow_remaining_obj)) {
    3825           0 :                 return NULL;
    3826             :         }
    3827           0 :         blob.length = blob_length;
    3828             : 
    3829           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3830           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3831             :         }
    3832           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3833           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3834             :         }
    3835             : 
    3836           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3837           0 :                 allow_remaining = true;
    3838             :         }
    3839             : 
    3840           0 :         return py_wbint_LookupSid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    3841             : }
    3842             : 
    3843           0 : static PyObject *py_wbint_LookupSid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3844             : {
    3845             :         DATA_BLOB blob;
    3846           0 :         Py_ssize_t blob_length = 0;
    3847           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    3848           0 :         PyObject *bigendian_obj = NULL;
    3849           0 :         PyObject *ndr64_obj = NULL;
    3850           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    3851           0 :         PyObject *allow_remaining_obj = NULL;
    3852           0 :         bool allow_remaining = false;
    3853             : 
    3854           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    3855             :                 discard_const_p(char *, kwnames),
    3856             :                 &blob.data, &blob_length,
    3857             :                 &bigendian_obj,
    3858             :                 &ndr64_obj,
    3859             :                 &allow_remaining_obj)) {
    3860           0 :                 return NULL;
    3861             :         }
    3862           0 :         blob.length = blob_length;
    3863             : 
    3864           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    3865           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    3866             :         }
    3867           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    3868           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    3869             :         }
    3870             : 
    3871           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3872           0 :                 allow_remaining = true;
    3873             :         }
    3874             : 
    3875           0 :         return py_wbint_LookupSid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    3876             : }
    3877             : 
    3878           0 : static PyObject *py_wbint_LookupSid_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    3879             : {
    3880           0 :         const struct ndr_interface_call *call = NULL;
    3881           0 :         struct wbint_LookupSid *object = (struct wbint_LookupSid *)pytalloc_get_ptr(py_obj);
    3882             :         PyObject *ret;
    3883             :         char *retstr;
    3884             : 
    3885           0 :         if (ndr_table_winbind.num_calls < 2) {
    3886           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSid_ndr_print");
    3887           0 :                 return NULL;
    3888             :         }
    3889           0 :         call = &ndr_table_winbind.calls[1];
    3890             : 
    3891           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    3892           0 :         ret = PyUnicode_FromString(retstr);
    3893           0 :         TALLOC_FREE(retstr);
    3894             : 
    3895           0 :         return ret;
    3896             : }
    3897             : 
    3898           0 : static PyObject *py_wbint_LookupSid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3899             : {
    3900           0 :         return py_wbint_LookupSid_ndr_print(py_obj, "wbint_LookupSid_in", NDR_IN);
    3901             : }
    3902             : 
    3903           0 : static PyObject *py_wbint_LookupSid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3904             : {
    3905           0 :         return py_wbint_LookupSid_ndr_print(py_obj, "wbint_LookupSid_out", NDR_OUT);
    3906             : }
    3907             : 
    3908             : static PyMethodDef py_wbint_LookupSid_methods[] = {
    3909             :         { "opnum", (PyCFunction)py_wbint_LookupSid_ndr_opnum, METH_NOARGS|METH_CLASS,
    3910             :                 "winbind.wbint_LookupSid.opnum() -> 1 (0x01) " },
    3911             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    3912             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    3913             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    3914             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    3915             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    3916             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    3917             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    3918             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    3919             :         { "__ndr_print_in__", (PyCFunction)py_wbint_LookupSid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    3920             :         { "__ndr_print_out__", (PyCFunction)py_wbint_LookupSid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    3921             :         { NULL, NULL, 0, NULL }
    3922             : };
    3923             : 
    3924             : 
    3925             : static PyTypeObject wbint_LookupSid_Type = {
    3926             :         PyVarObject_HEAD_INIT(NULL, 0)
    3927             :         .tp_name = "winbind.wbint_LookupSid",
    3928             :         .tp_getset = py_wbint_LookupSid_getsetters,
    3929             :         .tp_methods = py_wbint_LookupSid_methods,
    3930             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3931             :         .tp_new = py_wbint_LookupSid_new,
    3932             : };
    3933             : 
    3934           0 : static bool pack_py_wbint_LookupSid_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupSid *r)
    3935             : {
    3936             :         PyObject *py_sid;
    3937           0 :         const char *kwnames[] = {
    3938             :                 "sid", NULL
    3939             :         };
    3940             : 
    3941           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupSid", discard_const_p(char *, kwnames), &py_sid)) {
    3942           0 :                 return false;
    3943             :         }
    3944             : 
    3945           0 :         if (py_sid == NULL) {
    3946           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
    3947           0 :                 return false;
    3948             :         }
    3949           0 :         r->in.sid = talloc_ptrtype(r, r->in.sid);
    3950           0 :         if (r->in.sid == NULL) {
    3951           0 :                 PyErr_NoMemory();
    3952           0 :                 return false;
    3953             :         }
    3954           0 :         PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
    3955           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
    3956           0 :                 PyErr_NoMemory();
    3957           0 :                 return false;
    3958             :         }
    3959           0 :         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
    3960           0 :         return true;
    3961             : }
    3962             : 
    3963           0 : static PyObject *unpack_py_wbint_LookupSid_args_out(struct wbint_LookupSid *r)
    3964             : {
    3965             :         PyObject *result;
    3966             :         PyObject *py_type;
    3967             :         PyObject *py_domain;
    3968             :         PyObject *py_name;
    3969           0 :         result = PyTuple_New(3);
    3970           0 :         py_type = PyLong_FromLong((uint16_t)*r->out.type);
    3971           0 :         PyTuple_SetItem(result, 0, py_type);
    3972           0 :         if (*r->out.domain == NULL) {
    3973           0 :                 py_domain = Py_None;
    3974           0 :                 Py_INCREF(py_domain);
    3975             :         } else {
    3976           0 :                 if (*r->out.domain == NULL) {
    3977           0 :                         py_domain = Py_None;
    3978           0 :                         Py_INCREF(py_domain);
    3979             :                 } else {
    3980           0 :                         py_domain = PyUnicode_Decode(*r->out.domain, strlen(*r->out.domain), "utf-8", "ignore");
    3981             :                 }
    3982             :         }
    3983           0 :         PyTuple_SetItem(result, 1, py_domain);
    3984           0 :         if (*r->out.name == NULL) {
    3985           0 :                 py_name = Py_None;
    3986           0 :                 Py_INCREF(py_name);
    3987             :         } else {
    3988           0 :                 if (*r->out.name == NULL) {
    3989           0 :                         py_name = Py_None;
    3990           0 :                         Py_INCREF(py_name);
    3991             :                 } else {
    3992           0 :                         py_name = PyUnicode_Decode(*r->out.name, strlen(*r->out.name), "utf-8", "ignore");
    3993             :                 }
    3994             :         }
    3995           0 :         PyTuple_SetItem(result, 2, py_name);
    3996           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    3997           0 :                 PyErr_SetNTSTATUS(r->out.result);
    3998           0 :                 return NULL;
    3999             :         }
    4000             : 
    4001           0 :         return result;
    4002             : }
    4003             : 
    4004             : 
    4005           0 : static PyObject *py_wbint_LookupSids_in_get_sids(PyObject *obj, void *closure)
    4006             : {
    4007           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(obj);
    4008             :         PyObject *py_sids;
    4009           0 :         if (object->in.sids == NULL) {
    4010           0 :                 Py_RETURN_NONE;
    4011             :         }
    4012           0 :         py_sids = pytalloc_reference_ex(lsa_SidArray_Type, object->in.sids, object->in.sids);
    4013           0 :         return py_sids;
    4014             : }
    4015             : 
    4016           0 : static int py_wbint_LookupSids_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
    4017             : {
    4018           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    4019           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
    4020           0 :         if (value == NULL) {
    4021           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
    4022           0 :                 return -1;
    4023             :         }
    4024           0 :         object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
    4025           0 :         if (object->in.sids == NULL) {
    4026           0 :                 PyErr_NoMemory();
    4027           0 :                 return -1;
    4028             :         }
    4029           0 :         PY_CHECK_TYPE(lsa_SidArray_Type, value, return -1;);
    4030           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4031           0 :                 PyErr_NoMemory();
    4032           0 :                 return -1;
    4033             :         }
    4034           0 :         object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
    4035           0 :         return 0;
    4036             : }
    4037             : 
    4038           0 : static PyObject *py_wbint_LookupSids_out_get_domains(PyObject *obj, void *closure)
    4039             : {
    4040           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(obj);
    4041             :         PyObject *py_domains;
    4042           0 :         if (object->out.domains == NULL) {
    4043           0 :                 Py_RETURN_NONE;
    4044             :         }
    4045           0 :         py_domains = pytalloc_reference_ex(lsa_RefDomainList_Type, object->out.domains, object->out.domains);
    4046           0 :         return py_domains;
    4047             : }
    4048             : 
    4049           0 : static int py_wbint_LookupSids_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
    4050             : {
    4051           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    4052           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
    4053           0 :         if (value == NULL) {
    4054           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
    4055           0 :                 return -1;
    4056             :         }
    4057           0 :         object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
    4058           0 :         if (object->out.domains == NULL) {
    4059           0 :                 PyErr_NoMemory();
    4060           0 :                 return -1;
    4061             :         }
    4062           0 :         PY_CHECK_TYPE(lsa_RefDomainList_Type, value, return -1;);
    4063           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4064           0 :                 PyErr_NoMemory();
    4065           0 :                 return -1;
    4066             :         }
    4067           0 :         object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
    4068           0 :         return 0;
    4069             : }
    4070             : 
    4071           0 : static PyObject *py_wbint_LookupSids_out_get_names(PyObject *obj, void *closure)
    4072             : {
    4073           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(obj);
    4074             :         PyObject *py_names;
    4075           0 :         if (object->out.names == NULL) {
    4076           0 :                 Py_RETURN_NONE;
    4077             :         }
    4078           0 :         py_names = pytalloc_reference_ex(lsa_TransNameArray_Type, object->out.names, object->out.names);
    4079           0 :         return py_names;
    4080             : }
    4081             : 
    4082           0 : static int py_wbint_LookupSids_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
    4083             : {
    4084           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    4085           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
    4086           0 :         if (value == NULL) {
    4087           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.names");
    4088           0 :                 return -1;
    4089             :         }
    4090           0 :         object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
    4091           0 :         if (object->out.names == NULL) {
    4092           0 :                 PyErr_NoMemory();
    4093           0 :                 return -1;
    4094             :         }
    4095           0 :         PY_CHECK_TYPE(lsa_TransNameArray_Type, value, return -1;);
    4096           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4097           0 :                 PyErr_NoMemory();
    4098           0 :                 return -1;
    4099             :         }
    4100           0 :         object->out.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(value);
    4101           0 :         return 0;
    4102             : }
    4103             : 
    4104           0 : static PyObject *py_wbint_LookupSids_get_result(PyObject *obj, void *closure)
    4105             : {
    4106           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(obj);
    4107             :         PyObject *py_result;
    4108           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    4109           0 :         return py_result;
    4110             : }
    4111             : 
    4112           0 : static int py_wbint_LookupSids_set_result(PyObject *py_obj, PyObject *value, void *closure)
    4113             : {
    4114           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    4115           0 :         if (value == NULL) {
    4116           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    4117           0 :                 return -1;
    4118             :         }
    4119           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    4120           0 :         return 0;
    4121             : }
    4122             : 
    4123             : static PyGetSetDef py_wbint_LookupSids_getsetters[] = {
    4124             :         {
    4125             :                 .name = discard_const_p(char, "in_sids"),
    4126             :                 .get = py_wbint_LookupSids_in_get_sids,
    4127             :                 .set = py_wbint_LookupSids_in_set_sids,
    4128             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
    4129             :         },
    4130             :         {
    4131             :                 .name = discard_const_p(char, "out_domains"),
    4132             :                 .get = py_wbint_LookupSids_out_get_domains,
    4133             :                 .set = py_wbint_LookupSids_out_set_domains,
    4134             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
    4135             :         },
    4136             :         {
    4137             :                 .name = discard_const_p(char, "out_names"),
    4138             :                 .get = py_wbint_LookupSids_out_get_names,
    4139             :                 .set = py_wbint_LookupSids_out_set_names,
    4140             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray")
    4141             :         },
    4142             :         {
    4143             :                 .name = discard_const_p(char, "result"),
    4144             :                 .get = py_wbint_LookupSids_get_result,
    4145             :                 .set = py_wbint_LookupSids_set_result,
    4146             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    4147             :         },
    4148             :         { .name = NULL }
    4149             : };
    4150             : 
    4151           0 : static PyObject *py_wbint_LookupSids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4152             : {
    4153           0 :         PyObject *self = pytalloc_new(struct wbint_LookupSids, type);
    4154           0 :         struct wbint_LookupSids *_self = (struct wbint_LookupSids *)pytalloc_get_ptr(self);
    4155           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    4156           0 :         _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
    4157           0 :         _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList);
    4158           0 :         _self->out.names = talloc_zero(mem_ctx, struct lsa_TransNameArray);
    4159           0 :         return self;
    4160             : }
    4161             : 
    4162           0 : static PyObject *py_wbint_LookupSids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    4163             : {
    4164             : 
    4165             : 
    4166           0 :         return PyLong_FromLong(2);
    4167             : }
    4168             : 
    4169           0 : static PyObject *py_wbint_LookupSids_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    4170             : {
    4171           0 :         const struct ndr_interface_call *call = NULL;
    4172           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    4173           0 :         PyObject *ret = NULL;
    4174           0 :         struct ndr_push *push = NULL;
    4175             :         DATA_BLOB blob;
    4176             :         enum ndr_err_code err;
    4177             : 
    4178           0 :         if (ndr_table_winbind.num_calls < 3) {
    4179           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSids_ndr_pack");
    4180           0 :                 return NULL;
    4181             :         }
    4182           0 :         call = &ndr_table_winbind.calls[2];
    4183             : 
    4184           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    4185           0 :         if (push == NULL) {
    4186           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4187           0 :                 return NULL;
    4188             :         }
    4189             : 
    4190           0 :         push->flags |= ndr_push_flags;
    4191             : 
    4192           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    4193           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4194           0 :                 TALLOC_FREE(push);
    4195           0 :                 PyErr_SetNdrError(err);
    4196           0 :                 return NULL;
    4197             :         }
    4198           0 :         blob = ndr_push_blob(push);
    4199           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    4200           0 :         TALLOC_FREE(push);
    4201           0 :         return ret;
    4202             : }
    4203             : 
    4204           0 : static PyObject *py_wbint_LookupSids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4205             : {
    4206           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    4207           0 :         PyObject *bigendian_obj = NULL;
    4208           0 :         PyObject *ndr64_obj = NULL;
    4209           0 :         uint32_t ndr_push_flags = 0;
    4210             : 
    4211           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    4212             :                 discard_const_p(char *, kwnames),
    4213             :                 &bigendian_obj,
    4214             :                 &ndr64_obj)) {
    4215           0 :                 return NULL;
    4216             :         }
    4217             : 
    4218           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4219           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4220             :         }
    4221           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4222           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4223             :         }
    4224             : 
    4225           0 :         return py_wbint_LookupSids_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    4226             : }
    4227             : 
    4228           0 : static PyObject *py_wbint_LookupSids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4229             : {
    4230           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    4231           0 :         PyObject *bigendian_obj = NULL;
    4232           0 :         PyObject *ndr64_obj = NULL;
    4233           0 :         uint32_t ndr_push_flags = 0;
    4234             : 
    4235           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    4236             :                 discard_const_p(char *, kwnames),
    4237             :                 &bigendian_obj,
    4238             :                 &ndr64_obj)) {
    4239           0 :                 return NULL;
    4240             :         }
    4241             : 
    4242           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4243           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4244             :         }
    4245           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4246           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4247             :         }
    4248             : 
    4249           0 :         return py_wbint_LookupSids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    4250             : }
    4251             : 
    4252           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)
    4253             : {
    4254           0 :         const struct ndr_interface_call *call = NULL;
    4255           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    4256           0 :         struct ndr_pull *pull = NULL;
    4257             :         enum ndr_err_code err;
    4258             : 
    4259           0 :         if (ndr_table_winbind.num_calls < 3) {
    4260           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSids_ndr_unpack");
    4261           0 :                 return NULL;
    4262             :         }
    4263           0 :         call = &ndr_table_winbind.calls[2];
    4264             : 
    4265           0 :         pull = ndr_pull_init_blob(blob, object);
    4266           0 :         if (pull == NULL) {
    4267           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4268           0 :                 return NULL;
    4269             :         }
    4270             : 
    4271           0 :         pull->flags |= ndr_pull_flags;
    4272             : 
    4273           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    4274           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4275           0 :                 TALLOC_FREE(pull);
    4276           0 :                 PyErr_SetNdrError(err);
    4277           0 :                 return NULL;
    4278             :         }
    4279           0 :         if (!allow_remaining) {
    4280             :                 uint32_t highest_ofs;
    4281             : 
    4282           0 :                 if (pull->offset > pull->relative_highest_offset) {
    4283           0 :                         highest_ofs = pull->offset;
    4284             :                 } else {
    4285           0 :                         highest_ofs = pull->relative_highest_offset;
    4286             :                 }
    4287           0 :                 if (highest_ofs < pull->data_size) {
    4288           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    4289             :                                 "not all bytes consumed ofs[%u] size[%u]",
    4290             :                                 highest_ofs, pull->data_size);
    4291           0 :                         TALLOC_FREE(pull);
    4292           0 :                         PyErr_SetNdrError(err);
    4293           0 :                         return NULL;
    4294             :                 }
    4295             :         }
    4296             : 
    4297           0 :         TALLOC_FREE(pull);
    4298           0 :         Py_RETURN_NONE;
    4299             : }
    4300             : 
    4301           0 : static PyObject *py_wbint_LookupSids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4302             : {
    4303             :         DATA_BLOB blob;
    4304           0 :         Py_ssize_t blob_length = 0;
    4305           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4306           0 :         PyObject *bigendian_obj = NULL;
    4307           0 :         PyObject *ndr64_obj = NULL;
    4308           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4309           0 :         PyObject *allow_remaining_obj = NULL;
    4310           0 :         bool allow_remaining = false;
    4311             : 
    4312           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    4313             :                 discard_const_p(char *, kwnames),
    4314             :                 &blob.data, &blob_length,
    4315             :                 &bigendian_obj,
    4316             :                 &ndr64_obj,
    4317             :                 &allow_remaining_obj)) {
    4318           0 :                 return NULL;
    4319             :         }
    4320           0 :         blob.length = blob_length;
    4321             : 
    4322           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4323           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4324             :         }
    4325           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4326           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4327             :         }
    4328             : 
    4329           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4330           0 :                 allow_remaining = true;
    4331             :         }
    4332             : 
    4333           0 :         return py_wbint_LookupSids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    4334             : }
    4335             : 
    4336           0 : static PyObject *py_wbint_LookupSids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4337             : {
    4338             :         DATA_BLOB blob;
    4339           0 :         Py_ssize_t blob_length = 0;
    4340           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4341           0 :         PyObject *bigendian_obj = NULL;
    4342           0 :         PyObject *ndr64_obj = NULL;
    4343           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4344           0 :         PyObject *allow_remaining_obj = NULL;
    4345           0 :         bool allow_remaining = false;
    4346             : 
    4347           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    4348             :                 discard_const_p(char *, kwnames),
    4349             :                 &blob.data, &blob_length,
    4350             :                 &bigendian_obj,
    4351             :                 &ndr64_obj,
    4352             :                 &allow_remaining_obj)) {
    4353           0 :                 return NULL;
    4354             :         }
    4355           0 :         blob.length = blob_length;
    4356             : 
    4357           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4358           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4359             :         }
    4360           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4361           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4362             :         }
    4363             : 
    4364           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4365           0 :                 allow_remaining = true;
    4366             :         }
    4367             : 
    4368           0 :         return py_wbint_LookupSids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    4369             : }
    4370             : 
    4371           0 : static PyObject *py_wbint_LookupSids_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    4372             : {
    4373           0 :         const struct ndr_interface_call *call = NULL;
    4374           0 :         struct wbint_LookupSids *object = (struct wbint_LookupSids *)pytalloc_get_ptr(py_obj);
    4375             :         PyObject *ret;
    4376             :         char *retstr;
    4377             : 
    4378           0 :         if (ndr_table_winbind.num_calls < 3) {
    4379           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSids_ndr_print");
    4380           0 :                 return NULL;
    4381             :         }
    4382           0 :         call = &ndr_table_winbind.calls[2];
    4383             : 
    4384           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    4385           0 :         ret = PyUnicode_FromString(retstr);
    4386           0 :         TALLOC_FREE(retstr);
    4387             : 
    4388           0 :         return ret;
    4389             : }
    4390             : 
    4391           0 : static PyObject *py_wbint_LookupSids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4392             : {
    4393           0 :         return py_wbint_LookupSids_ndr_print(py_obj, "wbint_LookupSids_in", NDR_IN);
    4394             : }
    4395             : 
    4396           0 : static PyObject *py_wbint_LookupSids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4397             : {
    4398           0 :         return py_wbint_LookupSids_ndr_print(py_obj, "wbint_LookupSids_out", NDR_OUT);
    4399             : }
    4400             : 
    4401             : static PyMethodDef py_wbint_LookupSids_methods[] = {
    4402             :         { "opnum", (PyCFunction)py_wbint_LookupSids_ndr_opnum, METH_NOARGS|METH_CLASS,
    4403             :                 "winbind.wbint_LookupSids.opnum() -> 2 (0x02) " },
    4404             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    4405             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    4406             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    4407             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    4408             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    4409             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    4410             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    4411             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    4412             :         { "__ndr_print_in__", (PyCFunction)py_wbint_LookupSids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    4413             :         { "__ndr_print_out__", (PyCFunction)py_wbint_LookupSids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    4414             :         { NULL, NULL, 0, NULL }
    4415             : };
    4416             : 
    4417             : 
    4418             : static PyTypeObject wbint_LookupSids_Type = {
    4419             :         PyVarObject_HEAD_INIT(NULL, 0)
    4420             :         .tp_name = "winbind.wbint_LookupSids",
    4421             :         .tp_getset = py_wbint_LookupSids_getsetters,
    4422             :         .tp_methods = py_wbint_LookupSids_methods,
    4423             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4424             :         .tp_new = py_wbint_LookupSids_new,
    4425             : };
    4426             : 
    4427           0 : static bool pack_py_wbint_LookupSids_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupSids *r)
    4428             : {
    4429             :         PyObject *py_sids;
    4430           0 :         const char *kwnames[] = {
    4431             :                 "sids", NULL
    4432             :         };
    4433             : 
    4434           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupSids", discard_const_p(char *, kwnames), &py_sids)) {
    4435           0 :                 return false;
    4436             :         }
    4437             : 
    4438           0 :         if (py_sids == NULL) {
    4439           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
    4440           0 :                 return false;
    4441             :         }
    4442           0 :         r->in.sids = talloc_ptrtype(r, r->in.sids);
    4443           0 :         if (r->in.sids == NULL) {
    4444           0 :                 PyErr_NoMemory();
    4445           0 :                 return false;
    4446             :         }
    4447           0 :         PY_CHECK_TYPE(lsa_SidArray_Type, py_sids, return false;);
    4448           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
    4449           0 :                 PyErr_NoMemory();
    4450           0 :                 return false;
    4451             :         }
    4452           0 :         r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
    4453           0 :         return true;
    4454             : }
    4455             : 
    4456           0 : static PyObject *unpack_py_wbint_LookupSids_args_out(struct wbint_LookupSids *r)
    4457             : {
    4458             :         PyObject *result;
    4459             :         PyObject *py_domains;
    4460             :         PyObject *py_names;
    4461           0 :         result = PyTuple_New(2);
    4462           0 :         py_domains = pytalloc_reference_ex(lsa_RefDomainList_Type, r->out.domains, r->out.domains);
    4463           0 :         PyTuple_SetItem(result, 0, py_domains);
    4464           0 :         py_names = pytalloc_reference_ex(lsa_TransNameArray_Type, r->out.names, r->out.names);
    4465           0 :         PyTuple_SetItem(result, 1, py_names);
    4466           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    4467           0 :                 PyErr_SetNTSTATUS(r->out.result);
    4468           0 :                 return NULL;
    4469             :         }
    4470             : 
    4471           0 :         return result;
    4472             : }
    4473             : 
    4474             : 
    4475           0 : static PyObject *py_wbint_LookupName_in_get_domain(PyObject *obj, void *closure)
    4476             : {
    4477           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj);
    4478             :         PyObject *py_domain;
    4479           0 :         if (object->in.domain == NULL) {
    4480           0 :                 Py_RETURN_NONE;
    4481             :         }
    4482           0 :         if (object->in.domain == NULL) {
    4483           0 :                 py_domain = Py_None;
    4484           0 :                 Py_INCREF(py_domain);
    4485             :         } else {
    4486           0 :                 py_domain = PyUnicode_Decode(object->in.domain, strlen(object->in.domain), "utf-8", "ignore");
    4487             :         }
    4488           0 :         return py_domain;
    4489             : }
    4490             : 
    4491           0 : static int py_wbint_LookupName_in_set_domain(PyObject *py_obj, PyObject *value, void *closure)
    4492             : {
    4493           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    4494           0 :         if (value == NULL) {
    4495           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain");
    4496           0 :                 return -1;
    4497             :         }
    4498           0 :         object->in.domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain);
    4499           0 :         if (object->in.domain == NULL) {
    4500           0 :                 PyErr_NoMemory();
    4501           0 :                 return -1;
    4502             :         }
    4503             :         {
    4504             :                 const char *test_str;
    4505             :                 const char *talloc_str;
    4506           0 :                 PyObject *unicode = NULL;
    4507           0 :                 if (PyUnicode_Check(value)) {
    4508           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    4509           0 :                         if (unicode == NULL) {
    4510           0 :                                 PyErr_NoMemory();
    4511           0 :                                 return -1;
    4512             :                         }
    4513           0 :                         test_str = PyBytes_AS_STRING(unicode);
    4514           0 :                 } else if (PyBytes_Check(value)) {
    4515           0 :                         test_str = PyBytes_AS_STRING(value);
    4516             :                 } else {
    4517           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    4518           0 :                         return -1;
    4519             :                 }
    4520           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    4521           0 :                 if (unicode != NULL) {
    4522           0 :                         Py_DECREF(unicode);
    4523             :                 }
    4524           0 :                 if (talloc_str == NULL) {
    4525           0 :                         PyErr_NoMemory();
    4526           0 :                         return -1;
    4527             :                 }
    4528           0 :                 object->in.domain = talloc_str;
    4529             :         }
    4530           0 :         return 0;
    4531             : }
    4532             : 
    4533           0 : static PyObject *py_wbint_LookupName_in_get_name(PyObject *obj, void *closure)
    4534             : {
    4535           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj);
    4536             :         PyObject *py_name;
    4537           0 :         if (object->in.name == NULL) {
    4538           0 :                 Py_RETURN_NONE;
    4539             :         }
    4540           0 :         if (object->in.name == NULL) {
    4541           0 :                 py_name = Py_None;
    4542           0 :                 Py_INCREF(py_name);
    4543             :         } else {
    4544           0 :                 py_name = PyUnicode_Decode(object->in.name, strlen(object->in.name), "utf-8", "ignore");
    4545             :         }
    4546           0 :         return py_name;
    4547             : }
    4548             : 
    4549           0 : static int py_wbint_LookupName_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
    4550             : {
    4551           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    4552           0 :         if (value == NULL) {
    4553           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
    4554           0 :                 return -1;
    4555             :         }
    4556           0 :         object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
    4557           0 :         if (object->in.name == NULL) {
    4558           0 :                 PyErr_NoMemory();
    4559           0 :                 return -1;
    4560             :         }
    4561             :         {
    4562             :                 const char *test_str;
    4563             :                 const char *talloc_str;
    4564           0 :                 PyObject *unicode = NULL;
    4565           0 :                 if (PyUnicode_Check(value)) {
    4566           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    4567           0 :                         if (unicode == NULL) {
    4568           0 :                                 PyErr_NoMemory();
    4569           0 :                                 return -1;
    4570             :                         }
    4571           0 :                         test_str = PyBytes_AS_STRING(unicode);
    4572           0 :                 } else if (PyBytes_Check(value)) {
    4573           0 :                         test_str = PyBytes_AS_STRING(value);
    4574             :                 } else {
    4575           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    4576           0 :                         return -1;
    4577             :                 }
    4578           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    4579           0 :                 if (unicode != NULL) {
    4580           0 :                         Py_DECREF(unicode);
    4581             :                 }
    4582           0 :                 if (talloc_str == NULL) {
    4583           0 :                         PyErr_NoMemory();
    4584           0 :                         return -1;
    4585             :                 }
    4586           0 :                 object->in.name = talloc_str;
    4587             :         }
    4588           0 :         return 0;
    4589             : }
    4590             : 
    4591           0 : static PyObject *py_wbint_LookupName_in_get_flags(PyObject *obj, void *closure)
    4592             : {
    4593           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj);
    4594             :         PyObject *py_flags;
    4595           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
    4596           0 :         return py_flags;
    4597             : }
    4598             : 
    4599           0 : static int py_wbint_LookupName_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
    4600             : {
    4601           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    4602           0 :         if (value == NULL) {
    4603           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
    4604           0 :                 return -1;
    4605             :         }
    4606             :         {
    4607           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
    4608           0 :                 if (PyLong_Check(value)) {
    4609             :                         unsigned long long test_var;
    4610           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4611           0 :                         if (PyErr_Occurred() != NULL) {
    4612           0 :                                 return -1;
    4613             :                         }
    4614           0 :                         if (test_var > uint_max) {
    4615           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4616             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4617           0 :                                 return -1;
    4618             :                         }
    4619           0 :                         object->in.flags = test_var;
    4620             :                 } else {
    4621           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4622             :                           PyLong_Type.tp_name);
    4623           0 :                         return -1;
    4624             :                 }
    4625             :         }
    4626           0 :         return 0;
    4627             : }
    4628             : 
    4629           0 : static PyObject *py_wbint_LookupName_out_get_type(PyObject *obj, void *closure)
    4630             : {
    4631           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj);
    4632             :         PyObject *py_type;
    4633           0 :         if (object->out.type == NULL) {
    4634           0 :                 Py_RETURN_NONE;
    4635             :         }
    4636           0 :         py_type = PyLong_FromLong((uint16_t)*object->out.type);
    4637           0 :         return py_type;
    4638             : }
    4639             : 
    4640           0 : static int py_wbint_LookupName_out_set_type(PyObject *py_obj, PyObject *value, void *closure)
    4641             : {
    4642           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    4643           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.type));
    4644           0 :         if (value == NULL) {
    4645           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.type");
    4646           0 :                 return -1;
    4647             :         }
    4648           0 :         object->out.type = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.type);
    4649           0 :         if (object->out.type == NULL) {
    4650           0 :                 PyErr_NoMemory();
    4651           0 :                 return -1;
    4652             :         }
    4653             :         {
    4654           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.type));
    4655           0 :                 if (PyLong_Check(value)) {
    4656             :                         unsigned long long test_var;
    4657           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4658           0 :                         if (PyErr_Occurred() != NULL) {
    4659           0 :                                 return -1;
    4660             :                         }
    4661           0 :                         if (test_var > uint_max) {
    4662           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4663             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4664           0 :                                 return -1;
    4665             :                         }
    4666           0 :                         *object->out.type = test_var;
    4667             :                 } else {
    4668           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4669             :                           PyLong_Type.tp_name);
    4670           0 :                         return -1;
    4671             :                 }
    4672             :         }
    4673           0 :         return 0;
    4674             : }
    4675             : 
    4676           0 : static PyObject *py_wbint_LookupName_out_get_sid(PyObject *obj, void *closure)
    4677             : {
    4678           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj);
    4679             :         PyObject *py_sid;
    4680           0 :         if (object->out.sid == NULL) {
    4681           0 :                 Py_RETURN_NONE;
    4682             :         }
    4683           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, object->out.sid, object->out.sid);
    4684           0 :         return py_sid;
    4685             : }
    4686             : 
    4687           0 : static int py_wbint_LookupName_out_set_sid(PyObject *py_obj, PyObject *value, void *closure)
    4688             : {
    4689           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    4690           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sid));
    4691           0 :         if (value == NULL) {
    4692           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sid");
    4693           0 :                 return -1;
    4694             :         }
    4695           0 :         object->out.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sid);
    4696           0 :         if (object->out.sid == NULL) {
    4697           0 :                 PyErr_NoMemory();
    4698           0 :                 return -1;
    4699             :         }
    4700           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    4701           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4702           0 :                 PyErr_NoMemory();
    4703           0 :                 return -1;
    4704             :         }
    4705           0 :         object->out.sid = (struct dom_sid *)pytalloc_get_ptr(value);
    4706           0 :         return 0;
    4707             : }
    4708             : 
    4709           0 : static PyObject *py_wbint_LookupName_get_result(PyObject *obj, void *closure)
    4710             : {
    4711           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(obj);
    4712             :         PyObject *py_result;
    4713           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    4714           0 :         return py_result;
    4715             : }
    4716             : 
    4717           0 : static int py_wbint_LookupName_set_result(PyObject *py_obj, PyObject *value, void *closure)
    4718             : {
    4719           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    4720           0 :         if (value == NULL) {
    4721           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    4722           0 :                 return -1;
    4723             :         }
    4724           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    4725           0 :         return 0;
    4726             : }
    4727             : 
    4728             : static PyGetSetDef py_wbint_LookupName_getsetters[] = {
    4729             :         {
    4730             :                 .name = discard_const_p(char, "in_domain"),
    4731             :                 .get = py_wbint_LookupName_in_get_domain,
    4732             :                 .set = py_wbint_LookupName_in_set_domain,
    4733             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    4734             :         },
    4735             :         {
    4736             :                 .name = discard_const_p(char, "in_name"),
    4737             :                 .get = py_wbint_LookupName_in_get_name,
    4738             :                 .set = py_wbint_LookupName_in_set_name,
    4739             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    4740             :         },
    4741             :         {
    4742             :                 .name = discard_const_p(char, "in_flags"),
    4743             :                 .get = py_wbint_LookupName_in_get_flags,
    4744             :                 .set = py_wbint_LookupName_in_set_flags,
    4745             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4746             :         },
    4747             :         {
    4748             :                 .name = discard_const_p(char, "out_type"),
    4749             :                 .get = py_wbint_LookupName_out_get_type,
    4750             :                 .set = py_wbint_LookupName_out_set_type,
    4751             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
    4752             :         },
    4753             :         {
    4754             :                 .name = discard_const_p(char, "out_sid"),
    4755             :                 .get = py_wbint_LookupName_out_get_sid,
    4756             :                 .set = py_wbint_LookupName_out_set_sid,
    4757             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    4758             :         },
    4759             :         {
    4760             :                 .name = discard_const_p(char, "result"),
    4761             :                 .get = py_wbint_LookupName_get_result,
    4762             :                 .set = py_wbint_LookupName_set_result,
    4763             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    4764             :         },
    4765             :         { .name = NULL }
    4766             : };
    4767             : 
    4768           0 : static PyObject *py_wbint_LookupName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4769             : {
    4770           0 :         PyObject *self = pytalloc_new(struct wbint_LookupName, type);
    4771           0 :         struct wbint_LookupName *_self = (struct wbint_LookupName *)pytalloc_get_ptr(self);
    4772           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    4773           0 :         _self->out.type = talloc_zero(mem_ctx, enum lsa_SidType);
    4774           0 :         _self->out.sid = talloc_zero(mem_ctx, struct dom_sid);
    4775           0 :         return self;
    4776             : }
    4777             : 
    4778           0 : static PyObject *py_wbint_LookupName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    4779             : {
    4780             : 
    4781             : 
    4782           0 :         return PyLong_FromLong(3);
    4783             : }
    4784             : 
    4785           0 : static PyObject *py_wbint_LookupName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    4786             : {
    4787           0 :         const struct ndr_interface_call *call = NULL;
    4788           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    4789           0 :         PyObject *ret = NULL;
    4790           0 :         struct ndr_push *push = NULL;
    4791             :         DATA_BLOB blob;
    4792             :         enum ndr_err_code err;
    4793             : 
    4794           0 :         if (ndr_table_winbind.num_calls < 4) {
    4795           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupName_ndr_pack");
    4796           0 :                 return NULL;
    4797             :         }
    4798           0 :         call = &ndr_table_winbind.calls[3];
    4799             : 
    4800           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    4801           0 :         if (push == NULL) {
    4802           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4803           0 :                 return NULL;
    4804             :         }
    4805             : 
    4806           0 :         push->flags |= ndr_push_flags;
    4807             : 
    4808           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    4809           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4810           0 :                 TALLOC_FREE(push);
    4811           0 :                 PyErr_SetNdrError(err);
    4812           0 :                 return NULL;
    4813             :         }
    4814           0 :         blob = ndr_push_blob(push);
    4815           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    4816           0 :         TALLOC_FREE(push);
    4817           0 :         return ret;
    4818             : }
    4819             : 
    4820           0 : static PyObject *py_wbint_LookupName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4821             : {
    4822           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    4823           0 :         PyObject *bigendian_obj = NULL;
    4824           0 :         PyObject *ndr64_obj = NULL;
    4825           0 :         uint32_t ndr_push_flags = 0;
    4826             : 
    4827           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    4828             :                 discard_const_p(char *, kwnames),
    4829             :                 &bigendian_obj,
    4830             :                 &ndr64_obj)) {
    4831           0 :                 return NULL;
    4832             :         }
    4833             : 
    4834           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4835           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4836             :         }
    4837           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4838           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4839             :         }
    4840             : 
    4841           0 :         return py_wbint_LookupName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    4842             : }
    4843             : 
    4844           0 : static PyObject *py_wbint_LookupName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4845             : {
    4846           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    4847           0 :         PyObject *bigendian_obj = NULL;
    4848           0 :         PyObject *ndr64_obj = NULL;
    4849           0 :         uint32_t ndr_push_flags = 0;
    4850             : 
    4851           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    4852             :                 discard_const_p(char *, kwnames),
    4853             :                 &bigendian_obj,
    4854             :                 &ndr64_obj)) {
    4855           0 :                 return NULL;
    4856             :         }
    4857             : 
    4858           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4859           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    4860             :         }
    4861           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4862           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    4863             :         }
    4864             : 
    4865           0 :         return py_wbint_LookupName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    4866             : }
    4867             : 
    4868           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)
    4869             : {
    4870           0 :         const struct ndr_interface_call *call = NULL;
    4871           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    4872           0 :         struct ndr_pull *pull = NULL;
    4873             :         enum ndr_err_code err;
    4874             : 
    4875           0 :         if (ndr_table_winbind.num_calls < 4) {
    4876           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupName_ndr_unpack");
    4877           0 :                 return NULL;
    4878             :         }
    4879           0 :         call = &ndr_table_winbind.calls[3];
    4880             : 
    4881           0 :         pull = ndr_pull_init_blob(blob, object);
    4882           0 :         if (pull == NULL) {
    4883           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4884           0 :                 return NULL;
    4885             :         }
    4886             : 
    4887           0 :         pull->flags |= ndr_pull_flags;
    4888             : 
    4889           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    4890           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4891           0 :                 TALLOC_FREE(pull);
    4892           0 :                 PyErr_SetNdrError(err);
    4893           0 :                 return NULL;
    4894             :         }
    4895           0 :         if (!allow_remaining) {
    4896             :                 uint32_t highest_ofs;
    4897             : 
    4898           0 :                 if (pull->offset > pull->relative_highest_offset) {
    4899           0 :                         highest_ofs = pull->offset;
    4900             :                 } else {
    4901           0 :                         highest_ofs = pull->relative_highest_offset;
    4902             :                 }
    4903           0 :                 if (highest_ofs < pull->data_size) {
    4904           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    4905             :                                 "not all bytes consumed ofs[%u] size[%u]",
    4906             :                                 highest_ofs, pull->data_size);
    4907           0 :                         TALLOC_FREE(pull);
    4908           0 :                         PyErr_SetNdrError(err);
    4909           0 :                         return NULL;
    4910             :                 }
    4911             :         }
    4912             : 
    4913           0 :         TALLOC_FREE(pull);
    4914           0 :         Py_RETURN_NONE;
    4915             : }
    4916             : 
    4917           0 : static PyObject *py_wbint_LookupName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4918             : {
    4919             :         DATA_BLOB blob;
    4920           0 :         Py_ssize_t blob_length = 0;
    4921           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4922           0 :         PyObject *bigendian_obj = NULL;
    4923           0 :         PyObject *ndr64_obj = NULL;
    4924           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4925           0 :         PyObject *allow_remaining_obj = NULL;
    4926           0 :         bool allow_remaining = false;
    4927             : 
    4928           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    4929             :                 discard_const_p(char *, kwnames),
    4930             :                 &blob.data, &blob_length,
    4931             :                 &bigendian_obj,
    4932             :                 &ndr64_obj,
    4933             :                 &allow_remaining_obj)) {
    4934           0 :                 return NULL;
    4935             :         }
    4936           0 :         blob.length = blob_length;
    4937             : 
    4938           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4939           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4940             :         }
    4941           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4942           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4943             :         }
    4944             : 
    4945           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4946           0 :                 allow_remaining = true;
    4947             :         }
    4948             : 
    4949           0 :         return py_wbint_LookupName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    4950             : }
    4951             : 
    4952           0 : static PyObject *py_wbint_LookupName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4953             : {
    4954             :         DATA_BLOB blob;
    4955           0 :         Py_ssize_t blob_length = 0;
    4956           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    4957           0 :         PyObject *bigendian_obj = NULL;
    4958           0 :         PyObject *ndr64_obj = NULL;
    4959           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    4960           0 :         PyObject *allow_remaining_obj = NULL;
    4961           0 :         bool allow_remaining = false;
    4962             : 
    4963           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    4964             :                 discard_const_p(char *, kwnames),
    4965             :                 &blob.data, &blob_length,
    4966             :                 &bigendian_obj,
    4967             :                 &ndr64_obj,
    4968             :                 &allow_remaining_obj)) {
    4969           0 :                 return NULL;
    4970             :         }
    4971           0 :         blob.length = blob_length;
    4972             : 
    4973           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    4974           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    4975             :         }
    4976           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    4977           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    4978             :         }
    4979             : 
    4980           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4981           0 :                 allow_remaining = true;
    4982             :         }
    4983             : 
    4984           0 :         return py_wbint_LookupName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    4985             : }
    4986             : 
    4987           0 : static PyObject *py_wbint_LookupName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    4988             : {
    4989           0 :         const struct ndr_interface_call *call = NULL;
    4990           0 :         struct wbint_LookupName *object = (struct wbint_LookupName *)pytalloc_get_ptr(py_obj);
    4991             :         PyObject *ret;
    4992             :         char *retstr;
    4993             : 
    4994           0 :         if (ndr_table_winbind.num_calls < 4) {
    4995           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupName_ndr_print");
    4996           0 :                 return NULL;
    4997             :         }
    4998           0 :         call = &ndr_table_winbind.calls[3];
    4999             : 
    5000           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    5001           0 :         ret = PyUnicode_FromString(retstr);
    5002           0 :         TALLOC_FREE(retstr);
    5003             : 
    5004           0 :         return ret;
    5005             : }
    5006             : 
    5007           0 : static PyObject *py_wbint_LookupName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5008             : {
    5009           0 :         return py_wbint_LookupName_ndr_print(py_obj, "wbint_LookupName_in", NDR_IN);
    5010             : }
    5011             : 
    5012           0 : static PyObject *py_wbint_LookupName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5013             : {
    5014           0 :         return py_wbint_LookupName_ndr_print(py_obj, "wbint_LookupName_out", NDR_OUT);
    5015             : }
    5016             : 
    5017             : static PyMethodDef py_wbint_LookupName_methods[] = {
    5018             :         { "opnum", (PyCFunction)py_wbint_LookupName_ndr_opnum, METH_NOARGS|METH_CLASS,
    5019             :                 "winbind.wbint_LookupName.opnum() -> 3 (0x03) " },
    5020             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    5021             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    5022             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    5023             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    5024             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    5025             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    5026             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    5027             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    5028             :         { "__ndr_print_in__", (PyCFunction)py_wbint_LookupName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    5029             :         { "__ndr_print_out__", (PyCFunction)py_wbint_LookupName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    5030             :         { NULL, NULL, 0, NULL }
    5031             : };
    5032             : 
    5033             : 
    5034             : static PyTypeObject wbint_LookupName_Type = {
    5035             :         PyVarObject_HEAD_INIT(NULL, 0)
    5036             :         .tp_name = "winbind.wbint_LookupName",
    5037             :         .tp_getset = py_wbint_LookupName_getsetters,
    5038             :         .tp_methods = py_wbint_LookupName_methods,
    5039             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5040             :         .tp_new = py_wbint_LookupName_new,
    5041             : };
    5042             : 
    5043           0 : static bool pack_py_wbint_LookupName_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupName *r)
    5044             : {
    5045             :         PyObject *py_domain;
    5046             :         PyObject *py_name;
    5047             :         PyObject *py_flags;
    5048           0 :         const char *kwnames[] = {
    5049             :                 "domain", "name", "flags", NULL
    5050             :         };
    5051             : 
    5052           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:wbint_LookupName", discard_const_p(char *, kwnames), &py_domain, &py_name, &py_flags)) {
    5053           0 :                 return false;
    5054             :         }
    5055             : 
    5056           0 :         if (py_domain == NULL) {
    5057           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain");
    5058           0 :                 return false;
    5059             :         }
    5060           0 :         r->in.domain = talloc_ptrtype(r, r->in.domain);
    5061           0 :         if (r->in.domain == NULL) {
    5062           0 :                 PyErr_NoMemory();
    5063           0 :                 return false;
    5064             :         }
    5065             :         {
    5066             :                 const char *test_str;
    5067             :                 const char *talloc_str;
    5068           0 :                 PyObject *unicode = NULL;
    5069           0 :                 if (PyUnicode_Check(py_domain)) {
    5070           0 :                         unicode = PyUnicode_AsEncodedString(py_domain, "utf-8", "ignore");
    5071           0 :                         if (unicode == NULL) {
    5072           0 :                                 PyErr_NoMemory();
    5073           0 :                                 return false;
    5074             :                         }
    5075           0 :                         test_str = PyBytes_AS_STRING(unicode);
    5076           0 :                 } else if (PyBytes_Check(py_domain)) {
    5077           0 :                         test_str = PyBytes_AS_STRING(py_domain);
    5078             :                 } else {
    5079           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain)->tp_name);
    5080           0 :                         return false;
    5081             :                 }
    5082           0 :                 talloc_str = talloc_strdup(r, test_str);
    5083           0 :                 if (unicode != NULL) {
    5084           0 :                         Py_DECREF(unicode);
    5085             :                 }
    5086           0 :                 if (talloc_str == NULL) {
    5087           0 :                         PyErr_NoMemory();
    5088           0 :                         return false;
    5089             :                 }
    5090           0 :                 r->in.domain = talloc_str;
    5091             :         }
    5092           0 :         if (py_name == NULL) {
    5093           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
    5094           0 :                 return false;
    5095             :         }
    5096           0 :         r->in.name = talloc_ptrtype(r, r->in.name);
    5097           0 :         if (r->in.name == NULL) {
    5098           0 :                 PyErr_NoMemory();
    5099           0 :                 return false;
    5100             :         }
    5101             :         {
    5102             :                 const char *test_str;
    5103             :                 const char *talloc_str;
    5104           0 :                 PyObject *unicode = NULL;
    5105           0 :                 if (PyUnicode_Check(py_name)) {
    5106           0 :                         unicode = PyUnicode_AsEncodedString(py_name, "utf-8", "ignore");
    5107           0 :                         if (unicode == NULL) {
    5108           0 :                                 PyErr_NoMemory();
    5109           0 :                                 return false;
    5110             :                         }
    5111           0 :                         test_str = PyBytes_AS_STRING(unicode);
    5112           0 :                 } else if (PyBytes_Check(py_name)) {
    5113           0 :                         test_str = PyBytes_AS_STRING(py_name);
    5114             :                 } else {
    5115           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_name)->tp_name);
    5116           0 :                         return false;
    5117             :                 }
    5118           0 :                 talloc_str = talloc_strdup(r, test_str);
    5119           0 :                 if (unicode != NULL) {
    5120           0 :                         Py_DECREF(unicode);
    5121             :                 }
    5122           0 :                 if (talloc_str == NULL) {
    5123           0 :                         PyErr_NoMemory();
    5124           0 :                         return false;
    5125             :                 }
    5126           0 :                 r->in.name = talloc_str;
    5127             :         }
    5128           0 :         if (py_flags == NULL) {
    5129           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
    5130           0 :                 return false;
    5131             :         }
    5132             :         {
    5133           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
    5134           0 :                 if (PyLong_Check(py_flags)) {
    5135             :                         unsigned long long test_var;
    5136           0 :                         test_var = PyLong_AsUnsignedLongLong(py_flags);
    5137           0 :                         if (PyErr_Occurred() != NULL) {
    5138           0 :                                 return false;
    5139             :                         }
    5140           0 :                         if (test_var > uint_max) {
    5141           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    5142             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5143           0 :                                 return false;
    5144             :                         }
    5145           0 :                         r->in.flags = test_var;
    5146             :                 } else {
    5147           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    5148             :                           PyLong_Type.tp_name);
    5149           0 :                         return false;
    5150             :                 }
    5151             :         }
    5152           0 :         return true;
    5153             : }
    5154             : 
    5155           0 : static PyObject *unpack_py_wbint_LookupName_args_out(struct wbint_LookupName *r)
    5156             : {
    5157             :         PyObject *result;
    5158             :         PyObject *py_type;
    5159             :         PyObject *py_sid;
    5160           0 :         result = PyTuple_New(2);
    5161           0 :         py_type = PyLong_FromLong((uint16_t)*r->out.type);
    5162           0 :         PyTuple_SetItem(result, 0, py_type);
    5163           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, r->out.sid, r->out.sid);
    5164           0 :         PyTuple_SetItem(result, 1, py_sid);
    5165           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    5166           0 :                 PyErr_SetNTSTATUS(r->out.result);
    5167           0 :                 return NULL;
    5168             :         }
    5169             : 
    5170           0 :         return result;
    5171             : }
    5172             : 
    5173             : 
    5174           0 : static PyObject *py_wbint_Sids2UnixIDs_in_get_domains(PyObject *obj, void *closure)
    5175             : {
    5176           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(obj);
    5177             :         PyObject *py_domains;
    5178           0 :         if (object->in.domains == NULL) {
    5179           0 :                 Py_RETURN_NONE;
    5180             :         }
    5181           0 :         py_domains = pytalloc_reference_ex(lsa_RefDomainList_Type, object->in.domains, object->in.domains);
    5182           0 :         return py_domains;
    5183             : }
    5184             : 
    5185           0 : static int py_wbint_Sids2UnixIDs_in_set_domains(PyObject *py_obj, PyObject *value, void *closure)
    5186             : {
    5187           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    5188           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domains));
    5189           0 :         if (value == NULL) {
    5190           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domains");
    5191           0 :                 return -1;
    5192             :         }
    5193           0 :         object->in.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domains);
    5194           0 :         if (object->in.domains == NULL) {
    5195           0 :                 PyErr_NoMemory();
    5196           0 :                 return -1;
    5197             :         }
    5198           0 :         PY_CHECK_TYPE(lsa_RefDomainList_Type, value, return -1;);
    5199           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    5200           0 :                 PyErr_NoMemory();
    5201           0 :                 return -1;
    5202             :         }
    5203           0 :         object->in.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
    5204           0 :         return 0;
    5205             : }
    5206             : 
    5207           0 : static PyObject *py_wbint_Sids2UnixIDs_in_get_ids(PyObject *obj, void *closure)
    5208             : {
    5209           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(obj);
    5210             :         PyObject *py_ids;
    5211           0 :         if (object->in.ids == NULL) {
    5212           0 :                 Py_RETURN_NONE;
    5213             :         }
    5214           0 :         py_ids = pytalloc_reference_ex(&wbint_TransIDArray_Type, object->in.ids, object->in.ids);
    5215           0 :         return py_ids;
    5216             : }
    5217             : 
    5218           0 : static int py_wbint_Sids2UnixIDs_in_set_ids(PyObject *py_obj, PyObject *value, void *closure)
    5219             : {
    5220           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    5221           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.ids));
    5222           0 :         if (value == NULL) {
    5223           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.ids");
    5224           0 :                 return -1;
    5225             :         }
    5226           0 :         object->in.ids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.ids);
    5227           0 :         if (object->in.ids == NULL) {
    5228           0 :                 PyErr_NoMemory();
    5229           0 :                 return -1;
    5230             :         }
    5231           0 :         PY_CHECK_TYPE(&wbint_TransIDArray_Type, value, return -1;);
    5232           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    5233           0 :                 PyErr_NoMemory();
    5234           0 :                 return -1;
    5235             :         }
    5236           0 :         object->in.ids = (struct wbint_TransIDArray *)pytalloc_get_ptr(value);
    5237           0 :         return 0;
    5238             : }
    5239             : 
    5240           0 : static PyObject *py_wbint_Sids2UnixIDs_out_get_ids(PyObject *obj, void *closure)
    5241             : {
    5242           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(obj);
    5243             :         PyObject *py_ids;
    5244           0 :         if (object->out.ids == NULL) {
    5245           0 :                 Py_RETURN_NONE;
    5246             :         }
    5247           0 :         py_ids = pytalloc_reference_ex(&wbint_TransIDArray_Type, object->out.ids, object->out.ids);
    5248           0 :         return py_ids;
    5249             : }
    5250             : 
    5251           0 : static int py_wbint_Sids2UnixIDs_out_set_ids(PyObject *py_obj, PyObject *value, void *closure)
    5252             : {
    5253           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    5254           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ids));
    5255           0 :         if (value == NULL) {
    5256           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ids");
    5257           0 :                 return -1;
    5258             :         }
    5259           0 :         object->out.ids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ids);
    5260           0 :         if (object->out.ids == NULL) {
    5261           0 :                 PyErr_NoMemory();
    5262           0 :                 return -1;
    5263             :         }
    5264           0 :         PY_CHECK_TYPE(&wbint_TransIDArray_Type, value, return -1;);
    5265           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    5266           0 :                 PyErr_NoMemory();
    5267           0 :                 return -1;
    5268             :         }
    5269           0 :         object->out.ids = (struct wbint_TransIDArray *)pytalloc_get_ptr(value);
    5270           0 :         return 0;
    5271             : }
    5272             : 
    5273           0 : static PyObject *py_wbint_Sids2UnixIDs_get_result(PyObject *obj, void *closure)
    5274             : {
    5275           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(obj);
    5276             :         PyObject *py_result;
    5277           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    5278           0 :         return py_result;
    5279             : }
    5280             : 
    5281           0 : static int py_wbint_Sids2UnixIDs_set_result(PyObject *py_obj, PyObject *value, void *closure)
    5282             : {
    5283           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    5284           0 :         if (value == NULL) {
    5285           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    5286           0 :                 return -1;
    5287             :         }
    5288           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    5289           0 :         return 0;
    5290             : }
    5291             : 
    5292             : static PyGetSetDef py_wbint_Sids2UnixIDs_getsetters[] = {
    5293             :         {
    5294             :                 .name = discard_const_p(char, "in_domains"),
    5295             :                 .get = py_wbint_Sids2UnixIDs_in_get_domains,
    5296             :                 .set = py_wbint_Sids2UnixIDs_in_set_domains,
    5297             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
    5298             :         },
    5299             :         {
    5300             :                 .name = discard_const_p(char, "in_ids"),
    5301             :                 .get = py_wbint_Sids2UnixIDs_in_get_ids,
    5302             :                 .set = py_wbint_Sids2UnixIDs_in_set_ids,
    5303             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_TransIDArray")
    5304             :         },
    5305             :         {
    5306             :                 .name = discard_const_p(char, "out_ids"),
    5307             :                 .get = py_wbint_Sids2UnixIDs_out_get_ids,
    5308             :                 .set = py_wbint_Sids2UnixIDs_out_set_ids,
    5309             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_TransIDArray")
    5310             :         },
    5311             :         {
    5312             :                 .name = discard_const_p(char, "result"),
    5313             :                 .get = py_wbint_Sids2UnixIDs_get_result,
    5314             :                 .set = py_wbint_Sids2UnixIDs_set_result,
    5315             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    5316             :         },
    5317             :         { .name = NULL }
    5318             : };
    5319             : 
    5320           0 : static PyObject *py_wbint_Sids2UnixIDs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5321             : {
    5322           0 :         PyObject *self = pytalloc_new(struct wbint_Sids2UnixIDs, type);
    5323           0 :         struct wbint_Sids2UnixIDs *_self = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(self);
    5324           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    5325           0 :         _self->in.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList);
    5326           0 :         _self->in.ids = talloc_zero(mem_ctx, struct wbint_TransIDArray);
    5327           0 :         _self->out.ids = talloc_zero(mem_ctx, struct wbint_TransIDArray);
    5328           0 :         return self;
    5329             : }
    5330             : 
    5331           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    5332             : {
    5333             : 
    5334             : 
    5335           0 :         return PyLong_FromLong(4);
    5336             : }
    5337             : 
    5338           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    5339             : {
    5340           0 :         const struct ndr_interface_call *call = NULL;
    5341           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    5342           0 :         PyObject *ret = NULL;
    5343           0 :         struct ndr_push *push = NULL;
    5344             :         DATA_BLOB blob;
    5345             :         enum ndr_err_code err;
    5346             : 
    5347           0 :         if (ndr_table_winbind.num_calls < 5) {
    5348           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Sids2UnixIDs_ndr_pack");
    5349           0 :                 return NULL;
    5350             :         }
    5351           0 :         call = &ndr_table_winbind.calls[4];
    5352             : 
    5353           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    5354           0 :         if (push == NULL) {
    5355           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5356           0 :                 return NULL;
    5357             :         }
    5358             : 
    5359           0 :         push->flags |= ndr_push_flags;
    5360             : 
    5361           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    5362           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5363           0 :                 TALLOC_FREE(push);
    5364           0 :                 PyErr_SetNdrError(err);
    5365           0 :                 return NULL;
    5366             :         }
    5367           0 :         blob = ndr_push_blob(push);
    5368           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    5369           0 :         TALLOC_FREE(push);
    5370           0 :         return ret;
    5371             : }
    5372             : 
    5373           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5374             : {
    5375           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5376           0 :         PyObject *bigendian_obj = NULL;
    5377           0 :         PyObject *ndr64_obj = NULL;
    5378           0 :         uint32_t ndr_push_flags = 0;
    5379             : 
    5380           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    5381             :                 discard_const_p(char *, kwnames),
    5382             :                 &bigendian_obj,
    5383             :                 &ndr64_obj)) {
    5384           0 :                 return NULL;
    5385             :         }
    5386             : 
    5387           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5388           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5389             :         }
    5390           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5391           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5392             :         }
    5393             : 
    5394           0 :         return py_wbint_Sids2UnixIDs_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    5395             : }
    5396             : 
    5397           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5398             : {
    5399           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    5400           0 :         PyObject *bigendian_obj = NULL;
    5401           0 :         PyObject *ndr64_obj = NULL;
    5402           0 :         uint32_t ndr_push_flags = 0;
    5403             : 
    5404           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    5405             :                 discard_const_p(char *, kwnames),
    5406             :                 &bigendian_obj,
    5407             :                 &ndr64_obj)) {
    5408           0 :                 return NULL;
    5409             :         }
    5410             : 
    5411           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5412           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    5413             :         }
    5414           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5415           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    5416             :         }
    5417             : 
    5418           0 :         return py_wbint_Sids2UnixIDs_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    5419             : }
    5420             : 
    5421           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)
    5422             : {
    5423           0 :         const struct ndr_interface_call *call = NULL;
    5424           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    5425           0 :         struct ndr_pull *pull = NULL;
    5426             :         enum ndr_err_code err;
    5427             : 
    5428           0 :         if (ndr_table_winbind.num_calls < 5) {
    5429           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Sids2UnixIDs_ndr_unpack");
    5430           0 :                 return NULL;
    5431             :         }
    5432           0 :         call = &ndr_table_winbind.calls[4];
    5433             : 
    5434           0 :         pull = ndr_pull_init_blob(blob, object);
    5435           0 :         if (pull == NULL) {
    5436           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5437           0 :                 return NULL;
    5438             :         }
    5439             : 
    5440           0 :         pull->flags |= ndr_pull_flags;
    5441             : 
    5442           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    5443           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5444           0 :                 TALLOC_FREE(pull);
    5445           0 :                 PyErr_SetNdrError(err);
    5446           0 :                 return NULL;
    5447             :         }
    5448           0 :         if (!allow_remaining) {
    5449             :                 uint32_t highest_ofs;
    5450             : 
    5451           0 :                 if (pull->offset > pull->relative_highest_offset) {
    5452           0 :                         highest_ofs = pull->offset;
    5453             :                 } else {
    5454           0 :                         highest_ofs = pull->relative_highest_offset;
    5455             :                 }
    5456           0 :                 if (highest_ofs < pull->data_size) {
    5457           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    5458             :                                 "not all bytes consumed ofs[%u] size[%u]",
    5459             :                                 highest_ofs, pull->data_size);
    5460           0 :                         TALLOC_FREE(pull);
    5461           0 :                         PyErr_SetNdrError(err);
    5462           0 :                         return NULL;
    5463             :                 }
    5464             :         }
    5465             : 
    5466           0 :         TALLOC_FREE(pull);
    5467           0 :         Py_RETURN_NONE;
    5468             : }
    5469             : 
    5470           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5471             : {
    5472             :         DATA_BLOB blob;
    5473           0 :         Py_ssize_t blob_length = 0;
    5474           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    5475           0 :         PyObject *bigendian_obj = NULL;
    5476           0 :         PyObject *ndr64_obj = NULL;
    5477           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    5478           0 :         PyObject *allow_remaining_obj = NULL;
    5479           0 :         bool allow_remaining = false;
    5480             : 
    5481           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    5482             :                 discard_const_p(char *, kwnames),
    5483             :                 &blob.data, &blob_length,
    5484             :                 &bigendian_obj,
    5485             :                 &ndr64_obj,
    5486             :                 &allow_remaining_obj)) {
    5487           0 :                 return NULL;
    5488             :         }
    5489           0 :         blob.length = blob_length;
    5490             : 
    5491           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5492           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    5493             :         }
    5494           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5495           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    5496             :         }
    5497             : 
    5498           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5499           0 :                 allow_remaining = true;
    5500             :         }
    5501             : 
    5502           0 :         return py_wbint_Sids2UnixIDs_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    5503             : }
    5504             : 
    5505           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5506             : {
    5507             :         DATA_BLOB blob;
    5508           0 :         Py_ssize_t blob_length = 0;
    5509           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    5510           0 :         PyObject *bigendian_obj = NULL;
    5511           0 :         PyObject *ndr64_obj = NULL;
    5512           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    5513           0 :         PyObject *allow_remaining_obj = NULL;
    5514           0 :         bool allow_remaining = false;
    5515             : 
    5516           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    5517             :                 discard_const_p(char *, kwnames),
    5518             :                 &blob.data, &blob_length,
    5519             :                 &bigendian_obj,
    5520             :                 &ndr64_obj,
    5521             :                 &allow_remaining_obj)) {
    5522           0 :                 return NULL;
    5523             :         }
    5524           0 :         blob.length = blob_length;
    5525             : 
    5526           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    5527           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    5528             :         }
    5529           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    5530           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    5531             :         }
    5532             : 
    5533           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5534           0 :                 allow_remaining = true;
    5535             :         }
    5536             : 
    5537           0 :         return py_wbint_Sids2UnixIDs_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    5538             : }
    5539             : 
    5540           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    5541             : {
    5542           0 :         const struct ndr_interface_call *call = NULL;
    5543           0 :         struct wbint_Sids2UnixIDs *object = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(py_obj);
    5544             :         PyObject *ret;
    5545             :         char *retstr;
    5546             : 
    5547           0 :         if (ndr_table_winbind.num_calls < 5) {
    5548           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Sids2UnixIDs_ndr_print");
    5549           0 :                 return NULL;
    5550             :         }
    5551           0 :         call = &ndr_table_winbind.calls[4];
    5552             : 
    5553           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    5554           0 :         ret = PyUnicode_FromString(retstr);
    5555           0 :         TALLOC_FREE(retstr);
    5556             : 
    5557           0 :         return ret;
    5558             : }
    5559             : 
    5560           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5561             : {
    5562           0 :         return py_wbint_Sids2UnixIDs_ndr_print(py_obj, "wbint_Sids2UnixIDs_in", NDR_IN);
    5563             : }
    5564             : 
    5565           0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5566             : {
    5567           0 :         return py_wbint_Sids2UnixIDs_ndr_print(py_obj, "wbint_Sids2UnixIDs_out", NDR_OUT);
    5568             : }
    5569             : 
    5570             : static PyMethodDef py_wbint_Sids2UnixIDs_methods[] = {
    5571             :         { "opnum", (PyCFunction)py_wbint_Sids2UnixIDs_ndr_opnum, METH_NOARGS|METH_CLASS,
    5572             :                 "winbind.wbint_Sids2UnixIDs.opnum() -> 4 (0x04) " },
    5573             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    5574             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    5575             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    5576             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    5577             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    5578             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    5579             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    5580             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    5581             :         { "__ndr_print_in__", (PyCFunction)py_wbint_Sids2UnixIDs_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    5582             :         { "__ndr_print_out__", (PyCFunction)py_wbint_Sids2UnixIDs_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    5583             :         { NULL, NULL, 0, NULL }
    5584             : };
    5585             : 
    5586             : 
    5587             : static PyTypeObject wbint_Sids2UnixIDs_Type = {
    5588             :         PyVarObject_HEAD_INIT(NULL, 0)
    5589             :         .tp_name = "winbind.wbint_Sids2UnixIDs",
    5590             :         .tp_getset = py_wbint_Sids2UnixIDs_getsetters,
    5591             :         .tp_methods = py_wbint_Sids2UnixIDs_methods,
    5592             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5593             :         .tp_new = py_wbint_Sids2UnixIDs_new,
    5594             : };
    5595             : 
    5596           0 : static bool pack_py_wbint_Sids2UnixIDs_args_in(PyObject *args, PyObject *kwargs, struct wbint_Sids2UnixIDs *r)
    5597             : {
    5598             :         PyObject *py_domains;
    5599             :         PyObject *py_ids;
    5600           0 :         const char *kwnames[] = {
    5601             :                 "domains", "ids", NULL
    5602             :         };
    5603             : 
    5604           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_Sids2UnixIDs", discard_const_p(char *, kwnames), &py_domains, &py_ids)) {
    5605           0 :                 return false;
    5606             :         }
    5607             : 
    5608           0 :         if (py_domains == NULL) {
    5609           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domains");
    5610           0 :                 return false;
    5611             :         }
    5612           0 :         r->in.domains = talloc_ptrtype(r, r->in.domains);
    5613           0 :         if (r->in.domains == NULL) {
    5614           0 :                 PyErr_NoMemory();
    5615           0 :                 return false;
    5616             :         }
    5617           0 :         PY_CHECK_TYPE(lsa_RefDomainList_Type, py_domains, return false;);
    5618           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_domains)) == NULL) {
    5619           0 :                 PyErr_NoMemory();
    5620           0 :                 return false;
    5621             :         }
    5622           0 :         r->in.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_domains);
    5623           0 :         if (py_ids == NULL) {
    5624           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ids");
    5625           0 :                 return false;
    5626             :         }
    5627           0 :         r->in.ids = talloc_ptrtype(r, r->in.ids);
    5628           0 :         if (r->in.ids == NULL) {
    5629           0 :                 PyErr_NoMemory();
    5630           0 :                 return false;
    5631             :         }
    5632           0 :         PY_CHECK_TYPE(&wbint_TransIDArray_Type, py_ids, return false;);
    5633           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_ids)) == NULL) {
    5634           0 :                 PyErr_NoMemory();
    5635           0 :                 return false;
    5636             :         }
    5637           0 :         r->in.ids = (struct wbint_TransIDArray *)pytalloc_get_ptr(py_ids);
    5638           0 :         return true;
    5639             : }
    5640             : 
    5641           0 : static PyObject *unpack_py_wbint_Sids2UnixIDs_args_out(struct wbint_Sids2UnixIDs *r)
    5642             : {
    5643             :         PyObject *result;
    5644             :         PyObject *py_ids;
    5645           0 :         py_ids = pytalloc_reference_ex(&wbint_TransIDArray_Type, r->out.ids, r->out.ids);
    5646           0 :         result = py_ids;
    5647           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    5648           0 :                 PyErr_SetNTSTATUS(r->out.result);
    5649           0 :                 return NULL;
    5650             :         }
    5651             : 
    5652           0 :         return result;
    5653             : }
    5654             : 
    5655             : 
    5656           0 : static PyObject *py_wbint_UnixIDs2Sids_in_get_domain_name(PyObject *obj, void *closure)
    5657             : {
    5658           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    5659             :         PyObject *py_domain_name;
    5660           0 :         if (object->in.domain_name == NULL) {
    5661           0 :                 Py_RETURN_NONE;
    5662             :         }
    5663           0 :         if (object->in.domain_name == NULL) {
    5664           0 :                 py_domain_name = Py_None;
    5665           0 :                 Py_INCREF(py_domain_name);
    5666             :         } else {
    5667           0 :                 py_domain_name = PyUnicode_Decode(object->in.domain_name, strlen(object->in.domain_name), "utf-8", "ignore");
    5668             :         }
    5669           0 :         return py_domain_name;
    5670             : }
    5671             : 
    5672           0 : static int py_wbint_UnixIDs2Sids_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
    5673             : {
    5674           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    5675           0 :         if (value == NULL) {
    5676           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name");
    5677           0 :                 return -1;
    5678             :         }
    5679           0 :         object->in.domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_name);
    5680           0 :         if (object->in.domain_name == NULL) {
    5681           0 :                 PyErr_NoMemory();
    5682           0 :                 return -1;
    5683             :         }
    5684             :         {
    5685             :                 const char *test_str;
    5686             :                 const char *talloc_str;
    5687           0 :                 PyObject *unicode = NULL;
    5688           0 :                 if (PyUnicode_Check(value)) {
    5689           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    5690           0 :                         if (unicode == NULL) {
    5691           0 :                                 PyErr_NoMemory();
    5692           0 :                                 return -1;
    5693             :                         }
    5694           0 :                         test_str = PyBytes_AS_STRING(unicode);
    5695           0 :                 } else if (PyBytes_Check(value)) {
    5696           0 :                         test_str = PyBytes_AS_STRING(value);
    5697             :                 } else {
    5698           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    5699           0 :                         return -1;
    5700             :                 }
    5701           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    5702           0 :                 if (unicode != NULL) {
    5703           0 :                         Py_DECREF(unicode);
    5704             :                 }
    5705           0 :                 if (talloc_str == NULL) {
    5706           0 :                         PyErr_NoMemory();
    5707           0 :                         return -1;
    5708             :                 }
    5709           0 :                 object->in.domain_name = talloc_str;
    5710             :         }
    5711           0 :         return 0;
    5712             : }
    5713             : 
    5714           0 : static PyObject *py_wbint_UnixIDs2Sids_in_get_domain_sid(PyObject *obj, void *closure)
    5715             : {
    5716           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    5717             :         PyObject *py_domain_sid;
    5718           0 :         py_domain_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->in.domain_sid);
    5719           0 :         return py_domain_sid;
    5720             : }
    5721             : 
    5722           0 : static int py_wbint_UnixIDs2Sids_in_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
    5723             : {
    5724           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    5725           0 :         if (value == NULL) {
    5726           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_sid");
    5727           0 :                 return -1;
    5728             :         }
    5729           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    5730           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    5731           0 :                 PyErr_NoMemory();
    5732           0 :                 return -1;
    5733             :         }
    5734           0 :         object->in.domain_sid = *(struct dom_sid *)pytalloc_get_ptr(value);
    5735           0 :         return 0;
    5736             : }
    5737             : 
    5738           0 : static PyObject *py_wbint_UnixIDs2Sids_in_get_num_ids(PyObject *obj, void *closure)
    5739             : {
    5740           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    5741             :         PyObject *py_num_ids;
    5742           0 :         py_num_ids = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_ids);
    5743           0 :         return py_num_ids;
    5744             : }
    5745             : 
    5746           0 : static int py_wbint_UnixIDs2Sids_in_set_num_ids(PyObject *py_obj, PyObject *value, void *closure)
    5747             : {
    5748           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    5749           0 :         if (value == NULL) {
    5750           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_ids");
    5751           0 :                 return -1;
    5752             :         }
    5753             :         {
    5754           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_ids));
    5755           0 :                 if (PyLong_Check(value)) {
    5756             :                         unsigned long long test_var;
    5757           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5758           0 :                         if (PyErr_Occurred() != NULL) {
    5759           0 :                                 return -1;
    5760             :                         }
    5761           0 :                         if (test_var > uint_max) {
    5762           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    5763             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5764           0 :                                 return -1;
    5765             :                         }
    5766           0 :                         object->in.num_ids = test_var;
    5767             :                 } else {
    5768           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    5769             :                           PyLong_Type.tp_name);
    5770           0 :                         return -1;
    5771             :                 }
    5772             :         }
    5773           0 :         return 0;
    5774             : }
    5775             : 
    5776           0 : static PyObject *py_wbint_UnixIDs2Sids_in_get_xids(PyObject *obj, void *closure)
    5777             : {
    5778           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    5779             :         PyObject *py_xids;
    5780           0 :         py_xids = PyList_New(object->in.num_ids);
    5781           0 :         if (py_xids == NULL) {
    5782           0 :                 return NULL;
    5783             :         }
    5784             :         {
    5785             :                 int xids_cntr_0;
    5786           0 :                 for (xids_cntr_0 = 0; xids_cntr_0 < (object->in.num_ids); xids_cntr_0++) {
    5787             :                         PyObject *py_xids_0;
    5788           0 :                         py_xids_0 = pytalloc_reference_ex(unixid_Type, object->in.xids, &object->in.xids[xids_cntr_0]);
    5789           0 :                         PyList_SetItem(py_xids, xids_cntr_0, py_xids_0);
    5790             :                 }
    5791             :         }
    5792           0 :         return py_xids;
    5793             : }
    5794             : 
    5795           0 : static int py_wbint_UnixIDs2Sids_in_set_xids(PyObject *py_obj, PyObject *value, void *closure)
    5796             : {
    5797           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    5798           0 :         if (value == NULL) {
    5799           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.xids");
    5800           0 :                 return -1;
    5801             :         }
    5802           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    5803             :         {
    5804             :                 int xids_cntr_0;
    5805           0 :                 object->in.xids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.xids, PyList_GET_SIZE(value));
    5806           0 :                 if (!object->in.xids) { return -1;; }
    5807           0 :                 talloc_set_name_const(object->in.xids, "ARRAY: object->in.xids");
    5808           0 :                 for (xids_cntr_0 = 0; xids_cntr_0 < PyList_GET_SIZE(value); xids_cntr_0++) {
    5809           0 :                         if (PyList_GET_ITEM(value, xids_cntr_0) == NULL) {
    5810           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.xids[xids_cntr_0]");
    5811           0 :                                 return -1;
    5812             :                         }
    5813           0 :                         PY_CHECK_TYPE(unixid_Type, PyList_GET_ITEM(value, xids_cntr_0), return -1;);
    5814           0 :                         if (talloc_reference(object->in.xids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, xids_cntr_0))) == NULL) {
    5815           0 :                                 PyErr_NoMemory();
    5816           0 :                                 return -1;
    5817             :                         }
    5818           0 :                         object->in.xids[xids_cntr_0] = *(struct unixid *)pytalloc_get_ptr(PyList_GET_ITEM(value, xids_cntr_0));
    5819             :                 }
    5820             :         }
    5821           0 :         return 0;
    5822             : }
    5823             : 
    5824           0 : static PyObject *py_wbint_UnixIDs2Sids_out_get_xids(PyObject *obj, void *closure)
    5825             : {
    5826           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    5827             :         PyObject *py_xids;
    5828           0 :         py_xids = PyList_New(object->in.num_ids);
    5829           0 :         if (py_xids == NULL) {
    5830           0 :                 return NULL;
    5831             :         }
    5832             :         {
    5833             :                 int xids_cntr_0;
    5834           0 :                 for (xids_cntr_0 = 0; xids_cntr_0 < (object->in.num_ids); xids_cntr_0++) {
    5835             :                         PyObject *py_xids_0;
    5836           0 :                         py_xids_0 = pytalloc_reference_ex(unixid_Type, object->out.xids, &object->out.xids[xids_cntr_0]);
    5837           0 :                         PyList_SetItem(py_xids, xids_cntr_0, py_xids_0);
    5838             :                 }
    5839             :         }
    5840           0 :         return py_xids;
    5841             : }
    5842             : 
    5843           0 : static int py_wbint_UnixIDs2Sids_out_set_xids(PyObject *py_obj, PyObject *value, void *closure)
    5844             : {
    5845           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    5846           0 :         if (value == NULL) {
    5847           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.xids");
    5848           0 :                 return -1;
    5849             :         }
    5850           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    5851             :         {
    5852             :                 int xids_cntr_0;
    5853           0 :                 object->out.xids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.xids, PyList_GET_SIZE(value));
    5854           0 :                 if (!object->out.xids) { return -1;; }
    5855           0 :                 talloc_set_name_const(object->out.xids, "ARRAY: object->out.xids");
    5856           0 :                 for (xids_cntr_0 = 0; xids_cntr_0 < PyList_GET_SIZE(value); xids_cntr_0++) {
    5857           0 :                         if (PyList_GET_ITEM(value, xids_cntr_0) == NULL) {
    5858           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.xids[xids_cntr_0]");
    5859           0 :                                 return -1;
    5860             :                         }
    5861           0 :                         PY_CHECK_TYPE(unixid_Type, PyList_GET_ITEM(value, xids_cntr_0), return -1;);
    5862           0 :                         if (talloc_reference(object->out.xids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, xids_cntr_0))) == NULL) {
    5863           0 :                                 PyErr_NoMemory();
    5864           0 :                                 return -1;
    5865             :                         }
    5866           0 :                         object->out.xids[xids_cntr_0] = *(struct unixid *)pytalloc_get_ptr(PyList_GET_ITEM(value, xids_cntr_0));
    5867             :                 }
    5868             :         }
    5869           0 :         return 0;
    5870             : }
    5871             : 
    5872           0 : static PyObject *py_wbint_UnixIDs2Sids_out_get_sids(PyObject *obj, void *closure)
    5873             : {
    5874           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    5875             :         PyObject *py_sids;
    5876           0 :         py_sids = PyList_New(object->in.num_ids);
    5877           0 :         if (py_sids == NULL) {
    5878           0 :                 return NULL;
    5879             :         }
    5880             :         {
    5881             :                 int sids_cntr_0;
    5882           0 :                 for (sids_cntr_0 = 0; sids_cntr_0 < (object->in.num_ids); sids_cntr_0++) {
    5883             :                         PyObject *py_sids_0;
    5884           0 :                         py_sids_0 = pytalloc_reference_ex(dom_sid_Type, object->out.sids, &object->out.sids[sids_cntr_0]);
    5885           0 :                         PyList_SetItem(py_sids, sids_cntr_0, py_sids_0);
    5886             :                 }
    5887             :         }
    5888           0 :         return py_sids;
    5889             : }
    5890             : 
    5891           0 : static int py_wbint_UnixIDs2Sids_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
    5892             : {
    5893           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    5894           0 :         if (value == NULL) {
    5895           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
    5896           0 :                 return -1;
    5897             :         }
    5898           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    5899             :         {
    5900             :                 int sids_cntr_0;
    5901           0 :                 object->out.sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids, PyList_GET_SIZE(value));
    5902           0 :                 if (!object->out.sids) { return -1;; }
    5903           0 :                 talloc_set_name_const(object->out.sids, "ARRAY: object->out.sids");
    5904           0 :                 for (sids_cntr_0 = 0; sids_cntr_0 < PyList_GET_SIZE(value); sids_cntr_0++) {
    5905           0 :                         if (PyList_GET_ITEM(value, sids_cntr_0) == NULL) {
    5906           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids[sids_cntr_0]");
    5907           0 :                                 return -1;
    5908             :                         }
    5909           0 :                         PY_CHECK_TYPE(dom_sid_Type, PyList_GET_ITEM(value, sids_cntr_0), return -1;);
    5910           0 :                         if (talloc_reference(object->out.sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_0))) == NULL) {
    5911           0 :                                 PyErr_NoMemory();
    5912           0 :                                 return -1;
    5913             :                         }
    5914           0 :                         object->out.sids[sids_cntr_0] = *(struct dom_sid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_0));
    5915             :                 }
    5916             :         }
    5917           0 :         return 0;
    5918             : }
    5919             : 
    5920           0 : static PyObject *py_wbint_UnixIDs2Sids_get_result(PyObject *obj, void *closure)
    5921             : {
    5922           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(obj);
    5923             :         PyObject *py_result;
    5924           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    5925           0 :         return py_result;
    5926             : }
    5927             : 
    5928           0 : static int py_wbint_UnixIDs2Sids_set_result(PyObject *py_obj, PyObject *value, void *closure)
    5929             : {
    5930           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    5931           0 :         if (value == NULL) {
    5932           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    5933           0 :                 return -1;
    5934             :         }
    5935           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    5936           0 :         return 0;
    5937             : }
    5938             : 
    5939             : static PyGetSetDef py_wbint_UnixIDs2Sids_getsetters[] = {
    5940             :         {
    5941             :                 .name = discard_const_p(char, "in_domain_name"),
    5942             :                 .get = py_wbint_UnixIDs2Sids_in_get_domain_name,
    5943             :                 .set = py_wbint_UnixIDs2Sids_in_set_domain_name,
    5944             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    5945             :         },
    5946             :         {
    5947             :                 .name = discard_const_p(char, "in_domain_sid"),
    5948             :                 .get = py_wbint_UnixIDs2Sids_in_get_domain_sid,
    5949             :                 .set = py_wbint_UnixIDs2Sids_in_set_domain_sid,
    5950             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    5951             :         },
    5952             :         {
    5953             :                 .name = discard_const_p(char, "in_num_ids"),
    5954             :                 .get = py_wbint_UnixIDs2Sids_in_get_num_ids,
    5955             :                 .set = py_wbint_UnixIDs2Sids_in_set_num_ids,
    5956             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5957             :         },
    5958             :         {
    5959             :                 .name = discard_const_p(char, "in_xids"),
    5960             :                 .get = py_wbint_UnixIDs2Sids_in_get_xids,
    5961             :                 .set = py_wbint_UnixIDs2Sids_in_set_xids,
    5962             :                 .doc = discard_const_p(char, "PIDL-generated element of base type unixid")
    5963             :         },
    5964             :         {
    5965             :                 .name = discard_const_p(char, "out_xids"),
    5966             :                 .get = py_wbint_UnixIDs2Sids_out_get_xids,
    5967             :                 .set = py_wbint_UnixIDs2Sids_out_set_xids,
    5968             :                 .doc = discard_const_p(char, "PIDL-generated element of base type unixid")
    5969             :         },
    5970             :         {
    5971             :                 .name = discard_const_p(char, "out_sids"),
    5972             :                 .get = py_wbint_UnixIDs2Sids_out_get_sids,
    5973             :                 .set = py_wbint_UnixIDs2Sids_out_set_sids,
    5974             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    5975             :         },
    5976             :         {
    5977             :                 .name = discard_const_p(char, "result"),
    5978             :                 .get = py_wbint_UnixIDs2Sids_get_result,
    5979             :                 .set = py_wbint_UnixIDs2Sids_set_result,
    5980             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    5981             :         },
    5982             :         { .name = NULL }
    5983             : };
    5984             : 
    5985           0 : static PyObject *py_wbint_UnixIDs2Sids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5986             : {
    5987           0 :         PyObject *self = pytalloc_new(struct wbint_UnixIDs2Sids, type);
    5988           0 :         return self;
    5989             : }
    5990             : 
    5991           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    5992             : {
    5993             : 
    5994             : 
    5995           0 :         return PyLong_FromLong(5);
    5996             : }
    5997             : 
    5998           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    5999             : {
    6000           0 :         const struct ndr_interface_call *call = NULL;
    6001           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    6002           0 :         PyObject *ret = NULL;
    6003           0 :         struct ndr_push *push = NULL;
    6004             :         DATA_BLOB blob;
    6005             :         enum ndr_err_code err;
    6006             : 
    6007           0 :         if (ndr_table_winbind.num_calls < 6) {
    6008           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_UnixIDs2Sids_ndr_pack");
    6009           0 :                 return NULL;
    6010             :         }
    6011           0 :         call = &ndr_table_winbind.calls[5];
    6012             : 
    6013           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    6014           0 :         if (push == NULL) {
    6015           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6016           0 :                 return NULL;
    6017             :         }
    6018             : 
    6019           0 :         push->flags |= ndr_push_flags;
    6020             : 
    6021           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    6022           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6023           0 :                 TALLOC_FREE(push);
    6024           0 :                 PyErr_SetNdrError(err);
    6025           0 :                 return NULL;
    6026             :         }
    6027           0 :         blob = ndr_push_blob(push);
    6028           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    6029           0 :         TALLOC_FREE(push);
    6030           0 :         return ret;
    6031             : }
    6032             : 
    6033           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6034             : {
    6035           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6036           0 :         PyObject *bigendian_obj = NULL;
    6037           0 :         PyObject *ndr64_obj = NULL;
    6038           0 :         uint32_t ndr_push_flags = 0;
    6039             : 
    6040           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    6041             :                 discard_const_p(char *, kwnames),
    6042             :                 &bigendian_obj,
    6043             :                 &ndr64_obj)) {
    6044           0 :                 return NULL;
    6045             :         }
    6046             : 
    6047           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6048           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6049             :         }
    6050           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6051           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6052             :         }
    6053             : 
    6054           0 :         return py_wbint_UnixIDs2Sids_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    6055             : }
    6056             : 
    6057           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6058             : {
    6059           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6060           0 :         PyObject *bigendian_obj = NULL;
    6061           0 :         PyObject *ndr64_obj = NULL;
    6062           0 :         uint32_t ndr_push_flags = 0;
    6063             : 
    6064           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    6065             :                 discard_const_p(char *, kwnames),
    6066             :                 &bigendian_obj,
    6067             :                 &ndr64_obj)) {
    6068           0 :                 return NULL;
    6069             :         }
    6070             : 
    6071           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6072           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6073             :         }
    6074           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6075           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6076             :         }
    6077             : 
    6078           0 :         return py_wbint_UnixIDs2Sids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    6079             : }
    6080             : 
    6081           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)
    6082             : {
    6083           0 :         const struct ndr_interface_call *call = NULL;
    6084           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    6085           0 :         struct ndr_pull *pull = NULL;
    6086             :         enum ndr_err_code err;
    6087             : 
    6088           0 :         if (ndr_table_winbind.num_calls < 6) {
    6089           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_UnixIDs2Sids_ndr_unpack");
    6090           0 :                 return NULL;
    6091             :         }
    6092           0 :         call = &ndr_table_winbind.calls[5];
    6093             : 
    6094           0 :         pull = ndr_pull_init_blob(blob, object);
    6095           0 :         if (pull == NULL) {
    6096           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6097           0 :                 return NULL;
    6098             :         }
    6099             : 
    6100           0 :         pull->flags |= ndr_pull_flags;
    6101             : 
    6102           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    6103           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6104           0 :                 TALLOC_FREE(pull);
    6105           0 :                 PyErr_SetNdrError(err);
    6106           0 :                 return NULL;
    6107             :         }
    6108           0 :         if (!allow_remaining) {
    6109             :                 uint32_t highest_ofs;
    6110             : 
    6111           0 :                 if (pull->offset > pull->relative_highest_offset) {
    6112           0 :                         highest_ofs = pull->offset;
    6113             :                 } else {
    6114           0 :                         highest_ofs = pull->relative_highest_offset;
    6115             :                 }
    6116           0 :                 if (highest_ofs < pull->data_size) {
    6117           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    6118             :                                 "not all bytes consumed ofs[%u] size[%u]",
    6119             :                                 highest_ofs, pull->data_size);
    6120           0 :                         TALLOC_FREE(pull);
    6121           0 :                         PyErr_SetNdrError(err);
    6122           0 :                         return NULL;
    6123             :                 }
    6124             :         }
    6125             : 
    6126           0 :         TALLOC_FREE(pull);
    6127           0 :         Py_RETURN_NONE;
    6128             : }
    6129             : 
    6130           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6131             : {
    6132             :         DATA_BLOB blob;
    6133           0 :         Py_ssize_t blob_length = 0;
    6134           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6135           0 :         PyObject *bigendian_obj = NULL;
    6136           0 :         PyObject *ndr64_obj = NULL;
    6137           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6138           0 :         PyObject *allow_remaining_obj = NULL;
    6139           0 :         bool allow_remaining = false;
    6140             : 
    6141           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    6142             :                 discard_const_p(char *, kwnames),
    6143             :                 &blob.data, &blob_length,
    6144             :                 &bigendian_obj,
    6145             :                 &ndr64_obj,
    6146             :                 &allow_remaining_obj)) {
    6147           0 :                 return NULL;
    6148             :         }
    6149           0 :         blob.length = blob_length;
    6150             : 
    6151           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6152           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6153             :         }
    6154           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6155           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6156             :         }
    6157             : 
    6158           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6159           0 :                 allow_remaining = true;
    6160             :         }
    6161             : 
    6162           0 :         return py_wbint_UnixIDs2Sids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    6163             : }
    6164             : 
    6165           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6166             : {
    6167             :         DATA_BLOB blob;
    6168           0 :         Py_ssize_t blob_length = 0;
    6169           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6170           0 :         PyObject *bigendian_obj = NULL;
    6171           0 :         PyObject *ndr64_obj = NULL;
    6172           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6173           0 :         PyObject *allow_remaining_obj = NULL;
    6174           0 :         bool allow_remaining = false;
    6175             : 
    6176           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    6177             :                 discard_const_p(char *, kwnames),
    6178             :                 &blob.data, &blob_length,
    6179             :                 &bigendian_obj,
    6180             :                 &ndr64_obj,
    6181             :                 &allow_remaining_obj)) {
    6182           0 :                 return NULL;
    6183             :         }
    6184           0 :         blob.length = blob_length;
    6185             : 
    6186           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6187           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6188             :         }
    6189           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6190           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6191             :         }
    6192             : 
    6193           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6194           0 :                 allow_remaining = true;
    6195             :         }
    6196             : 
    6197           0 :         return py_wbint_UnixIDs2Sids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    6198             : }
    6199             : 
    6200           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    6201             : {
    6202           0 :         const struct ndr_interface_call *call = NULL;
    6203           0 :         struct wbint_UnixIDs2Sids *object = (struct wbint_UnixIDs2Sids *)pytalloc_get_ptr(py_obj);
    6204             :         PyObject *ret;
    6205             :         char *retstr;
    6206             : 
    6207           0 :         if (ndr_table_winbind.num_calls < 6) {
    6208           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_UnixIDs2Sids_ndr_print");
    6209           0 :                 return NULL;
    6210             :         }
    6211           0 :         call = &ndr_table_winbind.calls[5];
    6212             : 
    6213           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    6214           0 :         ret = PyUnicode_FromString(retstr);
    6215           0 :         TALLOC_FREE(retstr);
    6216             : 
    6217           0 :         return ret;
    6218             : }
    6219             : 
    6220           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6221             : {
    6222           0 :         return py_wbint_UnixIDs2Sids_ndr_print(py_obj, "wbint_UnixIDs2Sids_in", NDR_IN);
    6223             : }
    6224             : 
    6225           0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6226             : {
    6227           0 :         return py_wbint_UnixIDs2Sids_ndr_print(py_obj, "wbint_UnixIDs2Sids_out", NDR_OUT);
    6228             : }
    6229             : 
    6230             : static PyMethodDef py_wbint_UnixIDs2Sids_methods[] = {
    6231             :         { "opnum", (PyCFunction)py_wbint_UnixIDs2Sids_ndr_opnum, METH_NOARGS|METH_CLASS,
    6232             :                 "winbind.wbint_UnixIDs2Sids.opnum() -> 5 (0x05) " },
    6233             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    6234             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    6235             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    6236             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    6237             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    6238             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    6239             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    6240             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    6241             :         { "__ndr_print_in__", (PyCFunction)py_wbint_UnixIDs2Sids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    6242             :         { "__ndr_print_out__", (PyCFunction)py_wbint_UnixIDs2Sids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    6243             :         { NULL, NULL, 0, NULL }
    6244             : };
    6245             : 
    6246             : 
    6247             : static PyTypeObject wbint_UnixIDs2Sids_Type = {
    6248             :         PyVarObject_HEAD_INIT(NULL, 0)
    6249             :         .tp_name = "winbind.wbint_UnixIDs2Sids",
    6250             :         .tp_getset = py_wbint_UnixIDs2Sids_getsetters,
    6251             :         .tp_methods = py_wbint_UnixIDs2Sids_methods,
    6252             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6253             :         .tp_new = py_wbint_UnixIDs2Sids_new,
    6254             : };
    6255             : 
    6256           0 : static bool pack_py_wbint_UnixIDs2Sids_args_in(PyObject *args, PyObject *kwargs, struct wbint_UnixIDs2Sids *r)
    6257             : {
    6258             :         PyObject *py_domain_name;
    6259             :         PyObject *py_domain_sid;
    6260             :         PyObject *py_num_ids;
    6261             :         PyObject *py_xids;
    6262           0 :         const char *kwnames[] = {
    6263             :                 "domain_name", "domain_sid", "num_ids", "xids", NULL
    6264             :         };
    6265             : 
    6266           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)) {
    6267           0 :                 return false;
    6268             :         }
    6269             : 
    6270           0 :         if (py_domain_name == NULL) {
    6271           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name");
    6272           0 :                 return false;
    6273             :         }
    6274           0 :         r->in.domain_name = talloc_ptrtype(r, r->in.domain_name);
    6275           0 :         if (r->in.domain_name == NULL) {
    6276           0 :                 PyErr_NoMemory();
    6277           0 :                 return false;
    6278             :         }
    6279             :         {
    6280             :                 const char *test_str;
    6281             :                 const char *talloc_str;
    6282           0 :                 PyObject *unicode = NULL;
    6283           0 :                 if (PyUnicode_Check(py_domain_name)) {
    6284           0 :                         unicode = PyUnicode_AsEncodedString(py_domain_name, "utf-8", "ignore");
    6285           0 :                         if (unicode == NULL) {
    6286           0 :                                 PyErr_NoMemory();
    6287           0 :                                 return false;
    6288             :                         }
    6289           0 :                         test_str = PyBytes_AS_STRING(unicode);
    6290           0 :                 } else if (PyBytes_Check(py_domain_name)) {
    6291           0 :                         test_str = PyBytes_AS_STRING(py_domain_name);
    6292             :                 } else {
    6293           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain_name)->tp_name);
    6294           0 :                         return false;
    6295             :                 }
    6296           0 :                 talloc_str = talloc_strdup(r, test_str);
    6297           0 :                 if (unicode != NULL) {
    6298           0 :                         Py_DECREF(unicode);
    6299             :                 }
    6300           0 :                 if (talloc_str == NULL) {
    6301           0 :                         PyErr_NoMemory();
    6302           0 :                         return false;
    6303             :                 }
    6304           0 :                 r->in.domain_name = talloc_str;
    6305             :         }
    6306           0 :         if (py_domain_sid == NULL) {
    6307           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_sid");
    6308           0 :                 return false;
    6309             :         }
    6310           0 :         PY_CHECK_TYPE(dom_sid_Type, py_domain_sid, return false;);
    6311           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_sid)) == NULL) {
    6312           0 :                 PyErr_NoMemory();
    6313           0 :                 return false;
    6314             :         }
    6315           0 :         r->in.domain_sid = *(struct dom_sid *)pytalloc_get_ptr(py_domain_sid);
    6316           0 :         if (py_num_ids == NULL) {
    6317           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.num_ids");
    6318           0 :                 return false;
    6319             :         }
    6320             :         {
    6321           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.num_ids));
    6322           0 :                 if (PyLong_Check(py_num_ids)) {
    6323             :                         unsigned long long test_var;
    6324           0 :                         test_var = PyLong_AsUnsignedLongLong(py_num_ids);
    6325           0 :                         if (PyErr_Occurred() != NULL) {
    6326           0 :                                 return false;
    6327             :                         }
    6328           0 :                         if (test_var > uint_max) {
    6329           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    6330             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6331           0 :                                 return false;
    6332             :                         }
    6333           0 :                         r->in.num_ids = test_var;
    6334             :                 } else {
    6335           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    6336             :                           PyLong_Type.tp_name);
    6337           0 :                         return false;
    6338             :                 }
    6339             :         }
    6340           0 :         if (py_xids == NULL) {
    6341           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.xids");
    6342           0 :                 return false;
    6343             :         }
    6344           0 :         PY_CHECK_TYPE(&PyList_Type, py_xids, return false;);
    6345             :         {
    6346             :                 int xids_cntr_0;
    6347           0 :                 r->in.xids = talloc_array_ptrtype(r, r->in.xids, PyList_GET_SIZE(py_xids));
    6348           0 :                 if (!r->in.xids) { return false;; }
    6349           0 :                 talloc_set_name_const(r->in.xids, "ARRAY: r->in.xids");
    6350           0 :                 for (xids_cntr_0 = 0; xids_cntr_0 < PyList_GET_SIZE(py_xids); xids_cntr_0++) {
    6351           0 :                         if (PyList_GET_ITEM(py_xids, xids_cntr_0) == NULL) {
    6352           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.xids[xids_cntr_0]");
    6353           0 :                                 return false;
    6354             :                         }
    6355           0 :                         PY_CHECK_TYPE(unixid_Type, PyList_GET_ITEM(py_xids, xids_cntr_0), return false;);
    6356           0 :                         if (talloc_reference(r->in.xids, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_xids, xids_cntr_0))) == NULL) {
    6357           0 :                                 PyErr_NoMemory();
    6358           0 :                                 return false;
    6359             :                         }
    6360           0 :                         r->in.xids[xids_cntr_0] = *(struct unixid *)pytalloc_get_ptr(PyList_GET_ITEM(py_xids, xids_cntr_0));
    6361             :                 }
    6362             :         }
    6363           0 :         return true;
    6364             : }
    6365             : 
    6366           0 : static PyObject *unpack_py_wbint_UnixIDs2Sids_args_out(struct wbint_UnixIDs2Sids *r)
    6367             : {
    6368             :         PyObject *result;
    6369             :         PyObject *py_xids;
    6370             :         PyObject *py_sids;
    6371           0 :         result = PyTuple_New(2);
    6372           0 :         py_xids = PyList_New(r->in.num_ids);
    6373           0 :         if (py_xids == NULL) {
    6374           0 :                 return NULL;
    6375             :         }
    6376             :         {
    6377             :                 int xids_cntr_0;
    6378           0 :                 for (xids_cntr_0 = 0; xids_cntr_0 < (r->in.num_ids); xids_cntr_0++) {
    6379             :                         PyObject *py_xids_0;
    6380           0 :                         py_xids_0 = pytalloc_reference_ex(unixid_Type, r->out.xids, &r->out.xids[xids_cntr_0]);
    6381           0 :                         PyList_SetItem(py_xids, xids_cntr_0, py_xids_0);
    6382             :                 }
    6383             :         }
    6384           0 :         PyTuple_SetItem(result, 0, py_xids);
    6385           0 :         py_sids = PyList_New(r->in.num_ids);
    6386           0 :         if (py_sids == NULL) {
    6387           0 :                 return NULL;
    6388             :         }
    6389             :         {
    6390             :                 int sids_cntr_0;
    6391           0 :                 for (sids_cntr_0 = 0; sids_cntr_0 < (r->in.num_ids); sids_cntr_0++) {
    6392             :                         PyObject *py_sids_0;
    6393           0 :                         py_sids_0 = pytalloc_reference_ex(dom_sid_Type, r->out.sids, &r->out.sids[sids_cntr_0]);
    6394           0 :                         PyList_SetItem(py_sids, sids_cntr_0, py_sids_0);
    6395             :                 }
    6396             :         }
    6397           0 :         PyTuple_SetItem(result, 1, py_sids);
    6398           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    6399           0 :                 PyErr_SetNTSTATUS(r->out.result);
    6400           0 :                 return NULL;
    6401             :         }
    6402             : 
    6403           0 :         return result;
    6404             : }
    6405             : 
    6406             : 
    6407           0 : static PyObject *py_wbint_AllocateUid_out_get_uid(PyObject *obj, void *closure)
    6408             : {
    6409           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(obj);
    6410             :         PyObject *py_uid;
    6411           0 :         if (object->out.uid == NULL) {
    6412           0 :                 Py_RETURN_NONE;
    6413             :         }
    6414           0 :         py_uid = PyLong_FromUnsignedLongLong(*object->out.uid);
    6415           0 :         return py_uid;
    6416             : }
    6417             : 
    6418           0 : static int py_wbint_AllocateUid_out_set_uid(PyObject *py_obj, PyObject *value, void *closure)
    6419             : {
    6420           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj);
    6421           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.uid));
    6422           0 :         if (value == NULL) {
    6423           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.uid");
    6424           0 :                 return -1;
    6425             :         }
    6426           0 :         object->out.uid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.uid);
    6427           0 :         if (object->out.uid == NULL) {
    6428           0 :                 PyErr_NoMemory();
    6429           0 :                 return -1;
    6430             :         }
    6431             :         {
    6432           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.uid));
    6433           0 :                 if (PyLong_Check(value)) {
    6434             :                         unsigned long long test_var;
    6435           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6436           0 :                         if (PyErr_Occurred() != NULL) {
    6437           0 :                                 return -1;
    6438             :                         }
    6439           0 :                         if (test_var > uint_max) {
    6440           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    6441             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6442           0 :                                 return -1;
    6443             :                         }
    6444           0 :                         *object->out.uid = test_var;
    6445             :                 } else {
    6446           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    6447             :                           PyLong_Type.tp_name);
    6448           0 :                         return -1;
    6449             :                 }
    6450             :         }
    6451           0 :         return 0;
    6452             : }
    6453             : 
    6454           0 : static PyObject *py_wbint_AllocateUid_get_result(PyObject *obj, void *closure)
    6455             : {
    6456           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(obj);
    6457             :         PyObject *py_result;
    6458           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    6459           0 :         return py_result;
    6460             : }
    6461             : 
    6462           0 : static int py_wbint_AllocateUid_set_result(PyObject *py_obj, PyObject *value, void *closure)
    6463             : {
    6464           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj);
    6465           0 :         if (value == NULL) {
    6466           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    6467           0 :                 return -1;
    6468             :         }
    6469           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    6470           0 :         return 0;
    6471             : }
    6472             : 
    6473             : static PyGetSetDef py_wbint_AllocateUid_getsetters[] = {
    6474             :         {
    6475             :                 .name = discard_const_p(char, "out_uid"),
    6476             :                 .get = py_wbint_AllocateUid_out_get_uid,
    6477             :                 .set = py_wbint_AllocateUid_out_set_uid,
    6478             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
    6479             :         },
    6480             :         {
    6481             :                 .name = discard_const_p(char, "result"),
    6482             :                 .get = py_wbint_AllocateUid_get_result,
    6483             :                 .set = py_wbint_AllocateUid_set_result,
    6484             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    6485             :         },
    6486             :         { .name = NULL }
    6487             : };
    6488             : 
    6489           0 : static PyObject *py_wbint_AllocateUid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6490             : {
    6491           0 :         PyObject *self = pytalloc_new(struct wbint_AllocateUid, type);
    6492           0 :         struct wbint_AllocateUid *_self = (struct wbint_AllocateUid *)pytalloc_get_ptr(self);
    6493           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    6494           0 :         _self->out.uid = talloc_zero(mem_ctx, uint64_t);
    6495           0 :         return self;
    6496             : }
    6497             : 
    6498           0 : static PyObject *py_wbint_AllocateUid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    6499             : {
    6500             : 
    6501             : 
    6502           0 :         return PyLong_FromLong(6);
    6503             : }
    6504             : 
    6505           0 : static PyObject *py_wbint_AllocateUid_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    6506             : {
    6507           0 :         const struct ndr_interface_call *call = NULL;
    6508           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj);
    6509           0 :         PyObject *ret = NULL;
    6510           0 :         struct ndr_push *push = NULL;
    6511             :         DATA_BLOB blob;
    6512             :         enum ndr_err_code err;
    6513             : 
    6514           0 :         if (ndr_table_winbind.num_calls < 7) {
    6515           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateUid_ndr_pack");
    6516           0 :                 return NULL;
    6517             :         }
    6518           0 :         call = &ndr_table_winbind.calls[6];
    6519             : 
    6520           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    6521           0 :         if (push == NULL) {
    6522           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6523           0 :                 return NULL;
    6524             :         }
    6525             : 
    6526           0 :         push->flags |= ndr_push_flags;
    6527             : 
    6528           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    6529           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6530           0 :                 TALLOC_FREE(push);
    6531           0 :                 PyErr_SetNdrError(err);
    6532           0 :                 return NULL;
    6533             :         }
    6534           0 :         blob = ndr_push_blob(push);
    6535           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    6536           0 :         TALLOC_FREE(push);
    6537           0 :         return ret;
    6538             : }
    6539             : 
    6540           0 : static PyObject *py_wbint_AllocateUid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6541             : {
    6542           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6543           0 :         PyObject *bigendian_obj = NULL;
    6544           0 :         PyObject *ndr64_obj = NULL;
    6545           0 :         uint32_t ndr_push_flags = 0;
    6546             : 
    6547           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    6548             :                 discard_const_p(char *, kwnames),
    6549             :                 &bigendian_obj,
    6550             :                 &ndr64_obj)) {
    6551           0 :                 return NULL;
    6552             :         }
    6553             : 
    6554           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6555           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6556             :         }
    6557           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6558           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6559             :         }
    6560             : 
    6561           0 :         return py_wbint_AllocateUid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    6562             : }
    6563             : 
    6564           0 : static PyObject *py_wbint_AllocateUid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6565             : {
    6566           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6567           0 :         PyObject *bigendian_obj = NULL;
    6568           0 :         PyObject *ndr64_obj = NULL;
    6569           0 :         uint32_t ndr_push_flags = 0;
    6570             : 
    6571           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    6572             :                 discard_const_p(char *, kwnames),
    6573             :                 &bigendian_obj,
    6574             :                 &ndr64_obj)) {
    6575           0 :                 return NULL;
    6576             :         }
    6577             : 
    6578           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6579           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6580             :         }
    6581           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6582           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6583             :         }
    6584             : 
    6585           0 :         return py_wbint_AllocateUid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    6586             : }
    6587             : 
    6588           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)
    6589             : {
    6590           0 :         const struct ndr_interface_call *call = NULL;
    6591           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj);
    6592           0 :         struct ndr_pull *pull = NULL;
    6593             :         enum ndr_err_code err;
    6594             : 
    6595           0 :         if (ndr_table_winbind.num_calls < 7) {
    6596           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateUid_ndr_unpack");
    6597           0 :                 return NULL;
    6598             :         }
    6599           0 :         call = &ndr_table_winbind.calls[6];
    6600             : 
    6601           0 :         pull = ndr_pull_init_blob(blob, object);
    6602           0 :         if (pull == NULL) {
    6603           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6604           0 :                 return NULL;
    6605             :         }
    6606             : 
    6607           0 :         pull->flags |= ndr_pull_flags;
    6608             : 
    6609           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    6610           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6611           0 :                 TALLOC_FREE(pull);
    6612           0 :                 PyErr_SetNdrError(err);
    6613           0 :                 return NULL;
    6614             :         }
    6615           0 :         if (!allow_remaining) {
    6616             :                 uint32_t highest_ofs;
    6617             : 
    6618           0 :                 if (pull->offset > pull->relative_highest_offset) {
    6619           0 :                         highest_ofs = pull->offset;
    6620             :                 } else {
    6621           0 :                         highest_ofs = pull->relative_highest_offset;
    6622             :                 }
    6623           0 :                 if (highest_ofs < pull->data_size) {
    6624           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    6625             :                                 "not all bytes consumed ofs[%u] size[%u]",
    6626             :                                 highest_ofs, pull->data_size);
    6627           0 :                         TALLOC_FREE(pull);
    6628           0 :                         PyErr_SetNdrError(err);
    6629           0 :                         return NULL;
    6630             :                 }
    6631             :         }
    6632             : 
    6633           0 :         TALLOC_FREE(pull);
    6634           0 :         Py_RETURN_NONE;
    6635             : }
    6636             : 
    6637           0 : static PyObject *py_wbint_AllocateUid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6638             : {
    6639             :         DATA_BLOB blob;
    6640           0 :         Py_ssize_t blob_length = 0;
    6641           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6642           0 :         PyObject *bigendian_obj = NULL;
    6643           0 :         PyObject *ndr64_obj = NULL;
    6644           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6645           0 :         PyObject *allow_remaining_obj = NULL;
    6646           0 :         bool allow_remaining = false;
    6647             : 
    6648           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    6649             :                 discard_const_p(char *, kwnames),
    6650             :                 &blob.data, &blob_length,
    6651             :                 &bigendian_obj,
    6652             :                 &ndr64_obj,
    6653             :                 &allow_remaining_obj)) {
    6654           0 :                 return NULL;
    6655             :         }
    6656           0 :         blob.length = blob_length;
    6657             : 
    6658           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6659           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6660             :         }
    6661           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6662           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6663             :         }
    6664             : 
    6665           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6666           0 :                 allow_remaining = true;
    6667             :         }
    6668             : 
    6669           0 :         return py_wbint_AllocateUid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    6670             : }
    6671             : 
    6672           0 : static PyObject *py_wbint_AllocateUid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6673             : {
    6674             :         DATA_BLOB blob;
    6675           0 :         Py_ssize_t blob_length = 0;
    6676           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    6677           0 :         PyObject *bigendian_obj = NULL;
    6678           0 :         PyObject *ndr64_obj = NULL;
    6679           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    6680           0 :         PyObject *allow_remaining_obj = NULL;
    6681           0 :         bool allow_remaining = false;
    6682             : 
    6683           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    6684             :                 discard_const_p(char *, kwnames),
    6685             :                 &blob.data, &blob_length,
    6686             :                 &bigendian_obj,
    6687             :                 &ndr64_obj,
    6688             :                 &allow_remaining_obj)) {
    6689           0 :                 return NULL;
    6690             :         }
    6691           0 :         blob.length = blob_length;
    6692             : 
    6693           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6694           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    6695             :         }
    6696           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6697           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    6698             :         }
    6699             : 
    6700           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    6701           0 :                 allow_remaining = true;
    6702             :         }
    6703             : 
    6704           0 :         return py_wbint_AllocateUid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    6705             : }
    6706             : 
    6707           0 : static PyObject *py_wbint_AllocateUid_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    6708             : {
    6709           0 :         const struct ndr_interface_call *call = NULL;
    6710           0 :         struct wbint_AllocateUid *object = (struct wbint_AllocateUid *)pytalloc_get_ptr(py_obj);
    6711             :         PyObject *ret;
    6712             :         char *retstr;
    6713             : 
    6714           0 :         if (ndr_table_winbind.num_calls < 7) {
    6715           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateUid_ndr_print");
    6716           0 :                 return NULL;
    6717             :         }
    6718           0 :         call = &ndr_table_winbind.calls[6];
    6719             : 
    6720           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    6721           0 :         ret = PyUnicode_FromString(retstr);
    6722           0 :         TALLOC_FREE(retstr);
    6723             : 
    6724           0 :         return ret;
    6725             : }
    6726             : 
    6727           0 : static PyObject *py_wbint_AllocateUid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6728             : {
    6729           0 :         return py_wbint_AllocateUid_ndr_print(py_obj, "wbint_AllocateUid_in", NDR_IN);
    6730             : }
    6731             : 
    6732           0 : static PyObject *py_wbint_AllocateUid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    6733             : {
    6734           0 :         return py_wbint_AllocateUid_ndr_print(py_obj, "wbint_AllocateUid_out", NDR_OUT);
    6735             : }
    6736             : 
    6737             : static PyMethodDef py_wbint_AllocateUid_methods[] = {
    6738             :         { "opnum", (PyCFunction)py_wbint_AllocateUid_ndr_opnum, METH_NOARGS|METH_CLASS,
    6739             :                 "winbind.wbint_AllocateUid.opnum() -> 6 (0x06) " },
    6740             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    6741             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    6742             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    6743             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    6744             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    6745             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    6746             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    6747             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    6748             :         { "__ndr_print_in__", (PyCFunction)py_wbint_AllocateUid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    6749             :         { "__ndr_print_out__", (PyCFunction)py_wbint_AllocateUid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    6750             :         { NULL, NULL, 0, NULL }
    6751             : };
    6752             : 
    6753             : 
    6754             : static PyTypeObject wbint_AllocateUid_Type = {
    6755             :         PyVarObject_HEAD_INIT(NULL, 0)
    6756             :         .tp_name = "winbind.wbint_AllocateUid",
    6757             :         .tp_getset = py_wbint_AllocateUid_getsetters,
    6758             :         .tp_methods = py_wbint_AllocateUid_methods,
    6759             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6760             :         .tp_new = py_wbint_AllocateUid_new,
    6761             : };
    6762             : 
    6763           0 : static bool pack_py_wbint_AllocateUid_args_in(PyObject *args, PyObject *kwargs, struct wbint_AllocateUid *r)
    6764             : {
    6765           0 :         const char *kwnames[] = {
    6766             :                 NULL
    6767             :         };
    6768             : 
    6769           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_AllocateUid", discard_const_p(char *, kwnames))) {
    6770           0 :                 return false;
    6771             :         }
    6772             : 
    6773           0 :         return true;
    6774             : }
    6775             : 
    6776           0 : static PyObject *unpack_py_wbint_AllocateUid_args_out(struct wbint_AllocateUid *r)
    6777             : {
    6778             :         PyObject *result;
    6779             :         PyObject *py_uid;
    6780           0 :         py_uid = PyLong_FromUnsignedLongLong(*r->out.uid);
    6781           0 :         result = py_uid;
    6782           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    6783           0 :                 PyErr_SetNTSTATUS(r->out.result);
    6784           0 :                 return NULL;
    6785             :         }
    6786             : 
    6787           0 :         return result;
    6788             : }
    6789             : 
    6790             : 
    6791           0 : static PyObject *py_wbint_AllocateGid_out_get_gid(PyObject *obj, void *closure)
    6792             : {
    6793           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(obj);
    6794             :         PyObject *py_gid;
    6795           0 :         if (object->out.gid == NULL) {
    6796           0 :                 Py_RETURN_NONE;
    6797             :         }
    6798           0 :         py_gid = PyLong_FromUnsignedLongLong(*object->out.gid);
    6799           0 :         return py_gid;
    6800             : }
    6801             : 
    6802           0 : static int py_wbint_AllocateGid_out_set_gid(PyObject *py_obj, PyObject *value, void *closure)
    6803             : {
    6804           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj);
    6805           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.gid));
    6806           0 :         if (value == NULL) {
    6807           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.gid");
    6808           0 :                 return -1;
    6809             :         }
    6810           0 :         object->out.gid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.gid);
    6811           0 :         if (object->out.gid == NULL) {
    6812           0 :                 PyErr_NoMemory();
    6813           0 :                 return -1;
    6814             :         }
    6815             :         {
    6816           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.gid));
    6817           0 :                 if (PyLong_Check(value)) {
    6818             :                         unsigned long long test_var;
    6819           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6820           0 :                         if (PyErr_Occurred() != NULL) {
    6821           0 :                                 return -1;
    6822             :                         }
    6823           0 :                         if (test_var > uint_max) {
    6824           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    6825             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6826           0 :                                 return -1;
    6827             :                         }
    6828           0 :                         *object->out.gid = test_var;
    6829             :                 } else {
    6830           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    6831             :                           PyLong_Type.tp_name);
    6832           0 :                         return -1;
    6833             :                 }
    6834             :         }
    6835           0 :         return 0;
    6836             : }
    6837             : 
    6838           0 : static PyObject *py_wbint_AllocateGid_get_result(PyObject *obj, void *closure)
    6839             : {
    6840           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(obj);
    6841             :         PyObject *py_result;
    6842           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    6843           0 :         return py_result;
    6844             : }
    6845             : 
    6846           0 : static int py_wbint_AllocateGid_set_result(PyObject *py_obj, PyObject *value, void *closure)
    6847             : {
    6848           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj);
    6849           0 :         if (value == NULL) {
    6850           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    6851           0 :                 return -1;
    6852             :         }
    6853           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    6854           0 :         return 0;
    6855             : }
    6856             : 
    6857             : static PyGetSetDef py_wbint_AllocateGid_getsetters[] = {
    6858             :         {
    6859             :                 .name = discard_const_p(char, "out_gid"),
    6860             :                 .get = py_wbint_AllocateGid_out_get_gid,
    6861             :                 .set = py_wbint_AllocateGid_out_set_gid,
    6862             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
    6863             :         },
    6864             :         {
    6865             :                 .name = discard_const_p(char, "result"),
    6866             :                 .get = py_wbint_AllocateGid_get_result,
    6867             :                 .set = py_wbint_AllocateGid_set_result,
    6868             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    6869             :         },
    6870             :         { .name = NULL }
    6871             : };
    6872             : 
    6873           0 : static PyObject *py_wbint_AllocateGid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6874             : {
    6875           0 :         PyObject *self = pytalloc_new(struct wbint_AllocateGid, type);
    6876           0 :         struct wbint_AllocateGid *_self = (struct wbint_AllocateGid *)pytalloc_get_ptr(self);
    6877           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    6878           0 :         _self->out.gid = talloc_zero(mem_ctx, uint64_t);
    6879           0 :         return self;
    6880             : }
    6881             : 
    6882           0 : static PyObject *py_wbint_AllocateGid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    6883             : {
    6884             : 
    6885             : 
    6886           0 :         return PyLong_FromLong(7);
    6887             : }
    6888             : 
    6889           0 : static PyObject *py_wbint_AllocateGid_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    6890             : {
    6891           0 :         const struct ndr_interface_call *call = NULL;
    6892           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj);
    6893           0 :         PyObject *ret = NULL;
    6894           0 :         struct ndr_push *push = NULL;
    6895             :         DATA_BLOB blob;
    6896             :         enum ndr_err_code err;
    6897             : 
    6898           0 :         if (ndr_table_winbind.num_calls < 8) {
    6899           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateGid_ndr_pack");
    6900           0 :                 return NULL;
    6901             :         }
    6902           0 :         call = &ndr_table_winbind.calls[7];
    6903             : 
    6904           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    6905           0 :         if (push == NULL) {
    6906           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6907           0 :                 return NULL;
    6908             :         }
    6909             : 
    6910           0 :         push->flags |= ndr_push_flags;
    6911             : 
    6912           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    6913           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6914           0 :                 TALLOC_FREE(push);
    6915           0 :                 PyErr_SetNdrError(err);
    6916           0 :                 return NULL;
    6917             :         }
    6918           0 :         blob = ndr_push_blob(push);
    6919           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    6920           0 :         TALLOC_FREE(push);
    6921           0 :         return ret;
    6922             : }
    6923             : 
    6924           0 : static PyObject *py_wbint_AllocateGid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6925             : {
    6926           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6927           0 :         PyObject *bigendian_obj = NULL;
    6928           0 :         PyObject *ndr64_obj = NULL;
    6929           0 :         uint32_t ndr_push_flags = 0;
    6930             : 
    6931           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    6932             :                 discard_const_p(char *, kwnames),
    6933             :                 &bigendian_obj,
    6934             :                 &ndr64_obj)) {
    6935           0 :                 return NULL;
    6936             :         }
    6937             : 
    6938           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6939           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6940             :         }
    6941           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6942           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6943             :         }
    6944             : 
    6945           0 :         return py_wbint_AllocateGid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    6946             : }
    6947             : 
    6948           0 : static PyObject *py_wbint_AllocateGid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    6949             : {
    6950           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    6951           0 :         PyObject *bigendian_obj = NULL;
    6952           0 :         PyObject *ndr64_obj = NULL;
    6953           0 :         uint32_t ndr_push_flags = 0;
    6954             : 
    6955           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    6956             :                 discard_const_p(char *, kwnames),
    6957             :                 &bigendian_obj,
    6958             :                 &ndr64_obj)) {
    6959           0 :                 return NULL;
    6960             :         }
    6961             : 
    6962           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    6963           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    6964             :         }
    6965           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    6966           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    6967             :         }
    6968             : 
    6969           0 :         return py_wbint_AllocateGid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    6970             : }
    6971             : 
    6972           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)
    6973             : {
    6974           0 :         const struct ndr_interface_call *call = NULL;
    6975           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj);
    6976           0 :         struct ndr_pull *pull = NULL;
    6977             :         enum ndr_err_code err;
    6978             : 
    6979           0 :         if (ndr_table_winbind.num_calls < 8) {
    6980           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateGid_ndr_unpack");
    6981           0 :                 return NULL;
    6982             :         }
    6983           0 :         call = &ndr_table_winbind.calls[7];
    6984             : 
    6985           0 :         pull = ndr_pull_init_blob(blob, object);
    6986           0 :         if (pull == NULL) {
    6987           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    6988           0 :                 return NULL;
    6989             :         }
    6990             : 
    6991           0 :         pull->flags |= ndr_pull_flags;
    6992             : 
    6993           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    6994           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    6995           0 :                 TALLOC_FREE(pull);
    6996           0 :                 PyErr_SetNdrError(err);
    6997           0 :                 return NULL;
    6998             :         }
    6999           0 :         if (!allow_remaining) {
    7000             :                 uint32_t highest_ofs;
    7001             : 
    7002           0 :                 if (pull->offset > pull->relative_highest_offset) {
    7003           0 :                         highest_ofs = pull->offset;
    7004             :                 } else {
    7005           0 :                         highest_ofs = pull->relative_highest_offset;
    7006             :                 }
    7007           0 :                 if (highest_ofs < pull->data_size) {
    7008           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    7009             :                                 "not all bytes consumed ofs[%u] size[%u]",
    7010             :                                 highest_ofs, pull->data_size);
    7011           0 :                         TALLOC_FREE(pull);
    7012           0 :                         PyErr_SetNdrError(err);
    7013           0 :                         return NULL;
    7014             :                 }
    7015             :         }
    7016             : 
    7017           0 :         TALLOC_FREE(pull);
    7018           0 :         Py_RETURN_NONE;
    7019             : }
    7020             : 
    7021           0 : static PyObject *py_wbint_AllocateGid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7022             : {
    7023             :         DATA_BLOB blob;
    7024           0 :         Py_ssize_t blob_length = 0;
    7025           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    7026           0 :         PyObject *bigendian_obj = NULL;
    7027           0 :         PyObject *ndr64_obj = NULL;
    7028           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    7029           0 :         PyObject *allow_remaining_obj = NULL;
    7030           0 :         bool allow_remaining = false;
    7031             : 
    7032           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    7033             :                 discard_const_p(char *, kwnames),
    7034             :                 &blob.data, &blob_length,
    7035             :                 &bigendian_obj,
    7036             :                 &ndr64_obj,
    7037             :                 &allow_remaining_obj)) {
    7038           0 :                 return NULL;
    7039             :         }
    7040           0 :         blob.length = blob_length;
    7041             : 
    7042           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7043           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    7044             :         }
    7045           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7046           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    7047             :         }
    7048             : 
    7049           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    7050           0 :                 allow_remaining = true;
    7051             :         }
    7052             : 
    7053           0 :         return py_wbint_AllocateGid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    7054             : }
    7055             : 
    7056           0 : static PyObject *py_wbint_AllocateGid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7057             : {
    7058             :         DATA_BLOB blob;
    7059           0 :         Py_ssize_t blob_length = 0;
    7060           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    7061           0 :         PyObject *bigendian_obj = NULL;
    7062           0 :         PyObject *ndr64_obj = NULL;
    7063           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    7064           0 :         PyObject *allow_remaining_obj = NULL;
    7065           0 :         bool allow_remaining = false;
    7066             : 
    7067           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    7068             :                 discard_const_p(char *, kwnames),
    7069             :                 &blob.data, &blob_length,
    7070             :                 &bigendian_obj,
    7071             :                 &ndr64_obj,
    7072             :                 &allow_remaining_obj)) {
    7073           0 :                 return NULL;
    7074             :         }
    7075           0 :         blob.length = blob_length;
    7076             : 
    7077           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7078           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    7079             :         }
    7080           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7081           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    7082             :         }
    7083             : 
    7084           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    7085           0 :                 allow_remaining = true;
    7086             :         }
    7087             : 
    7088           0 :         return py_wbint_AllocateGid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    7089             : }
    7090             : 
    7091           0 : static PyObject *py_wbint_AllocateGid_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    7092             : {
    7093           0 :         const struct ndr_interface_call *call = NULL;
    7094           0 :         struct wbint_AllocateGid *object = (struct wbint_AllocateGid *)pytalloc_get_ptr(py_obj);
    7095             :         PyObject *ret;
    7096             :         char *retstr;
    7097             : 
    7098           0 :         if (ndr_table_winbind.num_calls < 8) {
    7099           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateGid_ndr_print");
    7100           0 :                 return NULL;
    7101             :         }
    7102           0 :         call = &ndr_table_winbind.calls[7];
    7103             : 
    7104           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    7105           0 :         ret = PyUnicode_FromString(retstr);
    7106           0 :         TALLOC_FREE(retstr);
    7107             : 
    7108           0 :         return ret;
    7109             : }
    7110             : 
    7111           0 : static PyObject *py_wbint_AllocateGid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7112             : {
    7113           0 :         return py_wbint_AllocateGid_ndr_print(py_obj, "wbint_AllocateGid_in", NDR_IN);
    7114             : }
    7115             : 
    7116           0 : static PyObject *py_wbint_AllocateGid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7117             : {
    7118           0 :         return py_wbint_AllocateGid_ndr_print(py_obj, "wbint_AllocateGid_out", NDR_OUT);
    7119             : }
    7120             : 
    7121             : static PyMethodDef py_wbint_AllocateGid_methods[] = {
    7122             :         { "opnum", (PyCFunction)py_wbint_AllocateGid_ndr_opnum, METH_NOARGS|METH_CLASS,
    7123             :                 "winbind.wbint_AllocateGid.opnum() -> 7 (0x07) " },
    7124             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    7125             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    7126             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    7127             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    7128             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    7129             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    7130             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    7131             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    7132             :         { "__ndr_print_in__", (PyCFunction)py_wbint_AllocateGid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    7133             :         { "__ndr_print_out__", (PyCFunction)py_wbint_AllocateGid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    7134             :         { NULL, NULL, 0, NULL }
    7135             : };
    7136             : 
    7137             : 
    7138             : static PyTypeObject wbint_AllocateGid_Type = {
    7139             :         PyVarObject_HEAD_INIT(NULL, 0)
    7140             :         .tp_name = "winbind.wbint_AllocateGid",
    7141             :         .tp_getset = py_wbint_AllocateGid_getsetters,
    7142             :         .tp_methods = py_wbint_AllocateGid_methods,
    7143             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    7144             :         .tp_new = py_wbint_AllocateGid_new,
    7145             : };
    7146             : 
    7147           0 : static bool pack_py_wbint_AllocateGid_args_in(PyObject *args, PyObject *kwargs, struct wbint_AllocateGid *r)
    7148             : {
    7149           0 :         const char *kwnames[] = {
    7150             :                 NULL
    7151             :         };
    7152             : 
    7153           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_AllocateGid", discard_const_p(char *, kwnames))) {
    7154           0 :                 return false;
    7155             :         }
    7156             : 
    7157           0 :         return true;
    7158             : }
    7159             : 
    7160           0 : static PyObject *unpack_py_wbint_AllocateGid_args_out(struct wbint_AllocateGid *r)
    7161             : {
    7162             :         PyObject *result;
    7163             :         PyObject *py_gid;
    7164           0 :         py_gid = PyLong_FromUnsignedLongLong(*r->out.gid);
    7165           0 :         result = py_gid;
    7166           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    7167           0 :                 PyErr_SetNTSTATUS(r->out.result);
    7168           0 :                 return NULL;
    7169             :         }
    7170             : 
    7171           0 :         return result;
    7172             : }
    7173             : 
    7174             : 
    7175           0 : static PyObject *py_wbint_GetNssInfo_in_get_info(PyObject *obj, void *closure)
    7176             : {
    7177           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(obj);
    7178             :         PyObject *py_info;
    7179           0 :         if (object->in.info == NULL) {
    7180           0 :                 Py_RETURN_NONE;
    7181             :         }
    7182           0 :         py_info = pytalloc_reference_ex(&wbint_userinfo_Type, object->in.info, object->in.info);
    7183           0 :         return py_info;
    7184             : }
    7185             : 
    7186           0 : static int py_wbint_GetNssInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
    7187             : {
    7188           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj);
    7189           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
    7190           0 :         if (value == NULL) {
    7191           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
    7192           0 :                 return -1;
    7193             :         }
    7194           0 :         object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
    7195           0 :         if (object->in.info == NULL) {
    7196           0 :                 PyErr_NoMemory();
    7197           0 :                 return -1;
    7198             :         }
    7199           0 :         PY_CHECK_TYPE(&wbint_userinfo_Type, value, return -1;);
    7200           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    7201           0 :                 PyErr_NoMemory();
    7202           0 :                 return -1;
    7203             :         }
    7204           0 :         object->in.info = (struct wbint_userinfo *)pytalloc_get_ptr(value);
    7205           0 :         return 0;
    7206             : }
    7207             : 
    7208           0 : static PyObject *py_wbint_GetNssInfo_out_get_info(PyObject *obj, void *closure)
    7209             : {
    7210           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(obj);
    7211             :         PyObject *py_info;
    7212           0 :         if (object->out.info == NULL) {
    7213           0 :                 Py_RETURN_NONE;
    7214             :         }
    7215           0 :         py_info = pytalloc_reference_ex(&wbint_userinfo_Type, object->out.info, object->out.info);
    7216           0 :         return py_info;
    7217             : }
    7218             : 
    7219           0 : static int py_wbint_GetNssInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
    7220             : {
    7221           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj);
    7222           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
    7223           0 :         if (value == NULL) {
    7224           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
    7225           0 :                 return -1;
    7226             :         }
    7227           0 :         object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
    7228           0 :         if (object->out.info == NULL) {
    7229           0 :                 PyErr_NoMemory();
    7230           0 :                 return -1;
    7231             :         }
    7232           0 :         PY_CHECK_TYPE(&wbint_userinfo_Type, value, return -1;);
    7233           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    7234           0 :                 PyErr_NoMemory();
    7235           0 :                 return -1;
    7236             :         }
    7237           0 :         object->out.info = (struct wbint_userinfo *)pytalloc_get_ptr(value);
    7238           0 :         return 0;
    7239             : }
    7240             : 
    7241           0 : static PyObject *py_wbint_GetNssInfo_get_result(PyObject *obj, void *closure)
    7242             : {
    7243           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(obj);
    7244             :         PyObject *py_result;
    7245           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    7246           0 :         return py_result;
    7247             : }
    7248             : 
    7249           0 : static int py_wbint_GetNssInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
    7250             : {
    7251           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj);
    7252           0 :         if (value == NULL) {
    7253           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    7254           0 :                 return -1;
    7255             :         }
    7256           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    7257           0 :         return 0;
    7258             : }
    7259             : 
    7260             : static PyGetSetDef py_wbint_GetNssInfo_getsetters[] = {
    7261             :         {
    7262             :                 .name = discard_const_p(char, "in_info"),
    7263             :                 .get = py_wbint_GetNssInfo_in_get_info,
    7264             :                 .set = py_wbint_GetNssInfo_in_set_info,
    7265             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_userinfo")
    7266             :         },
    7267             :         {
    7268             :                 .name = discard_const_p(char, "out_info"),
    7269             :                 .get = py_wbint_GetNssInfo_out_get_info,
    7270             :                 .set = py_wbint_GetNssInfo_out_set_info,
    7271             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_userinfo")
    7272             :         },
    7273             :         {
    7274             :                 .name = discard_const_p(char, "result"),
    7275             :                 .get = py_wbint_GetNssInfo_get_result,
    7276             :                 .set = py_wbint_GetNssInfo_set_result,
    7277             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    7278             :         },
    7279             :         { .name = NULL }
    7280             : };
    7281             : 
    7282           0 : static PyObject *py_wbint_GetNssInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    7283             : {
    7284           0 :         PyObject *self = pytalloc_new(struct wbint_GetNssInfo, type);
    7285           0 :         struct wbint_GetNssInfo *_self = (struct wbint_GetNssInfo *)pytalloc_get_ptr(self);
    7286           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    7287           0 :         _self->in.info = talloc_zero(mem_ctx, struct wbint_userinfo);
    7288           0 :         _self->out.info = talloc_zero(mem_ctx, struct wbint_userinfo);
    7289           0 :         return self;
    7290             : }
    7291             : 
    7292           0 : static PyObject *py_wbint_GetNssInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    7293             : {
    7294             : 
    7295             : 
    7296           0 :         return PyLong_FromLong(8);
    7297             : }
    7298             : 
    7299           0 : static PyObject *py_wbint_GetNssInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    7300             : {
    7301           0 :         const struct ndr_interface_call *call = NULL;
    7302           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj);
    7303           0 :         PyObject *ret = NULL;
    7304           0 :         struct ndr_push *push = NULL;
    7305             :         DATA_BLOB blob;
    7306             :         enum ndr_err_code err;
    7307             : 
    7308           0 :         if (ndr_table_winbind.num_calls < 9) {
    7309           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_GetNssInfo_ndr_pack");
    7310           0 :                 return NULL;
    7311             :         }
    7312           0 :         call = &ndr_table_winbind.calls[8];
    7313             : 
    7314           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    7315           0 :         if (push == NULL) {
    7316           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    7317           0 :                 return NULL;
    7318             :         }
    7319             : 
    7320           0 :         push->flags |= ndr_push_flags;
    7321             : 
    7322           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    7323           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    7324           0 :                 TALLOC_FREE(push);
    7325           0 :                 PyErr_SetNdrError(err);
    7326           0 :                 return NULL;
    7327             :         }
    7328           0 :         blob = ndr_push_blob(push);
    7329           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    7330           0 :         TALLOC_FREE(push);
    7331           0 :         return ret;
    7332             : }
    7333             : 
    7334           0 : static PyObject *py_wbint_GetNssInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7335             : {
    7336           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    7337           0 :         PyObject *bigendian_obj = NULL;
    7338           0 :         PyObject *ndr64_obj = NULL;
    7339           0 :         uint32_t ndr_push_flags = 0;
    7340             : 
    7341           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    7342             :                 discard_const_p(char *, kwnames),
    7343             :                 &bigendian_obj,
    7344             :                 &ndr64_obj)) {
    7345           0 :                 return NULL;
    7346             :         }
    7347             : 
    7348           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7349           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    7350             :         }
    7351           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7352           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    7353             :         }
    7354             : 
    7355           0 :         return py_wbint_GetNssInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    7356             : }
    7357             : 
    7358           0 : static PyObject *py_wbint_GetNssInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7359             : {
    7360           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    7361           0 :         PyObject *bigendian_obj = NULL;
    7362           0 :         PyObject *ndr64_obj = NULL;
    7363           0 :         uint32_t ndr_push_flags = 0;
    7364             : 
    7365           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    7366             :                 discard_const_p(char *, kwnames),
    7367             :                 &bigendian_obj,
    7368             :                 &ndr64_obj)) {
    7369           0 :                 return NULL;
    7370             :         }
    7371             : 
    7372           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7373           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    7374             :         }
    7375           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7376           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    7377             :         }
    7378             : 
    7379           0 :         return py_wbint_GetNssInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    7380             : }
    7381             : 
    7382           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)
    7383             : {
    7384           0 :         const struct ndr_interface_call *call = NULL;
    7385           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj);
    7386           0 :         struct ndr_pull *pull = NULL;
    7387             :         enum ndr_err_code err;
    7388             : 
    7389           0 :         if (ndr_table_winbind.num_calls < 9) {
    7390           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_GetNssInfo_ndr_unpack");
    7391           0 :                 return NULL;
    7392             :         }
    7393           0 :         call = &ndr_table_winbind.calls[8];
    7394             : 
    7395           0 :         pull = ndr_pull_init_blob(blob, object);
    7396           0 :         if (pull == NULL) {
    7397           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    7398           0 :                 return NULL;
    7399             :         }
    7400             : 
    7401           0 :         pull->flags |= ndr_pull_flags;
    7402             : 
    7403           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    7404           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    7405           0 :                 TALLOC_FREE(pull);
    7406           0 :                 PyErr_SetNdrError(err);
    7407           0 :                 return NULL;
    7408             :         }
    7409           0 :         if (!allow_remaining) {
    7410             :                 uint32_t highest_ofs;
    7411             : 
    7412           0 :                 if (pull->offset > pull->relative_highest_offset) {
    7413           0 :                         highest_ofs = pull->offset;
    7414             :                 } else {
    7415           0 :                         highest_ofs = pull->relative_highest_offset;
    7416             :                 }
    7417           0 :                 if (highest_ofs < pull->data_size) {
    7418           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    7419             :                                 "not all bytes consumed ofs[%u] size[%u]",
    7420             :                                 highest_ofs, pull->data_size);
    7421           0 :                         TALLOC_FREE(pull);
    7422           0 :                         PyErr_SetNdrError(err);
    7423           0 :                         return NULL;
    7424             :                 }
    7425             :         }
    7426             : 
    7427           0 :         TALLOC_FREE(pull);
    7428           0 :         Py_RETURN_NONE;
    7429             : }
    7430             : 
    7431           0 : static PyObject *py_wbint_GetNssInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7432             : {
    7433             :         DATA_BLOB blob;
    7434           0 :         Py_ssize_t blob_length = 0;
    7435           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    7436           0 :         PyObject *bigendian_obj = NULL;
    7437           0 :         PyObject *ndr64_obj = NULL;
    7438           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    7439           0 :         PyObject *allow_remaining_obj = NULL;
    7440           0 :         bool allow_remaining = false;
    7441             : 
    7442           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    7443             :                 discard_const_p(char *, kwnames),
    7444             :                 &blob.data, &blob_length,
    7445             :                 &bigendian_obj,
    7446             :                 &ndr64_obj,
    7447             :                 &allow_remaining_obj)) {
    7448           0 :                 return NULL;
    7449             :         }
    7450           0 :         blob.length = blob_length;
    7451             : 
    7452           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7453           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    7454             :         }
    7455           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7456           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    7457             :         }
    7458             : 
    7459           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    7460           0 :                 allow_remaining = true;
    7461             :         }
    7462             : 
    7463           0 :         return py_wbint_GetNssInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    7464             : }
    7465             : 
    7466           0 : static PyObject *py_wbint_GetNssInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7467             : {
    7468             :         DATA_BLOB blob;
    7469           0 :         Py_ssize_t blob_length = 0;
    7470           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    7471           0 :         PyObject *bigendian_obj = NULL;
    7472           0 :         PyObject *ndr64_obj = NULL;
    7473           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    7474           0 :         PyObject *allow_remaining_obj = NULL;
    7475           0 :         bool allow_remaining = false;
    7476             : 
    7477           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    7478             :                 discard_const_p(char *, kwnames),
    7479             :                 &blob.data, &blob_length,
    7480             :                 &bigendian_obj,
    7481             :                 &ndr64_obj,
    7482             :                 &allow_remaining_obj)) {
    7483           0 :                 return NULL;
    7484             :         }
    7485           0 :         blob.length = blob_length;
    7486             : 
    7487           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7488           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    7489             :         }
    7490           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7491           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    7492             :         }
    7493             : 
    7494           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    7495           0 :                 allow_remaining = true;
    7496             :         }
    7497             : 
    7498           0 :         return py_wbint_GetNssInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    7499             : }
    7500             : 
    7501           0 : static PyObject *py_wbint_GetNssInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    7502             : {
    7503           0 :         const struct ndr_interface_call *call = NULL;
    7504           0 :         struct wbint_GetNssInfo *object = (struct wbint_GetNssInfo *)pytalloc_get_ptr(py_obj);
    7505             :         PyObject *ret;
    7506             :         char *retstr;
    7507             : 
    7508           0 :         if (ndr_table_winbind.num_calls < 9) {
    7509           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_GetNssInfo_ndr_print");
    7510           0 :                 return NULL;
    7511             :         }
    7512           0 :         call = &ndr_table_winbind.calls[8];
    7513             : 
    7514           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    7515           0 :         ret = PyUnicode_FromString(retstr);
    7516           0 :         TALLOC_FREE(retstr);
    7517             : 
    7518           0 :         return ret;
    7519             : }
    7520             : 
    7521           0 : static PyObject *py_wbint_GetNssInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7522             : {
    7523           0 :         return py_wbint_GetNssInfo_ndr_print(py_obj, "wbint_GetNssInfo_in", NDR_IN);
    7524             : }
    7525             : 
    7526           0 : static PyObject *py_wbint_GetNssInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7527             : {
    7528           0 :         return py_wbint_GetNssInfo_ndr_print(py_obj, "wbint_GetNssInfo_out", NDR_OUT);
    7529             : }
    7530             : 
    7531             : static PyMethodDef py_wbint_GetNssInfo_methods[] = {
    7532             :         { "opnum", (PyCFunction)py_wbint_GetNssInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
    7533             :                 "winbind.wbint_GetNssInfo.opnum() -> 8 (0x08) " },
    7534             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    7535             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    7536             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    7537             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    7538             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    7539             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    7540             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    7541             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    7542             :         { "__ndr_print_in__", (PyCFunction)py_wbint_GetNssInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    7543             :         { "__ndr_print_out__", (PyCFunction)py_wbint_GetNssInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    7544             :         { NULL, NULL, 0, NULL }
    7545             : };
    7546             : 
    7547             : 
    7548             : static PyTypeObject wbint_GetNssInfo_Type = {
    7549             :         PyVarObject_HEAD_INIT(NULL, 0)
    7550             :         .tp_name = "winbind.wbint_GetNssInfo",
    7551             :         .tp_getset = py_wbint_GetNssInfo_getsetters,
    7552             :         .tp_methods = py_wbint_GetNssInfo_methods,
    7553             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    7554             :         .tp_new = py_wbint_GetNssInfo_new,
    7555             : };
    7556             : 
    7557           0 : static bool pack_py_wbint_GetNssInfo_args_in(PyObject *args, PyObject *kwargs, struct wbint_GetNssInfo *r)
    7558             : {
    7559             :         PyObject *py_info;
    7560           0 :         const char *kwnames[] = {
    7561             :                 "info", NULL
    7562             :         };
    7563             : 
    7564           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_GetNssInfo", discard_const_p(char *, kwnames), &py_info)) {
    7565           0 :                 return false;
    7566             :         }
    7567             : 
    7568           0 :         if (py_info == NULL) {
    7569           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
    7570           0 :                 return false;
    7571             :         }
    7572           0 :         r->in.info = talloc_ptrtype(r, r->in.info);
    7573           0 :         if (r->in.info == NULL) {
    7574           0 :                 PyErr_NoMemory();
    7575           0 :                 return false;
    7576             :         }
    7577           0 :         PY_CHECK_TYPE(&wbint_userinfo_Type, py_info, return false;);
    7578           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
    7579           0 :                 PyErr_NoMemory();
    7580           0 :                 return false;
    7581             :         }
    7582           0 :         r->in.info = (struct wbint_userinfo *)pytalloc_get_ptr(py_info);
    7583           0 :         return true;
    7584             : }
    7585             : 
    7586           0 : static PyObject *unpack_py_wbint_GetNssInfo_args_out(struct wbint_GetNssInfo *r)
    7587             : {
    7588             :         PyObject *result;
    7589             :         PyObject *py_info;
    7590           0 :         py_info = pytalloc_reference_ex(&wbint_userinfo_Type, r->out.info, r->out.info);
    7591           0 :         result = py_info;
    7592           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    7593           0 :                 PyErr_SetNTSTATUS(r->out.result);
    7594           0 :                 return NULL;
    7595             :         }
    7596             : 
    7597           0 :         return result;
    7598             : }
    7599             : 
    7600             : 
    7601           0 : static PyObject *py_wbint_LookupUserAliases_in_get_sids(PyObject *obj, void *closure)
    7602             : {
    7603           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(obj);
    7604             :         PyObject *py_sids;
    7605           0 :         if (object->in.sids == NULL) {
    7606           0 :                 Py_RETURN_NONE;
    7607             :         }
    7608           0 :         py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, object->in.sids, object->in.sids);
    7609           0 :         return py_sids;
    7610             : }
    7611             : 
    7612           0 : static int py_wbint_LookupUserAliases_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
    7613             : {
    7614           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj);
    7615           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
    7616           0 :         if (value == NULL) {
    7617           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
    7618           0 :                 return -1;
    7619             :         }
    7620           0 :         object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
    7621           0 :         if (object->in.sids == NULL) {
    7622           0 :                 PyErr_NoMemory();
    7623           0 :                 return -1;
    7624             :         }
    7625           0 :         PY_CHECK_TYPE(&wbint_SidArray_Type, value, return -1;);
    7626           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    7627           0 :                 PyErr_NoMemory();
    7628           0 :                 return -1;
    7629             :         }
    7630           0 :         object->in.sids = (struct wbint_SidArray *)pytalloc_get_ptr(value);
    7631           0 :         return 0;
    7632             : }
    7633             : 
    7634           0 : static PyObject *py_wbint_LookupUserAliases_out_get_rids(PyObject *obj, void *closure)
    7635             : {
    7636           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(obj);
    7637             :         PyObject *py_rids;
    7638           0 :         if (object->out.rids == NULL) {
    7639           0 :                 Py_RETURN_NONE;
    7640             :         }
    7641           0 :         py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, object->out.rids, object->out.rids);
    7642           0 :         return py_rids;
    7643             : }
    7644             : 
    7645           0 : static int py_wbint_LookupUserAliases_out_set_rids(PyObject *py_obj, PyObject *value, void *closure)
    7646             : {
    7647           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj);
    7648           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids));
    7649           0 :         if (value == NULL) {
    7650           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids");
    7651           0 :                 return -1;
    7652             :         }
    7653           0 :         object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids);
    7654           0 :         if (object->out.rids == NULL) {
    7655           0 :                 PyErr_NoMemory();
    7656           0 :                 return -1;
    7657             :         }
    7658           0 :         PY_CHECK_TYPE(&wbint_RidArray_Type, value, return -1;);
    7659           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    7660           0 :                 PyErr_NoMemory();
    7661           0 :                 return -1;
    7662             :         }
    7663           0 :         object->out.rids = (struct wbint_RidArray *)pytalloc_get_ptr(value);
    7664           0 :         return 0;
    7665             : }
    7666             : 
    7667           0 : static PyObject *py_wbint_LookupUserAliases_get_result(PyObject *obj, void *closure)
    7668             : {
    7669           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(obj);
    7670             :         PyObject *py_result;
    7671           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    7672           0 :         return py_result;
    7673             : }
    7674             : 
    7675           0 : static int py_wbint_LookupUserAliases_set_result(PyObject *py_obj, PyObject *value, void *closure)
    7676             : {
    7677           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj);
    7678           0 :         if (value == NULL) {
    7679           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    7680           0 :                 return -1;
    7681             :         }
    7682           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    7683           0 :         return 0;
    7684             : }
    7685             : 
    7686             : static PyGetSetDef py_wbint_LookupUserAliases_getsetters[] = {
    7687             :         {
    7688             :                 .name = discard_const_p(char, "in_sids"),
    7689             :                 .get = py_wbint_LookupUserAliases_in_get_sids,
    7690             :                 .set = py_wbint_LookupUserAliases_in_set_sids,
    7691             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_SidArray")
    7692             :         },
    7693             :         {
    7694             :                 .name = discard_const_p(char, "out_rids"),
    7695             :                 .get = py_wbint_LookupUserAliases_out_get_rids,
    7696             :                 .set = py_wbint_LookupUserAliases_out_set_rids,
    7697             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_RidArray")
    7698             :         },
    7699             :         {
    7700             :                 .name = discard_const_p(char, "result"),
    7701             :                 .get = py_wbint_LookupUserAliases_get_result,
    7702             :                 .set = py_wbint_LookupUserAliases_set_result,
    7703             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    7704             :         },
    7705             :         { .name = NULL }
    7706             : };
    7707             : 
    7708           0 : static PyObject *py_wbint_LookupUserAliases_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    7709             : {
    7710           0 :         PyObject *self = pytalloc_new(struct wbint_LookupUserAliases, type);
    7711           0 :         struct wbint_LookupUserAliases *_self = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(self);
    7712           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    7713           0 :         _self->in.sids = talloc_zero(mem_ctx, struct wbint_SidArray);
    7714           0 :         _self->out.rids = talloc_zero(mem_ctx, struct wbint_RidArray);
    7715           0 :         return self;
    7716             : }
    7717             : 
    7718           0 : static PyObject *py_wbint_LookupUserAliases_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    7719             : {
    7720             : 
    7721             : 
    7722           0 :         return PyLong_FromLong(9);
    7723             : }
    7724             : 
    7725           0 : static PyObject *py_wbint_LookupUserAliases_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    7726             : {
    7727           0 :         const struct ndr_interface_call *call = NULL;
    7728           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj);
    7729           0 :         PyObject *ret = NULL;
    7730           0 :         struct ndr_push *push = NULL;
    7731             :         DATA_BLOB blob;
    7732             :         enum ndr_err_code err;
    7733             : 
    7734           0 :         if (ndr_table_winbind.num_calls < 10) {
    7735           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserAliases_ndr_pack");
    7736           0 :                 return NULL;
    7737             :         }
    7738           0 :         call = &ndr_table_winbind.calls[9];
    7739             : 
    7740           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    7741           0 :         if (push == NULL) {
    7742           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    7743           0 :                 return NULL;
    7744             :         }
    7745             : 
    7746           0 :         push->flags |= ndr_push_flags;
    7747             : 
    7748           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    7749           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    7750           0 :                 TALLOC_FREE(push);
    7751           0 :                 PyErr_SetNdrError(err);
    7752           0 :                 return NULL;
    7753             :         }
    7754           0 :         blob = ndr_push_blob(push);
    7755           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    7756           0 :         TALLOC_FREE(push);
    7757           0 :         return ret;
    7758             : }
    7759             : 
    7760           0 : static PyObject *py_wbint_LookupUserAliases_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7761             : {
    7762           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    7763           0 :         PyObject *bigendian_obj = NULL;
    7764           0 :         PyObject *ndr64_obj = NULL;
    7765           0 :         uint32_t ndr_push_flags = 0;
    7766             : 
    7767           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    7768             :                 discard_const_p(char *, kwnames),
    7769             :                 &bigendian_obj,
    7770             :                 &ndr64_obj)) {
    7771           0 :                 return NULL;
    7772             :         }
    7773             : 
    7774           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7775           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    7776             :         }
    7777           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7778           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    7779             :         }
    7780             : 
    7781           0 :         return py_wbint_LookupUserAliases_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    7782             : }
    7783             : 
    7784           0 : static PyObject *py_wbint_LookupUserAliases_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7785             : {
    7786           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    7787           0 :         PyObject *bigendian_obj = NULL;
    7788           0 :         PyObject *ndr64_obj = NULL;
    7789           0 :         uint32_t ndr_push_flags = 0;
    7790             : 
    7791           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    7792             :                 discard_const_p(char *, kwnames),
    7793             :                 &bigendian_obj,
    7794             :                 &ndr64_obj)) {
    7795           0 :                 return NULL;
    7796             :         }
    7797             : 
    7798           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7799           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    7800             :         }
    7801           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7802           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    7803             :         }
    7804             : 
    7805           0 :         return py_wbint_LookupUserAliases_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    7806             : }
    7807             : 
    7808           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)
    7809             : {
    7810           0 :         const struct ndr_interface_call *call = NULL;
    7811           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj);
    7812           0 :         struct ndr_pull *pull = NULL;
    7813             :         enum ndr_err_code err;
    7814             : 
    7815           0 :         if (ndr_table_winbind.num_calls < 10) {
    7816           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserAliases_ndr_unpack");
    7817           0 :                 return NULL;
    7818             :         }
    7819           0 :         call = &ndr_table_winbind.calls[9];
    7820             : 
    7821           0 :         pull = ndr_pull_init_blob(blob, object);
    7822           0 :         if (pull == NULL) {
    7823           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    7824           0 :                 return NULL;
    7825             :         }
    7826             : 
    7827           0 :         pull->flags |= ndr_pull_flags;
    7828             : 
    7829           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    7830           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    7831           0 :                 TALLOC_FREE(pull);
    7832           0 :                 PyErr_SetNdrError(err);
    7833           0 :                 return NULL;
    7834             :         }
    7835           0 :         if (!allow_remaining) {
    7836             :                 uint32_t highest_ofs;
    7837             : 
    7838           0 :                 if (pull->offset > pull->relative_highest_offset) {
    7839           0 :                         highest_ofs = pull->offset;
    7840             :                 } else {
    7841           0 :                         highest_ofs = pull->relative_highest_offset;
    7842             :                 }
    7843           0 :                 if (highest_ofs < pull->data_size) {
    7844           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    7845             :                                 "not all bytes consumed ofs[%u] size[%u]",
    7846             :                                 highest_ofs, pull->data_size);
    7847           0 :                         TALLOC_FREE(pull);
    7848           0 :                         PyErr_SetNdrError(err);
    7849           0 :                         return NULL;
    7850             :                 }
    7851             :         }
    7852             : 
    7853           0 :         TALLOC_FREE(pull);
    7854           0 :         Py_RETURN_NONE;
    7855             : }
    7856             : 
    7857           0 : static PyObject *py_wbint_LookupUserAliases_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7858             : {
    7859             :         DATA_BLOB blob;
    7860           0 :         Py_ssize_t blob_length = 0;
    7861           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    7862           0 :         PyObject *bigendian_obj = NULL;
    7863           0 :         PyObject *ndr64_obj = NULL;
    7864           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    7865           0 :         PyObject *allow_remaining_obj = NULL;
    7866           0 :         bool allow_remaining = false;
    7867             : 
    7868           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    7869             :                 discard_const_p(char *, kwnames),
    7870             :                 &blob.data, &blob_length,
    7871             :                 &bigendian_obj,
    7872             :                 &ndr64_obj,
    7873             :                 &allow_remaining_obj)) {
    7874           0 :                 return NULL;
    7875             :         }
    7876           0 :         blob.length = blob_length;
    7877             : 
    7878           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7879           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    7880             :         }
    7881           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7882           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    7883             :         }
    7884             : 
    7885           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    7886           0 :                 allow_remaining = true;
    7887             :         }
    7888             : 
    7889           0 :         return py_wbint_LookupUserAliases_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    7890             : }
    7891             : 
    7892           0 : static PyObject *py_wbint_LookupUserAliases_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    7893             : {
    7894             :         DATA_BLOB blob;
    7895           0 :         Py_ssize_t blob_length = 0;
    7896           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    7897           0 :         PyObject *bigendian_obj = NULL;
    7898           0 :         PyObject *ndr64_obj = NULL;
    7899           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    7900           0 :         PyObject *allow_remaining_obj = NULL;
    7901           0 :         bool allow_remaining = false;
    7902             : 
    7903           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    7904             :                 discard_const_p(char *, kwnames),
    7905             :                 &blob.data, &blob_length,
    7906             :                 &bigendian_obj,
    7907             :                 &ndr64_obj,
    7908             :                 &allow_remaining_obj)) {
    7909           0 :                 return NULL;
    7910             :         }
    7911           0 :         blob.length = blob_length;
    7912             : 
    7913           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    7914           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    7915             :         }
    7916           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    7917           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    7918             :         }
    7919             : 
    7920           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    7921           0 :                 allow_remaining = true;
    7922             :         }
    7923             : 
    7924           0 :         return py_wbint_LookupUserAliases_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    7925             : }
    7926             : 
    7927           0 : static PyObject *py_wbint_LookupUserAliases_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    7928             : {
    7929           0 :         const struct ndr_interface_call *call = NULL;
    7930           0 :         struct wbint_LookupUserAliases *object = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(py_obj);
    7931             :         PyObject *ret;
    7932             :         char *retstr;
    7933             : 
    7934           0 :         if (ndr_table_winbind.num_calls < 10) {
    7935           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserAliases_ndr_print");
    7936           0 :                 return NULL;
    7937             :         }
    7938           0 :         call = &ndr_table_winbind.calls[9];
    7939             : 
    7940           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    7941           0 :         ret = PyUnicode_FromString(retstr);
    7942           0 :         TALLOC_FREE(retstr);
    7943             : 
    7944           0 :         return ret;
    7945             : }
    7946             : 
    7947           0 : static PyObject *py_wbint_LookupUserAliases_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7948             : {
    7949           0 :         return py_wbint_LookupUserAliases_ndr_print(py_obj, "wbint_LookupUserAliases_in", NDR_IN);
    7950             : }
    7951             : 
    7952           0 : static PyObject *py_wbint_LookupUserAliases_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    7953             : {
    7954           0 :         return py_wbint_LookupUserAliases_ndr_print(py_obj, "wbint_LookupUserAliases_out", NDR_OUT);
    7955             : }
    7956             : 
    7957             : static PyMethodDef py_wbint_LookupUserAliases_methods[] = {
    7958             :         { "opnum", (PyCFunction)py_wbint_LookupUserAliases_ndr_opnum, METH_NOARGS|METH_CLASS,
    7959             :                 "winbind.wbint_LookupUserAliases.opnum() -> 9 (0x09) " },
    7960             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    7961             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    7962             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    7963             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    7964             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    7965             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    7966             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    7967             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    7968             :         { "__ndr_print_in__", (PyCFunction)py_wbint_LookupUserAliases_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    7969             :         { "__ndr_print_out__", (PyCFunction)py_wbint_LookupUserAliases_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    7970             :         { NULL, NULL, 0, NULL }
    7971             : };
    7972             : 
    7973             : 
    7974             : static PyTypeObject wbint_LookupUserAliases_Type = {
    7975             :         PyVarObject_HEAD_INIT(NULL, 0)
    7976             :         .tp_name = "winbind.wbint_LookupUserAliases",
    7977             :         .tp_getset = py_wbint_LookupUserAliases_getsetters,
    7978             :         .tp_methods = py_wbint_LookupUserAliases_methods,
    7979             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    7980             :         .tp_new = py_wbint_LookupUserAliases_new,
    7981             : };
    7982             : 
    7983           0 : static bool pack_py_wbint_LookupUserAliases_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupUserAliases *r)
    7984             : {
    7985             :         PyObject *py_sids;
    7986           0 :         const char *kwnames[] = {
    7987             :                 "sids", NULL
    7988             :         };
    7989             : 
    7990           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupUserAliases", discard_const_p(char *, kwnames), &py_sids)) {
    7991           0 :                 return false;
    7992             :         }
    7993             : 
    7994           0 :         if (py_sids == NULL) {
    7995           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
    7996           0 :                 return false;
    7997             :         }
    7998           0 :         r->in.sids = talloc_ptrtype(r, r->in.sids);
    7999           0 :         if (r->in.sids == NULL) {
    8000           0 :                 PyErr_NoMemory();
    8001           0 :                 return false;
    8002             :         }
    8003           0 :         PY_CHECK_TYPE(&wbint_SidArray_Type, py_sids, return false;);
    8004           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
    8005           0 :                 PyErr_NoMemory();
    8006           0 :                 return false;
    8007             :         }
    8008           0 :         r->in.sids = (struct wbint_SidArray *)pytalloc_get_ptr(py_sids);
    8009           0 :         return true;
    8010             : }
    8011             : 
    8012           0 : static PyObject *unpack_py_wbint_LookupUserAliases_args_out(struct wbint_LookupUserAliases *r)
    8013             : {
    8014             :         PyObject *result;
    8015             :         PyObject *py_rids;
    8016           0 :         py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, r->out.rids, r->out.rids);
    8017           0 :         result = py_rids;
    8018           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    8019           0 :                 PyErr_SetNTSTATUS(r->out.result);
    8020           0 :                 return NULL;
    8021             :         }
    8022             : 
    8023           0 :         return result;
    8024             : }
    8025             : 
    8026             : 
    8027           0 : static PyObject *py_wbint_LookupUserGroups_in_get_sid(PyObject *obj, void *closure)
    8028             : {
    8029           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(obj);
    8030             :         PyObject *py_sid;
    8031           0 :         if (object->in.sid == NULL) {
    8032           0 :                 Py_RETURN_NONE;
    8033             :         }
    8034           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
    8035           0 :         return py_sid;
    8036             : }
    8037             : 
    8038           0 : static int py_wbint_LookupUserGroups_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
    8039             : {
    8040           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj);
    8041           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
    8042           0 :         if (value == NULL) {
    8043           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
    8044           0 :                 return -1;
    8045             :         }
    8046           0 :         object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
    8047           0 :         if (object->in.sid == NULL) {
    8048           0 :                 PyErr_NoMemory();
    8049           0 :                 return -1;
    8050             :         }
    8051           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    8052           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    8053           0 :                 PyErr_NoMemory();
    8054           0 :                 return -1;
    8055             :         }
    8056           0 :         object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
    8057           0 :         return 0;
    8058             : }
    8059             : 
    8060           0 : static PyObject *py_wbint_LookupUserGroups_out_get_sids(PyObject *obj, void *closure)
    8061             : {
    8062           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(obj);
    8063             :         PyObject *py_sids;
    8064           0 :         if (object->out.sids == NULL) {
    8065           0 :                 Py_RETURN_NONE;
    8066             :         }
    8067           0 :         py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, object->out.sids, object->out.sids);
    8068           0 :         return py_sids;
    8069             : }
    8070             : 
    8071           0 : static int py_wbint_LookupUserGroups_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
    8072             : {
    8073           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj);
    8074           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
    8075           0 :         if (value == NULL) {
    8076           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
    8077           0 :                 return -1;
    8078             :         }
    8079           0 :         object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
    8080           0 :         if (object->out.sids == NULL) {
    8081           0 :                 PyErr_NoMemory();
    8082           0 :                 return -1;
    8083             :         }
    8084           0 :         PY_CHECK_TYPE(&wbint_SidArray_Type, value, return -1;);
    8085           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    8086           0 :                 PyErr_NoMemory();
    8087           0 :                 return -1;
    8088             :         }
    8089           0 :         object->out.sids = (struct wbint_SidArray *)pytalloc_get_ptr(value);
    8090           0 :         return 0;
    8091             : }
    8092             : 
    8093           0 : static PyObject *py_wbint_LookupUserGroups_get_result(PyObject *obj, void *closure)
    8094             : {
    8095           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(obj);
    8096             :         PyObject *py_result;
    8097           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    8098           0 :         return py_result;
    8099             : }
    8100             : 
    8101           0 : static int py_wbint_LookupUserGroups_set_result(PyObject *py_obj, PyObject *value, void *closure)
    8102             : {
    8103           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj);
    8104           0 :         if (value == NULL) {
    8105           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    8106           0 :                 return -1;
    8107             :         }
    8108           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    8109           0 :         return 0;
    8110             : }
    8111             : 
    8112             : static PyGetSetDef py_wbint_LookupUserGroups_getsetters[] = {
    8113             :         {
    8114             :                 .name = discard_const_p(char, "in_sid"),
    8115             :                 .get = py_wbint_LookupUserGroups_in_get_sid,
    8116             :                 .set = py_wbint_LookupUserGroups_in_set_sid,
    8117             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    8118             :         },
    8119             :         {
    8120             :                 .name = discard_const_p(char, "out_sids"),
    8121             :                 .get = py_wbint_LookupUserGroups_out_get_sids,
    8122             :                 .set = py_wbint_LookupUserGroups_out_set_sids,
    8123             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_SidArray")
    8124             :         },
    8125             :         {
    8126             :                 .name = discard_const_p(char, "result"),
    8127             :                 .get = py_wbint_LookupUserGroups_get_result,
    8128             :                 .set = py_wbint_LookupUserGroups_set_result,
    8129             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    8130             :         },
    8131             :         { .name = NULL }
    8132             : };
    8133             : 
    8134           0 : static PyObject *py_wbint_LookupUserGroups_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    8135             : {
    8136           0 :         PyObject *self = pytalloc_new(struct wbint_LookupUserGroups, type);
    8137           0 :         struct wbint_LookupUserGroups *_self = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(self);
    8138           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    8139           0 :         _self->in.sid = talloc_zero(mem_ctx, struct dom_sid);
    8140           0 :         _self->out.sids = talloc_zero(mem_ctx, struct wbint_SidArray);
    8141           0 :         return self;
    8142             : }
    8143             : 
    8144           0 : static PyObject *py_wbint_LookupUserGroups_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    8145             : {
    8146             : 
    8147             : 
    8148           0 :         return PyLong_FromLong(10);
    8149             : }
    8150             : 
    8151           0 : static PyObject *py_wbint_LookupUserGroups_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    8152             : {
    8153           0 :         const struct ndr_interface_call *call = NULL;
    8154           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj);
    8155           0 :         PyObject *ret = NULL;
    8156           0 :         struct ndr_push *push = NULL;
    8157             :         DATA_BLOB blob;
    8158             :         enum ndr_err_code err;
    8159             : 
    8160           0 :         if (ndr_table_winbind.num_calls < 11) {
    8161           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserGroups_ndr_pack");
    8162           0 :                 return NULL;
    8163             :         }
    8164           0 :         call = &ndr_table_winbind.calls[10];
    8165             : 
    8166           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    8167           0 :         if (push == NULL) {
    8168           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    8169           0 :                 return NULL;
    8170             :         }
    8171             : 
    8172           0 :         push->flags |= ndr_push_flags;
    8173             : 
    8174           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    8175           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8176           0 :                 TALLOC_FREE(push);
    8177           0 :                 PyErr_SetNdrError(err);
    8178           0 :                 return NULL;
    8179             :         }
    8180           0 :         blob = ndr_push_blob(push);
    8181           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    8182           0 :         TALLOC_FREE(push);
    8183           0 :         return ret;
    8184             : }
    8185             : 
    8186           0 : static PyObject *py_wbint_LookupUserGroups_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8187             : {
    8188           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    8189           0 :         PyObject *bigendian_obj = NULL;
    8190           0 :         PyObject *ndr64_obj = NULL;
    8191           0 :         uint32_t ndr_push_flags = 0;
    8192             : 
    8193           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    8194             :                 discard_const_p(char *, kwnames),
    8195             :                 &bigendian_obj,
    8196             :                 &ndr64_obj)) {
    8197           0 :                 return NULL;
    8198             :         }
    8199             : 
    8200           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8201           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    8202             :         }
    8203           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8204           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    8205             :         }
    8206             : 
    8207           0 :         return py_wbint_LookupUserGroups_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    8208             : }
    8209             : 
    8210           0 : static PyObject *py_wbint_LookupUserGroups_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8211             : {
    8212           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    8213           0 :         PyObject *bigendian_obj = NULL;
    8214           0 :         PyObject *ndr64_obj = NULL;
    8215           0 :         uint32_t ndr_push_flags = 0;
    8216             : 
    8217           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    8218             :                 discard_const_p(char *, kwnames),
    8219             :                 &bigendian_obj,
    8220             :                 &ndr64_obj)) {
    8221           0 :                 return NULL;
    8222             :         }
    8223             : 
    8224           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8225           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    8226             :         }
    8227           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8228           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    8229             :         }
    8230             : 
    8231           0 :         return py_wbint_LookupUserGroups_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    8232             : }
    8233             : 
    8234           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)
    8235             : {
    8236           0 :         const struct ndr_interface_call *call = NULL;
    8237           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj);
    8238           0 :         struct ndr_pull *pull = NULL;
    8239             :         enum ndr_err_code err;
    8240             : 
    8241           0 :         if (ndr_table_winbind.num_calls < 11) {
    8242           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserGroups_ndr_unpack");
    8243           0 :                 return NULL;
    8244             :         }
    8245           0 :         call = &ndr_table_winbind.calls[10];
    8246             : 
    8247           0 :         pull = ndr_pull_init_blob(blob, object);
    8248           0 :         if (pull == NULL) {
    8249           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    8250           0 :                 return NULL;
    8251             :         }
    8252             : 
    8253           0 :         pull->flags |= ndr_pull_flags;
    8254             : 
    8255           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    8256           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8257           0 :                 TALLOC_FREE(pull);
    8258           0 :                 PyErr_SetNdrError(err);
    8259           0 :                 return NULL;
    8260             :         }
    8261           0 :         if (!allow_remaining) {
    8262             :                 uint32_t highest_ofs;
    8263             : 
    8264           0 :                 if (pull->offset > pull->relative_highest_offset) {
    8265           0 :                         highest_ofs = pull->offset;
    8266             :                 } else {
    8267           0 :                         highest_ofs = pull->relative_highest_offset;
    8268             :                 }
    8269           0 :                 if (highest_ofs < pull->data_size) {
    8270           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    8271             :                                 "not all bytes consumed ofs[%u] size[%u]",
    8272             :                                 highest_ofs, pull->data_size);
    8273           0 :                         TALLOC_FREE(pull);
    8274           0 :                         PyErr_SetNdrError(err);
    8275           0 :                         return NULL;
    8276             :                 }
    8277             :         }
    8278             : 
    8279           0 :         TALLOC_FREE(pull);
    8280           0 :         Py_RETURN_NONE;
    8281             : }
    8282             : 
    8283           0 : static PyObject *py_wbint_LookupUserGroups_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8284             : {
    8285             :         DATA_BLOB blob;
    8286           0 :         Py_ssize_t blob_length = 0;
    8287           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    8288           0 :         PyObject *bigendian_obj = NULL;
    8289           0 :         PyObject *ndr64_obj = NULL;
    8290           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    8291           0 :         PyObject *allow_remaining_obj = NULL;
    8292           0 :         bool allow_remaining = false;
    8293             : 
    8294           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    8295             :                 discard_const_p(char *, kwnames),
    8296             :                 &blob.data, &blob_length,
    8297             :                 &bigendian_obj,
    8298             :                 &ndr64_obj,
    8299             :                 &allow_remaining_obj)) {
    8300           0 :                 return NULL;
    8301             :         }
    8302           0 :         blob.length = blob_length;
    8303             : 
    8304           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8305           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    8306             :         }
    8307           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8308           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    8309             :         }
    8310             : 
    8311           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    8312           0 :                 allow_remaining = true;
    8313             :         }
    8314             : 
    8315           0 :         return py_wbint_LookupUserGroups_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    8316             : }
    8317             : 
    8318           0 : static PyObject *py_wbint_LookupUserGroups_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8319             : {
    8320             :         DATA_BLOB blob;
    8321           0 :         Py_ssize_t blob_length = 0;
    8322           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    8323           0 :         PyObject *bigendian_obj = NULL;
    8324           0 :         PyObject *ndr64_obj = NULL;
    8325           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    8326           0 :         PyObject *allow_remaining_obj = NULL;
    8327           0 :         bool allow_remaining = false;
    8328             : 
    8329           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    8330             :                 discard_const_p(char *, kwnames),
    8331             :                 &blob.data, &blob_length,
    8332             :                 &bigendian_obj,
    8333             :                 &ndr64_obj,
    8334             :                 &allow_remaining_obj)) {
    8335           0 :                 return NULL;
    8336             :         }
    8337           0 :         blob.length = blob_length;
    8338             : 
    8339           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8340           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    8341             :         }
    8342           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8343           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    8344             :         }
    8345             : 
    8346           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    8347           0 :                 allow_remaining = true;
    8348             :         }
    8349             : 
    8350           0 :         return py_wbint_LookupUserGroups_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    8351             : }
    8352             : 
    8353           0 : static PyObject *py_wbint_LookupUserGroups_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    8354             : {
    8355           0 :         const struct ndr_interface_call *call = NULL;
    8356           0 :         struct wbint_LookupUserGroups *object = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(py_obj);
    8357             :         PyObject *ret;
    8358             :         char *retstr;
    8359             : 
    8360           0 :         if (ndr_table_winbind.num_calls < 11) {
    8361           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserGroups_ndr_print");
    8362           0 :                 return NULL;
    8363             :         }
    8364           0 :         call = &ndr_table_winbind.calls[10];
    8365             : 
    8366           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    8367           0 :         ret = PyUnicode_FromString(retstr);
    8368           0 :         TALLOC_FREE(retstr);
    8369             : 
    8370           0 :         return ret;
    8371             : }
    8372             : 
    8373           0 : static PyObject *py_wbint_LookupUserGroups_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    8374             : {
    8375           0 :         return py_wbint_LookupUserGroups_ndr_print(py_obj, "wbint_LookupUserGroups_in", NDR_IN);
    8376             : }
    8377             : 
    8378           0 : static PyObject *py_wbint_LookupUserGroups_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    8379             : {
    8380           0 :         return py_wbint_LookupUserGroups_ndr_print(py_obj, "wbint_LookupUserGroups_out", NDR_OUT);
    8381             : }
    8382             : 
    8383             : static PyMethodDef py_wbint_LookupUserGroups_methods[] = {
    8384             :         { "opnum", (PyCFunction)py_wbint_LookupUserGroups_ndr_opnum, METH_NOARGS|METH_CLASS,
    8385             :                 "winbind.wbint_LookupUserGroups.opnum() -> 10 (0x0a) " },
    8386             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    8387             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    8388             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    8389             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    8390             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    8391             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    8392             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    8393             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    8394             :         { "__ndr_print_in__", (PyCFunction)py_wbint_LookupUserGroups_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    8395             :         { "__ndr_print_out__", (PyCFunction)py_wbint_LookupUserGroups_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    8396             :         { NULL, NULL, 0, NULL }
    8397             : };
    8398             : 
    8399             : 
    8400             : static PyTypeObject wbint_LookupUserGroups_Type = {
    8401             :         PyVarObject_HEAD_INIT(NULL, 0)
    8402             :         .tp_name = "winbind.wbint_LookupUserGroups",
    8403             :         .tp_getset = py_wbint_LookupUserGroups_getsetters,
    8404             :         .tp_methods = py_wbint_LookupUserGroups_methods,
    8405             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    8406             :         .tp_new = py_wbint_LookupUserGroups_new,
    8407             : };
    8408             : 
    8409           0 : static bool pack_py_wbint_LookupUserGroups_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupUserGroups *r)
    8410             : {
    8411             :         PyObject *py_sid;
    8412           0 :         const char *kwnames[] = {
    8413             :                 "sid", NULL
    8414             :         };
    8415             : 
    8416           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupUserGroups", discard_const_p(char *, kwnames), &py_sid)) {
    8417           0 :                 return false;
    8418             :         }
    8419             : 
    8420           0 :         if (py_sid == NULL) {
    8421           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
    8422           0 :                 return false;
    8423             :         }
    8424           0 :         r->in.sid = talloc_ptrtype(r, r->in.sid);
    8425           0 :         if (r->in.sid == NULL) {
    8426           0 :                 PyErr_NoMemory();
    8427           0 :                 return false;
    8428             :         }
    8429           0 :         PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
    8430           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
    8431           0 :                 PyErr_NoMemory();
    8432           0 :                 return false;
    8433             :         }
    8434           0 :         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
    8435           0 :         return true;
    8436             : }
    8437             : 
    8438           0 : static PyObject *unpack_py_wbint_LookupUserGroups_args_out(struct wbint_LookupUserGroups *r)
    8439             : {
    8440             :         PyObject *result;
    8441             :         PyObject *py_sids;
    8442           0 :         py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, r->out.sids, r->out.sids);
    8443           0 :         result = py_sids;
    8444           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    8445           0 :                 PyErr_SetNTSTATUS(r->out.result);
    8446           0 :                 return NULL;
    8447             :         }
    8448             : 
    8449           0 :         return result;
    8450             : }
    8451             : 
    8452             : 
    8453           0 : static PyObject *py_wbint_QuerySequenceNumber_out_get_sequence(PyObject *obj, void *closure)
    8454             : {
    8455           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(obj);
    8456             :         PyObject *py_sequence;
    8457           0 :         if (object->out.sequence == NULL) {
    8458           0 :                 Py_RETURN_NONE;
    8459             :         }
    8460           0 :         py_sequence = PyLong_FromUnsignedLongLong((uint32_t)*object->out.sequence);
    8461           0 :         return py_sequence;
    8462             : }
    8463             : 
    8464           0 : static int py_wbint_QuerySequenceNumber_out_set_sequence(PyObject *py_obj, PyObject *value, void *closure)
    8465             : {
    8466           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj);
    8467           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sequence));
    8468           0 :         if (value == NULL) {
    8469           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sequence");
    8470           0 :                 return -1;
    8471             :         }
    8472           0 :         object->out.sequence = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sequence);
    8473           0 :         if (object->out.sequence == NULL) {
    8474           0 :                 PyErr_NoMemory();
    8475           0 :                 return -1;
    8476             :         }
    8477             :         {
    8478           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.sequence));
    8479           0 :                 if (PyLong_Check(value)) {
    8480             :                         unsigned long long test_var;
    8481           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8482           0 :                         if (PyErr_Occurred() != NULL) {
    8483           0 :                                 return -1;
    8484             :                         }
    8485           0 :                         if (test_var > uint_max) {
    8486           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    8487             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8488           0 :                                 return -1;
    8489             :                         }
    8490           0 :                         *object->out.sequence = test_var;
    8491             :                 } else {
    8492           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    8493             :                           PyLong_Type.tp_name);
    8494           0 :                         return -1;
    8495             :                 }
    8496             :         }
    8497           0 :         return 0;
    8498             : }
    8499             : 
    8500           0 : static PyObject *py_wbint_QuerySequenceNumber_get_result(PyObject *obj, void *closure)
    8501             : {
    8502           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(obj);
    8503             :         PyObject *py_result;
    8504           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    8505           0 :         return py_result;
    8506             : }
    8507             : 
    8508           0 : static int py_wbint_QuerySequenceNumber_set_result(PyObject *py_obj, PyObject *value, void *closure)
    8509             : {
    8510           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj);
    8511           0 :         if (value == NULL) {
    8512           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    8513           0 :                 return -1;
    8514             :         }
    8515           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    8516           0 :         return 0;
    8517             : }
    8518             : 
    8519             : static PyGetSetDef py_wbint_QuerySequenceNumber_getsetters[] = {
    8520             :         {
    8521             :                 .name = discard_const_p(char, "out_sequence"),
    8522             :                 .get = py_wbint_QuerySequenceNumber_out_get_sequence,
    8523             :                 .set = py_wbint_QuerySequenceNumber_out_set_sequence,
    8524             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    8525             :         },
    8526             :         {
    8527             :                 .name = discard_const_p(char, "result"),
    8528             :                 .get = py_wbint_QuerySequenceNumber_get_result,
    8529             :                 .set = py_wbint_QuerySequenceNumber_set_result,
    8530             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    8531             :         },
    8532             :         { .name = NULL }
    8533             : };
    8534             : 
    8535           0 : static PyObject *py_wbint_QuerySequenceNumber_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    8536             : {
    8537           0 :         PyObject *self = pytalloc_new(struct wbint_QuerySequenceNumber, type);
    8538           0 :         struct wbint_QuerySequenceNumber *_self = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(self);
    8539           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    8540           0 :         _self->out.sequence = talloc_zero(mem_ctx, uint32_t);
    8541           0 :         return self;
    8542             : }
    8543             : 
    8544           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    8545             : {
    8546             : 
    8547             : 
    8548           0 :         return PyLong_FromLong(11);
    8549             : }
    8550             : 
    8551           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    8552             : {
    8553           0 :         const struct ndr_interface_call *call = NULL;
    8554           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj);
    8555           0 :         PyObject *ret = NULL;
    8556           0 :         struct ndr_push *push = NULL;
    8557             :         DATA_BLOB blob;
    8558             :         enum ndr_err_code err;
    8559             : 
    8560           0 :         if (ndr_table_winbind.num_calls < 12) {
    8561           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QuerySequenceNumber_ndr_pack");
    8562           0 :                 return NULL;
    8563             :         }
    8564           0 :         call = &ndr_table_winbind.calls[11];
    8565             : 
    8566           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    8567           0 :         if (push == NULL) {
    8568           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    8569           0 :                 return NULL;
    8570             :         }
    8571             : 
    8572           0 :         push->flags |= ndr_push_flags;
    8573             : 
    8574           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    8575           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8576           0 :                 TALLOC_FREE(push);
    8577           0 :                 PyErr_SetNdrError(err);
    8578           0 :                 return NULL;
    8579             :         }
    8580           0 :         blob = ndr_push_blob(push);
    8581           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    8582           0 :         TALLOC_FREE(push);
    8583           0 :         return ret;
    8584             : }
    8585             : 
    8586           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8587             : {
    8588           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    8589           0 :         PyObject *bigendian_obj = NULL;
    8590           0 :         PyObject *ndr64_obj = NULL;
    8591           0 :         uint32_t ndr_push_flags = 0;
    8592             : 
    8593           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    8594             :                 discard_const_p(char *, kwnames),
    8595             :                 &bigendian_obj,
    8596             :                 &ndr64_obj)) {
    8597           0 :                 return NULL;
    8598             :         }
    8599             : 
    8600           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8601           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    8602             :         }
    8603           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8604           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    8605             :         }
    8606             : 
    8607           0 :         return py_wbint_QuerySequenceNumber_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    8608             : }
    8609             : 
    8610           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8611             : {
    8612           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    8613           0 :         PyObject *bigendian_obj = NULL;
    8614           0 :         PyObject *ndr64_obj = NULL;
    8615           0 :         uint32_t ndr_push_flags = 0;
    8616             : 
    8617           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    8618             :                 discard_const_p(char *, kwnames),
    8619             :                 &bigendian_obj,
    8620             :                 &ndr64_obj)) {
    8621           0 :                 return NULL;
    8622             :         }
    8623             : 
    8624           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8625           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    8626             :         }
    8627           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8628           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    8629             :         }
    8630             : 
    8631           0 :         return py_wbint_QuerySequenceNumber_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    8632             : }
    8633             : 
    8634           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)
    8635             : {
    8636           0 :         const struct ndr_interface_call *call = NULL;
    8637           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj);
    8638           0 :         struct ndr_pull *pull = NULL;
    8639             :         enum ndr_err_code err;
    8640             : 
    8641           0 :         if (ndr_table_winbind.num_calls < 12) {
    8642           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QuerySequenceNumber_ndr_unpack");
    8643           0 :                 return NULL;
    8644             :         }
    8645           0 :         call = &ndr_table_winbind.calls[11];
    8646             : 
    8647           0 :         pull = ndr_pull_init_blob(blob, object);
    8648           0 :         if (pull == NULL) {
    8649           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    8650           0 :                 return NULL;
    8651             :         }
    8652             : 
    8653           0 :         pull->flags |= ndr_pull_flags;
    8654             : 
    8655           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    8656           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    8657           0 :                 TALLOC_FREE(pull);
    8658           0 :                 PyErr_SetNdrError(err);
    8659           0 :                 return NULL;
    8660             :         }
    8661           0 :         if (!allow_remaining) {
    8662             :                 uint32_t highest_ofs;
    8663             : 
    8664           0 :                 if (pull->offset > pull->relative_highest_offset) {
    8665           0 :                         highest_ofs = pull->offset;
    8666             :                 } else {
    8667           0 :                         highest_ofs = pull->relative_highest_offset;
    8668             :                 }
    8669           0 :                 if (highest_ofs < pull->data_size) {
    8670           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    8671             :                                 "not all bytes consumed ofs[%u] size[%u]",
    8672             :                                 highest_ofs, pull->data_size);
    8673           0 :                         TALLOC_FREE(pull);
    8674           0 :                         PyErr_SetNdrError(err);
    8675           0 :                         return NULL;
    8676             :                 }
    8677             :         }
    8678             : 
    8679           0 :         TALLOC_FREE(pull);
    8680           0 :         Py_RETURN_NONE;
    8681             : }
    8682             : 
    8683           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8684             : {
    8685             :         DATA_BLOB blob;
    8686           0 :         Py_ssize_t blob_length = 0;
    8687           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    8688           0 :         PyObject *bigendian_obj = NULL;
    8689           0 :         PyObject *ndr64_obj = NULL;
    8690           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    8691           0 :         PyObject *allow_remaining_obj = NULL;
    8692           0 :         bool allow_remaining = false;
    8693             : 
    8694           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    8695             :                 discard_const_p(char *, kwnames),
    8696             :                 &blob.data, &blob_length,
    8697             :                 &bigendian_obj,
    8698             :                 &ndr64_obj,
    8699             :                 &allow_remaining_obj)) {
    8700           0 :                 return NULL;
    8701             :         }
    8702           0 :         blob.length = blob_length;
    8703             : 
    8704           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8705           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    8706             :         }
    8707           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8708           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    8709             :         }
    8710             : 
    8711           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    8712           0 :                 allow_remaining = true;
    8713             :         }
    8714             : 
    8715           0 :         return py_wbint_QuerySequenceNumber_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    8716             : }
    8717             : 
    8718           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    8719             : {
    8720             :         DATA_BLOB blob;
    8721           0 :         Py_ssize_t blob_length = 0;
    8722           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    8723           0 :         PyObject *bigendian_obj = NULL;
    8724           0 :         PyObject *ndr64_obj = NULL;
    8725           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    8726           0 :         PyObject *allow_remaining_obj = NULL;
    8727           0 :         bool allow_remaining = false;
    8728             : 
    8729           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    8730             :                 discard_const_p(char *, kwnames),
    8731             :                 &blob.data, &blob_length,
    8732             :                 &bigendian_obj,
    8733             :                 &ndr64_obj,
    8734             :                 &allow_remaining_obj)) {
    8735           0 :                 return NULL;
    8736             :         }
    8737           0 :         blob.length = blob_length;
    8738             : 
    8739           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    8740           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    8741             :         }
    8742           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    8743           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    8744             :         }
    8745             : 
    8746           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    8747           0 :                 allow_remaining = true;
    8748             :         }
    8749             : 
    8750           0 :         return py_wbint_QuerySequenceNumber_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    8751             : }
    8752             : 
    8753           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    8754             : {
    8755           0 :         const struct ndr_interface_call *call = NULL;
    8756           0 :         struct wbint_QuerySequenceNumber *object = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(py_obj);
    8757             :         PyObject *ret;
    8758             :         char *retstr;
    8759             : 
    8760           0 :         if (ndr_table_winbind.num_calls < 12) {
    8761           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QuerySequenceNumber_ndr_print");
    8762           0 :                 return NULL;
    8763             :         }
    8764           0 :         call = &ndr_table_winbind.calls[11];
    8765             : 
    8766           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    8767           0 :         ret = PyUnicode_FromString(retstr);
    8768           0 :         TALLOC_FREE(retstr);
    8769             : 
    8770           0 :         return ret;
    8771             : }
    8772             : 
    8773           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    8774             : {
    8775           0 :         return py_wbint_QuerySequenceNumber_ndr_print(py_obj, "wbint_QuerySequenceNumber_in", NDR_IN);
    8776             : }
    8777             : 
    8778           0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    8779             : {
    8780           0 :         return py_wbint_QuerySequenceNumber_ndr_print(py_obj, "wbint_QuerySequenceNumber_out", NDR_OUT);
    8781             : }
    8782             : 
    8783             : static PyMethodDef py_wbint_QuerySequenceNumber_methods[] = {
    8784             :         { "opnum", (PyCFunction)py_wbint_QuerySequenceNumber_ndr_opnum, METH_NOARGS|METH_CLASS,
    8785             :                 "winbind.wbint_QuerySequenceNumber.opnum() -> 11 (0x0b) " },
    8786             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    8787             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    8788             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    8789             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    8790             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    8791             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    8792             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    8793             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    8794             :         { "__ndr_print_in__", (PyCFunction)py_wbint_QuerySequenceNumber_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    8795             :         { "__ndr_print_out__", (PyCFunction)py_wbint_QuerySequenceNumber_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    8796             :         { NULL, NULL, 0, NULL }
    8797             : };
    8798             : 
    8799             : 
    8800             : static PyTypeObject wbint_QuerySequenceNumber_Type = {
    8801             :         PyVarObject_HEAD_INIT(NULL, 0)
    8802             :         .tp_name = "winbind.wbint_QuerySequenceNumber",
    8803             :         .tp_getset = py_wbint_QuerySequenceNumber_getsetters,
    8804             :         .tp_methods = py_wbint_QuerySequenceNumber_methods,
    8805             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    8806             :         .tp_new = py_wbint_QuerySequenceNumber_new,
    8807             : };
    8808             : 
    8809           0 : static bool pack_py_wbint_QuerySequenceNumber_args_in(PyObject *args, PyObject *kwargs, struct wbint_QuerySequenceNumber *r)
    8810             : {
    8811           0 :         const char *kwnames[] = {
    8812             :                 NULL
    8813             :         };
    8814             : 
    8815           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_QuerySequenceNumber", discard_const_p(char *, kwnames))) {
    8816           0 :                 return false;
    8817             :         }
    8818             : 
    8819           0 :         return true;
    8820             : }
    8821             : 
    8822           0 : static PyObject *unpack_py_wbint_QuerySequenceNumber_args_out(struct wbint_QuerySequenceNumber *r)
    8823             : {
    8824             :         PyObject *result;
    8825             :         PyObject *py_sequence;
    8826           0 :         py_sequence = PyLong_FromUnsignedLongLong((uint32_t)*r->out.sequence);
    8827           0 :         result = py_sequence;
    8828           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    8829           0 :                 PyErr_SetNTSTATUS(r->out.result);
    8830           0 :                 return NULL;
    8831             :         }
    8832             : 
    8833           0 :         return result;
    8834             : }
    8835             : 
    8836             : 
    8837           0 : static PyObject *py_wbint_LookupGroupMembers_in_get_sid(PyObject *obj, void *closure)
    8838             : {
    8839           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(obj);
    8840             :         PyObject *py_sid;
    8841           0 :         if (object->in.sid == NULL) {
    8842           0 :                 Py_RETURN_NONE;
    8843             :         }
    8844           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
    8845           0 :         return py_sid;
    8846             : }
    8847             : 
    8848           0 : static int py_wbint_LookupGroupMembers_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
    8849             : {
    8850           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    8851           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
    8852           0 :         if (value == NULL) {
    8853           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
    8854           0 :                 return -1;
    8855             :         }
    8856           0 :         object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
    8857           0 :         if (object->in.sid == NULL) {
    8858           0 :                 PyErr_NoMemory();
    8859           0 :                 return -1;
    8860             :         }
    8861           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    8862           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    8863           0 :                 PyErr_NoMemory();
    8864           0 :                 return -1;
    8865             :         }
    8866           0 :         object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
    8867           0 :         return 0;
    8868             : }
    8869             : 
    8870           0 : static PyObject *py_wbint_LookupGroupMembers_in_get_type(PyObject *obj, void *closure)
    8871             : {
    8872           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(obj);
    8873             :         PyObject *py_type;
    8874           0 :         py_type = PyLong_FromLong((uint16_t)object->in.type);
    8875           0 :         return py_type;
    8876             : }
    8877             : 
    8878           0 : static int py_wbint_LookupGroupMembers_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
    8879             : {
    8880           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    8881           0 :         if (value == NULL) {
    8882           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.type");
    8883           0 :                 return -1;
    8884             :         }
    8885             :         {
    8886           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
    8887           0 :                 if (PyLong_Check(value)) {
    8888             :                         unsigned long long test_var;
    8889           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8890           0 :                         if (PyErr_Occurred() != NULL) {
    8891           0 :                                 return -1;
    8892             :                         }
    8893           0 :                         if (test_var > uint_max) {
    8894           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    8895             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8896           0 :                                 return -1;
    8897             :                         }
    8898           0 :                         object->in.type = test_var;
    8899             :                 } else {
    8900           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    8901             :                           PyLong_Type.tp_name);
    8902           0 :                         return -1;
    8903             :                 }
    8904             :         }
    8905           0 :         return 0;
    8906             : }
    8907             : 
    8908           0 : static PyObject *py_wbint_LookupGroupMembers_out_get_members(PyObject *obj, void *closure)
    8909             : {
    8910           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(obj);
    8911             :         PyObject *py_members;
    8912           0 :         if (object->out.members == NULL) {
    8913           0 :                 Py_RETURN_NONE;
    8914             :         }
    8915           0 :         py_members = pytalloc_reference_ex(&wbint_Principals_Type, object->out.members, object->out.members);
    8916           0 :         return py_members;
    8917             : }
    8918             : 
    8919           0 : static int py_wbint_LookupGroupMembers_out_set_members(PyObject *py_obj, PyObject *value, void *closure)
    8920             : {
    8921           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    8922           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.members));
    8923           0 :         if (value == NULL) {
    8924           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.members");
    8925           0 :                 return -1;
    8926             :         }
    8927           0 :         object->out.members = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.members);
    8928           0 :         if (object->out.members == NULL) {
    8929           0 :                 PyErr_NoMemory();
    8930           0 :                 return -1;
    8931             :         }
    8932           0 :         PY_CHECK_TYPE(&wbint_Principals_Type, value, return -1;);
    8933           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    8934           0 :                 PyErr_NoMemory();
    8935           0 :                 return -1;
    8936             :         }
    8937           0 :         object->out.members = (struct wbint_Principals *)pytalloc_get_ptr(value);
    8938           0 :         return 0;
    8939             : }
    8940             : 
    8941           0 : static PyObject *py_wbint_LookupGroupMembers_get_result(PyObject *obj, void *closure)
    8942             : {
    8943           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(obj);
    8944             :         PyObject *py_result;
    8945           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    8946           0 :         return py_result;
    8947             : }
    8948             : 
    8949           0 : static int py_wbint_LookupGroupMembers_set_result(PyObject *py_obj, PyObject *value, void *closure)
    8950             : {
    8951           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    8952           0 :         if (value == NULL) {
    8953           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    8954           0 :                 return -1;
    8955             :         }
    8956           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    8957           0 :         return 0;
    8958             : }
    8959             : 
    8960             : static PyGetSetDef py_wbint_LookupGroupMembers_getsetters[] = {
    8961             :         {
    8962             :                 .name = discard_const_p(char, "in_sid"),
    8963             :                 .get = py_wbint_LookupGroupMembers_in_get_sid,
    8964             :                 .set = py_wbint_LookupGroupMembers_in_set_sid,
    8965             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    8966             :         },
    8967             :         {
    8968             :                 .name = discard_const_p(char, "in_type"),
    8969             :                 .get = py_wbint_LookupGroupMembers_in_get_type,
    8970             :                 .set = py_wbint_LookupGroupMembers_in_set_type,
    8971             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
    8972             :         },
    8973             :         {
    8974             :                 .name = discard_const_p(char, "out_members"),
    8975             :                 .get = py_wbint_LookupGroupMembers_out_get_members,
    8976             :                 .set = py_wbint_LookupGroupMembers_out_set_members,
    8977             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principals")
    8978             :         },
    8979             :         {
    8980             :                 .name = discard_const_p(char, "result"),
    8981             :                 .get = py_wbint_LookupGroupMembers_get_result,
    8982             :                 .set = py_wbint_LookupGroupMembers_set_result,
    8983             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    8984             :         },
    8985             :         { .name = NULL }
    8986             : };
    8987             : 
    8988           0 : static PyObject *py_wbint_LookupGroupMembers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    8989             : {
    8990           0 :         PyObject *self = pytalloc_new(struct wbint_LookupGroupMembers, type);
    8991           0 :         struct wbint_LookupGroupMembers *_self = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(self);
    8992           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    8993           0 :         _self->in.sid = talloc_zero(mem_ctx, struct dom_sid);
    8994           0 :         _self->out.members = talloc_zero(mem_ctx, struct wbint_Principals);
    8995           0 :         return self;
    8996             : }
    8997             : 
    8998           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    8999             : {
    9000             : 
    9001             : 
    9002           0 :         return PyLong_FromLong(12);
    9003             : }
    9004             : 
    9005           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    9006             : {
    9007           0 :         const struct ndr_interface_call *call = NULL;
    9008           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    9009           0 :         PyObject *ret = NULL;
    9010           0 :         struct ndr_push *push = NULL;
    9011             :         DATA_BLOB blob;
    9012             :         enum ndr_err_code err;
    9013             : 
    9014           0 :         if (ndr_table_winbind.num_calls < 13) {
    9015           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupGroupMembers_ndr_pack");
    9016           0 :                 return NULL;
    9017             :         }
    9018           0 :         call = &ndr_table_winbind.calls[12];
    9019             : 
    9020           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    9021           0 :         if (push == NULL) {
    9022           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    9023           0 :                 return NULL;
    9024             :         }
    9025             : 
    9026           0 :         push->flags |= ndr_push_flags;
    9027             : 
    9028           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    9029           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    9030           0 :                 TALLOC_FREE(push);
    9031           0 :                 PyErr_SetNdrError(err);
    9032           0 :                 return NULL;
    9033             :         }
    9034           0 :         blob = ndr_push_blob(push);
    9035           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    9036           0 :         TALLOC_FREE(push);
    9037           0 :         return ret;
    9038             : }
    9039             : 
    9040           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9041             : {
    9042           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    9043           0 :         PyObject *bigendian_obj = NULL;
    9044           0 :         PyObject *ndr64_obj = NULL;
    9045           0 :         uint32_t ndr_push_flags = 0;
    9046             : 
    9047           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    9048             :                 discard_const_p(char *, kwnames),
    9049             :                 &bigendian_obj,
    9050             :                 &ndr64_obj)) {
    9051           0 :                 return NULL;
    9052             :         }
    9053             : 
    9054           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9055           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    9056             :         }
    9057           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9058           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    9059             :         }
    9060             : 
    9061           0 :         return py_wbint_LookupGroupMembers_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    9062             : }
    9063             : 
    9064           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9065             : {
    9066           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    9067           0 :         PyObject *bigendian_obj = NULL;
    9068           0 :         PyObject *ndr64_obj = NULL;
    9069           0 :         uint32_t ndr_push_flags = 0;
    9070             : 
    9071           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    9072             :                 discard_const_p(char *, kwnames),
    9073             :                 &bigendian_obj,
    9074             :                 &ndr64_obj)) {
    9075           0 :                 return NULL;
    9076             :         }
    9077             : 
    9078           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9079           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    9080             :         }
    9081           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9082           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    9083             :         }
    9084             : 
    9085           0 :         return py_wbint_LookupGroupMembers_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    9086             : }
    9087             : 
    9088           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)
    9089             : {
    9090           0 :         const struct ndr_interface_call *call = NULL;
    9091           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    9092           0 :         struct ndr_pull *pull = NULL;
    9093             :         enum ndr_err_code err;
    9094             : 
    9095           0 :         if (ndr_table_winbind.num_calls < 13) {
    9096           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupGroupMembers_ndr_unpack");
    9097           0 :                 return NULL;
    9098             :         }
    9099           0 :         call = &ndr_table_winbind.calls[12];
    9100             : 
    9101           0 :         pull = ndr_pull_init_blob(blob, object);
    9102           0 :         if (pull == NULL) {
    9103           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    9104           0 :                 return NULL;
    9105             :         }
    9106             : 
    9107           0 :         pull->flags |= ndr_pull_flags;
    9108             : 
    9109           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    9110           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    9111           0 :                 TALLOC_FREE(pull);
    9112           0 :                 PyErr_SetNdrError(err);
    9113           0 :                 return NULL;
    9114             :         }
    9115           0 :         if (!allow_remaining) {
    9116             :                 uint32_t highest_ofs;
    9117             : 
    9118           0 :                 if (pull->offset > pull->relative_highest_offset) {
    9119           0 :                         highest_ofs = pull->offset;
    9120             :                 } else {
    9121           0 :                         highest_ofs = pull->relative_highest_offset;
    9122             :                 }
    9123           0 :                 if (highest_ofs < pull->data_size) {
    9124           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    9125             :                                 "not all bytes consumed ofs[%u] size[%u]",
    9126             :                                 highest_ofs, pull->data_size);
    9127           0 :                         TALLOC_FREE(pull);
    9128           0 :                         PyErr_SetNdrError(err);
    9129           0 :                         return NULL;
    9130             :                 }
    9131             :         }
    9132             : 
    9133           0 :         TALLOC_FREE(pull);
    9134           0 :         Py_RETURN_NONE;
    9135             : }
    9136             : 
    9137           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9138             : {
    9139             :         DATA_BLOB blob;
    9140           0 :         Py_ssize_t blob_length = 0;
    9141           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    9142           0 :         PyObject *bigendian_obj = NULL;
    9143           0 :         PyObject *ndr64_obj = NULL;
    9144           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    9145           0 :         PyObject *allow_remaining_obj = NULL;
    9146           0 :         bool allow_remaining = false;
    9147             : 
    9148           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    9149             :                 discard_const_p(char *, kwnames),
    9150             :                 &blob.data, &blob_length,
    9151             :                 &bigendian_obj,
    9152             :                 &ndr64_obj,
    9153             :                 &allow_remaining_obj)) {
    9154           0 :                 return NULL;
    9155             :         }
    9156           0 :         blob.length = blob_length;
    9157             : 
    9158           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9159           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    9160             :         }
    9161           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9162           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    9163             :         }
    9164             : 
    9165           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    9166           0 :                 allow_remaining = true;
    9167             :         }
    9168             : 
    9169           0 :         return py_wbint_LookupGroupMembers_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    9170             : }
    9171             : 
    9172           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9173             : {
    9174             :         DATA_BLOB blob;
    9175           0 :         Py_ssize_t blob_length = 0;
    9176           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    9177           0 :         PyObject *bigendian_obj = NULL;
    9178           0 :         PyObject *ndr64_obj = NULL;
    9179           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    9180           0 :         PyObject *allow_remaining_obj = NULL;
    9181           0 :         bool allow_remaining = false;
    9182             : 
    9183           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    9184             :                 discard_const_p(char *, kwnames),
    9185             :                 &blob.data, &blob_length,
    9186             :                 &bigendian_obj,
    9187             :                 &ndr64_obj,
    9188             :                 &allow_remaining_obj)) {
    9189           0 :                 return NULL;
    9190             :         }
    9191           0 :         blob.length = blob_length;
    9192             : 
    9193           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9194           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    9195             :         }
    9196           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9197           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    9198             :         }
    9199             : 
    9200           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    9201           0 :                 allow_remaining = true;
    9202             :         }
    9203             : 
    9204           0 :         return py_wbint_LookupGroupMembers_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    9205             : }
    9206             : 
    9207           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    9208             : {
    9209           0 :         const struct ndr_interface_call *call = NULL;
    9210           0 :         struct wbint_LookupGroupMembers *object = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(py_obj);
    9211             :         PyObject *ret;
    9212             :         char *retstr;
    9213             : 
    9214           0 :         if (ndr_table_winbind.num_calls < 13) {
    9215           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupGroupMembers_ndr_print");
    9216           0 :                 return NULL;
    9217             :         }
    9218           0 :         call = &ndr_table_winbind.calls[12];
    9219             : 
    9220           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    9221           0 :         ret = PyUnicode_FromString(retstr);
    9222           0 :         TALLOC_FREE(retstr);
    9223             : 
    9224           0 :         return ret;
    9225             : }
    9226             : 
    9227           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    9228             : {
    9229           0 :         return py_wbint_LookupGroupMembers_ndr_print(py_obj, "wbint_LookupGroupMembers_in", NDR_IN);
    9230             : }
    9231             : 
    9232           0 : static PyObject *py_wbint_LookupGroupMembers_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    9233             : {
    9234           0 :         return py_wbint_LookupGroupMembers_ndr_print(py_obj, "wbint_LookupGroupMembers_out", NDR_OUT);
    9235             : }
    9236             : 
    9237             : static PyMethodDef py_wbint_LookupGroupMembers_methods[] = {
    9238             :         { "opnum", (PyCFunction)py_wbint_LookupGroupMembers_ndr_opnum, METH_NOARGS|METH_CLASS,
    9239             :                 "winbind.wbint_LookupGroupMembers.opnum() -> 12 (0x0c) " },
    9240             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    9241             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    9242             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    9243             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    9244             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    9245             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    9246             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    9247             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    9248             :         { "__ndr_print_in__", (PyCFunction)py_wbint_LookupGroupMembers_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    9249             :         { "__ndr_print_out__", (PyCFunction)py_wbint_LookupGroupMembers_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    9250             :         { NULL, NULL, 0, NULL }
    9251             : };
    9252             : 
    9253             : 
    9254             : static PyTypeObject wbint_LookupGroupMembers_Type = {
    9255             :         PyVarObject_HEAD_INIT(NULL, 0)
    9256             :         .tp_name = "winbind.wbint_LookupGroupMembers",
    9257             :         .tp_getset = py_wbint_LookupGroupMembers_getsetters,
    9258             :         .tp_methods = py_wbint_LookupGroupMembers_methods,
    9259             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    9260             :         .tp_new = py_wbint_LookupGroupMembers_new,
    9261             : };
    9262             : 
    9263           0 : static bool pack_py_wbint_LookupGroupMembers_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupGroupMembers *r)
    9264             : {
    9265             :         PyObject *py_sid;
    9266             :         PyObject *py_type;
    9267           0 :         const char *kwnames[] = {
    9268             :                 "sid", "type", NULL
    9269             :         };
    9270             : 
    9271           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_LookupGroupMembers", discard_const_p(char *, kwnames), &py_sid, &py_type)) {
    9272           0 :                 return false;
    9273             :         }
    9274             : 
    9275           0 :         if (py_sid == NULL) {
    9276           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
    9277           0 :                 return false;
    9278             :         }
    9279           0 :         r->in.sid = talloc_ptrtype(r, r->in.sid);
    9280           0 :         if (r->in.sid == NULL) {
    9281           0 :                 PyErr_NoMemory();
    9282           0 :                 return false;
    9283             :         }
    9284           0 :         PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
    9285           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
    9286           0 :                 PyErr_NoMemory();
    9287           0 :                 return false;
    9288             :         }
    9289           0 :         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
    9290           0 :         if (py_type == NULL) {
    9291           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.type");
    9292           0 :                 return false;
    9293             :         }
    9294             :         {
    9295           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
    9296           0 :                 if (PyLong_Check(py_type)) {
    9297             :                         unsigned long long test_var;
    9298           0 :                         test_var = PyLong_AsUnsignedLongLong(py_type);
    9299           0 :                         if (PyErr_Occurred() != NULL) {
    9300           0 :                                 return false;
    9301             :                         }
    9302           0 :                         if (test_var > uint_max) {
    9303           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    9304             :                                   PyLong_Type.tp_name, uint_max, test_var);
    9305           0 :                                 return false;
    9306             :                         }
    9307           0 :                         r->in.type = test_var;
    9308             :                 } else {
    9309           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    9310             :                           PyLong_Type.tp_name);
    9311           0 :                         return false;
    9312             :                 }
    9313             :         }
    9314           0 :         return true;
    9315             : }
    9316             : 
    9317           0 : static PyObject *unpack_py_wbint_LookupGroupMembers_args_out(struct wbint_LookupGroupMembers *r)
    9318             : {
    9319             :         PyObject *result;
    9320             :         PyObject *py_members;
    9321           0 :         py_members = pytalloc_reference_ex(&wbint_Principals_Type, r->out.members, r->out.members);
    9322           0 :         result = py_members;
    9323           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    9324           0 :                 PyErr_SetNTSTATUS(r->out.result);
    9325           0 :                 return NULL;
    9326             :         }
    9327             : 
    9328           0 :         return result;
    9329             : }
    9330             : 
    9331             : 
    9332           0 : static PyObject *py_wbint_QueryGroupList_out_get_groups(PyObject *obj, void *closure)
    9333             : {
    9334           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(obj);
    9335             :         PyObject *py_groups;
    9336           0 :         if (object->out.groups == NULL) {
    9337           0 :                 Py_RETURN_NONE;
    9338             :         }
    9339           0 :         py_groups = pytalloc_reference_ex(&wbint_Principals_Type, object->out.groups, object->out.groups);
    9340           0 :         return py_groups;
    9341             : }
    9342             : 
    9343           0 : static int py_wbint_QueryGroupList_out_set_groups(PyObject *py_obj, PyObject *value, void *closure)
    9344             : {
    9345           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj);
    9346           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.groups));
    9347           0 :         if (value == NULL) {
    9348           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.groups");
    9349           0 :                 return -1;
    9350             :         }
    9351           0 :         object->out.groups = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.groups);
    9352           0 :         if (object->out.groups == NULL) {
    9353           0 :                 PyErr_NoMemory();
    9354           0 :                 return -1;
    9355             :         }
    9356           0 :         PY_CHECK_TYPE(&wbint_Principals_Type, value, return -1;);
    9357           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    9358           0 :                 PyErr_NoMemory();
    9359           0 :                 return -1;
    9360             :         }
    9361           0 :         object->out.groups = (struct wbint_Principals *)pytalloc_get_ptr(value);
    9362           0 :         return 0;
    9363             : }
    9364             : 
    9365           0 : static PyObject *py_wbint_QueryGroupList_get_result(PyObject *obj, void *closure)
    9366             : {
    9367           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(obj);
    9368             :         PyObject *py_result;
    9369           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    9370           0 :         return py_result;
    9371             : }
    9372             : 
    9373           0 : static int py_wbint_QueryGroupList_set_result(PyObject *py_obj, PyObject *value, void *closure)
    9374             : {
    9375           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj);
    9376           0 :         if (value == NULL) {
    9377           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    9378           0 :                 return -1;
    9379             :         }
    9380           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    9381           0 :         return 0;
    9382             : }
    9383             : 
    9384             : static PyGetSetDef py_wbint_QueryGroupList_getsetters[] = {
    9385             :         {
    9386             :                 .name = discard_const_p(char, "out_groups"),
    9387             :                 .get = py_wbint_QueryGroupList_out_get_groups,
    9388             :                 .set = py_wbint_QueryGroupList_out_set_groups,
    9389             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principals")
    9390             :         },
    9391             :         {
    9392             :                 .name = discard_const_p(char, "result"),
    9393             :                 .get = py_wbint_QueryGroupList_get_result,
    9394             :                 .set = py_wbint_QueryGroupList_set_result,
    9395             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    9396             :         },
    9397             :         { .name = NULL }
    9398             : };
    9399             : 
    9400           0 : static PyObject *py_wbint_QueryGroupList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    9401             : {
    9402           0 :         PyObject *self = pytalloc_new(struct wbint_QueryGroupList, type);
    9403           0 :         struct wbint_QueryGroupList *_self = (struct wbint_QueryGroupList *)pytalloc_get_ptr(self);
    9404           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    9405           0 :         _self->out.groups = talloc_zero(mem_ctx, struct wbint_Principals);
    9406           0 :         return self;
    9407             : }
    9408             : 
    9409           0 : static PyObject *py_wbint_QueryGroupList_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    9410             : {
    9411             : 
    9412             : 
    9413           0 :         return PyLong_FromLong(13);
    9414             : }
    9415             : 
    9416           0 : static PyObject *py_wbint_QueryGroupList_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    9417             : {
    9418           0 :         const struct ndr_interface_call *call = NULL;
    9419           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj);
    9420           0 :         PyObject *ret = NULL;
    9421           0 :         struct ndr_push *push = NULL;
    9422             :         DATA_BLOB blob;
    9423             :         enum ndr_err_code err;
    9424             : 
    9425           0 :         if (ndr_table_winbind.num_calls < 14) {
    9426           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryGroupList_ndr_pack");
    9427           0 :                 return NULL;
    9428             :         }
    9429           0 :         call = &ndr_table_winbind.calls[13];
    9430             : 
    9431           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    9432           0 :         if (push == NULL) {
    9433           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    9434           0 :                 return NULL;
    9435             :         }
    9436             : 
    9437           0 :         push->flags |= ndr_push_flags;
    9438             : 
    9439           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    9440           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    9441           0 :                 TALLOC_FREE(push);
    9442           0 :                 PyErr_SetNdrError(err);
    9443           0 :                 return NULL;
    9444             :         }
    9445           0 :         blob = ndr_push_blob(push);
    9446           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    9447           0 :         TALLOC_FREE(push);
    9448           0 :         return ret;
    9449             : }
    9450             : 
    9451           0 : static PyObject *py_wbint_QueryGroupList_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9452             : {
    9453           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    9454           0 :         PyObject *bigendian_obj = NULL;
    9455           0 :         PyObject *ndr64_obj = NULL;
    9456           0 :         uint32_t ndr_push_flags = 0;
    9457             : 
    9458           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    9459             :                 discard_const_p(char *, kwnames),
    9460             :                 &bigendian_obj,
    9461             :                 &ndr64_obj)) {
    9462           0 :                 return NULL;
    9463             :         }
    9464             : 
    9465           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9466           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    9467             :         }
    9468           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9469           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    9470             :         }
    9471             : 
    9472           0 :         return py_wbint_QueryGroupList_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    9473             : }
    9474             : 
    9475           0 : static PyObject *py_wbint_QueryGroupList_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9476             : {
    9477           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    9478           0 :         PyObject *bigendian_obj = NULL;
    9479           0 :         PyObject *ndr64_obj = NULL;
    9480           0 :         uint32_t ndr_push_flags = 0;
    9481             : 
    9482           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    9483             :                 discard_const_p(char *, kwnames),
    9484             :                 &bigendian_obj,
    9485             :                 &ndr64_obj)) {
    9486           0 :                 return NULL;
    9487             :         }
    9488             : 
    9489           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9490           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    9491             :         }
    9492           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9493           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    9494             :         }
    9495             : 
    9496           0 :         return py_wbint_QueryGroupList_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    9497             : }
    9498             : 
    9499           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)
    9500             : {
    9501           0 :         const struct ndr_interface_call *call = NULL;
    9502           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj);
    9503           0 :         struct ndr_pull *pull = NULL;
    9504             :         enum ndr_err_code err;
    9505             : 
    9506           0 :         if (ndr_table_winbind.num_calls < 14) {
    9507           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryGroupList_ndr_unpack");
    9508           0 :                 return NULL;
    9509             :         }
    9510           0 :         call = &ndr_table_winbind.calls[13];
    9511             : 
    9512           0 :         pull = ndr_pull_init_blob(blob, object);
    9513           0 :         if (pull == NULL) {
    9514           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    9515           0 :                 return NULL;
    9516             :         }
    9517             : 
    9518           0 :         pull->flags |= ndr_pull_flags;
    9519             : 
    9520           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    9521           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    9522           0 :                 TALLOC_FREE(pull);
    9523           0 :                 PyErr_SetNdrError(err);
    9524           0 :                 return NULL;
    9525             :         }
    9526           0 :         if (!allow_remaining) {
    9527             :                 uint32_t highest_ofs;
    9528             : 
    9529           0 :                 if (pull->offset > pull->relative_highest_offset) {
    9530           0 :                         highest_ofs = pull->offset;
    9531             :                 } else {
    9532           0 :                         highest_ofs = pull->relative_highest_offset;
    9533             :                 }
    9534           0 :                 if (highest_ofs < pull->data_size) {
    9535           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    9536             :                                 "not all bytes consumed ofs[%u] size[%u]",
    9537             :                                 highest_ofs, pull->data_size);
    9538           0 :                         TALLOC_FREE(pull);
    9539           0 :                         PyErr_SetNdrError(err);
    9540           0 :                         return NULL;
    9541             :                 }
    9542             :         }
    9543             : 
    9544           0 :         TALLOC_FREE(pull);
    9545           0 :         Py_RETURN_NONE;
    9546             : }
    9547             : 
    9548           0 : static PyObject *py_wbint_QueryGroupList_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9549             : {
    9550             :         DATA_BLOB blob;
    9551           0 :         Py_ssize_t blob_length = 0;
    9552           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    9553           0 :         PyObject *bigendian_obj = NULL;
    9554           0 :         PyObject *ndr64_obj = NULL;
    9555           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    9556           0 :         PyObject *allow_remaining_obj = NULL;
    9557           0 :         bool allow_remaining = false;
    9558             : 
    9559           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    9560             :                 discard_const_p(char *, kwnames),
    9561             :                 &blob.data, &blob_length,
    9562             :                 &bigendian_obj,
    9563             :                 &ndr64_obj,
    9564             :                 &allow_remaining_obj)) {
    9565           0 :                 return NULL;
    9566             :         }
    9567           0 :         blob.length = blob_length;
    9568             : 
    9569           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9570           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    9571             :         }
    9572           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9573           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    9574             :         }
    9575             : 
    9576           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    9577           0 :                 allow_remaining = true;
    9578             :         }
    9579             : 
    9580           0 :         return py_wbint_QueryGroupList_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    9581             : }
    9582             : 
    9583           0 : static PyObject *py_wbint_QueryGroupList_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9584             : {
    9585             :         DATA_BLOB blob;
    9586           0 :         Py_ssize_t blob_length = 0;
    9587           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    9588           0 :         PyObject *bigendian_obj = NULL;
    9589           0 :         PyObject *ndr64_obj = NULL;
    9590           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    9591           0 :         PyObject *allow_remaining_obj = NULL;
    9592           0 :         bool allow_remaining = false;
    9593             : 
    9594           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    9595             :                 discard_const_p(char *, kwnames),
    9596             :                 &blob.data, &blob_length,
    9597             :                 &bigendian_obj,
    9598             :                 &ndr64_obj,
    9599             :                 &allow_remaining_obj)) {
    9600           0 :                 return NULL;
    9601             :         }
    9602           0 :         blob.length = blob_length;
    9603             : 
    9604           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9605           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    9606             :         }
    9607           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9608           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    9609             :         }
    9610             : 
    9611           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    9612           0 :                 allow_remaining = true;
    9613             :         }
    9614             : 
    9615           0 :         return py_wbint_QueryGroupList_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    9616             : }
    9617             : 
    9618           0 : static PyObject *py_wbint_QueryGroupList_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    9619             : {
    9620           0 :         const struct ndr_interface_call *call = NULL;
    9621           0 :         struct wbint_QueryGroupList *object = (struct wbint_QueryGroupList *)pytalloc_get_ptr(py_obj);
    9622             :         PyObject *ret;
    9623             :         char *retstr;
    9624             : 
    9625           0 :         if (ndr_table_winbind.num_calls < 14) {
    9626           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryGroupList_ndr_print");
    9627           0 :                 return NULL;
    9628             :         }
    9629           0 :         call = &ndr_table_winbind.calls[13];
    9630             : 
    9631           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
    9632           0 :         ret = PyUnicode_FromString(retstr);
    9633           0 :         TALLOC_FREE(retstr);
    9634             : 
    9635           0 :         return ret;
    9636             : }
    9637             : 
    9638           0 : static PyObject *py_wbint_QueryGroupList_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    9639             : {
    9640           0 :         return py_wbint_QueryGroupList_ndr_print(py_obj, "wbint_QueryGroupList_in", NDR_IN);
    9641             : }
    9642             : 
    9643           0 : static PyObject *py_wbint_QueryGroupList_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    9644             : {
    9645           0 :         return py_wbint_QueryGroupList_ndr_print(py_obj, "wbint_QueryGroupList_out", NDR_OUT);
    9646             : }
    9647             : 
    9648             : static PyMethodDef py_wbint_QueryGroupList_methods[] = {
    9649             :         { "opnum", (PyCFunction)py_wbint_QueryGroupList_ndr_opnum, METH_NOARGS|METH_CLASS,
    9650             :                 "winbind.wbint_QueryGroupList.opnum() -> 13 (0x0d) " },
    9651             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
    9652             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
    9653             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
    9654             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
    9655             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
    9656             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
    9657             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
    9658             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
    9659             :         { "__ndr_print_in__", (PyCFunction)py_wbint_QueryGroupList_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
    9660             :         { "__ndr_print_out__", (PyCFunction)py_wbint_QueryGroupList_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
    9661             :         { NULL, NULL, 0, NULL }
    9662             : };
    9663             : 
    9664             : 
    9665             : static PyTypeObject wbint_QueryGroupList_Type = {
    9666             :         PyVarObject_HEAD_INIT(NULL, 0)
    9667             :         .tp_name = "winbind.wbint_QueryGroupList",
    9668             :         .tp_getset = py_wbint_QueryGroupList_getsetters,
    9669             :         .tp_methods = py_wbint_QueryGroupList_methods,
    9670             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    9671             :         .tp_new = py_wbint_QueryGroupList_new,
    9672             : };
    9673             : 
    9674           0 : static bool pack_py_wbint_QueryGroupList_args_in(PyObject *args, PyObject *kwargs, struct wbint_QueryGroupList *r)
    9675             : {
    9676           0 :         const char *kwnames[] = {
    9677             :                 NULL
    9678             :         };
    9679             : 
    9680           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_QueryGroupList", discard_const_p(char *, kwnames))) {
    9681           0 :                 return false;
    9682             :         }
    9683             : 
    9684           0 :         return true;
    9685             : }
    9686             : 
    9687           0 : static PyObject *unpack_py_wbint_QueryGroupList_args_out(struct wbint_QueryGroupList *r)
    9688             : {
    9689             :         PyObject *result;
    9690             :         PyObject *py_groups;
    9691           0 :         py_groups = pytalloc_reference_ex(&wbint_Principals_Type, r->out.groups, r->out.groups);
    9692           0 :         result = py_groups;
    9693           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
    9694           0 :                 PyErr_SetNTSTATUS(r->out.result);
    9695           0 :                 return NULL;
    9696             :         }
    9697             : 
    9698           0 :         return result;
    9699             : }
    9700             : 
    9701             : 
    9702           0 : static PyObject *py_wbint_QueryUserRidList_out_get_rids(PyObject *obj, void *closure)
    9703             : {
    9704           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(obj);
    9705             :         PyObject *py_rids;
    9706           0 :         if (object->out.rids == NULL) {
    9707           0 :                 Py_RETURN_NONE;
    9708             :         }
    9709           0 :         py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, object->out.rids, object->out.rids);
    9710           0 :         return py_rids;
    9711             : }
    9712             : 
    9713           0 : static int py_wbint_QueryUserRidList_out_set_rids(PyObject *py_obj, PyObject *value, void *closure)
    9714             : {
    9715           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj);
    9716           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids));
    9717           0 :         if (value == NULL) {
    9718           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids");
    9719           0 :                 return -1;
    9720             :         }
    9721           0 :         object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids);
    9722           0 :         if (object->out.rids == NULL) {
    9723           0 :                 PyErr_NoMemory();
    9724           0 :                 return -1;
    9725             :         }
    9726           0 :         PY_CHECK_TYPE(&wbint_RidArray_Type, value, return -1;);
    9727           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    9728           0 :                 PyErr_NoMemory();
    9729           0 :                 return -1;
    9730             :         }
    9731           0 :         object->out.rids = (struct wbint_RidArray *)pytalloc_get_ptr(value);
    9732           0 :         return 0;
    9733             : }
    9734             : 
    9735           0 : static PyObject *py_wbint_QueryUserRidList_get_result(PyObject *obj, void *closure)
    9736             : {
    9737           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(obj);
    9738             :         PyObject *py_result;
    9739           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
    9740           0 :         return py_result;
    9741             : }
    9742             : 
    9743           0 : static int py_wbint_QueryUserRidList_set_result(PyObject *py_obj, PyObject *value, void *closure)
    9744             : {
    9745           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj);
    9746           0 :         if (value == NULL) {
    9747           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
    9748           0 :                 return -1;
    9749             :         }
    9750           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
    9751           0 :         return 0;
    9752             : }
    9753             : 
    9754             : static PyGetSetDef py_wbint_QueryUserRidList_getsetters[] = {
    9755             :         {
    9756             :                 .name = discard_const_p(char, "out_rids"),
    9757             :                 .get = py_wbint_QueryUserRidList_out_get_rids,
    9758             :                 .set = py_wbint_QueryUserRidList_out_set_rids,
    9759             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_RidArray")
    9760             :         },
    9761             :         {
    9762             :                 .name = discard_const_p(char, "result"),
    9763             :                 .get = py_wbint_QueryUserRidList_get_result,
    9764             :                 .set = py_wbint_QueryUserRidList_set_result,
    9765             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
    9766             :         },
    9767             :         { .name = NULL }
    9768             : };
    9769             : 
    9770           0 : static PyObject *py_wbint_QueryUserRidList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    9771             : {
    9772           0 :         PyObject *self = pytalloc_new(struct wbint_QueryUserRidList, type);
    9773           0 :         struct wbint_QueryUserRidList *_self = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(self);
    9774           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
    9775           0 :         _self->out.rids = talloc_zero(mem_ctx, struct wbint_RidArray);
    9776           0 :         return self;
    9777             : }
    9778             : 
    9779           0 : static PyObject *py_wbint_QueryUserRidList_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
    9780             : {
    9781             : 
    9782             : 
    9783           0 :         return PyLong_FromLong(14);
    9784             : }
    9785             : 
    9786           0 : static PyObject *py_wbint_QueryUserRidList_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
    9787             : {
    9788           0 :         const struct ndr_interface_call *call = NULL;
    9789           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj);
    9790           0 :         PyObject *ret = NULL;
    9791           0 :         struct ndr_push *push = NULL;
    9792             :         DATA_BLOB blob;
    9793             :         enum ndr_err_code err;
    9794             : 
    9795           0 :         if (ndr_table_winbind.num_calls < 15) {
    9796           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryUserRidList_ndr_pack");
    9797           0 :                 return NULL;
    9798             :         }
    9799           0 :         call = &ndr_table_winbind.calls[14];
    9800             : 
    9801           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
    9802           0 :         if (push == NULL) {
    9803           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    9804           0 :                 return NULL;
    9805             :         }
    9806             : 
    9807           0 :         push->flags |= ndr_push_flags;
    9808             : 
    9809           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
    9810           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    9811           0 :                 TALLOC_FREE(push);
    9812           0 :                 PyErr_SetNdrError(err);
    9813           0 :                 return NULL;
    9814             :         }
    9815           0 :         blob = ndr_push_blob(push);
    9816           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    9817           0 :         TALLOC_FREE(push);
    9818           0 :         return ret;
    9819             : }
    9820             : 
    9821           0 : static PyObject *py_wbint_QueryUserRidList_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9822             : {
    9823           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    9824           0 :         PyObject *bigendian_obj = NULL;
    9825           0 :         PyObject *ndr64_obj = NULL;
    9826           0 :         uint32_t ndr_push_flags = 0;
    9827             : 
    9828           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
    9829             :                 discard_const_p(char *, kwnames),
    9830             :                 &bigendian_obj,
    9831             :                 &ndr64_obj)) {
    9832           0 :                 return NULL;
    9833             :         }
    9834             : 
    9835           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9836           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    9837             :         }
    9838           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9839           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    9840             :         }
    9841             : 
    9842           0 :         return py_wbint_QueryUserRidList_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
    9843             : }
    9844             : 
    9845           0 : static PyObject *py_wbint_QueryUserRidList_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9846             : {
    9847           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
    9848           0 :         PyObject *bigendian_obj = NULL;
    9849           0 :         PyObject *ndr64_obj = NULL;
    9850           0 :         uint32_t ndr_push_flags = 0;
    9851             : 
    9852           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
    9853             :                 discard_const_p(char *, kwnames),
    9854             :                 &bigendian_obj,
    9855             :                 &ndr64_obj)) {
    9856           0 :                 return NULL;
    9857             :         }
    9858             : 
    9859           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9860           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
    9861             :         }
    9862           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9863           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
    9864             :         }
    9865             : 
    9866           0 :         return py_wbint_QueryUserRidList_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
    9867             : }
    9868             : 
    9869           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)
    9870             : {
    9871           0 :         const struct ndr_interface_call *call = NULL;
    9872           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj);
    9873           0 :         struct ndr_pull *pull = NULL;
    9874             :         enum ndr_err_code err;
    9875             : 
    9876           0 :         if (ndr_table_winbind.num_calls < 15) {
    9877           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryUserRidList_ndr_unpack");
    9878           0 :                 return NULL;
    9879             :         }
    9880           0 :         call = &ndr_table_winbind.calls[14];
    9881             : 
    9882           0 :         pull = ndr_pull_init_blob(blob, object);
    9883           0 :         if (pull == NULL) {
    9884           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    9885           0 :                 return NULL;
    9886             :         }
    9887             : 
    9888           0 :         pull->flags |= ndr_pull_flags;
    9889             : 
    9890           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
    9891           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    9892           0 :                 TALLOC_FREE(pull);
    9893           0 :                 PyErr_SetNdrError(err);
    9894           0 :                 return NULL;
    9895             :         }
    9896           0 :         if (!allow_remaining) {
    9897             :                 uint32_t highest_ofs;
    9898             : 
    9899           0 :                 if (pull->offset > pull->relative_highest_offset) {
    9900           0 :                         highest_ofs = pull->offset;
    9901             :                 } else {
    9902           0 :                         highest_ofs = pull->relative_highest_offset;
    9903             :                 }
    9904           0 :                 if (highest_ofs < pull->data_size) {
    9905           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
    9906             :                                 "not all bytes consumed ofs[%u] size[%u]",
    9907             :                                 highest_ofs, pull->data_size);
    9908           0 :                         TALLOC_FREE(pull);
    9909           0 :                         PyErr_SetNdrError(err);
    9910           0 :                         return NULL;
    9911             :                 }
    9912             :         }
    9913             : 
    9914           0 :         TALLOC_FREE(pull);
    9915           0 :         Py_RETURN_NONE;
    9916             : }
    9917             : 
    9918           0 : static PyObject *py_wbint_QueryUserRidList_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9919             : {
    9920             :         DATA_BLOB blob;
    9921           0 :         Py_ssize_t blob_length = 0;
    9922           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    9923           0 :         PyObject *bigendian_obj = NULL;
    9924           0 :         PyObject *ndr64_obj = NULL;
    9925           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    9926           0 :         PyObject *allow_remaining_obj = NULL;
    9927           0 :         bool allow_remaining = false;
    9928             : 
    9929           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
    9930             :                 discard_const_p(char *, kwnames),
    9931             :                 &blob.data, &blob_length,
    9932             :                 &bigendian_obj,
    9933             :                 &ndr64_obj,
    9934             :                 &allow_remaining_obj)) {
    9935           0 :                 return NULL;
    9936             :         }
    9937           0 :         blob.length = blob_length;
    9938             : 
    9939           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9940           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    9941             :         }
    9942           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9943           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    9944             :         }
    9945             : 
    9946           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    9947           0 :                 allow_remaining = true;
    9948             :         }
    9949             : 
    9950           0 :         return py_wbint_QueryUserRidList_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
    9951             : }
    9952             : 
    9953           0 : static PyObject *py_wbint_QueryUserRidList_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    9954             : {
    9955             :         DATA_BLOB blob;
    9956           0 :         Py_ssize_t blob_length = 0;
    9957           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
    9958           0 :         PyObject *bigendian_obj = NULL;
    9959           0 :         PyObject *ndr64_obj = NULL;
    9960           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
    9961           0 :         PyObject *allow_remaining_obj = NULL;
    9962           0 :         bool allow_remaining = false;
    9963             : 
    9964           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
    9965             :                 discard_const_p(char *, kwnames),
    9966             :                 &blob.data, &blob_length,
    9967             :                 &bigendian_obj,
    9968             :                 &ndr64_obj,
    9969             :                 &allow_remaining_obj)) {
    9970           0 :                 return NULL;
    9971             :         }
    9972           0 :         blob.length = blob_length;
    9973             : 
    9974           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
    9975           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
    9976             :         }
    9977           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
    9978           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
    9979             :         }
    9980             : 
    9981           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    9982           0 :                 allow_remaining = true;
    9983             :         }
    9984             : 
    9985           0 :         return py_wbint_QueryUserRidList_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
    9986             : }
    9987             : 
    9988           0 : static PyObject *py_wbint_QueryUserRidList_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
    9989             : {
    9990           0 :         const struct ndr_interface_call *call = NULL;
    9991           0 :         struct wbint_QueryUserRidList *object = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(py_obj);
    9992             :         PyObject *ret;
    9993             :         char *retstr;
    9994             : 
    9995           0 :         if (ndr_table_winbind.num_calls < 15) {
    9996           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryUserRidList_ndr_print");
    9997           0 :                 return NULL;
    9998             :         }
    9999           0 :         call = &ndr_table_winbind.calls[14];
   10000             : 
   10001           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   10002           0 :         ret = PyUnicode_FromString(retstr);
   10003           0 :         TALLOC_FREE(retstr);
   10004             : 
   10005           0 :         return ret;
   10006             : }
   10007             : 
   10008           0 : static PyObject *py_wbint_QueryUserRidList_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   10009             : {
   10010           0 :         return py_wbint_QueryUserRidList_ndr_print(py_obj, "wbint_QueryUserRidList_in", NDR_IN);
   10011             : }
   10012             : 
   10013           0 : static PyObject *py_wbint_QueryUserRidList_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   10014             : {
   10015           0 :         return py_wbint_QueryUserRidList_ndr_print(py_obj, "wbint_QueryUserRidList_out", NDR_OUT);
   10016             : }
   10017             : 
   10018             : static PyMethodDef py_wbint_QueryUserRidList_methods[] = {
   10019             :         { "opnum", (PyCFunction)py_wbint_QueryUserRidList_ndr_opnum, METH_NOARGS|METH_CLASS,
   10020             :                 "winbind.wbint_QueryUserRidList.opnum() -> 14 (0x0e) " },
   10021             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   10022             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   10023             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   10024             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   10025             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   10026             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   10027             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   10028             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   10029             :         { "__ndr_print_in__", (PyCFunction)py_wbint_QueryUserRidList_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   10030             :         { "__ndr_print_out__", (PyCFunction)py_wbint_QueryUserRidList_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   10031             :         { NULL, NULL, 0, NULL }
   10032             : };
   10033             : 
   10034             : 
   10035             : static PyTypeObject wbint_QueryUserRidList_Type = {
   10036             :         PyVarObject_HEAD_INIT(NULL, 0)
   10037             :         .tp_name = "winbind.wbint_QueryUserRidList",
   10038             :         .tp_getset = py_wbint_QueryUserRidList_getsetters,
   10039             :         .tp_methods = py_wbint_QueryUserRidList_methods,
   10040             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   10041             :         .tp_new = py_wbint_QueryUserRidList_new,
   10042             : };
   10043             : 
   10044           0 : static bool pack_py_wbint_QueryUserRidList_args_in(PyObject *args, PyObject *kwargs, struct wbint_QueryUserRidList *r)
   10045             : {
   10046           0 :         const char *kwnames[] = {
   10047             :                 NULL
   10048             :         };
   10049             : 
   10050           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_QueryUserRidList", discard_const_p(char *, kwnames))) {
   10051           0 :                 return false;
   10052             :         }
   10053             : 
   10054           0 :         return true;
   10055             : }
   10056             : 
   10057           0 : static PyObject *unpack_py_wbint_QueryUserRidList_args_out(struct wbint_QueryUserRidList *r)
   10058             : {
   10059             :         PyObject *result;
   10060             :         PyObject *py_rids;
   10061           0 :         py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, r->out.rids, r->out.rids);
   10062           0 :         result = py_rids;
   10063           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   10064           0 :                 PyErr_SetNTSTATUS(r->out.result);
   10065           0 :                 return NULL;
   10066             :         }
   10067             : 
   10068           0 :         return result;
   10069             : }
   10070             : 
   10071             : 
   10072           0 : static PyObject *py_wbint_DsGetDcName_in_get_domain_name(PyObject *obj, void *closure)
   10073             : {
   10074           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj);
   10075             :         PyObject *py_domain_name;
   10076           0 :         if (object->in.domain_name == NULL) {
   10077           0 :                 Py_RETURN_NONE;
   10078             :         }
   10079           0 :         if (object->in.domain_name == NULL) {
   10080           0 :                 py_domain_name = Py_None;
   10081           0 :                 Py_INCREF(py_domain_name);
   10082             :         } else {
   10083           0 :                 py_domain_name = PyUnicode_Decode(object->in.domain_name, strlen(object->in.domain_name), "utf-8", "ignore");
   10084             :         }
   10085           0 :         return py_domain_name;
   10086             : }
   10087             : 
   10088           0 : static int py_wbint_DsGetDcName_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
   10089             : {
   10090           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj);
   10091           0 :         if (value == NULL) {
   10092           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name");
   10093           0 :                 return -1;
   10094             :         }
   10095           0 :         object->in.domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_name);
   10096           0 :         if (object->in.domain_name == NULL) {
   10097           0 :                 PyErr_NoMemory();
   10098           0 :                 return -1;
   10099             :         }
   10100             :         {
   10101             :                 const char *test_str;
   10102             :                 const char *talloc_str;
   10103           0 :                 PyObject *unicode = NULL;
   10104           0 :                 if (PyUnicode_Check(value)) {
   10105           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   10106           0 :                         if (unicode == NULL) {
   10107           0 :                                 PyErr_NoMemory();
   10108           0 :                                 return -1;
   10109             :                         }
   10110           0 :                         test_str = PyBytes_AS_STRING(unicode);
   10111           0 :                 } else if (PyBytes_Check(value)) {
   10112           0 :                         test_str = PyBytes_AS_STRING(value);
   10113             :                 } else {
   10114           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   10115           0 :                         return -1;
   10116             :                 }
   10117           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   10118           0 :                 if (unicode != NULL) {
   10119           0 :                         Py_DECREF(unicode);
   10120             :                 }
   10121           0 :                 if (talloc_str == NULL) {
   10122           0 :                         PyErr_NoMemory();
   10123           0 :                         return -1;
   10124             :                 }
   10125           0 :                 object->in.domain_name = talloc_str;
   10126             :         }
   10127           0 :         return 0;
   10128             : }
   10129             : 
   10130           0 : static PyObject *py_wbint_DsGetDcName_in_get_domain_guid(PyObject *obj, void *closure)
   10131             : {
   10132           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj);
   10133             :         PyObject *py_domain_guid;
   10134           0 :         if (object->in.domain_guid == NULL) {
   10135           0 :                 Py_RETURN_NONE;
   10136             :         }
   10137           0 :         if (object->in.domain_guid == NULL) {
   10138           0 :                 py_domain_guid = Py_None;
   10139           0 :                 Py_INCREF(py_domain_guid);
   10140             :         } else {
   10141           0 :                 py_domain_guid = pytalloc_reference_ex(GUID_Type, object->in.domain_guid, object->in.domain_guid);
   10142             :         }
   10143           0 :         return py_domain_guid;
   10144             : }
   10145             : 
   10146           0 : static int py_wbint_DsGetDcName_in_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
   10147             : {
   10148           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj);
   10149           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_guid));
   10150           0 :         if (value == NULL) {
   10151           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_guid");
   10152           0 :                 return -1;
   10153             :         }
   10154           0 :         if (value == Py_None) {
   10155           0 :                 object->in.domain_guid = NULL;
   10156             :         } else {
   10157           0 :                 object->in.domain_guid = NULL;
   10158           0 :                 PY_CHECK_TYPE(GUID_Type, value, return -1;);
   10159           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   10160           0 :                         PyErr_NoMemory();
   10161           0 :                         return -1;
   10162             :                 }
   10163           0 :                 object->in.domain_guid = (struct GUID *)pytalloc_get_ptr(value);
   10164             :         }
   10165           0 :         return 0;
   10166             : }
   10167             : 
   10168           0 : static PyObject *py_wbint_DsGetDcName_in_get_site_name(PyObject *obj, void *closure)
   10169             : {
   10170           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj);
   10171             :         PyObject *py_site_name;
   10172           0 :         if (object->in.site_name == NULL) {
   10173           0 :                 Py_RETURN_NONE;
   10174             :         }
   10175           0 :         if (object->in.site_name == NULL) {
   10176           0 :                 py_site_name = Py_None;
   10177           0 :                 Py_INCREF(py_site_name);
   10178             :         } else {
   10179           0 :                 if (object->in.site_name == NULL) {
   10180           0 :                         py_site_name = Py_None;
   10181           0 :                         Py_INCREF(py_site_name);
   10182             :                 } else {
   10183           0 :                         py_site_name = PyUnicode_Decode(object->in.site_name, strlen(object->in.site_name), "utf-8", "ignore");
   10184             :                 }
   10185             :         }
   10186           0 :         return py_site_name;
   10187             : }
   10188             : 
   10189           0 : static int py_wbint_DsGetDcName_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure)
   10190             : {
   10191           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj);
   10192           0 :         if (value == NULL) {
   10193           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.site_name");
   10194           0 :                 return -1;
   10195             :         }
   10196           0 :         if (value == Py_None) {
   10197           0 :                 object->in.site_name = NULL;
   10198             :         } else {
   10199           0 :                 object->in.site_name = NULL;
   10200             :                 {
   10201             :                         const char *test_str;
   10202             :                         const char *talloc_str;
   10203           0 :                         PyObject *unicode = NULL;
   10204           0 :                         if (PyUnicode_Check(value)) {
   10205           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   10206           0 :                                 if (unicode == NULL) {
   10207           0 :                                         PyErr_NoMemory();
   10208           0 :                                         return -1;
   10209             :                                 }
   10210           0 :                                 test_str = PyBytes_AS_STRING(unicode);
   10211           0 :                         } else if (PyBytes_Check(value)) {
   10212           0 :                                 test_str = PyBytes_AS_STRING(value);
   10213             :                         } else {
   10214           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   10215           0 :                                 return -1;
   10216             :                         }
   10217           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   10218           0 :                         if (unicode != NULL) {
   10219           0 :                                 Py_DECREF(unicode);
   10220             :                         }
   10221           0 :                         if (talloc_str == NULL) {
   10222           0 :                                 PyErr_NoMemory();
   10223           0 :                                 return -1;
   10224             :                         }
   10225           0 :                         object->in.site_name = talloc_str;
   10226             :                 }
   10227             :         }
   10228           0 :         return 0;
   10229             : }
   10230             : 
   10231           0 : static PyObject *py_wbint_DsGetDcName_in_get_flags(PyObject *obj, void *closure)
   10232             : {
   10233           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj);
   10234             :         PyObject *py_flags;
   10235           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
   10236           0 :         return py_flags;
   10237             : }
   10238             : 
   10239           0 : static int py_wbint_DsGetDcName_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
   10240             : {
   10241           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj);
   10242           0 :         if (value == NULL) {
   10243           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
   10244           0 :                 return -1;
   10245             :         }
   10246             :         {
   10247           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
   10248           0 :                 if (PyLong_Check(value)) {
   10249             :                         unsigned long long test_var;
   10250           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   10251           0 :                         if (PyErr_Occurred() != NULL) {
   10252           0 :                                 return -1;
   10253             :                         }
   10254           0 :                         if (test_var > uint_max) {
   10255           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   10256             :                                   PyLong_Type.tp_name, uint_max, test_var);
   10257           0 :                                 return -1;
   10258             :                         }
   10259           0 :                         object->in.flags = test_var;
   10260             :                 } else {
   10261           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   10262             :                           PyLong_Type.tp_name);
   10263           0 :                         return -1;
   10264             :                 }
   10265             :         }
   10266           0 :         return 0;
   10267             : }
   10268             : 
   10269           0 : static PyObject *py_wbint_DsGetDcName_out_get_dc_info(PyObject *obj, void *closure)
   10270             : {
   10271           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj);
   10272             :         PyObject *py_dc_info;
   10273           0 :         if (object->out.dc_info == NULL) {
   10274           0 :                 Py_RETURN_NONE;
   10275             :         }
   10276           0 :         if (*object->out.dc_info == NULL) {
   10277           0 :                 py_dc_info = Py_None;
   10278           0 :                 Py_INCREF(py_dc_info);
   10279             :         } else {
   10280           0 :                 py_dc_info = pytalloc_reference_ex(netr_DsRGetDCNameInfo_Type, *object->out.dc_info, *object->out.dc_info);
   10281             :         }
   10282           0 :         return py_dc_info;
   10283             : }
   10284             : 
   10285           0 : static int py_wbint_DsGetDcName_out_set_dc_info(PyObject *py_obj, PyObject *value, void *closure)
   10286             : {
   10287           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj);
   10288           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dc_info));
   10289           0 :         if (value == NULL) {
   10290           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dc_info");
   10291           0 :                 return -1;
   10292             :         }
   10293           0 :         object->out.dc_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dc_info);
   10294           0 :         if (object->out.dc_info == NULL) {
   10295           0 :                 PyErr_NoMemory();
   10296           0 :                 return -1;
   10297             :         }
   10298           0 :         if (value == Py_None) {
   10299           0 :                 *object->out.dc_info = NULL;
   10300             :         } else {
   10301           0 :                 *object->out.dc_info = NULL;
   10302           0 :                 PY_CHECK_TYPE(netr_DsRGetDCNameInfo_Type, value, return -1;);
   10303           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   10304           0 :                         PyErr_NoMemory();
   10305           0 :                         return -1;
   10306             :                 }
   10307           0 :                 *object->out.dc_info = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(value);
   10308             :         }
   10309           0 :         return 0;
   10310             : }
   10311             : 
   10312           0 : static PyObject *py_wbint_DsGetDcName_get_result(PyObject *obj, void *closure)
   10313             : {
   10314           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(obj);
   10315             :         PyObject *py_result;
   10316           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   10317           0 :         return py_result;
   10318             : }
   10319             : 
   10320           0 : static int py_wbint_DsGetDcName_set_result(PyObject *py_obj, PyObject *value, void *closure)
   10321             : {
   10322           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj);
   10323           0 :         if (value == NULL) {
   10324           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   10325           0 :                 return -1;
   10326             :         }
   10327           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   10328           0 :         return 0;
   10329             : }
   10330             : 
   10331             : static PyGetSetDef py_wbint_DsGetDcName_getsetters[] = {
   10332             :         {
   10333             :                 .name = discard_const_p(char, "in_domain_name"),
   10334             :                 .get = py_wbint_DsGetDcName_in_get_domain_name,
   10335             :                 .set = py_wbint_DsGetDcName_in_set_domain_name,
   10336             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   10337             :         },
   10338             :         {
   10339             :                 .name = discard_const_p(char, "in_domain_guid"),
   10340             :                 .get = py_wbint_DsGetDcName_in_get_domain_guid,
   10341             :                 .set = py_wbint_DsGetDcName_in_set_domain_guid,
   10342             :                 .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
   10343             :         },
   10344             :         {
   10345             :                 .name = discard_const_p(char, "in_site_name"),
   10346             :                 .get = py_wbint_DsGetDcName_in_get_site_name,
   10347             :                 .set = py_wbint_DsGetDcName_in_set_site_name,
   10348             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   10349             :         },
   10350             :         {
   10351             :                 .name = discard_const_p(char, "in_flags"),
   10352             :                 .get = py_wbint_DsGetDcName_in_get_flags,
   10353             :                 .set = py_wbint_DsGetDcName_in_set_flags,
   10354             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
   10355             :         },
   10356             :         {
   10357             :                 .name = discard_const_p(char, "out_dc_info"),
   10358             :                 .get = py_wbint_DsGetDcName_out_get_dc_info,
   10359             :                 .set = py_wbint_DsGetDcName_out_set_dc_info,
   10360             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCNameInfo")
   10361             :         },
   10362             :         {
   10363             :                 .name = discard_const_p(char, "result"),
   10364             :                 .get = py_wbint_DsGetDcName_get_result,
   10365             :                 .set = py_wbint_DsGetDcName_set_result,
   10366             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   10367             :         },
   10368             :         { .name = NULL }
   10369             : };
   10370             : 
   10371           0 : static PyObject *py_wbint_DsGetDcName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   10372             : {
   10373           0 :         PyObject *self = pytalloc_new(struct wbint_DsGetDcName, type);
   10374           0 :         struct wbint_DsGetDcName *_self = (struct wbint_DsGetDcName *)pytalloc_get_ptr(self);
   10375           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
   10376             :         /* a pointer to a NULL pointer */
   10377           0 :         _self->out.dc_info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *);
   10378           0 :         return self;
   10379             : }
   10380             : 
   10381           0 : static PyObject *py_wbint_DsGetDcName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   10382             : {
   10383             : 
   10384             : 
   10385           0 :         return PyLong_FromLong(15);
   10386             : }
   10387             : 
   10388           0 : static PyObject *py_wbint_DsGetDcName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   10389             : {
   10390           0 :         const struct ndr_interface_call *call = NULL;
   10391           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj);
   10392           0 :         PyObject *ret = NULL;
   10393           0 :         struct ndr_push *push = NULL;
   10394             :         DATA_BLOB blob;
   10395             :         enum ndr_err_code err;
   10396             : 
   10397           0 :         if (ndr_table_winbind.num_calls < 16) {
   10398           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_DsGetDcName_ndr_pack");
   10399           0 :                 return NULL;
   10400             :         }
   10401           0 :         call = &ndr_table_winbind.calls[15];
   10402             : 
   10403           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   10404           0 :         if (push == NULL) {
   10405           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   10406           0 :                 return NULL;
   10407             :         }
   10408             : 
   10409           0 :         push->flags |= ndr_push_flags;
   10410             : 
   10411           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   10412           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   10413           0 :                 TALLOC_FREE(push);
   10414           0 :                 PyErr_SetNdrError(err);
   10415           0 :                 return NULL;
   10416             :         }
   10417           0 :         blob = ndr_push_blob(push);
   10418           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   10419           0 :         TALLOC_FREE(push);
   10420           0 :         return ret;
   10421             : }
   10422             : 
   10423           0 : static PyObject *py_wbint_DsGetDcName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   10424             : {
   10425           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   10426           0 :         PyObject *bigendian_obj = NULL;
   10427           0 :         PyObject *ndr64_obj = NULL;
   10428           0 :         uint32_t ndr_push_flags = 0;
   10429             : 
   10430           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   10431             :                 discard_const_p(char *, kwnames),
   10432             :                 &bigendian_obj,
   10433             :                 &ndr64_obj)) {
   10434           0 :                 return NULL;
   10435             :         }
   10436             : 
   10437           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   10438           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   10439             :         }
   10440           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   10441           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   10442             :         }
   10443             : 
   10444           0 :         return py_wbint_DsGetDcName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   10445             : }
   10446             : 
   10447           0 : static PyObject *py_wbint_DsGetDcName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   10448             : {
   10449           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   10450           0 :         PyObject *bigendian_obj = NULL;
   10451           0 :         PyObject *ndr64_obj = NULL;
   10452           0 :         uint32_t ndr_push_flags = 0;
   10453             : 
   10454           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   10455             :                 discard_const_p(char *, kwnames),
   10456             :                 &bigendian_obj,
   10457             :                 &ndr64_obj)) {
   10458           0 :                 return NULL;
   10459             :         }
   10460             : 
   10461           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   10462           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   10463             :         }
   10464           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   10465           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   10466             :         }
   10467             : 
   10468           0 :         return py_wbint_DsGetDcName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   10469             : }
   10470             : 
   10471           0 : static PyObject *py_wbint_DsGetDcName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   10472             : {
   10473           0 :         const struct ndr_interface_call *call = NULL;
   10474           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj);
   10475           0 :         struct ndr_pull *pull = NULL;
   10476             :         enum ndr_err_code err;
   10477             : 
   10478           0 :         if (ndr_table_winbind.num_calls < 16) {
   10479           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_DsGetDcName_ndr_unpack");
   10480           0 :                 return NULL;
   10481             :         }
   10482           0 :         call = &ndr_table_winbind.calls[15];
   10483             : 
   10484           0 :         pull = ndr_pull_init_blob(blob, object);
   10485           0 :         if (pull == NULL) {
   10486           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   10487           0 :                 return NULL;
   10488             :         }
   10489             : 
   10490           0 :         pull->flags |= ndr_pull_flags;
   10491             : 
   10492           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   10493           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   10494           0 :                 TALLOC_FREE(pull);
   10495           0 :                 PyErr_SetNdrError(err);
   10496           0 :                 return NULL;
   10497             :         }
   10498           0 :         if (!allow_remaining) {
   10499             :                 uint32_t highest_ofs;
   10500             : 
   10501           0 :                 if (pull->offset > pull->relative_highest_offset) {
   10502           0 :                         highest_ofs = pull->offset;
   10503             :                 } else {
   10504           0 :                         highest_ofs = pull->relative_highest_offset;
   10505             :                 }
   10506           0 :                 if (highest_ofs < pull->data_size) {
   10507           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   10508             :                                 "not all bytes consumed ofs[%u] size[%u]",
   10509             :                                 highest_ofs, pull->data_size);
   10510           0 :                         TALLOC_FREE(pull);
   10511           0 :                         PyErr_SetNdrError(err);
   10512           0 :                         return NULL;
   10513             :                 }
   10514             :         }
   10515             : 
   10516           0 :         TALLOC_FREE(pull);
   10517           0 :         Py_RETURN_NONE;
   10518             : }
   10519             : 
   10520           0 : static PyObject *py_wbint_DsGetDcName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   10521             : {
   10522             :         DATA_BLOB blob;
   10523           0 :         Py_ssize_t blob_length = 0;
   10524           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   10525           0 :         PyObject *bigendian_obj = NULL;
   10526           0 :         PyObject *ndr64_obj = NULL;
   10527           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   10528           0 :         PyObject *allow_remaining_obj = NULL;
   10529           0 :         bool allow_remaining = false;
   10530             : 
   10531           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   10532             :                 discard_const_p(char *, kwnames),
   10533             :                 &blob.data, &blob_length,
   10534             :                 &bigendian_obj,
   10535             :                 &ndr64_obj,
   10536             :                 &allow_remaining_obj)) {
   10537           0 :                 return NULL;
   10538             :         }
   10539           0 :         blob.length = blob_length;
   10540             : 
   10541           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   10542           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   10543             :         }
   10544           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   10545           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   10546             :         }
   10547             : 
   10548           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   10549           0 :                 allow_remaining = true;
   10550             :         }
   10551             : 
   10552           0 :         return py_wbint_DsGetDcName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   10553             : }
   10554             : 
   10555           0 : static PyObject *py_wbint_DsGetDcName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   10556             : {
   10557             :         DATA_BLOB blob;
   10558           0 :         Py_ssize_t blob_length = 0;
   10559           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   10560           0 :         PyObject *bigendian_obj = NULL;
   10561           0 :         PyObject *ndr64_obj = NULL;
   10562           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   10563           0 :         PyObject *allow_remaining_obj = NULL;
   10564           0 :         bool allow_remaining = false;
   10565             : 
   10566           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   10567             :                 discard_const_p(char *, kwnames),
   10568             :                 &blob.data, &blob_length,
   10569             :                 &bigendian_obj,
   10570             :                 &ndr64_obj,
   10571             :                 &allow_remaining_obj)) {
   10572           0 :                 return NULL;
   10573             :         }
   10574           0 :         blob.length = blob_length;
   10575             : 
   10576           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   10577           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   10578             :         }
   10579           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   10580           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   10581             :         }
   10582             : 
   10583           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   10584           0 :                 allow_remaining = true;
   10585             :         }
   10586             : 
   10587           0 :         return py_wbint_DsGetDcName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   10588             : }
   10589             : 
   10590           0 : static PyObject *py_wbint_DsGetDcName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   10591             : {
   10592           0 :         const struct ndr_interface_call *call = NULL;
   10593           0 :         struct wbint_DsGetDcName *object = (struct wbint_DsGetDcName *)pytalloc_get_ptr(py_obj);
   10594             :         PyObject *ret;
   10595             :         char *retstr;
   10596             : 
   10597           0 :         if (ndr_table_winbind.num_calls < 16) {
   10598           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_DsGetDcName_ndr_print");
   10599           0 :                 return NULL;
   10600             :         }
   10601           0 :         call = &ndr_table_winbind.calls[15];
   10602             : 
   10603           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   10604           0 :         ret = PyUnicode_FromString(retstr);
   10605           0 :         TALLOC_FREE(retstr);
   10606             : 
   10607           0 :         return ret;
   10608             : }
   10609             : 
   10610           0 : static PyObject *py_wbint_DsGetDcName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   10611             : {
   10612           0 :         return py_wbint_DsGetDcName_ndr_print(py_obj, "wbint_DsGetDcName_in", NDR_IN);
   10613             : }
   10614             : 
   10615           0 : static PyObject *py_wbint_DsGetDcName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   10616             : {
   10617           0 :         return py_wbint_DsGetDcName_ndr_print(py_obj, "wbint_DsGetDcName_out", NDR_OUT);
   10618             : }
   10619             : 
   10620             : static PyMethodDef py_wbint_DsGetDcName_methods[] = {
   10621             :         { "opnum", (PyCFunction)py_wbint_DsGetDcName_ndr_opnum, METH_NOARGS|METH_CLASS,
   10622             :                 "winbind.wbint_DsGetDcName.opnum() -> 15 (0x0f) " },
   10623             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_DsGetDcName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   10624             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   10625             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_DsGetDcName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   10626             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   10627             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_DsGetDcName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   10628             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   10629             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_DsGetDcName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   10630             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   10631             :         { "__ndr_print_in__", (PyCFunction)py_wbint_DsGetDcName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   10632             :         { "__ndr_print_out__", (PyCFunction)py_wbint_DsGetDcName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   10633             :         { NULL, NULL, 0, NULL }
   10634             : };
   10635             : 
   10636             : 
   10637             : static PyTypeObject wbint_DsGetDcName_Type = {
   10638             :         PyVarObject_HEAD_INIT(NULL, 0)
   10639             :         .tp_name = "winbind.wbint_DsGetDcName",
   10640             :         .tp_getset = py_wbint_DsGetDcName_getsetters,
   10641             :         .tp_methods = py_wbint_DsGetDcName_methods,
   10642             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   10643             :         .tp_new = py_wbint_DsGetDcName_new,
   10644             : };
   10645             : 
   10646           0 : static bool pack_py_wbint_DsGetDcName_args_in(PyObject *args, PyObject *kwargs, struct wbint_DsGetDcName *r)
   10647             : {
   10648             :         PyObject *py_domain_name;
   10649             :         PyObject *py_domain_guid;
   10650             :         PyObject *py_site_name;
   10651             :         PyObject *py_flags;
   10652           0 :         const char *kwnames[] = {
   10653             :                 "domain_name", "domain_guid", "site_name", "flags", NULL
   10654             :         };
   10655             : 
   10656           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:wbint_DsGetDcName", discard_const_p(char *, kwnames), &py_domain_name, &py_domain_guid, &py_site_name, &py_flags)) {
   10657           0 :                 return false;
   10658             :         }
   10659             : 
   10660           0 :         if (py_domain_name == NULL) {
   10661           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name");
   10662           0 :                 return false;
   10663             :         }
   10664           0 :         r->in.domain_name = talloc_ptrtype(r, r->in.domain_name);
   10665           0 :         if (r->in.domain_name == NULL) {
   10666           0 :                 PyErr_NoMemory();
   10667           0 :                 return false;
   10668             :         }
   10669             :         {
   10670             :                 const char *test_str;
   10671             :                 const char *talloc_str;
   10672           0 :                 PyObject *unicode = NULL;
   10673           0 :                 if (PyUnicode_Check(py_domain_name)) {
   10674           0 :                         unicode = PyUnicode_AsEncodedString(py_domain_name, "utf-8", "ignore");
   10675           0 :                         if (unicode == NULL) {
   10676           0 :                                 PyErr_NoMemory();
   10677           0 :                                 return false;
   10678             :                         }
   10679           0 :                         test_str = PyBytes_AS_STRING(unicode);
   10680           0 :                 } else if (PyBytes_Check(py_domain_name)) {
   10681           0 :                         test_str = PyBytes_AS_STRING(py_domain_name);
   10682             :                 } else {
   10683           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain_name)->tp_name);
   10684           0 :                         return false;
   10685             :                 }
   10686           0 :                 talloc_str = talloc_strdup(r, test_str);
   10687           0 :                 if (unicode != NULL) {
   10688           0 :                         Py_DECREF(unicode);
   10689             :                 }
   10690           0 :                 if (talloc_str == NULL) {
   10691           0 :                         PyErr_NoMemory();
   10692           0 :                         return false;
   10693             :                 }
   10694           0 :                 r->in.domain_name = talloc_str;
   10695             :         }
   10696           0 :         if (py_domain_guid == NULL) {
   10697           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_guid");
   10698           0 :                 return false;
   10699             :         }
   10700           0 :         if (py_domain_guid == Py_None) {
   10701           0 :                 r->in.domain_guid = NULL;
   10702             :         } else {
   10703           0 :                 r->in.domain_guid = NULL;
   10704           0 :                 PY_CHECK_TYPE(GUID_Type, py_domain_guid, return false;);
   10705           0 :                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_guid)) == NULL) {
   10706           0 :                         PyErr_NoMemory();
   10707           0 :                         return false;
   10708             :                 }
   10709           0 :                 r->in.domain_guid = (struct GUID *)pytalloc_get_ptr(py_domain_guid);
   10710             :         }
   10711           0 :         if (py_site_name == NULL) {
   10712           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.site_name");
   10713           0 :                 return false;
   10714             :         }
   10715           0 :         if (py_site_name == Py_None) {
   10716           0 :                 r->in.site_name = NULL;
   10717             :         } else {
   10718           0 :                 r->in.site_name = NULL;
   10719             :                 {
   10720             :                         const char *test_str;
   10721             :                         const char *talloc_str;
   10722           0 :                         PyObject *unicode = NULL;
   10723           0 :                         if (PyUnicode_Check(py_site_name)) {
   10724           0 :                                 unicode = PyUnicode_AsEncodedString(py_site_name, "utf-8", "ignore");
   10725           0 :                                 if (unicode == NULL) {
   10726           0 :                                         PyErr_NoMemory();
   10727           0 :                                         return false;
   10728             :                                 }
   10729           0 :                                 test_str = PyBytes_AS_STRING(unicode);
   10730           0 :                         } else if (PyBytes_Check(py_site_name)) {
   10731           0 :                                 test_str = PyBytes_AS_STRING(py_site_name);
   10732             :                         } else {
   10733           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_site_name)->tp_name);
   10734           0 :                                 return false;
   10735             :                         }
   10736           0 :                         talloc_str = talloc_strdup(r, test_str);
   10737           0 :                         if (unicode != NULL) {
   10738           0 :                                 Py_DECREF(unicode);
   10739             :                         }
   10740           0 :                         if (talloc_str == NULL) {
   10741           0 :                                 PyErr_NoMemory();
   10742           0 :                                 return false;
   10743             :                         }
   10744           0 :                         r->in.site_name = talloc_str;
   10745             :                 }
   10746             :         }
   10747           0 :         if (py_flags == NULL) {
   10748           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
   10749           0 :                 return false;
   10750             :         }
   10751             :         {
   10752           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
   10753           0 :                 if (PyLong_Check(py_flags)) {
   10754             :                         unsigned long long test_var;
   10755           0 :                         test_var = PyLong_AsUnsignedLongLong(py_flags);
   10756           0 :                         if (PyErr_Occurred() != NULL) {
   10757           0 :                                 return false;
   10758             :                         }
   10759           0 :                         if (test_var > uint_max) {
   10760           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   10761             :                                   PyLong_Type.tp_name, uint_max, test_var);
   10762           0 :                                 return false;
   10763             :                         }
   10764           0 :                         r->in.flags = test_var;
   10765             :                 } else {
   10766           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   10767             :                           PyLong_Type.tp_name);
   10768           0 :                         return false;
   10769             :                 }
   10770             :         }
   10771           0 :         return true;
   10772             : }
   10773             : 
   10774           0 : static PyObject *unpack_py_wbint_DsGetDcName_args_out(struct wbint_DsGetDcName *r)
   10775             : {
   10776             :         PyObject *result;
   10777             :         PyObject *py_dc_info;
   10778           0 :         if (*r->out.dc_info == NULL) {
   10779           0 :                 py_dc_info = Py_None;
   10780           0 :                 Py_INCREF(py_dc_info);
   10781             :         } else {
   10782           0 :                 py_dc_info = pytalloc_reference_ex(netr_DsRGetDCNameInfo_Type, *r->out.dc_info, *r->out.dc_info);
   10783             :         }
   10784           0 :         result = py_dc_info;
   10785           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   10786           0 :                 PyErr_SetNTSTATUS(r->out.result);
   10787           0 :                 return NULL;
   10788             :         }
   10789             : 
   10790           0 :         return result;
   10791             : }
   10792             : 
   10793             : 
   10794           0 : static PyObject *py_wbint_LookupRids_in_get_domain_sid(PyObject *obj, void *closure)
   10795             : {
   10796           0 :         struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(obj);
   10797             :         PyObject *py_domain_sid;
   10798           0 :         if (object->in.domain_sid == NULL) {
   10799           0 :                 Py_RETURN_NONE;
   10800             :         }
   10801           0 :         py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->in.domain_sid, object->in.domain_sid);
   10802           0 :         return py_domain_sid;
   10803             : }
   10804             : 
   10805           0 : static int py_wbint_LookupRids_in_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
   10806             : {
   10807           0 :         struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj);
   10808           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_sid));
   10809           0 :         if (value == NULL) {
   10810           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_sid");
   10811           0 :                 return -1;
   10812             :         }
   10813           0 :         object->in.domain_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_sid);
   10814           0 :         if (object->in.domain_sid == NULL) {
   10815           0 :                 PyErr_NoMemory();
   10816           0 :                 return -1;
   10817             :         }
   10818           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
   10819           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   10820           0 :                 PyErr_NoMemory();
   10821           0 :                 return -1;
   10822             :         }
   10823           0 :         object->in.domain_sid = (struct dom_sid *)pytalloc_get_ptr(value);
   10824           0 :         return 0;
   10825             : }
   10826             : 
   10827           0 : static PyObject *py_wbint_LookupRids_in_get_rids(PyObject *obj, void *closure)
   10828             : {
   10829           0 :         struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(obj);
   10830             :         PyObject *py_rids;
   10831           0 :         if (object->in.rids == NULL) {
   10832           0 :                 Py_RETURN_NONE;
   10833             :         }
   10834           0 :         py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, object->in.rids, object->in.rids);
   10835           0 :         return py_rids;
   10836             : }
   10837             : 
   10838           0 : static int py_wbint_LookupRids_in_set_rids(PyObject *py_obj, PyObject *value, void *closure)
   10839             : {
   10840           0 :         struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj);
   10841           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.rids));
   10842           0 :         if (value == NULL) {
   10843           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rids");
   10844           0 :                 return -1;
   10845             :         }
   10846           0 :         object->in.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.rids);
   10847           0 :         if (object->in.rids == NULL) {
   10848           0 :                 PyErr_NoMemory();
   10849           0 :                 return -1;
   10850             :         }
   10851           0 :         PY_CHECK_TYPE(&wbint_RidArray_Type, value, return -1;);
   10852           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   10853           0 :                 PyErr_NoMemory();
   10854           0 :                 return -1;
   10855             :         }
   10856           0 :         object->in.rids = (struct wbint_RidArray *)pytalloc_get_ptr(value);
   10857           0 :         return 0;
   10858             : }
   10859             : 
   10860           0 : static PyObject *py_wbint_LookupRids_out_get_domain_name(PyObject *obj, void *closure)
   10861             : {
   10862           0 :         struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(obj);
   10863             :         PyObject *py_domain_name;
   10864           0 :         if (object->out.domain_name == NULL) {
   10865           0 :                 Py_RETURN_NONE;
   10866             :         }
   10867           0 :         if (*object->out.domain_name == NULL) {
   10868           0 :                 py_domain_name = Py_None;
   10869           0 :                 Py_INCREF(py_domain_name);
   10870             :         } else {
   10871           0 :                 if (*object->out.domain_name == NULL) {
   10872           0 :                         py_domain_name = Py_None;
   10873           0 :                         Py_INCREF(py_domain_name);
   10874             :                 } else {
   10875           0 :                         py_domain_name = PyUnicode_Decode(*object->out.domain_name, strlen(*object->out.domain_name), "utf-8", "ignore");
   10876             :                 }
   10877             :         }
   10878           0 :         return py_domain_name;
   10879             : }
   10880             : 
   10881           0 : static int py_wbint_LookupRids_out_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
   10882             : {
   10883           0 :         struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj);
   10884           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domain_name));
   10885           0 :         if (value == NULL) {
   10886           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domain_name");
   10887           0 :                 return -1;
   10888             :         }
   10889           0 :         object->out.domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domain_name);
   10890           0 :         if (object->out.domain_name == NULL) {
   10891           0 :                 PyErr_NoMemory();
   10892           0 :                 return -1;
   10893             :         }
   10894           0 :         if (value == Py_None) {
   10895           0 :                 *object->out.domain_name = NULL;
   10896             :         } else {
   10897           0 :                 *object->out.domain_name = NULL;
   10898             :                 {
   10899             :                         const char *test_str;
   10900             :                         const char *talloc_str;
   10901           0 :                         PyObject *unicode = NULL;
   10902           0 :                         if (PyUnicode_Check(value)) {
   10903           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   10904           0 :                                 if (unicode == NULL) {
   10905           0 :                                         PyErr_NoMemory();
   10906           0 :                                         return -1;
   10907             :                                 }
   10908           0 :                                 test_str = PyBytes_AS_STRING(unicode);
   10909           0 :                         } else if (PyBytes_Check(value)) {
   10910           0 :                                 test_str = PyBytes_AS_STRING(value);
   10911             :                         } else {
   10912           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   10913           0 :                                 return -1;
   10914             :                         }
   10915           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   10916           0 :                         if (unicode != NULL) {
   10917           0 :                                 Py_DECREF(unicode);
   10918             :                         }
   10919           0 :                         if (talloc_str == NULL) {
   10920           0 :                                 PyErr_NoMemory();
   10921           0 :                                 return -1;
   10922             :                         }
   10923           0 :                         *object->out.domain_name = talloc_str;
   10924             :                 }
   10925             :         }
   10926           0 :         return 0;
   10927             : }
   10928             : 
   10929           0 : static PyObject *py_wbint_LookupRids_out_get_names(PyObject *obj, void *closure)
   10930             : {
   10931           0 :         struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(obj);
   10932             :         PyObject *py_names;
   10933           0 :         if (object->out.names == NULL) {
   10934           0 :                 Py_RETURN_NONE;
   10935             :         }
   10936           0 :         py_names = pytalloc_reference_ex(&wbint_Principals_Type, object->out.names, object->out.names);
   10937           0 :         return py_names;
   10938             : }
   10939             : 
   10940           0 : static int py_wbint_LookupRids_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
   10941             : {
   10942           0 :         struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj);
   10943           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
   10944           0 :         if (value == NULL) {
   10945           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.names");
   10946           0 :                 return -1;
   10947             :         }
   10948           0 :         object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
   10949           0 :         if (object->out.names == NULL) {
   10950           0 :                 PyErr_NoMemory();
   10951           0 :                 return -1;
   10952             :         }
   10953           0 :         PY_CHECK_TYPE(&wbint_Principals_Type, value, return -1;);
   10954           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   10955           0 :                 PyErr_NoMemory();
   10956           0 :                 return -1;
   10957             :         }
   10958           0 :         object->out.names = (struct wbint_Principals *)pytalloc_get_ptr(value);
   10959           0 :         return 0;
   10960             : }
   10961             : 
   10962           0 : static PyObject *py_wbint_LookupRids_get_result(PyObject *obj, void *closure)
   10963             : {
   10964           0 :         struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(obj);
   10965             :         PyObject *py_result;
   10966           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   10967           0 :         return py_result;
   10968             : }
   10969             : 
   10970           0 : static int py_wbint_LookupRids_set_result(PyObject *py_obj, PyObject *value, void *closure)
   10971             : {
   10972           0 :         struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj);
   10973           0 :         if (value == NULL) {
   10974           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   10975           0 :                 return -1;
   10976             :         }
   10977           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   10978           0 :         return 0;
   10979             : }
   10980             : 
   10981             : static PyGetSetDef py_wbint_LookupRids_getsetters[] = {
   10982             :         {
   10983             :                 .name = discard_const_p(char, "in_domain_sid"),
   10984             :                 .get = py_wbint_LookupRids_in_get_domain_sid,
   10985             :                 .set = py_wbint_LookupRids_in_set_domain_sid,
   10986             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
   10987             :         },
   10988             :         {
   10989             :                 .name = discard_const_p(char, "in_rids"),
   10990             :                 .get = py_wbint_LookupRids_in_get_rids,
   10991             :                 .set = py_wbint_LookupRids_in_set_rids,
   10992             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_RidArray")
   10993             :         },
   10994             :         {
   10995             :                 .name = discard_const_p(char, "out_domain_name"),
   10996             :                 .get = py_wbint_LookupRids_out_get_domain_name,
   10997             :                 .set = py_wbint_LookupRids_out_set_domain_name,
   10998             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   10999             :         },
   11000             :         {
   11001             :                 .name = discard_const_p(char, "out_names"),
   11002             :                 .get = py_wbint_LookupRids_out_get_names,
   11003             :                 .set = py_wbint_LookupRids_out_set_names,
   11004             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principals")
   11005             :         },
   11006             :         {
   11007             :                 .name = discard_const_p(char, "result"),
   11008             :                 .get = py_wbint_LookupRids_get_result,
   11009             :                 .set = py_wbint_LookupRids_set_result,
   11010             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   11011             :         },
   11012             :         { .name = NULL }
   11013             : };
   11014             : 
   11015           0 : static PyObject *py_wbint_LookupRids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   11016             : {
   11017           0 :         PyObject *self = pytalloc_new(struct wbint_LookupRids, type);
   11018           0 :         struct wbint_LookupRids *_self = (struct wbint_LookupRids *)pytalloc_get_ptr(self);
   11019           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
   11020           0 :         _self->in.domain_sid = talloc_zero(mem_ctx, struct dom_sid);
   11021           0 :         _self->in.rids = talloc_zero(mem_ctx, struct wbint_RidArray);
   11022           0 :         _self->out.names = talloc_zero(mem_ctx, struct wbint_Principals);
   11023           0 :         return self;
   11024             : }
   11025             : 
   11026           0 : static PyObject *py_wbint_LookupRids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   11027             : {
   11028             : 
   11029             : 
   11030           0 :         return PyLong_FromLong(16);
   11031             : }
   11032             : 
   11033           0 : static PyObject *py_wbint_LookupRids_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   11034             : {
   11035           0 :         const struct ndr_interface_call *call = NULL;
   11036           0 :         struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj);
   11037           0 :         PyObject *ret = NULL;
   11038           0 :         struct ndr_push *push = NULL;
   11039             :         DATA_BLOB blob;
   11040             :         enum ndr_err_code err;
   11041             : 
   11042           0 :         if (ndr_table_winbind.num_calls < 17) {
   11043           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupRids_ndr_pack");
   11044           0 :                 return NULL;
   11045             :         }
   11046           0 :         call = &ndr_table_winbind.calls[16];
   11047             : 
   11048           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   11049           0 :         if (push == NULL) {
   11050           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   11051           0 :                 return NULL;
   11052             :         }
   11053             : 
   11054           0 :         push->flags |= ndr_push_flags;
   11055             : 
   11056           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   11057           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   11058           0 :                 TALLOC_FREE(push);
   11059           0 :                 PyErr_SetNdrError(err);
   11060           0 :                 return NULL;
   11061             :         }
   11062           0 :         blob = ndr_push_blob(push);
   11063           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   11064           0 :         TALLOC_FREE(push);
   11065           0 :         return ret;
   11066             : }
   11067             : 
   11068           0 : static PyObject *py_wbint_LookupRids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   11069             : {
   11070           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   11071           0 :         PyObject *bigendian_obj = NULL;
   11072           0 :         PyObject *ndr64_obj = NULL;
   11073           0 :         uint32_t ndr_push_flags = 0;
   11074             : 
   11075           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   11076             :                 discard_const_p(char *, kwnames),
   11077             :                 &bigendian_obj,
   11078             :                 &ndr64_obj)) {
   11079           0 :                 return NULL;
   11080             :         }
   11081             : 
   11082           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   11083           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   11084             :         }
   11085           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   11086           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   11087             :         }
   11088             : 
   11089           0 :         return py_wbint_LookupRids_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   11090             : }
   11091             : 
   11092           0 : static PyObject *py_wbint_LookupRids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   11093             : {
   11094           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   11095           0 :         PyObject *bigendian_obj = NULL;
   11096           0 :         PyObject *ndr64_obj = NULL;
   11097           0 :         uint32_t ndr_push_flags = 0;
   11098             : 
   11099           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   11100             :                 discard_const_p(char *, kwnames),
   11101             :                 &bigendian_obj,
   11102             :                 &ndr64_obj)) {
   11103           0 :                 return NULL;
   11104             :         }
   11105             : 
   11106           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   11107           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   11108             :         }
   11109           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   11110           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   11111             :         }
   11112             : 
   11113           0 :         return py_wbint_LookupRids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   11114             : }
   11115             : 
   11116           0 : static PyObject *py_wbint_LookupRids_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   11117             : {
   11118           0 :         const struct ndr_interface_call *call = NULL;
   11119           0 :         struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj);
   11120           0 :         struct ndr_pull *pull = NULL;
   11121             :         enum ndr_err_code err;
   11122             : 
   11123           0 :         if (ndr_table_winbind.num_calls < 17) {
   11124           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupRids_ndr_unpack");
   11125           0 :                 return NULL;
   11126             :         }
   11127           0 :         call = &ndr_table_winbind.calls[16];
   11128             : 
   11129           0 :         pull = ndr_pull_init_blob(blob, object);
   11130           0 :         if (pull == NULL) {
   11131           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   11132           0 :                 return NULL;
   11133             :         }
   11134             : 
   11135           0 :         pull->flags |= ndr_pull_flags;
   11136             : 
   11137           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   11138           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   11139           0 :                 TALLOC_FREE(pull);
   11140           0 :                 PyErr_SetNdrError(err);
   11141           0 :                 return NULL;
   11142             :         }
   11143           0 :         if (!allow_remaining) {
   11144             :                 uint32_t highest_ofs;
   11145             : 
   11146           0 :                 if (pull->offset > pull->relative_highest_offset) {
   11147           0 :                         highest_ofs = pull->offset;
   11148             :                 } else {
   11149           0 :                         highest_ofs = pull->relative_highest_offset;
   11150             :                 }
   11151           0 :                 if (highest_ofs < pull->data_size) {
   11152           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   11153             :                                 "not all bytes consumed ofs[%u] size[%u]",
   11154             :                                 highest_ofs, pull->data_size);
   11155           0 :                         TALLOC_FREE(pull);
   11156           0 :                         PyErr_SetNdrError(err);
   11157           0 :                         return NULL;
   11158             :                 }
   11159             :         }
   11160             : 
   11161           0 :         TALLOC_FREE(pull);
   11162           0 :         Py_RETURN_NONE;
   11163             : }
   11164             : 
   11165           0 : static PyObject *py_wbint_LookupRids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   11166             : {
   11167             :         DATA_BLOB blob;
   11168           0 :         Py_ssize_t blob_length = 0;
   11169           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   11170           0 :         PyObject *bigendian_obj = NULL;
   11171           0 :         PyObject *ndr64_obj = NULL;
   11172           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   11173           0 :         PyObject *allow_remaining_obj = NULL;
   11174           0 :         bool allow_remaining = false;
   11175             : 
   11176           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   11177             :                 discard_const_p(char *, kwnames),
   11178             :                 &blob.data, &blob_length,
   11179             :                 &bigendian_obj,
   11180             :                 &ndr64_obj,
   11181             :                 &allow_remaining_obj)) {
   11182           0 :                 return NULL;
   11183             :         }
   11184           0 :         blob.length = blob_length;
   11185             : 
   11186           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   11187           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   11188             :         }
   11189           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   11190           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   11191             :         }
   11192             : 
   11193           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   11194           0 :                 allow_remaining = true;
   11195             :         }
   11196             : 
   11197           0 :         return py_wbint_LookupRids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   11198             : }
   11199             : 
   11200           0 : static PyObject *py_wbint_LookupRids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   11201             : {
   11202             :         DATA_BLOB blob;
   11203           0 :         Py_ssize_t blob_length = 0;
   11204           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   11205           0 :         PyObject *bigendian_obj = NULL;
   11206           0 :         PyObject *ndr64_obj = NULL;
   11207           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   11208           0 :         PyObject *allow_remaining_obj = NULL;
   11209           0 :         bool allow_remaining = false;
   11210             : 
   11211           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   11212             :                 discard_const_p(char *, kwnames),
   11213             :                 &blob.data, &blob_length,
   11214             :                 &bigendian_obj,
   11215             :                 &ndr64_obj,
   11216             :                 &allow_remaining_obj)) {
   11217           0 :                 return NULL;
   11218             :         }
   11219           0 :         blob.length = blob_length;
   11220             : 
   11221           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   11222           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   11223             :         }
   11224           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   11225           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   11226             :         }
   11227             : 
   11228           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   11229           0 :                 allow_remaining = true;
   11230             :         }
   11231             : 
   11232           0 :         return py_wbint_LookupRids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   11233             : }
   11234             : 
   11235           0 : static PyObject *py_wbint_LookupRids_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   11236             : {
   11237           0 :         const struct ndr_interface_call *call = NULL;
   11238           0 :         struct wbint_LookupRids *object = (struct wbint_LookupRids *)pytalloc_get_ptr(py_obj);
   11239             :         PyObject *ret;
   11240             :         char *retstr;
   11241             : 
   11242           0 :         if (ndr_table_winbind.num_calls < 17) {
   11243           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupRids_ndr_print");
   11244           0 :                 return NULL;
   11245             :         }
   11246           0 :         call = &ndr_table_winbind.calls[16];
   11247             : 
   11248           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   11249           0 :         ret = PyUnicode_FromString(retstr);
   11250           0 :         TALLOC_FREE(retstr);
   11251             : 
   11252           0 :         return ret;
   11253             : }
   11254             : 
   11255           0 : static PyObject *py_wbint_LookupRids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   11256             : {
   11257           0 :         return py_wbint_LookupRids_ndr_print(py_obj, "wbint_LookupRids_in", NDR_IN);
   11258             : }
   11259             : 
   11260           0 : static PyObject *py_wbint_LookupRids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   11261             : {
   11262           0 :         return py_wbint_LookupRids_ndr_print(py_obj, "wbint_LookupRids_out", NDR_OUT);
   11263             : }
   11264             : 
   11265             : static PyMethodDef py_wbint_LookupRids_methods[] = {
   11266             :         { "opnum", (PyCFunction)py_wbint_LookupRids_ndr_opnum, METH_NOARGS|METH_CLASS,
   11267             :                 "winbind.wbint_LookupRids.opnum() -> 16 (0x10) " },
   11268             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupRids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   11269             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   11270             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupRids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   11271             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   11272             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupRids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   11273             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   11274             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupRids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   11275             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   11276             :         { "__ndr_print_in__", (PyCFunction)py_wbint_LookupRids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   11277             :         { "__ndr_print_out__", (PyCFunction)py_wbint_LookupRids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   11278             :         { NULL, NULL, 0, NULL }
   11279             : };
   11280             : 
   11281             : 
   11282             : static PyTypeObject wbint_LookupRids_Type = {
   11283             :         PyVarObject_HEAD_INIT(NULL, 0)
   11284             :         .tp_name = "winbind.wbint_LookupRids",
   11285             :         .tp_getset = py_wbint_LookupRids_getsetters,
   11286             :         .tp_methods = py_wbint_LookupRids_methods,
   11287             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   11288             :         .tp_new = py_wbint_LookupRids_new,
   11289             : };
   11290             : 
   11291           0 : static bool pack_py_wbint_LookupRids_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupRids *r)
   11292             : {
   11293             :         PyObject *py_domain_sid;
   11294             :         PyObject *py_rids;
   11295           0 :         const char *kwnames[] = {
   11296             :                 "domain_sid", "rids", NULL
   11297             :         };
   11298             : 
   11299           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_LookupRids", discard_const_p(char *, kwnames), &py_domain_sid, &py_rids)) {
   11300           0 :                 return false;
   11301             :         }
   11302             : 
   11303           0 :         if (py_domain_sid == NULL) {
   11304           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_sid");
   11305           0 :                 return false;
   11306             :         }
   11307           0 :         r->in.domain_sid = talloc_ptrtype(r, r->in.domain_sid);
   11308           0 :         if (r->in.domain_sid == NULL) {
   11309           0 :                 PyErr_NoMemory();
   11310           0 :                 return false;
   11311             :         }
   11312           0 :         PY_CHECK_TYPE(dom_sid_Type, py_domain_sid, return false;);
   11313           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_sid)) == NULL) {
   11314           0 :                 PyErr_NoMemory();
   11315           0 :                 return false;
   11316             :         }
   11317           0 :         r->in.domain_sid = (struct dom_sid *)pytalloc_get_ptr(py_domain_sid);
   11318           0 :         if (py_rids == NULL) {
   11319           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rids");
   11320           0 :                 return false;
   11321             :         }
   11322           0 :         r->in.rids = talloc_ptrtype(r, r->in.rids);
   11323           0 :         if (r->in.rids == NULL) {
   11324           0 :                 PyErr_NoMemory();
   11325           0 :                 return false;
   11326             :         }
   11327           0 :         PY_CHECK_TYPE(&wbint_RidArray_Type, py_rids, return false;);
   11328           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_rids)) == NULL) {
   11329           0 :                 PyErr_NoMemory();
   11330           0 :                 return false;
   11331             :         }
   11332           0 :         r->in.rids = (struct wbint_RidArray *)pytalloc_get_ptr(py_rids);
   11333           0 :         return true;
   11334             : }
   11335             : 
   11336           0 : static PyObject *unpack_py_wbint_LookupRids_args_out(struct wbint_LookupRids *r)
   11337             : {
   11338             :         PyObject *result;
   11339             :         PyObject *py_domain_name;
   11340             :         PyObject *py_names;
   11341           0 :         result = PyTuple_New(2);
   11342           0 :         if (*r->out.domain_name == NULL) {
   11343           0 :                 py_domain_name = Py_None;
   11344           0 :                 Py_INCREF(py_domain_name);
   11345             :         } else {
   11346           0 :                 if (*r->out.domain_name == NULL) {
   11347           0 :                         py_domain_name = Py_None;
   11348           0 :                         Py_INCREF(py_domain_name);
   11349             :                 } else {
   11350           0 :                         py_domain_name = PyUnicode_Decode(*r->out.domain_name, strlen(*r->out.domain_name), "utf-8", "ignore");
   11351             :                 }
   11352             :         }
   11353           0 :         PyTuple_SetItem(result, 0, py_domain_name);
   11354           0 :         py_names = pytalloc_reference_ex(&wbint_Principals_Type, r->out.names, r->out.names);
   11355           0 :         PyTuple_SetItem(result, 1, py_names);
   11356           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   11357           0 :                 PyErr_SetNTSTATUS(r->out.result);
   11358           0 :                 return NULL;
   11359             :         }
   11360             : 
   11361           0 :         return result;
   11362             : }
   11363             : 
   11364             : 
   11365           0 : static PyObject *py_wbint_CheckMachineAccount_get_result(PyObject *obj, void *closure)
   11366             : {
   11367           0 :         struct wbint_CheckMachineAccount *object = (struct wbint_CheckMachineAccount *)pytalloc_get_ptr(obj);
   11368             :         PyObject *py_result;
   11369           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   11370           0 :         return py_result;
   11371             : }
   11372             : 
   11373           0 : static int py_wbint_CheckMachineAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
   11374             : {
   11375           0 :         struct wbint_CheckMachineAccount *object = (struct wbint_CheckMachineAccount *)pytalloc_get_ptr(py_obj);
   11376           0 :         if (value == NULL) {
   11377           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   11378           0 :                 return -1;
   11379             :         }
   11380           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   11381           0 :         return 0;
   11382             : }
   11383             : 
   11384             : static PyGetSetDef py_wbint_CheckMachineAccount_getsetters[] = {
   11385             :         {
   11386             :                 .name = discard_const_p(char, "result"),
   11387             :                 .get = py_wbint_CheckMachineAccount_get_result,
   11388             :                 .set = py_wbint_CheckMachineAccount_set_result,
   11389             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   11390             :         },
   11391             :         { .name = NULL }
   11392             : };
   11393             : 
   11394           0 : static PyObject *py_wbint_CheckMachineAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   11395             : {
   11396           0 :         PyObject *self = pytalloc_new(struct wbint_CheckMachineAccount, type);
   11397           0 :         return self;
   11398             : }
   11399             : 
   11400           0 : static PyObject *py_wbint_CheckMachineAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   11401             : {
   11402             : 
   11403             : 
   11404           0 :         return PyLong_FromLong(17);
   11405             : }
   11406             : 
   11407           0 : static PyObject *py_wbint_CheckMachineAccount_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   11408             : {
   11409           0 :         const struct ndr_interface_call *call = NULL;
   11410           0 :         struct wbint_CheckMachineAccount *object = (struct wbint_CheckMachineAccount *)pytalloc_get_ptr(py_obj);
   11411           0 :         PyObject *ret = NULL;
   11412           0 :         struct ndr_push *push = NULL;
   11413             :         DATA_BLOB blob;
   11414             :         enum ndr_err_code err;
   11415             : 
   11416           0 :         if (ndr_table_winbind.num_calls < 18) {
   11417           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_CheckMachineAccount_ndr_pack");
   11418           0 :                 return NULL;
   11419             :         }
   11420           0 :         call = &ndr_table_winbind.calls[17];
   11421             : 
   11422           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   11423           0 :         if (push == NULL) {
   11424           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   11425           0 :                 return NULL;
   11426             :         }
   11427             : 
   11428           0 :         push->flags |= ndr_push_flags;
   11429             : 
   11430           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   11431           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   11432           0 :                 TALLOC_FREE(push);
   11433           0 :                 PyErr_SetNdrError(err);
   11434           0 :                 return NULL;
   11435             :         }
   11436           0 :         blob = ndr_push_blob(push);
   11437           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   11438           0 :         TALLOC_FREE(push);
   11439           0 :         return ret;
   11440             : }
   11441             : 
   11442           0 : static PyObject *py_wbint_CheckMachineAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   11443             : {
   11444           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   11445           0 :         PyObject *bigendian_obj = NULL;
   11446           0 :         PyObject *ndr64_obj = NULL;
   11447           0 :         uint32_t ndr_push_flags = 0;
   11448             : 
   11449           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   11450             :                 discard_const_p(char *, kwnames),
   11451             :                 &bigendian_obj,
   11452             :                 &ndr64_obj)) {
   11453           0 :                 return NULL;
   11454             :         }
   11455             : 
   11456           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   11457           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   11458             :         }
   11459           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   11460           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   11461             :         }
   11462             : 
   11463           0 :         return py_wbint_CheckMachineAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   11464             : }
   11465             : 
   11466           0 : static PyObject *py_wbint_CheckMachineAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   11467             : {
   11468           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   11469           0 :         PyObject *bigendian_obj = NULL;
   11470           0 :         PyObject *ndr64_obj = NULL;
   11471           0 :         uint32_t ndr_push_flags = 0;
   11472             : 
   11473           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   11474             :                 discard_const_p(char *, kwnames),
   11475             :                 &bigendian_obj,
   11476             :                 &ndr64_obj)) {
   11477           0 :                 return NULL;
   11478             :         }
   11479             : 
   11480           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   11481           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   11482             :         }
   11483           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   11484           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   11485             :         }
   11486             : 
   11487           0 :         return py_wbint_CheckMachineAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   11488             : }
   11489             : 
   11490           0 : static PyObject *py_wbint_CheckMachineAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   11491             : {
   11492           0 :         const struct ndr_interface_call *call = NULL;
   11493           0 :         struct wbint_CheckMachineAccount *object = (struct wbint_CheckMachineAccount *)pytalloc_get_ptr(py_obj);
   11494           0 :         struct ndr_pull *pull = NULL;
   11495             :         enum ndr_err_code err;
   11496             : 
   11497           0 :         if (ndr_table_winbind.num_calls < 18) {
   11498           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_CheckMachineAccount_ndr_unpack");
   11499           0 :                 return NULL;
   11500             :         }
   11501           0 :         call = &ndr_table_winbind.calls[17];
   11502             : 
   11503           0 :         pull = ndr_pull_init_blob(blob, object);
   11504           0 :         if (pull == NULL) {
   11505           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   11506           0 :                 return NULL;
   11507             :         }
   11508             : 
   11509           0 :         pull->flags |= ndr_pull_flags;
   11510             : 
   11511           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   11512           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   11513           0 :                 TALLOC_FREE(pull);
   11514           0 :                 PyErr_SetNdrError(err);
   11515           0 :                 return NULL;
   11516             :         }
   11517           0 :         if (!allow_remaining) {
   11518             :                 uint32_t highest_ofs;
   11519             : 
   11520           0 :                 if (pull->offset > pull->relative_highest_offset) {
   11521           0 :                         highest_ofs = pull->offset;
   11522             :                 } else {
   11523           0 :                         highest_ofs = pull->relative_highest_offset;
   11524             :                 }
   11525           0 :                 if (highest_ofs < pull->data_size) {
   11526           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   11527             :                                 "not all bytes consumed ofs[%u] size[%u]",
   11528             :                                 highest_ofs, pull->data_size);
   11529           0 :                         TALLOC_FREE(pull);
   11530           0 :                         PyErr_SetNdrError(err);
   11531           0 :                         return NULL;
   11532             :                 }
   11533             :         }
   11534             : 
   11535           0 :         TALLOC_FREE(pull);
   11536           0 :         Py_RETURN_NONE;
   11537             : }
   11538             : 
   11539           0 : static PyObject *py_wbint_CheckMachineAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   11540             : {
   11541             :         DATA_BLOB blob;
   11542           0 :         Py_ssize_t blob_length = 0;
   11543           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   11544           0 :         PyObject *bigendian_obj = NULL;
   11545           0 :         PyObject *ndr64_obj = NULL;
   11546           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   11547           0 :         PyObject *allow_remaining_obj = NULL;
   11548           0 :         bool allow_remaining = false;
   11549             : 
   11550           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   11551             :                 discard_const_p(char *, kwnames),
   11552             :                 &blob.data, &blob_length,
   11553             :                 &bigendian_obj,
   11554             :                 &ndr64_obj,
   11555             :                 &allow_remaining_obj)) {
   11556           0 :                 return NULL;
   11557             :         }
   11558           0 :         blob.length = blob_length;
   11559             : 
   11560           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   11561           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   11562             :         }
   11563           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   11564           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   11565             :         }
   11566             : 
   11567           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   11568           0 :                 allow_remaining = true;
   11569             :         }
   11570             : 
   11571           0 :         return py_wbint_CheckMachineAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   11572             : }
   11573             : 
   11574           0 : static PyObject *py_wbint_CheckMachineAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   11575             : {
   11576             :         DATA_BLOB blob;
   11577           0 :         Py_ssize_t blob_length = 0;
   11578           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   11579           0 :         PyObject *bigendian_obj = NULL;
   11580           0 :         PyObject *ndr64_obj = NULL;
   11581           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   11582           0 :         PyObject *allow_remaining_obj = NULL;
   11583           0 :         bool allow_remaining = false;
   11584             : 
   11585           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   11586             :                 discard_const_p(char *, kwnames),
   11587             :                 &blob.data, &blob_length,
   11588             :                 &bigendian_obj,
   11589             :                 &ndr64_obj,
   11590             :                 &allow_remaining_obj)) {
   11591           0 :                 return NULL;
   11592             :         }
   11593           0 :         blob.length = blob_length;
   11594             : 
   11595           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   11596           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   11597             :         }
   11598           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   11599           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   11600             :         }
   11601             : 
   11602           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   11603           0 :                 allow_remaining = true;
   11604             :         }
   11605             : 
   11606           0 :         return py_wbint_CheckMachineAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   11607             : }
   11608             : 
   11609           0 : static PyObject *py_wbint_CheckMachineAccount_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   11610             : {
   11611           0 :         const struct ndr_interface_call *call = NULL;
   11612           0 :         struct wbint_CheckMachineAccount *object = (struct wbint_CheckMachineAccount *)pytalloc_get_ptr(py_obj);
   11613             :         PyObject *ret;
   11614             :         char *retstr;
   11615             : 
   11616           0 :         if (ndr_table_winbind.num_calls < 18) {
   11617           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_CheckMachineAccount_ndr_print");
   11618           0 :                 return NULL;
   11619             :         }
   11620           0 :         call = &ndr_table_winbind.calls[17];
   11621             : 
   11622           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   11623           0 :         ret = PyUnicode_FromString(retstr);
   11624           0 :         TALLOC_FREE(retstr);
   11625             : 
   11626           0 :         return ret;
   11627             : }
   11628             : 
   11629           0 : static PyObject *py_wbint_CheckMachineAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   11630             : {
   11631           0 :         return py_wbint_CheckMachineAccount_ndr_print(py_obj, "wbint_CheckMachineAccount_in", NDR_IN);
   11632             : }
   11633             : 
   11634           0 : static PyObject *py_wbint_CheckMachineAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   11635             : {
   11636           0 :         return py_wbint_CheckMachineAccount_ndr_print(py_obj, "wbint_CheckMachineAccount_out", NDR_OUT);
   11637             : }
   11638             : 
   11639             : static PyMethodDef py_wbint_CheckMachineAccount_methods[] = {
   11640             :         { "opnum", (PyCFunction)py_wbint_CheckMachineAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
   11641             :                 "winbind.wbint_CheckMachineAccount.opnum() -> 17 (0x11) " },
   11642             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_CheckMachineAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   11643             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   11644             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_CheckMachineAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   11645             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   11646             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_CheckMachineAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   11647             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   11648             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_CheckMachineAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   11649             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   11650             :         { "__ndr_print_in__", (PyCFunction)py_wbint_CheckMachineAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   11651             :         { "__ndr_print_out__", (PyCFunction)py_wbint_CheckMachineAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   11652             :         { NULL, NULL, 0, NULL }
   11653             : };
   11654             : 
   11655             : 
   11656             : static PyTypeObject wbint_CheckMachineAccount_Type = {
   11657             :         PyVarObject_HEAD_INIT(NULL, 0)
   11658             :         .tp_name = "winbind.wbint_CheckMachineAccount",
   11659             :         .tp_getset = py_wbint_CheckMachineAccount_getsetters,
   11660             :         .tp_methods = py_wbint_CheckMachineAccount_methods,
   11661             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   11662             :         .tp_new = py_wbint_CheckMachineAccount_new,
   11663             : };
   11664             : 
   11665           0 : static bool pack_py_wbint_CheckMachineAccount_args_in(PyObject *args, PyObject *kwargs, struct wbint_CheckMachineAccount *r)
   11666             : {
   11667           0 :         const char *kwnames[] = {
   11668             :                 NULL
   11669             :         };
   11670             : 
   11671           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_CheckMachineAccount", discard_const_p(char *, kwnames))) {
   11672           0 :                 return false;
   11673             :         }
   11674             : 
   11675           0 :         return true;
   11676             : }
   11677             : 
   11678           0 : static PyObject *unpack_py_wbint_CheckMachineAccount_args_out(struct wbint_CheckMachineAccount *r)
   11679             : {
   11680             :         PyObject *result;
   11681           0 :         result = Py_None;
   11682           0 :         Py_INCREF(result);
   11683           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   11684           0 :                 PyErr_SetNTSTATUS(r->out.result);
   11685           0 :                 return NULL;
   11686             :         }
   11687             : 
   11688           0 :         return result;
   11689             : }
   11690             : 
   11691             : 
   11692           0 : static PyObject *py_wbint_ChangeMachineAccount_in_get_dcname(PyObject *obj, void *closure)
   11693             : {
   11694           0 :         struct wbint_ChangeMachineAccount *object = (struct wbint_ChangeMachineAccount *)pytalloc_get_ptr(obj);
   11695             :         PyObject *py_dcname;
   11696           0 :         if (object->in.dcname == NULL) {
   11697           0 :                 Py_RETURN_NONE;
   11698             :         }
   11699           0 :         if (object->in.dcname == NULL) {
   11700           0 :                 py_dcname = Py_None;
   11701           0 :                 Py_INCREF(py_dcname);
   11702             :         } else {
   11703           0 :                 if (object->in.dcname == NULL) {
   11704           0 :                         py_dcname = Py_None;
   11705           0 :                         Py_INCREF(py_dcname);
   11706             :                 } else {
   11707           0 :                         py_dcname = PyUnicode_Decode(object->in.dcname, strlen(object->in.dcname), "utf-8", "ignore");
   11708             :                 }
   11709             :         }
   11710           0 :         return py_dcname;
   11711             : }
   11712             : 
   11713           0 : static int py_wbint_ChangeMachineAccount_in_set_dcname(PyObject *py_obj, PyObject *value, void *closure)
   11714             : {
   11715           0 :         struct wbint_ChangeMachineAccount *object = (struct wbint_ChangeMachineAccount *)pytalloc_get_ptr(py_obj);
   11716           0 :         if (value == NULL) {
   11717           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dcname");
   11718           0 :                 return -1;
   11719             :         }
   11720           0 :         if (value == Py_None) {
   11721           0 :                 object->in.dcname = NULL;
   11722             :         } else {
   11723           0 :                 object->in.dcname = NULL;
   11724             :                 {
   11725             :                         const char *test_str;
   11726             :                         const char *talloc_str;
   11727           0 :                         PyObject *unicode = NULL;
   11728           0 :                         if (PyUnicode_Check(value)) {
   11729           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   11730           0 :                                 if (unicode == NULL) {
   11731           0 :                                         PyErr_NoMemory();
   11732           0 :                                         return -1;
   11733             :                                 }
   11734           0 :                                 test_str = PyBytes_AS_STRING(unicode);
   11735           0 :                         } else if (PyBytes_Check(value)) {
   11736           0 :                                 test_str = PyBytes_AS_STRING(value);
   11737             :                         } else {
   11738           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   11739           0 :                                 return -1;
   11740             :                         }
   11741           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   11742           0 :                         if (unicode != NULL) {
   11743           0 :                                 Py_DECREF(unicode);
   11744             :                         }
   11745           0 :                         if (talloc_str == NULL) {
   11746           0 :                                 PyErr_NoMemory();
   11747           0 :                                 return -1;
   11748             :                         }
   11749           0 :                         object->in.dcname = talloc_str;
   11750             :                 }
   11751             :         }
   11752           0 :         return 0;
   11753             : }
   11754             : 
   11755           0 : static PyObject *py_wbint_ChangeMachineAccount_get_result(PyObject *obj, void *closure)
   11756             : {
   11757           0 :         struct wbint_ChangeMachineAccount *object = (struct wbint_ChangeMachineAccount *)pytalloc_get_ptr(obj);
   11758             :         PyObject *py_result;
   11759           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   11760           0 :         return py_result;
   11761             : }
   11762             : 
   11763           0 : static int py_wbint_ChangeMachineAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
   11764             : {
   11765           0 :         struct wbint_ChangeMachineAccount *object = (struct wbint_ChangeMachineAccount *)pytalloc_get_ptr(py_obj);
   11766           0 :         if (value == NULL) {
   11767           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   11768           0 :                 return -1;
   11769             :         }
   11770           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   11771           0 :         return 0;
   11772             : }
   11773             : 
   11774             : static PyGetSetDef py_wbint_ChangeMachineAccount_getsetters[] = {
   11775             :         {
   11776             :                 .name = discard_const_p(char, "in_dcname"),
   11777             :                 .get = py_wbint_ChangeMachineAccount_in_get_dcname,
   11778             :                 .set = py_wbint_ChangeMachineAccount_in_set_dcname,
   11779             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   11780             :         },
   11781             :         {
   11782             :                 .name = discard_const_p(char, "result"),
   11783             :                 .get = py_wbint_ChangeMachineAccount_get_result,
   11784             :                 .set = py_wbint_ChangeMachineAccount_set_result,
   11785             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   11786             :         },
   11787             :         { .name = NULL }
   11788             : };
   11789             : 
   11790           0 : static PyObject *py_wbint_ChangeMachineAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   11791             : {
   11792           0 :         PyObject *self = pytalloc_new(struct wbint_ChangeMachineAccount, type);
   11793           0 :         return self;
   11794             : }
   11795             : 
   11796           0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   11797             : {
   11798             : 
   11799             : 
   11800           0 :         return PyLong_FromLong(18);
   11801             : }
   11802             : 
   11803           0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   11804             : {
   11805           0 :         const struct ndr_interface_call *call = NULL;
   11806           0 :         struct wbint_ChangeMachineAccount *object = (struct wbint_ChangeMachineAccount *)pytalloc_get_ptr(py_obj);
   11807           0 :         PyObject *ret = NULL;
   11808           0 :         struct ndr_push *push = NULL;
   11809             :         DATA_BLOB blob;
   11810             :         enum ndr_err_code err;
   11811             : 
   11812           0 :         if (ndr_table_winbind.num_calls < 19) {
   11813           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ChangeMachineAccount_ndr_pack");
   11814           0 :                 return NULL;
   11815             :         }
   11816           0 :         call = &ndr_table_winbind.calls[18];
   11817             : 
   11818           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   11819           0 :         if (push == NULL) {
   11820           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   11821           0 :                 return NULL;
   11822             :         }
   11823             : 
   11824           0 :         push->flags |= ndr_push_flags;
   11825             : 
   11826           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   11827           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   11828           0 :                 TALLOC_FREE(push);
   11829           0 :                 PyErr_SetNdrError(err);
   11830           0 :                 return NULL;
   11831             :         }
   11832           0 :         blob = ndr_push_blob(push);
   11833           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   11834           0 :         TALLOC_FREE(push);
   11835           0 :         return ret;
   11836             : }
   11837             : 
   11838           0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   11839             : {
   11840           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   11841           0 :         PyObject *bigendian_obj = NULL;
   11842           0 :         PyObject *ndr64_obj = NULL;
   11843           0 :         uint32_t ndr_push_flags = 0;
   11844             : 
   11845           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   11846             :                 discard_const_p(char *, kwnames),
   11847             :                 &bigendian_obj,
   11848             :                 &ndr64_obj)) {
   11849           0 :                 return NULL;
   11850             :         }
   11851             : 
   11852           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   11853           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   11854             :         }
   11855           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   11856           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   11857             :         }
   11858             : 
   11859           0 :         return py_wbint_ChangeMachineAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   11860             : }
   11861             : 
   11862           0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   11863             : {
   11864           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   11865           0 :         PyObject *bigendian_obj = NULL;
   11866           0 :         PyObject *ndr64_obj = NULL;
   11867           0 :         uint32_t ndr_push_flags = 0;
   11868             : 
   11869           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   11870             :                 discard_const_p(char *, kwnames),
   11871             :                 &bigendian_obj,
   11872             :                 &ndr64_obj)) {
   11873           0 :                 return NULL;
   11874             :         }
   11875             : 
   11876           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   11877           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   11878             :         }
   11879           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   11880           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   11881             :         }
   11882             : 
   11883           0 :         return py_wbint_ChangeMachineAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   11884             : }
   11885             : 
   11886           0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   11887             : {
   11888           0 :         const struct ndr_interface_call *call = NULL;
   11889           0 :         struct wbint_ChangeMachineAccount *object = (struct wbint_ChangeMachineAccount *)pytalloc_get_ptr(py_obj);
   11890           0 :         struct ndr_pull *pull = NULL;
   11891             :         enum ndr_err_code err;
   11892             : 
   11893           0 :         if (ndr_table_winbind.num_calls < 19) {
   11894           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ChangeMachineAccount_ndr_unpack");
   11895           0 :                 return NULL;
   11896             :         }
   11897           0 :         call = &ndr_table_winbind.calls[18];
   11898             : 
   11899           0 :         pull = ndr_pull_init_blob(blob, object);
   11900           0 :         if (pull == NULL) {
   11901           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   11902           0 :                 return NULL;
   11903             :         }
   11904             : 
   11905           0 :         pull->flags |= ndr_pull_flags;
   11906             : 
   11907           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   11908           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   11909           0 :                 TALLOC_FREE(pull);
   11910           0 :                 PyErr_SetNdrError(err);
   11911           0 :                 return NULL;
   11912             :         }
   11913           0 :         if (!allow_remaining) {
   11914             :                 uint32_t highest_ofs;
   11915             : 
   11916           0 :                 if (pull->offset > pull->relative_highest_offset) {
   11917           0 :                         highest_ofs = pull->offset;
   11918             :                 } else {
   11919           0 :                         highest_ofs = pull->relative_highest_offset;
   11920             :                 }
   11921           0 :                 if (highest_ofs < pull->data_size) {
   11922           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   11923             :                                 "not all bytes consumed ofs[%u] size[%u]",
   11924             :                                 highest_ofs, pull->data_size);
   11925           0 :                         TALLOC_FREE(pull);
   11926           0 :                         PyErr_SetNdrError(err);
   11927           0 :                         return NULL;
   11928             :                 }
   11929             :         }
   11930             : 
   11931           0 :         TALLOC_FREE(pull);
   11932           0 :         Py_RETURN_NONE;
   11933             : }
   11934             : 
   11935           0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   11936             : {
   11937             :         DATA_BLOB blob;
   11938           0 :         Py_ssize_t blob_length = 0;
   11939           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   11940           0 :         PyObject *bigendian_obj = NULL;
   11941           0 :         PyObject *ndr64_obj = NULL;
   11942           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   11943           0 :         PyObject *allow_remaining_obj = NULL;
   11944           0 :         bool allow_remaining = false;
   11945             : 
   11946           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   11947             :                 discard_const_p(char *, kwnames),
   11948             :                 &blob.data, &blob_length,
   11949             :                 &bigendian_obj,
   11950             :                 &ndr64_obj,
   11951             :                 &allow_remaining_obj)) {
   11952           0 :                 return NULL;
   11953             :         }
   11954           0 :         blob.length = blob_length;
   11955             : 
   11956           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   11957           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   11958             :         }
   11959           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   11960           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   11961             :         }
   11962             : 
   11963           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   11964           0 :                 allow_remaining = true;
   11965             :         }
   11966             : 
   11967           0 :         return py_wbint_ChangeMachineAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   11968             : }
   11969             : 
   11970           0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   11971             : {
   11972             :         DATA_BLOB blob;
   11973           0 :         Py_ssize_t blob_length = 0;
   11974           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   11975           0 :         PyObject *bigendian_obj = NULL;
   11976           0 :         PyObject *ndr64_obj = NULL;
   11977           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   11978           0 :         PyObject *allow_remaining_obj = NULL;
   11979           0 :         bool allow_remaining = false;
   11980             : 
   11981           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   11982             :                 discard_const_p(char *, kwnames),
   11983             :                 &blob.data, &blob_length,
   11984             :                 &bigendian_obj,
   11985             :                 &ndr64_obj,
   11986             :                 &allow_remaining_obj)) {
   11987           0 :                 return NULL;
   11988             :         }
   11989           0 :         blob.length = blob_length;
   11990             : 
   11991           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   11992           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   11993             :         }
   11994           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   11995           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   11996             :         }
   11997             : 
   11998           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   11999           0 :                 allow_remaining = true;
   12000             :         }
   12001             : 
   12002           0 :         return py_wbint_ChangeMachineAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   12003             : }
   12004             : 
   12005           0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   12006             : {
   12007           0 :         const struct ndr_interface_call *call = NULL;
   12008           0 :         struct wbint_ChangeMachineAccount *object = (struct wbint_ChangeMachineAccount *)pytalloc_get_ptr(py_obj);
   12009             :         PyObject *ret;
   12010             :         char *retstr;
   12011             : 
   12012           0 :         if (ndr_table_winbind.num_calls < 19) {
   12013           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ChangeMachineAccount_ndr_print");
   12014           0 :                 return NULL;
   12015             :         }
   12016           0 :         call = &ndr_table_winbind.calls[18];
   12017             : 
   12018           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   12019           0 :         ret = PyUnicode_FromString(retstr);
   12020           0 :         TALLOC_FREE(retstr);
   12021             : 
   12022           0 :         return ret;
   12023             : }
   12024             : 
   12025           0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   12026             : {
   12027           0 :         return py_wbint_ChangeMachineAccount_ndr_print(py_obj, "wbint_ChangeMachineAccount_in", NDR_IN);
   12028             : }
   12029             : 
   12030           0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   12031             : {
   12032           0 :         return py_wbint_ChangeMachineAccount_ndr_print(py_obj, "wbint_ChangeMachineAccount_out", NDR_OUT);
   12033             : }
   12034             : 
   12035             : static PyMethodDef py_wbint_ChangeMachineAccount_methods[] = {
   12036             :         { "opnum", (PyCFunction)py_wbint_ChangeMachineAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
   12037             :                 "winbind.wbint_ChangeMachineAccount.opnum() -> 18 (0x12) " },
   12038             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ChangeMachineAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   12039             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   12040             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ChangeMachineAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   12041             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   12042             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ChangeMachineAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   12043             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   12044             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ChangeMachineAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   12045             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   12046             :         { "__ndr_print_in__", (PyCFunction)py_wbint_ChangeMachineAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   12047             :         { "__ndr_print_out__", (PyCFunction)py_wbint_ChangeMachineAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   12048             :         { NULL, NULL, 0, NULL }
   12049             : };
   12050             : 
   12051             : 
   12052             : static PyTypeObject wbint_ChangeMachineAccount_Type = {
   12053             :         PyVarObject_HEAD_INIT(NULL, 0)
   12054             :         .tp_name = "winbind.wbint_ChangeMachineAccount",
   12055             :         .tp_getset = py_wbint_ChangeMachineAccount_getsetters,
   12056             :         .tp_methods = py_wbint_ChangeMachineAccount_methods,
   12057             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   12058             :         .tp_new = py_wbint_ChangeMachineAccount_new,
   12059             : };
   12060             : 
   12061           0 : static bool pack_py_wbint_ChangeMachineAccount_args_in(PyObject *args, PyObject *kwargs, struct wbint_ChangeMachineAccount *r)
   12062             : {
   12063             :         PyObject *py_dcname;
   12064           0 :         const char *kwnames[] = {
   12065             :                 "dcname", NULL
   12066             :         };
   12067             : 
   12068           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_ChangeMachineAccount", discard_const_p(char *, kwnames), &py_dcname)) {
   12069           0 :                 return false;
   12070             :         }
   12071             : 
   12072           0 :         if (py_dcname == NULL) {
   12073           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dcname");
   12074           0 :                 return false;
   12075             :         }
   12076           0 :         if (py_dcname == Py_None) {
   12077           0 :                 r->in.dcname = NULL;
   12078             :         } else {
   12079           0 :                 r->in.dcname = NULL;
   12080             :                 {
   12081             :                         const char *test_str;
   12082             :                         const char *talloc_str;
   12083           0 :                         PyObject *unicode = NULL;
   12084           0 :                         if (PyUnicode_Check(py_dcname)) {
   12085           0 :                                 unicode = PyUnicode_AsEncodedString(py_dcname, "utf-8", "ignore");
   12086           0 :                                 if (unicode == NULL) {
   12087           0 :                                         PyErr_NoMemory();
   12088           0 :                                         return false;
   12089             :                                 }
   12090           0 :                                 test_str = PyBytes_AS_STRING(unicode);
   12091           0 :                         } else if (PyBytes_Check(py_dcname)) {
   12092           0 :                                 test_str = PyBytes_AS_STRING(py_dcname);
   12093             :                         } else {
   12094           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_dcname)->tp_name);
   12095           0 :                                 return false;
   12096             :                         }
   12097           0 :                         talloc_str = talloc_strdup(r, test_str);
   12098           0 :                         if (unicode != NULL) {
   12099           0 :                                 Py_DECREF(unicode);
   12100             :                         }
   12101           0 :                         if (talloc_str == NULL) {
   12102           0 :                                 PyErr_NoMemory();
   12103           0 :                                 return false;
   12104             :                         }
   12105           0 :                         r->in.dcname = talloc_str;
   12106             :                 }
   12107             :         }
   12108           0 :         return true;
   12109             : }
   12110             : 
   12111           0 : static PyObject *unpack_py_wbint_ChangeMachineAccount_args_out(struct wbint_ChangeMachineAccount *r)
   12112             : {
   12113             :         PyObject *result;
   12114           0 :         result = Py_None;
   12115           0 :         Py_INCREF(result);
   12116           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   12117           0 :                 PyErr_SetNTSTATUS(r->out.result);
   12118           0 :                 return NULL;
   12119             :         }
   12120             : 
   12121           0 :         return result;
   12122             : }
   12123             : 
   12124             : 
   12125           0 : static PyObject *py_wbint_PingDc_out_get_dcname(PyObject *obj, void *closure)
   12126             : {
   12127           0 :         struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(obj);
   12128             :         PyObject *py_dcname;
   12129           0 :         if (object->out.dcname == NULL) {
   12130           0 :                 Py_RETURN_NONE;
   12131             :         }
   12132           0 :         if (*object->out.dcname == NULL) {
   12133           0 :                 py_dcname = Py_None;
   12134           0 :                 Py_INCREF(py_dcname);
   12135             :         } else {
   12136           0 :                 if (*object->out.dcname == NULL) {
   12137           0 :                         py_dcname = Py_None;
   12138           0 :                         Py_INCREF(py_dcname);
   12139             :                 } else {
   12140           0 :                         py_dcname = PyUnicode_Decode(*object->out.dcname, strlen(*object->out.dcname), "utf-8", "ignore");
   12141             :                 }
   12142             :         }
   12143           0 :         return py_dcname;
   12144             : }
   12145             : 
   12146           0 : static int py_wbint_PingDc_out_set_dcname(PyObject *py_obj, PyObject *value, void *closure)
   12147             : {
   12148           0 :         struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(py_obj);
   12149           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dcname));
   12150           0 :         if (value == NULL) {
   12151           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dcname");
   12152           0 :                 return -1;
   12153             :         }
   12154           0 :         object->out.dcname = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dcname);
   12155           0 :         if (object->out.dcname == NULL) {
   12156           0 :                 PyErr_NoMemory();
   12157           0 :                 return -1;
   12158             :         }
   12159           0 :         if (value == Py_None) {
   12160           0 :                 *object->out.dcname = NULL;
   12161             :         } else {
   12162           0 :                 *object->out.dcname = NULL;
   12163             :                 {
   12164             :                         const char *test_str;
   12165             :                         const char *talloc_str;
   12166           0 :                         PyObject *unicode = NULL;
   12167           0 :                         if (PyUnicode_Check(value)) {
   12168           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   12169           0 :                                 if (unicode == NULL) {
   12170           0 :                                         PyErr_NoMemory();
   12171           0 :                                         return -1;
   12172             :                                 }
   12173           0 :                                 test_str = PyBytes_AS_STRING(unicode);
   12174           0 :                         } else if (PyBytes_Check(value)) {
   12175           0 :                                 test_str = PyBytes_AS_STRING(value);
   12176             :                         } else {
   12177           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   12178           0 :                                 return -1;
   12179             :                         }
   12180           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   12181           0 :                         if (unicode != NULL) {
   12182           0 :                                 Py_DECREF(unicode);
   12183             :                         }
   12184           0 :                         if (talloc_str == NULL) {
   12185           0 :                                 PyErr_NoMemory();
   12186           0 :                                 return -1;
   12187             :                         }
   12188           0 :                         *object->out.dcname = talloc_str;
   12189             :                 }
   12190             :         }
   12191           0 :         return 0;
   12192             : }
   12193             : 
   12194           0 : static PyObject *py_wbint_PingDc_get_result(PyObject *obj, void *closure)
   12195             : {
   12196           0 :         struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(obj);
   12197             :         PyObject *py_result;
   12198           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   12199           0 :         return py_result;
   12200             : }
   12201             : 
   12202           0 : static int py_wbint_PingDc_set_result(PyObject *py_obj, PyObject *value, void *closure)
   12203             : {
   12204           0 :         struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(py_obj);
   12205           0 :         if (value == NULL) {
   12206           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   12207           0 :                 return -1;
   12208             :         }
   12209           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   12210           0 :         return 0;
   12211             : }
   12212             : 
   12213             : static PyGetSetDef py_wbint_PingDc_getsetters[] = {
   12214             :         {
   12215             :                 .name = discard_const_p(char, "out_dcname"),
   12216             :                 .get = py_wbint_PingDc_out_get_dcname,
   12217             :                 .set = py_wbint_PingDc_out_set_dcname,
   12218             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   12219             :         },
   12220             :         {
   12221             :                 .name = discard_const_p(char, "result"),
   12222             :                 .get = py_wbint_PingDc_get_result,
   12223             :                 .set = py_wbint_PingDc_set_result,
   12224             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   12225             :         },
   12226             :         { .name = NULL }
   12227             : };
   12228             : 
   12229           0 : static PyObject *py_wbint_PingDc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   12230             : {
   12231           0 :         PyObject *self = pytalloc_new(struct wbint_PingDc, type);
   12232           0 :         return self;
   12233             : }
   12234             : 
   12235           0 : static PyObject *py_wbint_PingDc_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   12236             : {
   12237             : 
   12238             : 
   12239           0 :         return PyLong_FromLong(19);
   12240             : }
   12241             : 
   12242           0 : static PyObject *py_wbint_PingDc_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   12243             : {
   12244           0 :         const struct ndr_interface_call *call = NULL;
   12245           0 :         struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(py_obj);
   12246           0 :         PyObject *ret = NULL;
   12247           0 :         struct ndr_push *push = NULL;
   12248             :         DATA_BLOB blob;
   12249             :         enum ndr_err_code err;
   12250             : 
   12251           0 :         if (ndr_table_winbind.num_calls < 20) {
   12252           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PingDc_ndr_pack");
   12253           0 :                 return NULL;
   12254             :         }
   12255           0 :         call = &ndr_table_winbind.calls[19];
   12256             : 
   12257           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   12258           0 :         if (push == NULL) {
   12259           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   12260           0 :                 return NULL;
   12261             :         }
   12262             : 
   12263           0 :         push->flags |= ndr_push_flags;
   12264             : 
   12265           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   12266           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   12267           0 :                 TALLOC_FREE(push);
   12268           0 :                 PyErr_SetNdrError(err);
   12269           0 :                 return NULL;
   12270             :         }
   12271           0 :         blob = ndr_push_blob(push);
   12272           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   12273           0 :         TALLOC_FREE(push);
   12274           0 :         return ret;
   12275             : }
   12276             : 
   12277           0 : static PyObject *py_wbint_PingDc_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   12278             : {
   12279           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   12280           0 :         PyObject *bigendian_obj = NULL;
   12281           0 :         PyObject *ndr64_obj = NULL;
   12282           0 :         uint32_t ndr_push_flags = 0;
   12283             : 
   12284           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   12285             :                 discard_const_p(char *, kwnames),
   12286             :                 &bigendian_obj,
   12287             :                 &ndr64_obj)) {
   12288           0 :                 return NULL;
   12289             :         }
   12290             : 
   12291           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   12292           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   12293             :         }
   12294           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   12295           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   12296             :         }
   12297             : 
   12298           0 :         return py_wbint_PingDc_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   12299             : }
   12300             : 
   12301           0 : static PyObject *py_wbint_PingDc_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   12302             : {
   12303           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   12304           0 :         PyObject *bigendian_obj = NULL;
   12305           0 :         PyObject *ndr64_obj = NULL;
   12306           0 :         uint32_t ndr_push_flags = 0;
   12307             : 
   12308           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   12309             :                 discard_const_p(char *, kwnames),
   12310             :                 &bigendian_obj,
   12311             :                 &ndr64_obj)) {
   12312           0 :                 return NULL;
   12313             :         }
   12314             : 
   12315           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   12316           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   12317             :         }
   12318           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   12319           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   12320             :         }
   12321             : 
   12322           0 :         return py_wbint_PingDc_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   12323             : }
   12324             : 
   12325           0 : static PyObject *py_wbint_PingDc_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   12326             : {
   12327           0 :         const struct ndr_interface_call *call = NULL;
   12328           0 :         struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(py_obj);
   12329           0 :         struct ndr_pull *pull = NULL;
   12330             :         enum ndr_err_code err;
   12331             : 
   12332           0 :         if (ndr_table_winbind.num_calls < 20) {
   12333           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PingDc_ndr_unpack");
   12334           0 :                 return NULL;
   12335             :         }
   12336           0 :         call = &ndr_table_winbind.calls[19];
   12337             : 
   12338           0 :         pull = ndr_pull_init_blob(blob, object);
   12339           0 :         if (pull == NULL) {
   12340           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   12341           0 :                 return NULL;
   12342             :         }
   12343             : 
   12344           0 :         pull->flags |= ndr_pull_flags;
   12345             : 
   12346           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   12347           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   12348           0 :                 TALLOC_FREE(pull);
   12349           0 :                 PyErr_SetNdrError(err);
   12350           0 :                 return NULL;
   12351             :         }
   12352           0 :         if (!allow_remaining) {
   12353             :                 uint32_t highest_ofs;
   12354             : 
   12355           0 :                 if (pull->offset > pull->relative_highest_offset) {
   12356           0 :                         highest_ofs = pull->offset;
   12357             :                 } else {
   12358           0 :                         highest_ofs = pull->relative_highest_offset;
   12359             :                 }
   12360           0 :                 if (highest_ofs < pull->data_size) {
   12361           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   12362             :                                 "not all bytes consumed ofs[%u] size[%u]",
   12363             :                                 highest_ofs, pull->data_size);
   12364           0 :                         TALLOC_FREE(pull);
   12365           0 :                         PyErr_SetNdrError(err);
   12366           0 :                         return NULL;
   12367             :                 }
   12368             :         }
   12369             : 
   12370           0 :         TALLOC_FREE(pull);
   12371           0 :         Py_RETURN_NONE;
   12372             : }
   12373             : 
   12374           0 : static PyObject *py_wbint_PingDc_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   12375             : {
   12376             :         DATA_BLOB blob;
   12377           0 :         Py_ssize_t blob_length = 0;
   12378           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   12379           0 :         PyObject *bigendian_obj = NULL;
   12380           0 :         PyObject *ndr64_obj = NULL;
   12381           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   12382           0 :         PyObject *allow_remaining_obj = NULL;
   12383           0 :         bool allow_remaining = false;
   12384             : 
   12385           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   12386             :                 discard_const_p(char *, kwnames),
   12387             :                 &blob.data, &blob_length,
   12388             :                 &bigendian_obj,
   12389             :                 &ndr64_obj,
   12390             :                 &allow_remaining_obj)) {
   12391           0 :                 return NULL;
   12392             :         }
   12393           0 :         blob.length = blob_length;
   12394             : 
   12395           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   12396           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   12397             :         }
   12398           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   12399           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   12400             :         }
   12401             : 
   12402           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   12403           0 :                 allow_remaining = true;
   12404             :         }
   12405             : 
   12406           0 :         return py_wbint_PingDc_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   12407             : }
   12408             : 
   12409           0 : static PyObject *py_wbint_PingDc_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   12410             : {
   12411             :         DATA_BLOB blob;
   12412           0 :         Py_ssize_t blob_length = 0;
   12413           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   12414           0 :         PyObject *bigendian_obj = NULL;
   12415           0 :         PyObject *ndr64_obj = NULL;
   12416           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   12417           0 :         PyObject *allow_remaining_obj = NULL;
   12418           0 :         bool allow_remaining = false;
   12419             : 
   12420           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   12421             :                 discard_const_p(char *, kwnames),
   12422             :                 &blob.data, &blob_length,
   12423             :                 &bigendian_obj,
   12424             :                 &ndr64_obj,
   12425             :                 &allow_remaining_obj)) {
   12426           0 :                 return NULL;
   12427             :         }
   12428           0 :         blob.length = blob_length;
   12429             : 
   12430           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   12431           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   12432             :         }
   12433           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   12434           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   12435             :         }
   12436             : 
   12437           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   12438           0 :                 allow_remaining = true;
   12439             :         }
   12440             : 
   12441           0 :         return py_wbint_PingDc_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   12442             : }
   12443             : 
   12444           0 : static PyObject *py_wbint_PingDc_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   12445             : {
   12446           0 :         const struct ndr_interface_call *call = NULL;
   12447           0 :         struct wbint_PingDc *object = (struct wbint_PingDc *)pytalloc_get_ptr(py_obj);
   12448             :         PyObject *ret;
   12449             :         char *retstr;
   12450             : 
   12451           0 :         if (ndr_table_winbind.num_calls < 20) {
   12452           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PingDc_ndr_print");
   12453           0 :                 return NULL;
   12454             :         }
   12455           0 :         call = &ndr_table_winbind.calls[19];
   12456             : 
   12457           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   12458           0 :         ret = PyUnicode_FromString(retstr);
   12459           0 :         TALLOC_FREE(retstr);
   12460             : 
   12461           0 :         return ret;
   12462             : }
   12463             : 
   12464           0 : static PyObject *py_wbint_PingDc_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   12465             : {
   12466           0 :         return py_wbint_PingDc_ndr_print(py_obj, "wbint_PingDc_in", NDR_IN);
   12467             : }
   12468             : 
   12469           0 : static PyObject *py_wbint_PingDc_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   12470             : {
   12471           0 :         return py_wbint_PingDc_ndr_print(py_obj, "wbint_PingDc_out", NDR_OUT);
   12472             : }
   12473             : 
   12474             : static PyMethodDef py_wbint_PingDc_methods[] = {
   12475             :         { "opnum", (PyCFunction)py_wbint_PingDc_ndr_opnum, METH_NOARGS|METH_CLASS,
   12476             :                 "winbind.wbint_PingDc.opnum() -> 19 (0x13) " },
   12477             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PingDc_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   12478             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   12479             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PingDc_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   12480             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   12481             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PingDc_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   12482             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   12483             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PingDc_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   12484             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   12485             :         { "__ndr_print_in__", (PyCFunction)py_wbint_PingDc_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   12486             :         { "__ndr_print_out__", (PyCFunction)py_wbint_PingDc_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   12487             :         { NULL, NULL, 0, NULL }
   12488             : };
   12489             : 
   12490             : 
   12491             : static PyTypeObject wbint_PingDc_Type = {
   12492             :         PyVarObject_HEAD_INIT(NULL, 0)
   12493             :         .tp_name = "winbind.wbint_PingDc",
   12494             :         .tp_getset = py_wbint_PingDc_getsetters,
   12495             :         .tp_methods = py_wbint_PingDc_methods,
   12496             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   12497             :         .tp_new = py_wbint_PingDc_new,
   12498             : };
   12499             : 
   12500           0 : static bool pack_py_wbint_PingDc_args_in(PyObject *args, PyObject *kwargs, struct wbint_PingDc *r)
   12501             : {
   12502           0 :         const char *kwnames[] = {
   12503             :                 NULL
   12504             :         };
   12505             : 
   12506           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_PingDc", discard_const_p(char *, kwnames))) {
   12507           0 :                 return false;
   12508             :         }
   12509             : 
   12510           0 :         return true;
   12511             : }
   12512             : 
   12513           0 : static PyObject *unpack_py_wbint_PingDc_args_out(struct wbint_PingDc *r)
   12514             : {
   12515             :         PyObject *result;
   12516             :         PyObject *py_dcname;
   12517           0 :         if (*r->out.dcname == NULL) {
   12518           0 :                 py_dcname = Py_None;
   12519           0 :                 Py_INCREF(py_dcname);
   12520             :         } else {
   12521           0 :                 if (*r->out.dcname == NULL) {
   12522           0 :                         py_dcname = Py_None;
   12523           0 :                         Py_INCREF(py_dcname);
   12524             :                 } else {
   12525           0 :                         py_dcname = PyUnicode_Decode(*r->out.dcname, strlen(*r->out.dcname), "utf-8", "ignore");
   12526             :                 }
   12527             :         }
   12528           0 :         result = py_dcname;
   12529           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   12530           0 :                 PyErr_SetNTSTATUS(r->out.result);
   12531           0 :                 return NULL;
   12532             :         }
   12533             : 
   12534           0 :         return result;
   12535             : }
   12536             : 
   12537             : 
   12538           0 : static PyObject *py_wbint_ListTrustedDomains_in_get_client_name(PyObject *obj, void *closure)
   12539             : {
   12540           0 :         struct wbint_ListTrustedDomains *object = (struct wbint_ListTrustedDomains *)pytalloc_get_ptr(obj);
   12541             :         PyObject *py_client_name;
   12542           0 :         if (object->in.client_name == NULL) {
   12543           0 :                 Py_RETURN_NONE;
   12544             :         }
   12545           0 :         if (object->in.client_name == NULL) {
   12546           0 :                 py_client_name = Py_None;
   12547           0 :                 Py_INCREF(py_client_name);
   12548             :         } else {
   12549           0 :                 py_client_name = PyUnicode_Decode(object->in.client_name, strlen(object->in.client_name), "utf-8", "ignore");
   12550             :         }
   12551           0 :         return py_client_name;
   12552             : }
   12553             : 
   12554           0 : static int py_wbint_ListTrustedDomains_in_set_client_name(PyObject *py_obj, PyObject *value, void *closure)
   12555             : {
   12556           0 :         struct wbint_ListTrustedDomains *object = (struct wbint_ListTrustedDomains *)pytalloc_get_ptr(py_obj);
   12557           0 :         if (value == NULL) {
   12558           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_name");
   12559           0 :                 return -1;
   12560             :         }
   12561           0 :         object->in.client_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.client_name);
   12562           0 :         if (object->in.client_name == NULL) {
   12563           0 :                 PyErr_NoMemory();
   12564           0 :                 return -1;
   12565             :         }
   12566             :         {
   12567             :                 const char *test_str;
   12568             :                 const char *talloc_str;
   12569           0 :                 PyObject *unicode = NULL;
   12570           0 :                 if (PyUnicode_Check(value)) {
   12571           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   12572           0 :                         if (unicode == NULL) {
   12573           0 :                                 PyErr_NoMemory();
   12574           0 :                                 return -1;
   12575             :                         }
   12576           0 :                         test_str = PyBytes_AS_STRING(unicode);
   12577           0 :                 } else if (PyBytes_Check(value)) {
   12578           0 :                         test_str = PyBytes_AS_STRING(value);
   12579             :                 } else {
   12580           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   12581           0 :                         return -1;
   12582             :                 }
   12583           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   12584           0 :                 if (unicode != NULL) {
   12585           0 :                         Py_DECREF(unicode);
   12586             :                 }
   12587           0 :                 if (talloc_str == NULL) {
   12588           0 :                         PyErr_NoMemory();
   12589           0 :                         return -1;
   12590             :                 }
   12591           0 :                 object->in.client_name = talloc_str;
   12592             :         }
   12593           0 :         return 0;
   12594             : }
   12595             : 
   12596           0 : static PyObject *py_wbint_ListTrustedDomains_in_get_client_pid(PyObject *obj, void *closure)
   12597             : {
   12598           0 :         struct wbint_ListTrustedDomains *object = (struct wbint_ListTrustedDomains *)pytalloc_get_ptr(obj);
   12599             :         PyObject *py_client_pid;
   12600           0 :         py_client_pid = PyLong_FromUnsignedLongLong(object->in.client_pid);
   12601           0 :         return py_client_pid;
   12602             : }
   12603             : 
   12604           0 : static int py_wbint_ListTrustedDomains_in_set_client_pid(PyObject *py_obj, PyObject *value, void *closure)
   12605             : {
   12606           0 :         struct wbint_ListTrustedDomains *object = (struct wbint_ListTrustedDomains *)pytalloc_get_ptr(py_obj);
   12607           0 :         if (value == NULL) {
   12608           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_pid");
   12609           0 :                 return -1;
   12610             :         }
   12611             :         {
   12612           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_pid));
   12613           0 :                 if (PyLong_Check(value)) {
   12614             :                         unsigned long long test_var;
   12615           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   12616           0 :                         if (PyErr_Occurred() != NULL) {
   12617           0 :                                 return -1;
   12618             :                         }
   12619           0 :                         if (test_var > uint_max) {
   12620           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   12621             :                                   PyLong_Type.tp_name, uint_max, test_var);
   12622           0 :                                 return -1;
   12623             :                         }
   12624           0 :                         object->in.client_pid = test_var;
   12625             :                 } else {
   12626           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   12627             :                           PyLong_Type.tp_name);
   12628           0 :                         return -1;
   12629             :                 }
   12630             :         }
   12631           0 :         return 0;
   12632             : }
   12633             : 
   12634           0 : static PyObject *py_wbint_ListTrustedDomains_out_get_domains(PyObject *obj, void *closure)
   12635             : {
   12636           0 :         struct wbint_ListTrustedDomains *object = (struct wbint_ListTrustedDomains *)pytalloc_get_ptr(obj);
   12637             :         PyObject *py_domains;
   12638           0 :         if (object->out.domains == NULL) {
   12639           0 :                 Py_RETURN_NONE;
   12640             :         }
   12641           0 :         py_domains = pytalloc_reference_ex(netr_DomainTrustList_Type, object->out.domains, object->out.domains);
   12642           0 :         return py_domains;
   12643             : }
   12644             : 
   12645           0 : static int py_wbint_ListTrustedDomains_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
   12646             : {
   12647           0 :         struct wbint_ListTrustedDomains *object = (struct wbint_ListTrustedDomains *)pytalloc_get_ptr(py_obj);
   12648           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
   12649           0 :         if (value == NULL) {
   12650           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
   12651           0 :                 return -1;
   12652             :         }
   12653           0 :         object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
   12654           0 :         if (object->out.domains == NULL) {
   12655           0 :                 PyErr_NoMemory();
   12656           0 :                 return -1;
   12657             :         }
   12658           0 :         PY_CHECK_TYPE(netr_DomainTrustList_Type, value, return -1;);
   12659           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   12660           0 :                 PyErr_NoMemory();
   12661           0 :                 return -1;
   12662             :         }
   12663           0 :         object->out.domains = (struct netr_DomainTrustList *)pytalloc_get_ptr(value);
   12664           0 :         return 0;
   12665             : }
   12666             : 
   12667           0 : static PyObject *py_wbint_ListTrustedDomains_get_result(PyObject *obj, void *closure)
   12668             : {
   12669           0 :         struct wbint_ListTrustedDomains *object = (struct wbint_ListTrustedDomains *)pytalloc_get_ptr(obj);
   12670             :         PyObject *py_result;
   12671           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   12672           0 :         return py_result;
   12673             : }
   12674             : 
   12675           0 : static int py_wbint_ListTrustedDomains_set_result(PyObject *py_obj, PyObject *value, void *closure)
   12676             : {
   12677           0 :         struct wbint_ListTrustedDomains *object = (struct wbint_ListTrustedDomains *)pytalloc_get_ptr(py_obj);
   12678           0 :         if (value == NULL) {
   12679           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   12680           0 :                 return -1;
   12681             :         }
   12682           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   12683           0 :         return 0;
   12684             : }
   12685             : 
   12686             : static PyGetSetDef py_wbint_ListTrustedDomains_getsetters[] = {
   12687             :         {
   12688             :                 .name = discard_const_p(char, "in_client_name"),
   12689             :                 .get = py_wbint_ListTrustedDomains_in_get_client_name,
   12690             :                 .set = py_wbint_ListTrustedDomains_in_set_client_name,
   12691             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   12692             :         },
   12693             :         {
   12694             :                 .name = discard_const_p(char, "in_client_pid"),
   12695             :                 .get = py_wbint_ListTrustedDomains_in_get_client_pid,
   12696             :                 .set = py_wbint_ListTrustedDomains_in_set_client_pid,
   12697             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
   12698             :         },
   12699             :         {
   12700             :                 .name = discard_const_p(char, "out_domains"),
   12701             :                 .get = py_wbint_ListTrustedDomains_out_get_domains,
   12702             :                 .set = py_wbint_ListTrustedDomains_out_set_domains,
   12703             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_DomainTrustList")
   12704             :         },
   12705             :         {
   12706             :                 .name = discard_const_p(char, "result"),
   12707             :                 .get = py_wbint_ListTrustedDomains_get_result,
   12708             :                 .set = py_wbint_ListTrustedDomains_set_result,
   12709             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   12710             :         },
   12711             :         { .name = NULL }
   12712             : };
   12713             : 
   12714           0 : static PyObject *py_wbint_ListTrustedDomains_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   12715             : {
   12716           0 :         PyObject *self = pytalloc_new(struct wbint_ListTrustedDomains, type);
   12717           0 :         struct wbint_ListTrustedDomains *_self = (struct wbint_ListTrustedDomains *)pytalloc_get_ptr(self);
   12718           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
   12719           0 :         _self->out.domains = talloc_zero(mem_ctx, struct netr_DomainTrustList);
   12720           0 :         return self;
   12721             : }
   12722             : 
   12723           0 : static PyObject *py_wbint_ListTrustedDomains_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   12724             : {
   12725             : 
   12726             : 
   12727           0 :         return PyLong_FromLong(20);
   12728             : }
   12729             : 
   12730           0 : static PyObject *py_wbint_ListTrustedDomains_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   12731             : {
   12732           0 :         const struct ndr_interface_call *call = NULL;
   12733           0 :         struct wbint_ListTrustedDomains *object = (struct wbint_ListTrustedDomains *)pytalloc_get_ptr(py_obj);
   12734           0 :         PyObject *ret = NULL;
   12735           0 :         struct ndr_push *push = NULL;
   12736             :         DATA_BLOB blob;
   12737             :         enum ndr_err_code err;
   12738             : 
   12739           0 :         if (ndr_table_winbind.num_calls < 21) {
   12740           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ListTrustedDomains_ndr_pack");
   12741           0 :                 return NULL;
   12742             :         }
   12743           0 :         call = &ndr_table_winbind.calls[20];
   12744             : 
   12745           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   12746           0 :         if (push == NULL) {
   12747           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   12748           0 :                 return NULL;
   12749             :         }
   12750             : 
   12751           0 :         push->flags |= ndr_push_flags;
   12752             : 
   12753           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   12754           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   12755           0 :                 TALLOC_FREE(push);
   12756           0 :                 PyErr_SetNdrError(err);
   12757           0 :                 return NULL;
   12758             :         }
   12759           0 :         blob = ndr_push_blob(push);
   12760           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   12761           0 :         TALLOC_FREE(push);
   12762           0 :         return ret;
   12763             : }
   12764             : 
   12765           0 : static PyObject *py_wbint_ListTrustedDomains_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   12766             : {
   12767           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   12768           0 :         PyObject *bigendian_obj = NULL;
   12769           0 :         PyObject *ndr64_obj = NULL;
   12770           0 :         uint32_t ndr_push_flags = 0;
   12771             : 
   12772           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   12773             :                 discard_const_p(char *, kwnames),
   12774             :                 &bigendian_obj,
   12775             :                 &ndr64_obj)) {
   12776           0 :                 return NULL;
   12777             :         }
   12778             : 
   12779           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   12780           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   12781             :         }
   12782           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   12783           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   12784             :         }
   12785             : 
   12786           0 :         return py_wbint_ListTrustedDomains_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   12787             : }
   12788             : 
   12789           0 : static PyObject *py_wbint_ListTrustedDomains_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   12790             : {
   12791           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   12792           0 :         PyObject *bigendian_obj = NULL;
   12793           0 :         PyObject *ndr64_obj = NULL;
   12794           0 :         uint32_t ndr_push_flags = 0;
   12795             : 
   12796           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   12797             :                 discard_const_p(char *, kwnames),
   12798             :                 &bigendian_obj,
   12799             :                 &ndr64_obj)) {
   12800           0 :                 return NULL;
   12801             :         }
   12802             : 
   12803           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   12804           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   12805             :         }
   12806           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   12807           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   12808             :         }
   12809             : 
   12810           0 :         return py_wbint_ListTrustedDomains_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   12811             : }
   12812             : 
   12813           0 : static PyObject *py_wbint_ListTrustedDomains_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   12814             : {
   12815           0 :         const struct ndr_interface_call *call = NULL;
   12816           0 :         struct wbint_ListTrustedDomains *object = (struct wbint_ListTrustedDomains *)pytalloc_get_ptr(py_obj);
   12817           0 :         struct ndr_pull *pull = NULL;
   12818             :         enum ndr_err_code err;
   12819             : 
   12820           0 :         if (ndr_table_winbind.num_calls < 21) {
   12821           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ListTrustedDomains_ndr_unpack");
   12822           0 :                 return NULL;
   12823             :         }
   12824           0 :         call = &ndr_table_winbind.calls[20];
   12825             : 
   12826           0 :         pull = ndr_pull_init_blob(blob, object);
   12827           0 :         if (pull == NULL) {
   12828           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   12829           0 :                 return NULL;
   12830             :         }
   12831             : 
   12832           0 :         pull->flags |= ndr_pull_flags;
   12833             : 
   12834           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   12835           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   12836           0 :                 TALLOC_FREE(pull);
   12837           0 :                 PyErr_SetNdrError(err);
   12838           0 :                 return NULL;
   12839             :         }
   12840           0 :         if (!allow_remaining) {
   12841             :                 uint32_t highest_ofs;
   12842             : 
   12843           0 :                 if (pull->offset > pull->relative_highest_offset) {
   12844           0 :                         highest_ofs = pull->offset;
   12845             :                 } else {
   12846           0 :                         highest_ofs = pull->relative_highest_offset;
   12847             :                 }
   12848           0 :                 if (highest_ofs < pull->data_size) {
   12849           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   12850             :                                 "not all bytes consumed ofs[%u] size[%u]",
   12851             :                                 highest_ofs, pull->data_size);
   12852           0 :                         TALLOC_FREE(pull);
   12853           0 :                         PyErr_SetNdrError(err);
   12854           0 :                         return NULL;
   12855             :                 }
   12856             :         }
   12857             : 
   12858           0 :         TALLOC_FREE(pull);
   12859           0 :         Py_RETURN_NONE;
   12860             : }
   12861             : 
   12862           0 : static PyObject *py_wbint_ListTrustedDomains_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   12863             : {
   12864             :         DATA_BLOB blob;
   12865           0 :         Py_ssize_t blob_length = 0;
   12866           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   12867           0 :         PyObject *bigendian_obj = NULL;
   12868           0 :         PyObject *ndr64_obj = NULL;
   12869           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   12870           0 :         PyObject *allow_remaining_obj = NULL;
   12871           0 :         bool allow_remaining = false;
   12872             : 
   12873           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   12874             :                 discard_const_p(char *, kwnames),
   12875             :                 &blob.data, &blob_length,
   12876             :                 &bigendian_obj,
   12877             :                 &ndr64_obj,
   12878             :                 &allow_remaining_obj)) {
   12879           0 :                 return NULL;
   12880             :         }
   12881           0 :         blob.length = blob_length;
   12882             : 
   12883           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   12884           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   12885             :         }
   12886           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   12887           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   12888             :         }
   12889             : 
   12890           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   12891           0 :                 allow_remaining = true;
   12892             :         }
   12893             : 
   12894           0 :         return py_wbint_ListTrustedDomains_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   12895             : }
   12896             : 
   12897           0 : static PyObject *py_wbint_ListTrustedDomains_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   12898             : {
   12899             :         DATA_BLOB blob;
   12900           0 :         Py_ssize_t blob_length = 0;
   12901           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   12902           0 :         PyObject *bigendian_obj = NULL;
   12903           0 :         PyObject *ndr64_obj = NULL;
   12904           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   12905           0 :         PyObject *allow_remaining_obj = NULL;
   12906           0 :         bool allow_remaining = false;
   12907             : 
   12908           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   12909             :                 discard_const_p(char *, kwnames),
   12910             :                 &blob.data, &blob_length,
   12911             :                 &bigendian_obj,
   12912             :                 &ndr64_obj,
   12913             :                 &allow_remaining_obj)) {
   12914           0 :                 return NULL;
   12915             :         }
   12916           0 :         blob.length = blob_length;
   12917             : 
   12918           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   12919           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   12920             :         }
   12921           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   12922           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   12923             :         }
   12924             : 
   12925           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   12926           0 :                 allow_remaining = true;
   12927             :         }
   12928             : 
   12929           0 :         return py_wbint_ListTrustedDomains_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   12930             : }
   12931             : 
   12932           0 : static PyObject *py_wbint_ListTrustedDomains_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   12933             : {
   12934           0 :         const struct ndr_interface_call *call = NULL;
   12935           0 :         struct wbint_ListTrustedDomains *object = (struct wbint_ListTrustedDomains *)pytalloc_get_ptr(py_obj);
   12936             :         PyObject *ret;
   12937             :         char *retstr;
   12938             : 
   12939           0 :         if (ndr_table_winbind.num_calls < 21) {
   12940           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ListTrustedDomains_ndr_print");
   12941           0 :                 return NULL;
   12942             :         }
   12943           0 :         call = &ndr_table_winbind.calls[20];
   12944             : 
   12945           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   12946           0 :         ret = PyUnicode_FromString(retstr);
   12947           0 :         TALLOC_FREE(retstr);
   12948             : 
   12949           0 :         return ret;
   12950             : }
   12951             : 
   12952           0 : static PyObject *py_wbint_ListTrustedDomains_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   12953             : {
   12954           0 :         return py_wbint_ListTrustedDomains_ndr_print(py_obj, "wbint_ListTrustedDomains_in", NDR_IN);
   12955             : }
   12956             : 
   12957           0 : static PyObject *py_wbint_ListTrustedDomains_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   12958             : {
   12959           0 :         return py_wbint_ListTrustedDomains_ndr_print(py_obj, "wbint_ListTrustedDomains_out", NDR_OUT);
   12960             : }
   12961             : 
   12962             : static PyMethodDef py_wbint_ListTrustedDomains_methods[] = {
   12963             :         { "opnum", (PyCFunction)py_wbint_ListTrustedDomains_ndr_opnum, METH_NOARGS|METH_CLASS,
   12964             :                 "winbind.wbint_ListTrustedDomains.opnum() -> 20 (0x14) " },
   12965             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ListTrustedDomains_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   12966             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   12967             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ListTrustedDomains_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   12968             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   12969             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ListTrustedDomains_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   12970             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   12971             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ListTrustedDomains_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   12972             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   12973             :         { "__ndr_print_in__", (PyCFunction)py_wbint_ListTrustedDomains_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   12974             :         { "__ndr_print_out__", (PyCFunction)py_wbint_ListTrustedDomains_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   12975             :         { NULL, NULL, 0, NULL }
   12976             : };
   12977             : 
   12978             : 
   12979             : static PyTypeObject wbint_ListTrustedDomains_Type = {
   12980             :         PyVarObject_HEAD_INIT(NULL, 0)
   12981             :         .tp_name = "winbind.wbint_ListTrustedDomains",
   12982             :         .tp_getset = py_wbint_ListTrustedDomains_getsetters,
   12983             :         .tp_methods = py_wbint_ListTrustedDomains_methods,
   12984             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   12985             :         .tp_new = py_wbint_ListTrustedDomains_new,
   12986             : };
   12987             : 
   12988           0 : static bool pack_py_wbint_ListTrustedDomains_args_in(PyObject *args, PyObject *kwargs, struct wbint_ListTrustedDomains *r)
   12989             : {
   12990             :         PyObject *py_client_name;
   12991             :         PyObject *py_client_pid;
   12992           0 :         const char *kwnames[] = {
   12993             :                 "client_name", "client_pid", NULL
   12994             :         };
   12995             : 
   12996           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_ListTrustedDomains", discard_const_p(char *, kwnames), &py_client_name, &py_client_pid)) {
   12997           0 :                 return false;
   12998             :         }
   12999             : 
   13000           0 :         if (py_client_name == NULL) {
   13001           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_name");
   13002           0 :                 return false;
   13003             :         }
   13004           0 :         r->in.client_name = talloc_ptrtype(r, r->in.client_name);
   13005           0 :         if (r->in.client_name == NULL) {
   13006           0 :                 PyErr_NoMemory();
   13007           0 :                 return false;
   13008             :         }
   13009             :         {
   13010             :                 const char *test_str;
   13011             :                 const char *talloc_str;
   13012           0 :                 PyObject *unicode = NULL;
   13013           0 :                 if (PyUnicode_Check(py_client_name)) {
   13014           0 :                         unicode = PyUnicode_AsEncodedString(py_client_name, "utf-8", "ignore");
   13015           0 :                         if (unicode == NULL) {
   13016           0 :                                 PyErr_NoMemory();
   13017           0 :                                 return false;
   13018             :                         }
   13019           0 :                         test_str = PyBytes_AS_STRING(unicode);
   13020           0 :                 } else if (PyBytes_Check(py_client_name)) {
   13021           0 :                         test_str = PyBytes_AS_STRING(py_client_name);
   13022             :                 } else {
   13023           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_name)->tp_name);
   13024           0 :                         return false;
   13025             :                 }
   13026           0 :                 talloc_str = talloc_strdup(r, test_str);
   13027           0 :                 if (unicode != NULL) {
   13028           0 :                         Py_DECREF(unicode);
   13029             :                 }
   13030           0 :                 if (talloc_str == NULL) {
   13031           0 :                         PyErr_NoMemory();
   13032           0 :                         return false;
   13033             :                 }
   13034           0 :                 r->in.client_name = talloc_str;
   13035             :         }
   13036           0 :         if (py_client_pid == NULL) {
   13037           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_pid");
   13038           0 :                 return false;
   13039             :         }
   13040             :         {
   13041           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_pid));
   13042           0 :                 if (PyLong_Check(py_client_pid)) {
   13043             :                         unsigned long long test_var;
   13044           0 :                         test_var = PyLong_AsUnsignedLongLong(py_client_pid);
   13045           0 :                         if (PyErr_Occurred() != NULL) {
   13046           0 :                                 return false;
   13047             :                         }
   13048           0 :                         if (test_var > uint_max) {
   13049           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   13050             :                                   PyLong_Type.tp_name, uint_max, test_var);
   13051           0 :                                 return false;
   13052             :                         }
   13053           0 :                         r->in.client_pid = test_var;
   13054             :                 } else {
   13055           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   13056             :                           PyLong_Type.tp_name);
   13057           0 :                         return false;
   13058             :                 }
   13059             :         }
   13060           0 :         return true;
   13061             : }
   13062             : 
   13063           0 : static PyObject *unpack_py_wbint_ListTrustedDomains_args_out(struct wbint_ListTrustedDomains *r)
   13064             : {
   13065             :         PyObject *result;
   13066             :         PyObject *py_domains;
   13067           0 :         py_domains = pytalloc_reference_ex(netr_DomainTrustList_Type, r->out.domains, r->out.domains);
   13068           0 :         result = py_domains;
   13069           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   13070           0 :                 PyErr_SetNTSTATUS(r->out.result);
   13071           0 :                 return NULL;
   13072             :         }
   13073             : 
   13074           0 :         return result;
   13075             : }
   13076             : 
   13077             : 
   13078           0 : static PyObject *py_wbint_PamAuth_in_get_client_name(PyObject *obj, void *closure)
   13079             : {
   13080           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(obj);
   13081             :         PyObject *py_client_name;
   13082           0 :         if (object->in.client_name == NULL) {
   13083           0 :                 Py_RETURN_NONE;
   13084             :         }
   13085           0 :         if (object->in.client_name == NULL) {
   13086           0 :                 py_client_name = Py_None;
   13087           0 :                 Py_INCREF(py_client_name);
   13088             :         } else {
   13089           0 :                 py_client_name = PyUnicode_Decode(object->in.client_name, strlen(object->in.client_name), "utf-8", "ignore");
   13090             :         }
   13091           0 :         return py_client_name;
   13092             : }
   13093             : 
   13094           0 : static int py_wbint_PamAuth_in_set_client_name(PyObject *py_obj, PyObject *value, void *closure)
   13095             : {
   13096           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(py_obj);
   13097           0 :         if (value == NULL) {
   13098           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_name");
   13099           0 :                 return -1;
   13100             :         }
   13101           0 :         object->in.client_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.client_name);
   13102           0 :         if (object->in.client_name == NULL) {
   13103           0 :                 PyErr_NoMemory();
   13104           0 :                 return -1;
   13105             :         }
   13106             :         {
   13107             :                 const char *test_str;
   13108             :                 const char *talloc_str;
   13109           0 :                 PyObject *unicode = NULL;
   13110           0 :                 if (PyUnicode_Check(value)) {
   13111           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   13112           0 :                         if (unicode == NULL) {
   13113           0 :                                 PyErr_NoMemory();
   13114           0 :                                 return -1;
   13115             :                         }
   13116           0 :                         test_str = PyBytes_AS_STRING(unicode);
   13117           0 :                 } else if (PyBytes_Check(value)) {
   13118           0 :                         test_str = PyBytes_AS_STRING(value);
   13119             :                 } else {
   13120           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   13121           0 :                         return -1;
   13122             :                 }
   13123           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   13124           0 :                 if (unicode != NULL) {
   13125           0 :                         Py_DECREF(unicode);
   13126             :                 }
   13127           0 :                 if (talloc_str == NULL) {
   13128           0 :                         PyErr_NoMemory();
   13129           0 :                         return -1;
   13130             :                 }
   13131           0 :                 object->in.client_name = talloc_str;
   13132             :         }
   13133           0 :         return 0;
   13134             : }
   13135             : 
   13136           0 : static PyObject *py_wbint_PamAuth_in_get_client_pid(PyObject *obj, void *closure)
   13137             : {
   13138           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(obj);
   13139             :         PyObject *py_client_pid;
   13140           0 :         py_client_pid = PyLong_FromUnsignedLongLong(object->in.client_pid);
   13141           0 :         return py_client_pid;
   13142             : }
   13143             : 
   13144           0 : static int py_wbint_PamAuth_in_set_client_pid(PyObject *py_obj, PyObject *value, void *closure)
   13145             : {
   13146           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(py_obj);
   13147           0 :         if (value == NULL) {
   13148           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_pid");
   13149           0 :                 return -1;
   13150             :         }
   13151             :         {
   13152           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_pid));
   13153           0 :                 if (PyLong_Check(value)) {
   13154             :                         unsigned long long test_var;
   13155           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   13156           0 :                         if (PyErr_Occurred() != NULL) {
   13157           0 :                                 return -1;
   13158             :                         }
   13159           0 :                         if (test_var > uint_max) {
   13160           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   13161             :                                   PyLong_Type.tp_name, uint_max, test_var);
   13162           0 :                                 return -1;
   13163             :                         }
   13164           0 :                         object->in.client_pid = test_var;
   13165             :                 } else {
   13166           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   13167             :                           PyLong_Type.tp_name);
   13168           0 :                         return -1;
   13169             :                 }
   13170             :         }
   13171           0 :         return 0;
   13172             : }
   13173             : 
   13174           0 : static PyObject *py_wbint_PamAuth_in_get_flags(PyObject *obj, void *closure)
   13175             : {
   13176           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(obj);
   13177             :         PyObject *py_flags;
   13178           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
   13179           0 :         return py_flags;
   13180             : }
   13181             : 
   13182           0 : static int py_wbint_PamAuth_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
   13183             : {
   13184           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(py_obj);
   13185           0 :         if (value == NULL) {
   13186           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
   13187           0 :                 return -1;
   13188             :         }
   13189             :         {
   13190           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
   13191           0 :                 if (PyLong_Check(value)) {
   13192             :                         unsigned long long test_var;
   13193           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   13194           0 :                         if (PyErr_Occurred() != NULL) {
   13195           0 :                                 return -1;
   13196             :                         }
   13197           0 :                         if (test_var > uint_max) {
   13198           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   13199             :                                   PyLong_Type.tp_name, uint_max, test_var);
   13200           0 :                                 return -1;
   13201             :                         }
   13202           0 :                         object->in.flags = test_var;
   13203             :                 } else {
   13204           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   13205             :                           PyLong_Type.tp_name);
   13206           0 :                         return -1;
   13207             :                 }
   13208             :         }
   13209           0 :         return 0;
   13210             : }
   13211             : 
   13212           0 : static PyObject *py_wbint_PamAuth_in_get_info(PyObject *obj, void *closure)
   13213             : {
   13214           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(obj);
   13215             :         PyObject *py_info;
   13216           0 :         if (object->in.info == NULL) {
   13217           0 :                 Py_RETURN_NONE;
   13218             :         }
   13219           0 :         py_info = pytalloc_reference_ex(&wbint_AuthUserInfo_Type, object->in.info, object->in.info);
   13220           0 :         return py_info;
   13221             : }
   13222             : 
   13223           0 : static int py_wbint_PamAuth_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
   13224             : {
   13225           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(py_obj);
   13226           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
   13227           0 :         if (value == NULL) {
   13228           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
   13229           0 :                 return -1;
   13230             :         }
   13231           0 :         object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
   13232           0 :         if (object->in.info == NULL) {
   13233           0 :                 PyErr_NoMemory();
   13234           0 :                 return -1;
   13235             :         }
   13236           0 :         PY_CHECK_TYPE(&wbint_AuthUserInfo_Type, value, return -1;);
   13237           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   13238           0 :                 PyErr_NoMemory();
   13239           0 :                 return -1;
   13240             :         }
   13241           0 :         object->in.info = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(value);
   13242           0 :         return 0;
   13243             : }
   13244             : 
   13245           0 : static PyObject *py_wbint_PamAuth_in_get_require_membership_of_sid(PyObject *obj, void *closure)
   13246             : {
   13247           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(obj);
   13248             :         PyObject *py_require_membership_of_sid;
   13249           0 :         if (object->in.require_membership_of_sid == NULL) {
   13250           0 :                 Py_RETURN_NONE;
   13251             :         }
   13252           0 :         py_require_membership_of_sid = pytalloc_reference_ex(&wbint_SidArray_Type, object->in.require_membership_of_sid, object->in.require_membership_of_sid);
   13253           0 :         return py_require_membership_of_sid;
   13254             : }
   13255             : 
   13256           0 : static int py_wbint_PamAuth_in_set_require_membership_of_sid(PyObject *py_obj, PyObject *value, void *closure)
   13257             : {
   13258           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(py_obj);
   13259           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.require_membership_of_sid));
   13260           0 :         if (value == NULL) {
   13261           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.require_membership_of_sid");
   13262           0 :                 return -1;
   13263             :         }
   13264           0 :         object->in.require_membership_of_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.require_membership_of_sid);
   13265           0 :         if (object->in.require_membership_of_sid == NULL) {
   13266           0 :                 PyErr_NoMemory();
   13267           0 :                 return -1;
   13268             :         }
   13269           0 :         PY_CHECK_TYPE(&wbint_SidArray_Type, value, return -1;);
   13270           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   13271           0 :                 PyErr_NoMemory();
   13272           0 :                 return -1;
   13273             :         }
   13274           0 :         object->in.require_membership_of_sid = (struct wbint_SidArray *)pytalloc_get_ptr(value);
   13275           0 :         return 0;
   13276             : }
   13277             : 
   13278           0 : static PyObject *py_wbint_PamAuth_out_get_validation(PyObject *obj, void *closure)
   13279             : {
   13280           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(obj);
   13281             :         PyObject *py_validation;
   13282           0 :         if (object->out.validation == NULL) {
   13283           0 :                 Py_RETURN_NONE;
   13284             :         }
   13285           0 :         py_validation = pytalloc_reference_ex(&wbint_Validation_Type, object->out.validation, object->out.validation);
   13286           0 :         return py_validation;
   13287             : }
   13288             : 
   13289           0 : static int py_wbint_PamAuth_out_set_validation(PyObject *py_obj, PyObject *value, void *closure)
   13290             : {
   13291           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(py_obj);
   13292           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.validation));
   13293           0 :         if (value == NULL) {
   13294           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.validation");
   13295           0 :                 return -1;
   13296             :         }
   13297           0 :         object->out.validation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.validation);
   13298           0 :         if (object->out.validation == NULL) {
   13299           0 :                 PyErr_NoMemory();
   13300           0 :                 return -1;
   13301             :         }
   13302           0 :         PY_CHECK_TYPE(&wbint_Validation_Type, value, return -1;);
   13303           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   13304           0 :                 PyErr_NoMemory();
   13305           0 :                 return -1;
   13306             :         }
   13307           0 :         object->out.validation = (struct wbint_Validation *)pytalloc_get_ptr(value);
   13308           0 :         return 0;
   13309             : }
   13310             : 
   13311           0 : static PyObject *py_wbint_PamAuth_get_result(PyObject *obj, void *closure)
   13312             : {
   13313           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(obj);
   13314             :         PyObject *py_result;
   13315           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   13316           0 :         return py_result;
   13317             : }
   13318             : 
   13319           0 : static int py_wbint_PamAuth_set_result(PyObject *py_obj, PyObject *value, void *closure)
   13320             : {
   13321           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(py_obj);
   13322           0 :         if (value == NULL) {
   13323           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   13324           0 :                 return -1;
   13325             :         }
   13326           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   13327           0 :         return 0;
   13328             : }
   13329             : 
   13330             : static PyGetSetDef py_wbint_PamAuth_getsetters[] = {
   13331             :         {
   13332             :                 .name = discard_const_p(char, "in_client_name"),
   13333             :                 .get = py_wbint_PamAuth_in_get_client_name,
   13334             :                 .set = py_wbint_PamAuth_in_set_client_name,
   13335             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   13336             :         },
   13337             :         {
   13338             :                 .name = discard_const_p(char, "in_client_pid"),
   13339             :                 .get = py_wbint_PamAuth_in_get_client_pid,
   13340             :                 .set = py_wbint_PamAuth_in_set_client_pid,
   13341             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
   13342             :         },
   13343             :         {
   13344             :                 .name = discard_const_p(char, "in_flags"),
   13345             :                 .get = py_wbint_PamAuth_in_get_flags,
   13346             :                 .set = py_wbint_PamAuth_in_set_flags,
   13347             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
   13348             :         },
   13349             :         {
   13350             :                 .name = discard_const_p(char, "in_info"),
   13351             :                 .get = py_wbint_PamAuth_in_get_info,
   13352             :                 .set = py_wbint_PamAuth_in_set_info,
   13353             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_AuthUserInfo")
   13354             :         },
   13355             :         {
   13356             :                 .name = discard_const_p(char, "in_require_membership_of_sid"),
   13357             :                 .get = py_wbint_PamAuth_in_get_require_membership_of_sid,
   13358             :                 .set = py_wbint_PamAuth_in_set_require_membership_of_sid,
   13359             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_SidArray")
   13360             :         },
   13361             :         {
   13362             :                 .name = discard_const_p(char, "out_validation"),
   13363             :                 .get = py_wbint_PamAuth_out_get_validation,
   13364             :                 .set = py_wbint_PamAuth_out_set_validation,
   13365             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Validation")
   13366             :         },
   13367             :         {
   13368             :                 .name = discard_const_p(char, "result"),
   13369             :                 .get = py_wbint_PamAuth_get_result,
   13370             :                 .set = py_wbint_PamAuth_set_result,
   13371             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   13372             :         },
   13373             :         { .name = NULL }
   13374             : };
   13375             : 
   13376           0 : static PyObject *py_wbint_PamAuth_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   13377             : {
   13378           0 :         PyObject *self = pytalloc_new(struct wbint_PamAuth, type);
   13379           0 :         struct wbint_PamAuth *_self = (struct wbint_PamAuth *)pytalloc_get_ptr(self);
   13380           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
   13381           0 :         _self->in.info = talloc_zero(mem_ctx, struct wbint_AuthUserInfo);
   13382           0 :         _self->in.require_membership_of_sid = talloc_zero(mem_ctx, struct wbint_SidArray);
   13383           0 :         _self->out.validation = talloc_zero(mem_ctx, struct wbint_Validation);
   13384           0 :         return self;
   13385             : }
   13386             : 
   13387           0 : static PyObject *py_wbint_PamAuth_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   13388             : {
   13389             : 
   13390             : 
   13391           0 :         return PyLong_FromLong(21);
   13392             : }
   13393             : 
   13394           0 : static PyObject *py_wbint_PamAuth_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   13395             : {
   13396           0 :         const struct ndr_interface_call *call = NULL;
   13397           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(py_obj);
   13398           0 :         PyObject *ret = NULL;
   13399           0 :         struct ndr_push *push = NULL;
   13400             :         DATA_BLOB blob;
   13401             :         enum ndr_err_code err;
   13402             : 
   13403           0 :         if (ndr_table_winbind.num_calls < 22) {
   13404           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuth_ndr_pack");
   13405           0 :                 return NULL;
   13406             :         }
   13407           0 :         call = &ndr_table_winbind.calls[21];
   13408             : 
   13409           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   13410           0 :         if (push == NULL) {
   13411           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   13412           0 :                 return NULL;
   13413             :         }
   13414             : 
   13415           0 :         push->flags |= ndr_push_flags;
   13416             : 
   13417           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   13418           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   13419           0 :                 TALLOC_FREE(push);
   13420           0 :                 PyErr_SetNdrError(err);
   13421           0 :                 return NULL;
   13422             :         }
   13423           0 :         blob = ndr_push_blob(push);
   13424           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   13425           0 :         TALLOC_FREE(push);
   13426           0 :         return ret;
   13427             : }
   13428             : 
   13429           0 : static PyObject *py_wbint_PamAuth_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   13430             : {
   13431           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   13432           0 :         PyObject *bigendian_obj = NULL;
   13433           0 :         PyObject *ndr64_obj = NULL;
   13434           0 :         uint32_t ndr_push_flags = 0;
   13435             : 
   13436           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   13437             :                 discard_const_p(char *, kwnames),
   13438             :                 &bigendian_obj,
   13439             :                 &ndr64_obj)) {
   13440           0 :                 return NULL;
   13441             :         }
   13442             : 
   13443           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   13444           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   13445             :         }
   13446           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   13447           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   13448             :         }
   13449             : 
   13450           0 :         return py_wbint_PamAuth_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   13451             : }
   13452             : 
   13453           0 : static PyObject *py_wbint_PamAuth_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   13454             : {
   13455           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   13456           0 :         PyObject *bigendian_obj = NULL;
   13457           0 :         PyObject *ndr64_obj = NULL;
   13458           0 :         uint32_t ndr_push_flags = 0;
   13459             : 
   13460           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   13461             :                 discard_const_p(char *, kwnames),
   13462             :                 &bigendian_obj,
   13463             :                 &ndr64_obj)) {
   13464           0 :                 return NULL;
   13465             :         }
   13466             : 
   13467           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   13468           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   13469             :         }
   13470           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   13471           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   13472             :         }
   13473             : 
   13474           0 :         return py_wbint_PamAuth_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   13475             : }
   13476             : 
   13477           0 : static PyObject *py_wbint_PamAuth_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   13478             : {
   13479           0 :         const struct ndr_interface_call *call = NULL;
   13480           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(py_obj);
   13481           0 :         struct ndr_pull *pull = NULL;
   13482             :         enum ndr_err_code err;
   13483             : 
   13484           0 :         if (ndr_table_winbind.num_calls < 22) {
   13485           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuth_ndr_unpack");
   13486           0 :                 return NULL;
   13487             :         }
   13488           0 :         call = &ndr_table_winbind.calls[21];
   13489             : 
   13490           0 :         pull = ndr_pull_init_blob(blob, object);
   13491           0 :         if (pull == NULL) {
   13492           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   13493           0 :                 return NULL;
   13494             :         }
   13495             : 
   13496           0 :         pull->flags |= ndr_pull_flags;
   13497             : 
   13498           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   13499           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   13500           0 :                 TALLOC_FREE(pull);
   13501           0 :                 PyErr_SetNdrError(err);
   13502           0 :                 return NULL;
   13503             :         }
   13504           0 :         if (!allow_remaining) {
   13505             :                 uint32_t highest_ofs;
   13506             : 
   13507           0 :                 if (pull->offset > pull->relative_highest_offset) {
   13508           0 :                         highest_ofs = pull->offset;
   13509             :                 } else {
   13510           0 :                         highest_ofs = pull->relative_highest_offset;
   13511             :                 }
   13512           0 :                 if (highest_ofs < pull->data_size) {
   13513           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   13514             :                                 "not all bytes consumed ofs[%u] size[%u]",
   13515             :                                 highest_ofs, pull->data_size);
   13516           0 :                         TALLOC_FREE(pull);
   13517           0 :                         PyErr_SetNdrError(err);
   13518           0 :                         return NULL;
   13519             :                 }
   13520             :         }
   13521             : 
   13522           0 :         TALLOC_FREE(pull);
   13523           0 :         Py_RETURN_NONE;
   13524             : }
   13525             : 
   13526           0 : static PyObject *py_wbint_PamAuth_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   13527             : {
   13528             :         DATA_BLOB blob;
   13529           0 :         Py_ssize_t blob_length = 0;
   13530           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   13531           0 :         PyObject *bigendian_obj = NULL;
   13532           0 :         PyObject *ndr64_obj = NULL;
   13533           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   13534           0 :         PyObject *allow_remaining_obj = NULL;
   13535           0 :         bool allow_remaining = false;
   13536             : 
   13537           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   13538             :                 discard_const_p(char *, kwnames),
   13539             :                 &blob.data, &blob_length,
   13540             :                 &bigendian_obj,
   13541             :                 &ndr64_obj,
   13542             :                 &allow_remaining_obj)) {
   13543           0 :                 return NULL;
   13544             :         }
   13545           0 :         blob.length = blob_length;
   13546             : 
   13547           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   13548           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   13549             :         }
   13550           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   13551           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   13552             :         }
   13553             : 
   13554           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   13555           0 :                 allow_remaining = true;
   13556             :         }
   13557             : 
   13558           0 :         return py_wbint_PamAuth_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   13559             : }
   13560             : 
   13561           0 : static PyObject *py_wbint_PamAuth_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   13562             : {
   13563             :         DATA_BLOB blob;
   13564           0 :         Py_ssize_t blob_length = 0;
   13565           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   13566           0 :         PyObject *bigendian_obj = NULL;
   13567           0 :         PyObject *ndr64_obj = NULL;
   13568           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   13569           0 :         PyObject *allow_remaining_obj = NULL;
   13570           0 :         bool allow_remaining = false;
   13571             : 
   13572           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   13573             :                 discard_const_p(char *, kwnames),
   13574             :                 &blob.data, &blob_length,
   13575             :                 &bigendian_obj,
   13576             :                 &ndr64_obj,
   13577             :                 &allow_remaining_obj)) {
   13578           0 :                 return NULL;
   13579             :         }
   13580           0 :         blob.length = blob_length;
   13581             : 
   13582           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   13583           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   13584             :         }
   13585           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   13586           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   13587             :         }
   13588             : 
   13589           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   13590           0 :                 allow_remaining = true;
   13591             :         }
   13592             : 
   13593           0 :         return py_wbint_PamAuth_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   13594             : }
   13595             : 
   13596           0 : static PyObject *py_wbint_PamAuth_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   13597             : {
   13598           0 :         const struct ndr_interface_call *call = NULL;
   13599           0 :         struct wbint_PamAuth *object = (struct wbint_PamAuth *)pytalloc_get_ptr(py_obj);
   13600             :         PyObject *ret;
   13601             :         char *retstr;
   13602             : 
   13603           0 :         if (ndr_table_winbind.num_calls < 22) {
   13604           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuth_ndr_print");
   13605           0 :                 return NULL;
   13606             :         }
   13607           0 :         call = &ndr_table_winbind.calls[21];
   13608             : 
   13609           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   13610           0 :         ret = PyUnicode_FromString(retstr);
   13611           0 :         TALLOC_FREE(retstr);
   13612             : 
   13613           0 :         return ret;
   13614             : }
   13615             : 
   13616           0 : static PyObject *py_wbint_PamAuth_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   13617             : {
   13618           0 :         return py_wbint_PamAuth_ndr_print(py_obj, "wbint_PamAuth_in", NDR_IN);
   13619             : }
   13620             : 
   13621           0 : static PyObject *py_wbint_PamAuth_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   13622             : {
   13623           0 :         return py_wbint_PamAuth_ndr_print(py_obj, "wbint_PamAuth_out", NDR_OUT);
   13624             : }
   13625             : 
   13626             : static PyMethodDef py_wbint_PamAuth_methods[] = {
   13627             :         { "opnum", (PyCFunction)py_wbint_PamAuth_ndr_opnum, METH_NOARGS|METH_CLASS,
   13628             :                 "winbind.wbint_PamAuth.opnum() -> 21 (0x15) " },
   13629             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuth_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   13630             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   13631             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuth_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   13632             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   13633             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuth_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   13634             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   13635             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuth_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   13636             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   13637             :         { "__ndr_print_in__", (PyCFunction)py_wbint_PamAuth_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   13638             :         { "__ndr_print_out__", (PyCFunction)py_wbint_PamAuth_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   13639             :         { NULL, NULL, 0, NULL }
   13640             : };
   13641             : 
   13642             : 
   13643             : static PyTypeObject wbint_PamAuth_Type = {
   13644             :         PyVarObject_HEAD_INIT(NULL, 0)
   13645             :         .tp_name = "winbind.wbint_PamAuth",
   13646             :         .tp_getset = py_wbint_PamAuth_getsetters,
   13647             :         .tp_methods = py_wbint_PamAuth_methods,
   13648             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   13649             :         .tp_new = py_wbint_PamAuth_new,
   13650             : };
   13651             : 
   13652           0 : static bool pack_py_wbint_PamAuth_args_in(PyObject *args, PyObject *kwargs, struct wbint_PamAuth *r)
   13653             : {
   13654             :         PyObject *py_client_name;
   13655             :         PyObject *py_client_pid;
   13656             :         PyObject *py_flags;
   13657             :         PyObject *py_info;
   13658             :         PyObject *py_require_membership_of_sid;
   13659           0 :         const char *kwnames[] = {
   13660             :                 "client_name", "client_pid", "flags", "info", "require_membership_of_sid", NULL
   13661             :         };
   13662             : 
   13663           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:wbint_PamAuth", discard_const_p(char *, kwnames), &py_client_name, &py_client_pid, &py_flags, &py_info, &py_require_membership_of_sid)) {
   13664           0 :                 return false;
   13665             :         }
   13666             : 
   13667           0 :         if (py_client_name == NULL) {
   13668           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_name");
   13669           0 :                 return false;
   13670             :         }
   13671           0 :         r->in.client_name = talloc_ptrtype(r, r->in.client_name);
   13672           0 :         if (r->in.client_name == NULL) {
   13673           0 :                 PyErr_NoMemory();
   13674           0 :                 return false;
   13675             :         }
   13676             :         {
   13677             :                 const char *test_str;
   13678             :                 const char *talloc_str;
   13679           0 :                 PyObject *unicode = NULL;
   13680           0 :                 if (PyUnicode_Check(py_client_name)) {
   13681           0 :                         unicode = PyUnicode_AsEncodedString(py_client_name, "utf-8", "ignore");
   13682           0 :                         if (unicode == NULL) {
   13683           0 :                                 PyErr_NoMemory();
   13684           0 :                                 return false;
   13685             :                         }
   13686           0 :                         test_str = PyBytes_AS_STRING(unicode);
   13687           0 :                 } else if (PyBytes_Check(py_client_name)) {
   13688           0 :                         test_str = PyBytes_AS_STRING(py_client_name);
   13689             :                 } else {
   13690           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_name)->tp_name);
   13691           0 :                         return false;
   13692             :                 }
   13693           0 :                 talloc_str = talloc_strdup(r, test_str);
   13694           0 :                 if (unicode != NULL) {
   13695           0 :                         Py_DECREF(unicode);
   13696             :                 }
   13697           0 :                 if (talloc_str == NULL) {
   13698           0 :                         PyErr_NoMemory();
   13699           0 :                         return false;
   13700             :                 }
   13701           0 :                 r->in.client_name = talloc_str;
   13702             :         }
   13703           0 :         if (py_client_pid == NULL) {
   13704           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_pid");
   13705           0 :                 return false;
   13706             :         }
   13707             :         {
   13708           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_pid));
   13709           0 :                 if (PyLong_Check(py_client_pid)) {
   13710             :                         unsigned long long test_var;
   13711           0 :                         test_var = PyLong_AsUnsignedLongLong(py_client_pid);
   13712           0 :                         if (PyErr_Occurred() != NULL) {
   13713           0 :                                 return false;
   13714             :                         }
   13715           0 :                         if (test_var > uint_max) {
   13716           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   13717             :                                   PyLong_Type.tp_name, uint_max, test_var);
   13718           0 :                                 return false;
   13719             :                         }
   13720           0 :                         r->in.client_pid = test_var;
   13721             :                 } else {
   13722           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   13723             :                           PyLong_Type.tp_name);
   13724           0 :                         return false;
   13725             :                 }
   13726             :         }
   13727           0 :         if (py_flags == NULL) {
   13728           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
   13729           0 :                 return false;
   13730             :         }
   13731             :         {
   13732           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
   13733           0 :                 if (PyLong_Check(py_flags)) {
   13734             :                         unsigned long long test_var;
   13735           0 :                         test_var = PyLong_AsUnsignedLongLong(py_flags);
   13736           0 :                         if (PyErr_Occurred() != NULL) {
   13737           0 :                                 return false;
   13738             :                         }
   13739           0 :                         if (test_var > uint_max) {
   13740           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   13741             :                                   PyLong_Type.tp_name, uint_max, test_var);
   13742           0 :                                 return false;
   13743             :                         }
   13744           0 :                         r->in.flags = test_var;
   13745             :                 } else {
   13746           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   13747             :                           PyLong_Type.tp_name);
   13748           0 :                         return false;
   13749             :                 }
   13750             :         }
   13751           0 :         if (py_info == NULL) {
   13752           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
   13753           0 :                 return false;
   13754             :         }
   13755           0 :         r->in.info = talloc_ptrtype(r, r->in.info);
   13756           0 :         if (r->in.info == NULL) {
   13757           0 :                 PyErr_NoMemory();
   13758           0 :                 return false;
   13759             :         }
   13760           0 :         PY_CHECK_TYPE(&wbint_AuthUserInfo_Type, py_info, return false;);
   13761           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
   13762           0 :                 PyErr_NoMemory();
   13763           0 :                 return false;
   13764             :         }
   13765           0 :         r->in.info = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(py_info);
   13766           0 :         if (py_require_membership_of_sid == NULL) {
   13767           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.require_membership_of_sid");
   13768           0 :                 return false;
   13769             :         }
   13770           0 :         r->in.require_membership_of_sid = talloc_ptrtype(r, r->in.require_membership_of_sid);
   13771           0 :         if (r->in.require_membership_of_sid == NULL) {
   13772           0 :                 PyErr_NoMemory();
   13773           0 :                 return false;
   13774             :         }
   13775           0 :         PY_CHECK_TYPE(&wbint_SidArray_Type, py_require_membership_of_sid, return false;);
   13776           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_require_membership_of_sid)) == NULL) {
   13777           0 :                 PyErr_NoMemory();
   13778           0 :                 return false;
   13779             :         }
   13780           0 :         r->in.require_membership_of_sid = (struct wbint_SidArray *)pytalloc_get_ptr(py_require_membership_of_sid);
   13781           0 :         return true;
   13782             : }
   13783             : 
   13784           0 : static PyObject *unpack_py_wbint_PamAuth_args_out(struct wbint_PamAuth *r)
   13785             : {
   13786             :         PyObject *result;
   13787             :         PyObject *py_validation;
   13788           0 :         py_validation = pytalloc_reference_ex(&wbint_Validation_Type, r->out.validation, r->out.validation);
   13789           0 :         result = py_validation;
   13790           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   13791           0 :                 PyErr_SetNTSTATUS(r->out.result);
   13792           0 :                 return NULL;
   13793             :         }
   13794             : 
   13795           0 :         return result;
   13796             : }
   13797             : 
   13798             : 
   13799           0 : static PyObject *py_wbint_PamAuthCrap_in_get_client_name(PyObject *obj, void *closure)
   13800             : {
   13801           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   13802             :         PyObject *py_client_name;
   13803           0 :         if (object->in.client_name == NULL) {
   13804           0 :                 Py_RETURN_NONE;
   13805             :         }
   13806           0 :         if (object->in.client_name == NULL) {
   13807           0 :                 py_client_name = Py_None;
   13808           0 :                 Py_INCREF(py_client_name);
   13809             :         } else {
   13810           0 :                 py_client_name = PyUnicode_Decode(object->in.client_name, strlen(object->in.client_name), "utf-8", "ignore");
   13811             :         }
   13812           0 :         return py_client_name;
   13813             : }
   13814             : 
   13815           0 : static int py_wbint_PamAuthCrap_in_set_client_name(PyObject *py_obj, PyObject *value, void *closure)
   13816             : {
   13817           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   13818           0 :         if (value == NULL) {
   13819           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_name");
   13820           0 :                 return -1;
   13821             :         }
   13822           0 :         object->in.client_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.client_name);
   13823           0 :         if (object->in.client_name == NULL) {
   13824           0 :                 PyErr_NoMemory();
   13825           0 :                 return -1;
   13826             :         }
   13827             :         {
   13828             :                 const char *test_str;
   13829             :                 const char *talloc_str;
   13830           0 :                 PyObject *unicode = NULL;
   13831           0 :                 if (PyUnicode_Check(value)) {
   13832           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   13833           0 :                         if (unicode == NULL) {
   13834           0 :                                 PyErr_NoMemory();
   13835           0 :                                 return -1;
   13836             :                         }
   13837           0 :                         test_str = PyBytes_AS_STRING(unicode);
   13838           0 :                 } else if (PyBytes_Check(value)) {
   13839           0 :                         test_str = PyBytes_AS_STRING(value);
   13840             :                 } else {
   13841           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   13842           0 :                         return -1;
   13843             :                 }
   13844           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   13845           0 :                 if (unicode != NULL) {
   13846           0 :                         Py_DECREF(unicode);
   13847             :                 }
   13848           0 :                 if (talloc_str == NULL) {
   13849           0 :                         PyErr_NoMemory();
   13850           0 :                         return -1;
   13851             :                 }
   13852           0 :                 object->in.client_name = talloc_str;
   13853             :         }
   13854           0 :         return 0;
   13855             : }
   13856             : 
   13857           0 : static PyObject *py_wbint_PamAuthCrap_in_get_client_pid(PyObject *obj, void *closure)
   13858             : {
   13859           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   13860             :         PyObject *py_client_pid;
   13861           0 :         py_client_pid = PyLong_FromUnsignedLongLong(object->in.client_pid);
   13862           0 :         return py_client_pid;
   13863             : }
   13864             : 
   13865           0 : static int py_wbint_PamAuthCrap_in_set_client_pid(PyObject *py_obj, PyObject *value, void *closure)
   13866             : {
   13867           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   13868           0 :         if (value == NULL) {
   13869           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_pid");
   13870           0 :                 return -1;
   13871             :         }
   13872             :         {
   13873           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_pid));
   13874           0 :                 if (PyLong_Check(value)) {
   13875             :                         unsigned long long test_var;
   13876           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   13877           0 :                         if (PyErr_Occurred() != NULL) {
   13878           0 :                                 return -1;
   13879             :                         }
   13880           0 :                         if (test_var > uint_max) {
   13881           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   13882             :                                   PyLong_Type.tp_name, uint_max, test_var);
   13883           0 :                                 return -1;
   13884             :                         }
   13885           0 :                         object->in.client_pid = test_var;
   13886             :                 } else {
   13887           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   13888             :                           PyLong_Type.tp_name);
   13889           0 :                         return -1;
   13890             :                 }
   13891             :         }
   13892           0 :         return 0;
   13893             : }
   13894             : 
   13895           0 : static PyObject *py_wbint_PamAuthCrap_in_get_flags(PyObject *obj, void *closure)
   13896             : {
   13897           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   13898             :         PyObject *py_flags;
   13899           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
   13900           0 :         return py_flags;
   13901             : }
   13902             : 
   13903           0 : static int py_wbint_PamAuthCrap_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
   13904             : {
   13905           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   13906           0 :         if (value == NULL) {
   13907           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
   13908           0 :                 return -1;
   13909             :         }
   13910             :         {
   13911           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
   13912           0 :                 if (PyLong_Check(value)) {
   13913             :                         unsigned long long test_var;
   13914           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   13915           0 :                         if (PyErr_Occurred() != NULL) {
   13916           0 :                                 return -1;
   13917             :                         }
   13918           0 :                         if (test_var > uint_max) {
   13919           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   13920             :                                   PyLong_Type.tp_name, uint_max, test_var);
   13921           0 :                                 return -1;
   13922             :                         }
   13923           0 :                         object->in.flags = test_var;
   13924             :                 } else {
   13925           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   13926             :                           PyLong_Type.tp_name);
   13927           0 :                         return -1;
   13928             :                 }
   13929             :         }
   13930           0 :         return 0;
   13931             : }
   13932             : 
   13933           0 : static PyObject *py_wbint_PamAuthCrap_in_get_user(PyObject *obj, void *closure)
   13934             : {
   13935           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   13936             :         PyObject *py_user;
   13937           0 :         if (object->in.user == NULL) {
   13938           0 :                 Py_RETURN_NONE;
   13939             :         }
   13940           0 :         if (object->in.user == NULL) {
   13941           0 :                 py_user = Py_None;
   13942           0 :                 Py_INCREF(py_user);
   13943             :         } else {
   13944           0 :                 py_user = PyUnicode_Decode(object->in.user, strlen(object->in.user), "utf-8", "ignore");
   13945             :         }
   13946           0 :         return py_user;
   13947             : }
   13948             : 
   13949           0 : static int py_wbint_PamAuthCrap_in_set_user(PyObject *py_obj, PyObject *value, void *closure)
   13950             : {
   13951           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   13952           0 :         if (value == NULL) {
   13953           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user");
   13954           0 :                 return -1;
   13955             :         }
   13956           0 :         object->in.user = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user);
   13957           0 :         if (object->in.user == NULL) {
   13958           0 :                 PyErr_NoMemory();
   13959           0 :                 return -1;
   13960             :         }
   13961             :         {
   13962             :                 const char *test_str;
   13963             :                 const char *talloc_str;
   13964           0 :                 PyObject *unicode = NULL;
   13965           0 :                 if (PyUnicode_Check(value)) {
   13966           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   13967           0 :                         if (unicode == NULL) {
   13968           0 :                                 PyErr_NoMemory();
   13969           0 :                                 return -1;
   13970             :                         }
   13971           0 :                         test_str = PyBytes_AS_STRING(unicode);
   13972           0 :                 } else if (PyBytes_Check(value)) {
   13973           0 :                         test_str = PyBytes_AS_STRING(value);
   13974             :                 } else {
   13975           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   13976           0 :                         return -1;
   13977             :                 }
   13978           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   13979           0 :                 if (unicode != NULL) {
   13980           0 :                         Py_DECREF(unicode);
   13981             :                 }
   13982           0 :                 if (talloc_str == NULL) {
   13983           0 :                         PyErr_NoMemory();
   13984           0 :                         return -1;
   13985             :                 }
   13986           0 :                 object->in.user = talloc_str;
   13987             :         }
   13988           0 :         return 0;
   13989             : }
   13990             : 
   13991           0 : static PyObject *py_wbint_PamAuthCrap_in_get_domain(PyObject *obj, void *closure)
   13992             : {
   13993           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   13994             :         PyObject *py_domain;
   13995           0 :         if (object->in.domain == NULL) {
   13996           0 :                 Py_RETURN_NONE;
   13997             :         }
   13998           0 :         if (object->in.domain == NULL) {
   13999           0 :                 py_domain = Py_None;
   14000           0 :                 Py_INCREF(py_domain);
   14001             :         } else {
   14002           0 :                 py_domain = PyUnicode_Decode(object->in.domain, strlen(object->in.domain), "utf-8", "ignore");
   14003             :         }
   14004           0 :         return py_domain;
   14005             : }
   14006             : 
   14007           0 : static int py_wbint_PamAuthCrap_in_set_domain(PyObject *py_obj, PyObject *value, void *closure)
   14008             : {
   14009           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   14010           0 :         if (value == NULL) {
   14011           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain");
   14012           0 :                 return -1;
   14013             :         }
   14014           0 :         object->in.domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain);
   14015           0 :         if (object->in.domain == NULL) {
   14016           0 :                 PyErr_NoMemory();
   14017           0 :                 return -1;
   14018             :         }
   14019             :         {
   14020             :                 const char *test_str;
   14021             :                 const char *talloc_str;
   14022           0 :                 PyObject *unicode = NULL;
   14023           0 :                 if (PyUnicode_Check(value)) {
   14024           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   14025           0 :                         if (unicode == NULL) {
   14026           0 :                                 PyErr_NoMemory();
   14027           0 :                                 return -1;
   14028             :                         }
   14029           0 :                         test_str = PyBytes_AS_STRING(unicode);
   14030           0 :                 } else if (PyBytes_Check(value)) {
   14031           0 :                         test_str = PyBytes_AS_STRING(value);
   14032             :                 } else {
   14033           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   14034           0 :                         return -1;
   14035             :                 }
   14036           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   14037           0 :                 if (unicode != NULL) {
   14038           0 :                         Py_DECREF(unicode);
   14039             :                 }
   14040           0 :                 if (talloc_str == NULL) {
   14041           0 :                         PyErr_NoMemory();
   14042           0 :                         return -1;
   14043             :                 }
   14044           0 :                 object->in.domain = talloc_str;
   14045             :         }
   14046           0 :         return 0;
   14047             : }
   14048             : 
   14049           0 : static PyObject *py_wbint_PamAuthCrap_in_get_workstation(PyObject *obj, void *closure)
   14050             : {
   14051           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   14052             :         PyObject *py_workstation;
   14053           0 :         if (object->in.workstation == NULL) {
   14054           0 :                 Py_RETURN_NONE;
   14055             :         }
   14056           0 :         if (object->in.workstation == NULL) {
   14057           0 :                 py_workstation = Py_None;
   14058           0 :                 Py_INCREF(py_workstation);
   14059             :         } else {
   14060           0 :                 py_workstation = PyUnicode_Decode(object->in.workstation, strlen(object->in.workstation), "utf-8", "ignore");
   14061             :         }
   14062           0 :         return py_workstation;
   14063             : }
   14064             : 
   14065           0 : static int py_wbint_PamAuthCrap_in_set_workstation(PyObject *py_obj, PyObject *value, void *closure)
   14066             : {
   14067           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   14068           0 :         if (value == NULL) {
   14069           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.workstation");
   14070           0 :                 return -1;
   14071             :         }
   14072           0 :         object->in.workstation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.workstation);
   14073           0 :         if (object->in.workstation == NULL) {
   14074           0 :                 PyErr_NoMemory();
   14075           0 :                 return -1;
   14076             :         }
   14077             :         {
   14078             :                 const char *test_str;
   14079             :                 const char *talloc_str;
   14080           0 :                 PyObject *unicode = NULL;
   14081           0 :                 if (PyUnicode_Check(value)) {
   14082           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   14083           0 :                         if (unicode == NULL) {
   14084           0 :                                 PyErr_NoMemory();
   14085           0 :                                 return -1;
   14086             :                         }
   14087           0 :                         test_str = PyBytes_AS_STRING(unicode);
   14088           0 :                 } else if (PyBytes_Check(value)) {
   14089           0 :                         test_str = PyBytes_AS_STRING(value);
   14090             :                 } else {
   14091           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   14092           0 :                         return -1;
   14093             :                 }
   14094           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   14095           0 :                 if (unicode != NULL) {
   14096           0 :                         Py_DECREF(unicode);
   14097             :                 }
   14098           0 :                 if (talloc_str == NULL) {
   14099           0 :                         PyErr_NoMemory();
   14100           0 :                         return -1;
   14101             :                 }
   14102           0 :                 object->in.workstation = talloc_str;
   14103             :         }
   14104           0 :         return 0;
   14105             : }
   14106             : 
   14107           0 : static PyObject *py_wbint_PamAuthCrap_in_get_lm_resp(PyObject *obj, void *closure)
   14108             : {
   14109           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   14110             :         PyObject *py_lm_resp;
   14111           0 :         py_lm_resp = PyBytes_FromStringAndSize((char *)(object->in.lm_resp).data, (object->in.lm_resp).length);
   14112           0 :         return py_lm_resp;
   14113             : }
   14114             : 
   14115           0 : static int py_wbint_PamAuthCrap_in_set_lm_resp(PyObject *py_obj, PyObject *value, void *closure)
   14116             : {
   14117           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   14118           0 :         if (value == NULL) {
   14119           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_resp");
   14120           0 :                 return -1;
   14121             :         }
   14122           0 :         object->in.lm_resp = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
   14123           0 :         return 0;
   14124             : }
   14125             : 
   14126           0 : static PyObject *py_wbint_PamAuthCrap_in_get_nt_resp(PyObject *obj, void *closure)
   14127             : {
   14128           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   14129             :         PyObject *py_nt_resp;
   14130           0 :         py_nt_resp = PyBytes_FromStringAndSize((char *)(object->in.nt_resp).data, (object->in.nt_resp).length);
   14131           0 :         return py_nt_resp;
   14132             : }
   14133             : 
   14134           0 : static int py_wbint_PamAuthCrap_in_set_nt_resp(PyObject *py_obj, PyObject *value, void *closure)
   14135             : {
   14136           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   14137           0 :         if (value == NULL) {
   14138           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.nt_resp");
   14139           0 :                 return -1;
   14140             :         }
   14141           0 :         object->in.nt_resp = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
   14142           0 :         return 0;
   14143             : }
   14144             : 
   14145           0 : static PyObject *py_wbint_PamAuthCrap_in_get_chal(PyObject *obj, void *closure)
   14146             : {
   14147           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   14148             :         PyObject *py_chal;
   14149           0 :         py_chal = PyBytes_FromStringAndSize((char *)(object->in.chal).data, (object->in.chal).length);
   14150           0 :         return py_chal;
   14151             : }
   14152             : 
   14153           0 : static int py_wbint_PamAuthCrap_in_set_chal(PyObject *py_obj, PyObject *value, void *closure)
   14154             : {
   14155           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   14156           0 :         if (value == NULL) {
   14157           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.chal");
   14158           0 :                 return -1;
   14159             :         }
   14160           0 :         object->in.chal = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
   14161           0 :         return 0;
   14162             : }
   14163             : 
   14164           0 : static PyObject *py_wbint_PamAuthCrap_in_get_logon_parameters(PyObject *obj, void *closure)
   14165             : {
   14166           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   14167             :         PyObject *py_logon_parameters;
   14168           0 :         py_logon_parameters = PyLong_FromUnsignedLongLong((uint32_t)object->in.logon_parameters);
   14169           0 :         return py_logon_parameters;
   14170             : }
   14171             : 
   14172           0 : static int py_wbint_PamAuthCrap_in_set_logon_parameters(PyObject *py_obj, PyObject *value, void *closure)
   14173             : {
   14174           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   14175           0 :         if (value == NULL) {
   14176           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_parameters");
   14177           0 :                 return -1;
   14178             :         }
   14179             :         {
   14180           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.logon_parameters));
   14181           0 :                 if (PyLong_Check(value)) {
   14182             :                         unsigned long long test_var;
   14183           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   14184           0 :                         if (PyErr_Occurred() != NULL) {
   14185           0 :                                 return -1;
   14186             :                         }
   14187           0 :                         if (test_var > uint_max) {
   14188           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   14189             :                                   PyLong_Type.tp_name, uint_max, test_var);
   14190           0 :                                 return -1;
   14191             :                         }
   14192           0 :                         object->in.logon_parameters = test_var;
   14193             :                 } else {
   14194           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   14195             :                           PyLong_Type.tp_name);
   14196           0 :                         return -1;
   14197             :                 }
   14198             :         }
   14199           0 :         return 0;
   14200             : }
   14201             : 
   14202           0 : static PyObject *py_wbint_PamAuthCrap_in_get_require_membership_of_sid(PyObject *obj, void *closure)
   14203             : {
   14204           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   14205             :         PyObject *py_require_membership_of_sid;
   14206           0 :         if (object->in.require_membership_of_sid == NULL) {
   14207           0 :                 Py_RETURN_NONE;
   14208             :         }
   14209           0 :         py_require_membership_of_sid = pytalloc_reference_ex(&wbint_SidArray_Type, object->in.require_membership_of_sid, object->in.require_membership_of_sid);
   14210           0 :         return py_require_membership_of_sid;
   14211             : }
   14212             : 
   14213           0 : static int py_wbint_PamAuthCrap_in_set_require_membership_of_sid(PyObject *py_obj, PyObject *value, void *closure)
   14214             : {
   14215           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   14216           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.require_membership_of_sid));
   14217           0 :         if (value == NULL) {
   14218           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.require_membership_of_sid");
   14219           0 :                 return -1;
   14220             :         }
   14221           0 :         object->in.require_membership_of_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.require_membership_of_sid);
   14222           0 :         if (object->in.require_membership_of_sid == NULL) {
   14223           0 :                 PyErr_NoMemory();
   14224           0 :                 return -1;
   14225             :         }
   14226           0 :         PY_CHECK_TYPE(&wbint_SidArray_Type, value, return -1;);
   14227           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   14228           0 :                 PyErr_NoMemory();
   14229           0 :                 return -1;
   14230             :         }
   14231           0 :         object->in.require_membership_of_sid = (struct wbint_SidArray *)pytalloc_get_ptr(value);
   14232           0 :         return 0;
   14233             : }
   14234             : 
   14235           0 : static PyObject *py_wbint_PamAuthCrap_out_get_authoritative(PyObject *obj, void *closure)
   14236             : {
   14237           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   14238             :         PyObject *py_authoritative;
   14239           0 :         if (object->out.authoritative == NULL) {
   14240           0 :                 Py_RETURN_NONE;
   14241             :         }
   14242           0 :         py_authoritative = PyLong_FromLong((uint16_t)*object->out.authoritative);
   14243           0 :         return py_authoritative;
   14244             : }
   14245             : 
   14246           0 : static int py_wbint_PamAuthCrap_out_set_authoritative(PyObject *py_obj, PyObject *value, void *closure)
   14247             : {
   14248           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   14249           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.authoritative));
   14250           0 :         if (value == NULL) {
   14251           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.authoritative");
   14252           0 :                 return -1;
   14253             :         }
   14254           0 :         object->out.authoritative = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.authoritative);
   14255           0 :         if (object->out.authoritative == NULL) {
   14256           0 :                 PyErr_NoMemory();
   14257           0 :                 return -1;
   14258             :         }
   14259             :         {
   14260           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.authoritative));
   14261           0 :                 if (PyLong_Check(value)) {
   14262             :                         unsigned long long test_var;
   14263           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   14264           0 :                         if (PyErr_Occurred() != NULL) {
   14265           0 :                                 return -1;
   14266             :                         }
   14267           0 :                         if (test_var > uint_max) {
   14268           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   14269             :                                   PyLong_Type.tp_name, uint_max, test_var);
   14270           0 :                                 return -1;
   14271             :                         }
   14272           0 :                         *object->out.authoritative = test_var;
   14273             :                 } else {
   14274           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   14275             :                           PyLong_Type.tp_name);
   14276           0 :                         return -1;
   14277             :                 }
   14278             :         }
   14279           0 :         return 0;
   14280             : }
   14281             : 
   14282           0 : static PyObject *py_wbint_PamAuthCrap_out_get_validation(PyObject *obj, void *closure)
   14283             : {
   14284           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   14285             :         PyObject *py_validation;
   14286           0 :         if (object->out.validation == NULL) {
   14287           0 :                 Py_RETURN_NONE;
   14288             :         }
   14289           0 :         py_validation = pytalloc_reference_ex(&wbint_PamAuthCrapValidation_Type, object->out.validation, object->out.validation);
   14290           0 :         return py_validation;
   14291             : }
   14292             : 
   14293           0 : static int py_wbint_PamAuthCrap_out_set_validation(PyObject *py_obj, PyObject *value, void *closure)
   14294             : {
   14295           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   14296           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.validation));
   14297           0 :         if (value == NULL) {
   14298           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.validation");
   14299           0 :                 return -1;
   14300             :         }
   14301           0 :         object->out.validation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.validation);
   14302           0 :         if (object->out.validation == NULL) {
   14303           0 :                 PyErr_NoMemory();
   14304           0 :                 return -1;
   14305             :         }
   14306           0 :         PY_CHECK_TYPE(&wbint_PamAuthCrapValidation_Type, value, return -1;);
   14307           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   14308           0 :                 PyErr_NoMemory();
   14309           0 :                 return -1;
   14310             :         }
   14311           0 :         object->out.validation = (struct wbint_PamAuthCrapValidation *)pytalloc_get_ptr(value);
   14312           0 :         return 0;
   14313             : }
   14314             : 
   14315           0 : static PyObject *py_wbint_PamAuthCrap_get_result(PyObject *obj, void *closure)
   14316             : {
   14317           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(obj);
   14318             :         PyObject *py_result;
   14319           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   14320           0 :         return py_result;
   14321             : }
   14322             : 
   14323           0 : static int py_wbint_PamAuthCrap_set_result(PyObject *py_obj, PyObject *value, void *closure)
   14324             : {
   14325           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   14326           0 :         if (value == NULL) {
   14327           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   14328           0 :                 return -1;
   14329             :         }
   14330           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   14331           0 :         return 0;
   14332             : }
   14333             : 
   14334             : static PyGetSetDef py_wbint_PamAuthCrap_getsetters[] = {
   14335             :         {
   14336             :                 .name = discard_const_p(char, "in_client_name"),
   14337             :                 .get = py_wbint_PamAuthCrap_in_get_client_name,
   14338             :                 .set = py_wbint_PamAuthCrap_in_set_client_name,
   14339             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   14340             :         },
   14341             :         {
   14342             :                 .name = discard_const_p(char, "in_client_pid"),
   14343             :                 .get = py_wbint_PamAuthCrap_in_get_client_pid,
   14344             :                 .set = py_wbint_PamAuthCrap_in_set_client_pid,
   14345             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
   14346             :         },
   14347             :         {
   14348             :                 .name = discard_const_p(char, "in_flags"),
   14349             :                 .get = py_wbint_PamAuthCrap_in_get_flags,
   14350             :                 .set = py_wbint_PamAuthCrap_in_set_flags,
   14351             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
   14352             :         },
   14353             :         {
   14354             :                 .name = discard_const_p(char, "in_user"),
   14355             :                 .get = py_wbint_PamAuthCrap_in_get_user,
   14356             :                 .set = py_wbint_PamAuthCrap_in_set_user,
   14357             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   14358             :         },
   14359             :         {
   14360             :                 .name = discard_const_p(char, "in_domain"),
   14361             :                 .get = py_wbint_PamAuthCrap_in_get_domain,
   14362             :                 .set = py_wbint_PamAuthCrap_in_set_domain,
   14363             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   14364             :         },
   14365             :         {
   14366             :                 .name = discard_const_p(char, "in_workstation"),
   14367             :                 .get = py_wbint_PamAuthCrap_in_get_workstation,
   14368             :                 .set = py_wbint_PamAuthCrap_in_set_workstation,
   14369             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   14370             :         },
   14371             :         {
   14372             :                 .name = discard_const_p(char, "in_lm_resp"),
   14373             :                 .get = py_wbint_PamAuthCrap_in_get_lm_resp,
   14374             :                 .set = py_wbint_PamAuthCrap_in_set_lm_resp,
   14375             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
   14376             :         },
   14377             :         {
   14378             :                 .name = discard_const_p(char, "in_nt_resp"),
   14379             :                 .get = py_wbint_PamAuthCrap_in_get_nt_resp,
   14380             :                 .set = py_wbint_PamAuthCrap_in_set_nt_resp,
   14381             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
   14382             :         },
   14383             :         {
   14384             :                 .name = discard_const_p(char, "in_chal"),
   14385             :                 .get = py_wbint_PamAuthCrap_in_get_chal,
   14386             :                 .set = py_wbint_PamAuthCrap_in_set_chal,
   14387             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
   14388             :         },
   14389             :         {
   14390             :                 .name = discard_const_p(char, "in_logon_parameters"),
   14391             :                 .get = py_wbint_PamAuthCrap_in_get_logon_parameters,
   14392             :                 .set = py_wbint_PamAuthCrap_in_set_logon_parameters,
   14393             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
   14394             :         },
   14395             :         {
   14396             :                 .name = discard_const_p(char, "in_require_membership_of_sid"),
   14397             :                 .get = py_wbint_PamAuthCrap_in_get_require_membership_of_sid,
   14398             :                 .set = py_wbint_PamAuthCrap_in_set_require_membership_of_sid,
   14399             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_SidArray")
   14400             :         },
   14401             :         {
   14402             :                 .name = discard_const_p(char, "out_authoritative"),
   14403             :                 .get = py_wbint_PamAuthCrap_out_get_authoritative,
   14404             :                 .set = py_wbint_PamAuthCrap_out_set_authoritative,
   14405             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   14406             :         },
   14407             :         {
   14408             :                 .name = discard_const_p(char, "out_validation"),
   14409             :                 .get = py_wbint_PamAuthCrap_out_get_validation,
   14410             :                 .set = py_wbint_PamAuthCrap_out_set_validation,
   14411             :                 .doc = discard_const_p(char, "PIDL-generated element of base type wbint_PamAuthCrapValidation")
   14412             :         },
   14413             :         {
   14414             :                 .name = discard_const_p(char, "result"),
   14415             :                 .get = py_wbint_PamAuthCrap_get_result,
   14416             :                 .set = py_wbint_PamAuthCrap_set_result,
   14417             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   14418             :         },
   14419             :         { .name = NULL }
   14420             : };
   14421             : 
   14422           0 : static PyObject *py_wbint_PamAuthCrap_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   14423             : {
   14424           0 :         PyObject *self = pytalloc_new(struct wbint_PamAuthCrap, type);
   14425           0 :         struct wbint_PamAuthCrap *_self = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(self);
   14426           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
   14427           0 :         _self->in.require_membership_of_sid = talloc_zero(mem_ctx, struct wbint_SidArray);
   14428           0 :         _self->out.authoritative = talloc_zero(mem_ctx, uint8_t);
   14429           0 :         _self->out.validation = talloc_zero(mem_ctx, struct wbint_PamAuthCrapValidation);
   14430           0 :         return self;
   14431             : }
   14432             : 
   14433           0 : static PyObject *py_wbint_PamAuthCrap_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   14434             : {
   14435             : 
   14436             : 
   14437           0 :         return PyLong_FromLong(22);
   14438             : }
   14439             : 
   14440           0 : static PyObject *py_wbint_PamAuthCrap_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   14441             : {
   14442           0 :         const struct ndr_interface_call *call = NULL;
   14443           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   14444           0 :         PyObject *ret = NULL;
   14445           0 :         struct ndr_push *push = NULL;
   14446             :         DATA_BLOB blob;
   14447             :         enum ndr_err_code err;
   14448             : 
   14449           0 :         if (ndr_table_winbind.num_calls < 23) {
   14450           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthCrap_ndr_pack");
   14451           0 :                 return NULL;
   14452             :         }
   14453           0 :         call = &ndr_table_winbind.calls[22];
   14454             : 
   14455           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   14456           0 :         if (push == NULL) {
   14457           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   14458           0 :                 return NULL;
   14459             :         }
   14460             : 
   14461           0 :         push->flags |= ndr_push_flags;
   14462             : 
   14463           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   14464           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   14465           0 :                 TALLOC_FREE(push);
   14466           0 :                 PyErr_SetNdrError(err);
   14467           0 :                 return NULL;
   14468             :         }
   14469           0 :         blob = ndr_push_blob(push);
   14470           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   14471           0 :         TALLOC_FREE(push);
   14472           0 :         return ret;
   14473             : }
   14474             : 
   14475           0 : static PyObject *py_wbint_PamAuthCrap_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   14476             : {
   14477           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   14478           0 :         PyObject *bigendian_obj = NULL;
   14479           0 :         PyObject *ndr64_obj = NULL;
   14480           0 :         uint32_t ndr_push_flags = 0;
   14481             : 
   14482           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   14483             :                 discard_const_p(char *, kwnames),
   14484             :                 &bigendian_obj,
   14485             :                 &ndr64_obj)) {
   14486           0 :                 return NULL;
   14487             :         }
   14488             : 
   14489           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   14490           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   14491             :         }
   14492           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   14493           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   14494             :         }
   14495             : 
   14496           0 :         return py_wbint_PamAuthCrap_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   14497             : }
   14498             : 
   14499           0 : static PyObject *py_wbint_PamAuthCrap_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   14500             : {
   14501           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   14502           0 :         PyObject *bigendian_obj = NULL;
   14503           0 :         PyObject *ndr64_obj = NULL;
   14504           0 :         uint32_t ndr_push_flags = 0;
   14505             : 
   14506           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   14507             :                 discard_const_p(char *, kwnames),
   14508             :                 &bigendian_obj,
   14509             :                 &ndr64_obj)) {
   14510           0 :                 return NULL;
   14511             :         }
   14512             : 
   14513           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   14514           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   14515             :         }
   14516           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   14517           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   14518             :         }
   14519             : 
   14520           0 :         return py_wbint_PamAuthCrap_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   14521             : }
   14522             : 
   14523           0 : static PyObject *py_wbint_PamAuthCrap_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   14524             : {
   14525           0 :         const struct ndr_interface_call *call = NULL;
   14526           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   14527           0 :         struct ndr_pull *pull = NULL;
   14528             :         enum ndr_err_code err;
   14529             : 
   14530           0 :         if (ndr_table_winbind.num_calls < 23) {
   14531           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthCrap_ndr_unpack");
   14532           0 :                 return NULL;
   14533             :         }
   14534           0 :         call = &ndr_table_winbind.calls[22];
   14535             : 
   14536           0 :         pull = ndr_pull_init_blob(blob, object);
   14537           0 :         if (pull == NULL) {
   14538           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   14539           0 :                 return NULL;
   14540             :         }
   14541             : 
   14542           0 :         pull->flags |= ndr_pull_flags;
   14543             : 
   14544           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   14545           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   14546           0 :                 TALLOC_FREE(pull);
   14547           0 :                 PyErr_SetNdrError(err);
   14548           0 :                 return NULL;
   14549             :         }
   14550           0 :         if (!allow_remaining) {
   14551             :                 uint32_t highest_ofs;
   14552             : 
   14553           0 :                 if (pull->offset > pull->relative_highest_offset) {
   14554           0 :                         highest_ofs = pull->offset;
   14555             :                 } else {
   14556           0 :                         highest_ofs = pull->relative_highest_offset;
   14557             :                 }
   14558           0 :                 if (highest_ofs < pull->data_size) {
   14559           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   14560             :                                 "not all bytes consumed ofs[%u] size[%u]",
   14561             :                                 highest_ofs, pull->data_size);
   14562           0 :                         TALLOC_FREE(pull);
   14563           0 :                         PyErr_SetNdrError(err);
   14564           0 :                         return NULL;
   14565             :                 }
   14566             :         }
   14567             : 
   14568           0 :         TALLOC_FREE(pull);
   14569           0 :         Py_RETURN_NONE;
   14570             : }
   14571             : 
   14572           0 : static PyObject *py_wbint_PamAuthCrap_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   14573             : {
   14574             :         DATA_BLOB blob;
   14575           0 :         Py_ssize_t blob_length = 0;
   14576           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   14577           0 :         PyObject *bigendian_obj = NULL;
   14578           0 :         PyObject *ndr64_obj = NULL;
   14579           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   14580           0 :         PyObject *allow_remaining_obj = NULL;
   14581           0 :         bool allow_remaining = false;
   14582             : 
   14583           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   14584             :                 discard_const_p(char *, kwnames),
   14585             :                 &blob.data, &blob_length,
   14586             :                 &bigendian_obj,
   14587             :                 &ndr64_obj,
   14588             :                 &allow_remaining_obj)) {
   14589           0 :                 return NULL;
   14590             :         }
   14591           0 :         blob.length = blob_length;
   14592             : 
   14593           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   14594           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   14595             :         }
   14596           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   14597           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   14598             :         }
   14599             : 
   14600           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   14601           0 :                 allow_remaining = true;
   14602             :         }
   14603             : 
   14604           0 :         return py_wbint_PamAuthCrap_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   14605             : }
   14606             : 
   14607           0 : static PyObject *py_wbint_PamAuthCrap_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   14608             : {
   14609             :         DATA_BLOB blob;
   14610           0 :         Py_ssize_t blob_length = 0;
   14611           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   14612           0 :         PyObject *bigendian_obj = NULL;
   14613           0 :         PyObject *ndr64_obj = NULL;
   14614           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   14615           0 :         PyObject *allow_remaining_obj = NULL;
   14616           0 :         bool allow_remaining = false;
   14617             : 
   14618           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   14619             :                 discard_const_p(char *, kwnames),
   14620             :                 &blob.data, &blob_length,
   14621             :                 &bigendian_obj,
   14622             :                 &ndr64_obj,
   14623             :                 &allow_remaining_obj)) {
   14624           0 :                 return NULL;
   14625             :         }
   14626           0 :         blob.length = blob_length;
   14627             : 
   14628           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   14629           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   14630             :         }
   14631           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   14632           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   14633             :         }
   14634             : 
   14635           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   14636           0 :                 allow_remaining = true;
   14637             :         }
   14638             : 
   14639           0 :         return py_wbint_PamAuthCrap_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   14640             : }
   14641             : 
   14642           0 : static PyObject *py_wbint_PamAuthCrap_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   14643             : {
   14644           0 :         const struct ndr_interface_call *call = NULL;
   14645           0 :         struct wbint_PamAuthCrap *object = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(py_obj);
   14646             :         PyObject *ret;
   14647             :         char *retstr;
   14648             : 
   14649           0 :         if (ndr_table_winbind.num_calls < 23) {
   14650           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthCrap_ndr_print");
   14651           0 :                 return NULL;
   14652             :         }
   14653           0 :         call = &ndr_table_winbind.calls[22];
   14654             : 
   14655           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   14656           0 :         ret = PyUnicode_FromString(retstr);
   14657           0 :         TALLOC_FREE(retstr);
   14658             : 
   14659           0 :         return ret;
   14660             : }
   14661             : 
   14662           0 : static PyObject *py_wbint_PamAuthCrap_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   14663             : {
   14664           0 :         return py_wbint_PamAuthCrap_ndr_print(py_obj, "wbint_PamAuthCrap_in", NDR_IN);
   14665             : }
   14666             : 
   14667           0 : static PyObject *py_wbint_PamAuthCrap_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   14668             : {
   14669           0 :         return py_wbint_PamAuthCrap_ndr_print(py_obj, "wbint_PamAuthCrap_out", NDR_OUT);
   14670             : }
   14671             : 
   14672             : static PyMethodDef py_wbint_PamAuthCrap_methods[] = {
   14673             :         { "opnum", (PyCFunction)py_wbint_PamAuthCrap_ndr_opnum, METH_NOARGS|METH_CLASS,
   14674             :                 "winbind.wbint_PamAuthCrap.opnum() -> 22 (0x16) " },
   14675             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrap_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   14676             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   14677             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrap_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   14678             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   14679             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrap_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   14680             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   14681             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrap_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   14682             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   14683             :         { "__ndr_print_in__", (PyCFunction)py_wbint_PamAuthCrap_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   14684             :         { "__ndr_print_out__", (PyCFunction)py_wbint_PamAuthCrap_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   14685             :         { NULL, NULL, 0, NULL }
   14686             : };
   14687             : 
   14688             : 
   14689             : static PyTypeObject wbint_PamAuthCrap_Type = {
   14690             :         PyVarObject_HEAD_INIT(NULL, 0)
   14691             :         .tp_name = "winbind.wbint_PamAuthCrap",
   14692             :         .tp_getset = py_wbint_PamAuthCrap_getsetters,
   14693             :         .tp_methods = py_wbint_PamAuthCrap_methods,
   14694             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   14695             :         .tp_new = py_wbint_PamAuthCrap_new,
   14696             : };
   14697             : 
   14698           0 : static bool pack_py_wbint_PamAuthCrap_args_in(PyObject *args, PyObject *kwargs, struct wbint_PamAuthCrap *r)
   14699             : {
   14700             :         PyObject *py_client_name;
   14701             :         PyObject *py_client_pid;
   14702             :         PyObject *py_flags;
   14703             :         PyObject *py_user;
   14704             :         PyObject *py_domain;
   14705             :         PyObject *py_workstation;
   14706             :         PyObject *py_lm_resp;
   14707             :         PyObject *py_nt_resp;
   14708             :         PyObject *py_chal;
   14709             :         PyObject *py_logon_parameters;
   14710             :         PyObject *py_require_membership_of_sid;
   14711           0 :         const char *kwnames[] = {
   14712             :                 "client_name", "client_pid", "flags", "user", "domain", "workstation", "lm_resp", "nt_resp", "chal", "logon_parameters", "require_membership_of_sid", NULL
   14713             :         };
   14714             : 
   14715           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOOOOO:wbint_PamAuthCrap", discard_const_p(char *, kwnames), &py_client_name, &py_client_pid, &py_flags, &py_user, &py_domain, &py_workstation, &py_lm_resp, &py_nt_resp, &py_chal, &py_logon_parameters, &py_require_membership_of_sid)) {
   14716           0 :                 return false;
   14717             :         }
   14718             : 
   14719           0 :         if (py_client_name == NULL) {
   14720           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_name");
   14721           0 :                 return false;
   14722             :         }
   14723           0 :         r->in.client_name = talloc_ptrtype(r, r->in.client_name);
   14724           0 :         if (r->in.client_name == NULL) {
   14725           0 :                 PyErr_NoMemory();
   14726           0 :                 return false;
   14727             :         }
   14728             :         {
   14729             :                 const char *test_str;
   14730             :                 const char *talloc_str;
   14731           0 :                 PyObject *unicode = NULL;
   14732           0 :                 if (PyUnicode_Check(py_client_name)) {
   14733           0 :                         unicode = PyUnicode_AsEncodedString(py_client_name, "utf-8", "ignore");
   14734           0 :                         if (unicode == NULL) {
   14735           0 :                                 PyErr_NoMemory();
   14736           0 :                                 return false;
   14737             :                         }
   14738           0 :                         test_str = PyBytes_AS_STRING(unicode);
   14739           0 :                 } else if (PyBytes_Check(py_client_name)) {
   14740           0 :                         test_str = PyBytes_AS_STRING(py_client_name);
   14741             :                 } else {
   14742           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_name)->tp_name);
   14743           0 :                         return false;
   14744             :                 }
   14745           0 :                 talloc_str = talloc_strdup(r, test_str);
   14746           0 :                 if (unicode != NULL) {
   14747           0 :                         Py_DECREF(unicode);
   14748             :                 }
   14749           0 :                 if (talloc_str == NULL) {
   14750           0 :                         PyErr_NoMemory();
   14751           0 :                         return false;
   14752             :                 }
   14753           0 :                 r->in.client_name = talloc_str;
   14754             :         }
   14755           0 :         if (py_client_pid == NULL) {
   14756           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_pid");
   14757           0 :                 return false;
   14758             :         }
   14759             :         {
   14760           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_pid));
   14761           0 :                 if (PyLong_Check(py_client_pid)) {
   14762             :                         unsigned long long test_var;
   14763           0 :                         test_var = PyLong_AsUnsignedLongLong(py_client_pid);
   14764           0 :                         if (PyErr_Occurred() != NULL) {
   14765           0 :                                 return false;
   14766             :                         }
   14767           0 :                         if (test_var > uint_max) {
   14768           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   14769             :                                   PyLong_Type.tp_name, uint_max, test_var);
   14770           0 :                                 return false;
   14771             :                         }
   14772           0 :                         r->in.client_pid = test_var;
   14773             :                 } else {
   14774           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   14775             :                           PyLong_Type.tp_name);
   14776           0 :                         return false;
   14777             :                 }
   14778             :         }
   14779           0 :         if (py_flags == NULL) {
   14780           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
   14781           0 :                 return false;
   14782             :         }
   14783             :         {
   14784           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
   14785           0 :                 if (PyLong_Check(py_flags)) {
   14786             :                         unsigned long long test_var;
   14787           0 :                         test_var = PyLong_AsUnsignedLongLong(py_flags);
   14788           0 :                         if (PyErr_Occurred() != NULL) {
   14789           0 :                                 return false;
   14790             :                         }
   14791           0 :                         if (test_var > uint_max) {
   14792           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   14793             :                                   PyLong_Type.tp_name, uint_max, test_var);
   14794           0 :                                 return false;
   14795             :                         }
   14796           0 :                         r->in.flags = test_var;
   14797             :                 } else {
   14798           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   14799             :                           PyLong_Type.tp_name);
   14800           0 :                         return false;
   14801             :                 }
   14802             :         }
   14803           0 :         if (py_user == NULL) {
   14804           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user");
   14805           0 :                 return false;
   14806             :         }
   14807           0 :         r->in.user = talloc_ptrtype(r, r->in.user);
   14808           0 :         if (r->in.user == NULL) {
   14809           0 :                 PyErr_NoMemory();
   14810           0 :                 return false;
   14811             :         }
   14812             :         {
   14813             :                 const char *test_str;
   14814             :                 const char *talloc_str;
   14815           0 :                 PyObject *unicode = NULL;
   14816           0 :                 if (PyUnicode_Check(py_user)) {
   14817           0 :                         unicode = PyUnicode_AsEncodedString(py_user, "utf-8", "ignore");
   14818           0 :                         if (unicode == NULL) {
   14819           0 :                                 PyErr_NoMemory();
   14820           0 :                                 return false;
   14821             :                         }
   14822           0 :                         test_str = PyBytes_AS_STRING(unicode);
   14823           0 :                 } else if (PyBytes_Check(py_user)) {
   14824           0 :                         test_str = PyBytes_AS_STRING(py_user);
   14825             :                 } else {
   14826           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_user)->tp_name);
   14827           0 :                         return false;
   14828             :                 }
   14829           0 :                 talloc_str = talloc_strdup(r, test_str);
   14830           0 :                 if (unicode != NULL) {
   14831           0 :                         Py_DECREF(unicode);
   14832             :                 }
   14833           0 :                 if (talloc_str == NULL) {
   14834           0 :                         PyErr_NoMemory();
   14835           0 :                         return false;
   14836             :                 }
   14837           0 :                 r->in.user = talloc_str;
   14838             :         }
   14839           0 :         if (py_domain == NULL) {
   14840           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain");
   14841           0 :                 return false;
   14842             :         }
   14843           0 :         r->in.domain = talloc_ptrtype(r, r->in.domain);
   14844           0 :         if (r->in.domain == NULL) {
   14845           0 :                 PyErr_NoMemory();
   14846           0 :                 return false;
   14847             :         }
   14848             :         {
   14849             :                 const char *test_str;
   14850             :                 const char *talloc_str;
   14851           0 :                 PyObject *unicode = NULL;
   14852           0 :                 if (PyUnicode_Check(py_domain)) {
   14853           0 :                         unicode = PyUnicode_AsEncodedString(py_domain, "utf-8", "ignore");
   14854           0 :                         if (unicode == NULL) {
   14855           0 :                                 PyErr_NoMemory();
   14856           0 :                                 return false;
   14857             :                         }
   14858           0 :                         test_str = PyBytes_AS_STRING(unicode);
   14859           0 :                 } else if (PyBytes_Check(py_domain)) {
   14860           0 :                         test_str = PyBytes_AS_STRING(py_domain);
   14861             :                 } else {
   14862           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain)->tp_name);
   14863           0 :                         return false;
   14864             :                 }
   14865           0 :                 talloc_str = talloc_strdup(r, test_str);
   14866           0 :                 if (unicode != NULL) {
   14867           0 :                         Py_DECREF(unicode);
   14868             :                 }
   14869           0 :                 if (talloc_str == NULL) {
   14870           0 :                         PyErr_NoMemory();
   14871           0 :                         return false;
   14872             :                 }
   14873           0 :                 r->in.domain = talloc_str;
   14874             :         }
   14875           0 :         if (py_workstation == NULL) {
   14876           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.workstation");
   14877           0 :                 return false;
   14878             :         }
   14879           0 :         r->in.workstation = talloc_ptrtype(r, r->in.workstation);
   14880           0 :         if (r->in.workstation == NULL) {
   14881           0 :                 PyErr_NoMemory();
   14882           0 :                 return false;
   14883             :         }
   14884             :         {
   14885             :                 const char *test_str;
   14886             :                 const char *talloc_str;
   14887           0 :                 PyObject *unicode = NULL;
   14888           0 :                 if (PyUnicode_Check(py_workstation)) {
   14889           0 :                         unicode = PyUnicode_AsEncodedString(py_workstation, "utf-8", "ignore");
   14890           0 :                         if (unicode == NULL) {
   14891           0 :                                 PyErr_NoMemory();
   14892           0 :                                 return false;
   14893             :                         }
   14894           0 :                         test_str = PyBytes_AS_STRING(unicode);
   14895           0 :                 } else if (PyBytes_Check(py_workstation)) {
   14896           0 :                         test_str = PyBytes_AS_STRING(py_workstation);
   14897             :                 } else {
   14898           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_workstation)->tp_name);
   14899           0 :                         return false;
   14900             :                 }
   14901           0 :                 talloc_str = talloc_strdup(r, test_str);
   14902           0 :                 if (unicode != NULL) {
   14903           0 :                         Py_DECREF(unicode);
   14904             :                 }
   14905           0 :                 if (talloc_str == NULL) {
   14906           0 :                         PyErr_NoMemory();
   14907           0 :                         return false;
   14908             :                 }
   14909           0 :                 r->in.workstation = talloc_str;
   14910             :         }
   14911           0 :         if (py_lm_resp == NULL) {
   14912           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_resp");
   14913           0 :                 return false;
   14914             :         }
   14915           0 :         r->in.lm_resp = data_blob_talloc(r, PyBytes_AS_STRING(py_lm_resp), PyBytes_GET_SIZE(py_lm_resp));
   14916           0 :         if (py_nt_resp == NULL) {
   14917           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.nt_resp");
   14918           0 :                 return false;
   14919             :         }
   14920           0 :         r->in.nt_resp = data_blob_talloc(r, PyBytes_AS_STRING(py_nt_resp), PyBytes_GET_SIZE(py_nt_resp));
   14921           0 :         if (py_chal == NULL) {
   14922           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.chal");
   14923           0 :                 return false;
   14924             :         }
   14925           0 :         r->in.chal = data_blob_talloc(r, PyBytes_AS_STRING(py_chal), PyBytes_GET_SIZE(py_chal));
   14926           0 :         if (py_logon_parameters == NULL) {
   14927           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_parameters");
   14928           0 :                 return false;
   14929             :         }
   14930             :         {
   14931           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.logon_parameters));
   14932           0 :                 if (PyLong_Check(py_logon_parameters)) {
   14933             :                         unsigned long long test_var;
   14934           0 :                         test_var = PyLong_AsUnsignedLongLong(py_logon_parameters);
   14935           0 :                         if (PyErr_Occurred() != NULL) {
   14936           0 :                                 return false;
   14937             :                         }
   14938           0 :                         if (test_var > uint_max) {
   14939           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   14940             :                                   PyLong_Type.tp_name, uint_max, test_var);
   14941           0 :                                 return false;
   14942             :                         }
   14943           0 :                         r->in.logon_parameters = test_var;
   14944             :                 } else {
   14945           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   14946             :                           PyLong_Type.tp_name);
   14947           0 :                         return false;
   14948             :                 }
   14949             :         }
   14950           0 :         if (py_require_membership_of_sid == NULL) {
   14951           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.require_membership_of_sid");
   14952           0 :                 return false;
   14953             :         }
   14954           0 :         r->in.require_membership_of_sid = talloc_ptrtype(r, r->in.require_membership_of_sid);
   14955           0 :         if (r->in.require_membership_of_sid == NULL) {
   14956           0 :                 PyErr_NoMemory();
   14957           0 :                 return false;
   14958             :         }
   14959           0 :         PY_CHECK_TYPE(&wbint_SidArray_Type, py_require_membership_of_sid, return false;);
   14960           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_require_membership_of_sid)) == NULL) {
   14961           0 :                 PyErr_NoMemory();
   14962           0 :                 return false;
   14963             :         }
   14964           0 :         r->in.require_membership_of_sid = (struct wbint_SidArray *)pytalloc_get_ptr(py_require_membership_of_sid);
   14965           0 :         return true;
   14966             : }
   14967             : 
   14968           0 : static PyObject *unpack_py_wbint_PamAuthCrap_args_out(struct wbint_PamAuthCrap *r)
   14969             : {
   14970             :         PyObject *result;
   14971             :         PyObject *py_authoritative;
   14972             :         PyObject *py_validation;
   14973           0 :         result = PyTuple_New(2);
   14974           0 :         py_authoritative = PyLong_FromLong((uint16_t)*r->out.authoritative);
   14975           0 :         PyTuple_SetItem(result, 0, py_authoritative);
   14976           0 :         py_validation = pytalloc_reference_ex(&wbint_PamAuthCrapValidation_Type, r->out.validation, r->out.validation);
   14977           0 :         PyTuple_SetItem(result, 1, py_validation);
   14978           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   14979           0 :                 PyErr_SetNTSTATUS(r->out.result);
   14980           0 :                 return NULL;
   14981             :         }
   14982             : 
   14983           0 :         return result;
   14984             : }
   14985             : 
   14986             : 
   14987           0 : static PyObject *py_wbint_PamLogOff_in_get_client_name(PyObject *obj, void *closure)
   14988             : {
   14989           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(obj);
   14990             :         PyObject *py_client_name;
   14991           0 :         if (object->in.client_name == NULL) {
   14992           0 :                 Py_RETURN_NONE;
   14993             :         }
   14994           0 :         if (object->in.client_name == NULL) {
   14995           0 :                 py_client_name = Py_None;
   14996           0 :                 Py_INCREF(py_client_name);
   14997             :         } else {
   14998           0 :                 py_client_name = PyUnicode_Decode(object->in.client_name, strlen(object->in.client_name), "utf-8", "ignore");
   14999             :         }
   15000           0 :         return py_client_name;
   15001             : }
   15002             : 
   15003           0 : static int py_wbint_PamLogOff_in_set_client_name(PyObject *py_obj, PyObject *value, void *closure)
   15004             : {
   15005           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(py_obj);
   15006           0 :         if (value == NULL) {
   15007           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_name");
   15008           0 :                 return -1;
   15009             :         }
   15010           0 :         object->in.client_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.client_name);
   15011           0 :         if (object->in.client_name == NULL) {
   15012           0 :                 PyErr_NoMemory();
   15013           0 :                 return -1;
   15014             :         }
   15015             :         {
   15016             :                 const char *test_str;
   15017             :                 const char *talloc_str;
   15018           0 :                 PyObject *unicode = NULL;
   15019           0 :                 if (PyUnicode_Check(value)) {
   15020           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   15021           0 :                         if (unicode == NULL) {
   15022           0 :                                 PyErr_NoMemory();
   15023           0 :                                 return -1;
   15024             :                         }
   15025           0 :                         test_str = PyBytes_AS_STRING(unicode);
   15026           0 :                 } else if (PyBytes_Check(value)) {
   15027           0 :                         test_str = PyBytes_AS_STRING(value);
   15028             :                 } else {
   15029           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   15030           0 :                         return -1;
   15031             :                 }
   15032           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   15033           0 :                 if (unicode != NULL) {
   15034           0 :                         Py_DECREF(unicode);
   15035             :                 }
   15036           0 :                 if (talloc_str == NULL) {
   15037           0 :                         PyErr_NoMemory();
   15038           0 :                         return -1;
   15039             :                 }
   15040           0 :                 object->in.client_name = talloc_str;
   15041             :         }
   15042           0 :         return 0;
   15043             : }
   15044             : 
   15045           0 : static PyObject *py_wbint_PamLogOff_in_get_client_pid(PyObject *obj, void *closure)
   15046             : {
   15047           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(obj);
   15048             :         PyObject *py_client_pid;
   15049           0 :         py_client_pid = PyLong_FromUnsignedLongLong(object->in.client_pid);
   15050           0 :         return py_client_pid;
   15051             : }
   15052             : 
   15053           0 : static int py_wbint_PamLogOff_in_set_client_pid(PyObject *py_obj, PyObject *value, void *closure)
   15054             : {
   15055           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(py_obj);
   15056           0 :         if (value == NULL) {
   15057           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_pid");
   15058           0 :                 return -1;
   15059             :         }
   15060             :         {
   15061           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_pid));
   15062           0 :                 if (PyLong_Check(value)) {
   15063             :                         unsigned long long test_var;
   15064           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   15065           0 :                         if (PyErr_Occurred() != NULL) {
   15066           0 :                                 return -1;
   15067             :                         }
   15068           0 :                         if (test_var > uint_max) {
   15069           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   15070             :                                   PyLong_Type.tp_name, uint_max, test_var);
   15071           0 :                                 return -1;
   15072             :                         }
   15073           0 :                         object->in.client_pid = test_var;
   15074             :                 } else {
   15075           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   15076             :                           PyLong_Type.tp_name);
   15077           0 :                         return -1;
   15078             :                 }
   15079             :         }
   15080           0 :         return 0;
   15081             : }
   15082             : 
   15083           0 : static PyObject *py_wbint_PamLogOff_in_get_flags(PyObject *obj, void *closure)
   15084             : {
   15085           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(obj);
   15086             :         PyObject *py_flags;
   15087           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
   15088           0 :         return py_flags;
   15089             : }
   15090             : 
   15091           0 : static int py_wbint_PamLogOff_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
   15092             : {
   15093           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(py_obj);
   15094           0 :         if (value == NULL) {
   15095           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
   15096           0 :                 return -1;
   15097             :         }
   15098             :         {
   15099           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
   15100           0 :                 if (PyLong_Check(value)) {
   15101             :                         unsigned long long test_var;
   15102           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   15103           0 :                         if (PyErr_Occurred() != NULL) {
   15104           0 :                                 return -1;
   15105             :                         }
   15106           0 :                         if (test_var > uint_max) {
   15107           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   15108             :                                   PyLong_Type.tp_name, uint_max, test_var);
   15109           0 :                                 return -1;
   15110             :                         }
   15111           0 :                         object->in.flags = test_var;
   15112             :                 } else {
   15113           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   15114             :                           PyLong_Type.tp_name);
   15115           0 :                         return -1;
   15116             :                 }
   15117             :         }
   15118           0 :         return 0;
   15119             : }
   15120             : 
   15121           0 : static PyObject *py_wbint_PamLogOff_in_get_user(PyObject *obj, void *closure)
   15122             : {
   15123           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(obj);
   15124             :         PyObject *py_user;
   15125           0 :         if (object->in.user == NULL) {
   15126           0 :                 Py_RETURN_NONE;
   15127             :         }
   15128           0 :         if (object->in.user == NULL) {
   15129           0 :                 py_user = Py_None;
   15130           0 :                 Py_INCREF(py_user);
   15131             :         } else {
   15132           0 :                 py_user = PyUnicode_Decode(object->in.user, strlen(object->in.user), "utf-8", "ignore");
   15133             :         }
   15134           0 :         return py_user;
   15135             : }
   15136             : 
   15137           0 : static int py_wbint_PamLogOff_in_set_user(PyObject *py_obj, PyObject *value, void *closure)
   15138             : {
   15139           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(py_obj);
   15140           0 :         if (value == NULL) {
   15141           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user");
   15142           0 :                 return -1;
   15143             :         }
   15144           0 :         object->in.user = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user);
   15145           0 :         if (object->in.user == NULL) {
   15146           0 :                 PyErr_NoMemory();
   15147           0 :                 return -1;
   15148             :         }
   15149             :         {
   15150             :                 const char *test_str;
   15151             :                 const char *talloc_str;
   15152           0 :                 PyObject *unicode = NULL;
   15153           0 :                 if (PyUnicode_Check(value)) {
   15154           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   15155           0 :                         if (unicode == NULL) {
   15156           0 :                                 PyErr_NoMemory();
   15157           0 :                                 return -1;
   15158             :                         }
   15159           0 :                         test_str = PyBytes_AS_STRING(unicode);
   15160           0 :                 } else if (PyBytes_Check(value)) {
   15161           0 :                         test_str = PyBytes_AS_STRING(value);
   15162             :                 } else {
   15163           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   15164           0 :                         return -1;
   15165             :                 }
   15166           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   15167           0 :                 if (unicode != NULL) {
   15168           0 :                         Py_DECREF(unicode);
   15169             :                 }
   15170           0 :                 if (talloc_str == NULL) {
   15171           0 :                         PyErr_NoMemory();
   15172           0 :                         return -1;
   15173             :                 }
   15174           0 :                 object->in.user = talloc_str;
   15175             :         }
   15176           0 :         return 0;
   15177             : }
   15178             : 
   15179           0 : static PyObject *py_wbint_PamLogOff_in_get_krb5ccname(PyObject *obj, void *closure)
   15180             : {
   15181           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(obj);
   15182             :         PyObject *py_krb5ccname;
   15183           0 :         if (object->in.krb5ccname == NULL) {
   15184           0 :                 Py_RETURN_NONE;
   15185             :         }
   15186           0 :         if (object->in.krb5ccname == NULL) {
   15187           0 :                 py_krb5ccname = Py_None;
   15188           0 :                 Py_INCREF(py_krb5ccname);
   15189             :         } else {
   15190           0 :                 py_krb5ccname = PyUnicode_Decode(object->in.krb5ccname, strlen(object->in.krb5ccname), "utf-8", "ignore");
   15191             :         }
   15192           0 :         return py_krb5ccname;
   15193             : }
   15194             : 
   15195           0 : static int py_wbint_PamLogOff_in_set_krb5ccname(PyObject *py_obj, PyObject *value, void *closure)
   15196             : {
   15197           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(py_obj);
   15198           0 :         if (value == NULL) {
   15199           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.krb5ccname");
   15200           0 :                 return -1;
   15201             :         }
   15202           0 :         object->in.krb5ccname = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.krb5ccname);
   15203           0 :         if (object->in.krb5ccname == NULL) {
   15204           0 :                 PyErr_NoMemory();
   15205           0 :                 return -1;
   15206             :         }
   15207             :         {
   15208             :                 const char *test_str;
   15209             :                 const char *talloc_str;
   15210           0 :                 PyObject *unicode = NULL;
   15211           0 :                 if (PyUnicode_Check(value)) {
   15212           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   15213           0 :                         if (unicode == NULL) {
   15214           0 :                                 PyErr_NoMemory();
   15215           0 :                                 return -1;
   15216             :                         }
   15217           0 :                         test_str = PyBytes_AS_STRING(unicode);
   15218           0 :                 } else if (PyBytes_Check(value)) {
   15219           0 :                         test_str = PyBytes_AS_STRING(value);
   15220             :                 } else {
   15221           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   15222           0 :                         return -1;
   15223             :                 }
   15224           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   15225           0 :                 if (unicode != NULL) {
   15226           0 :                         Py_DECREF(unicode);
   15227             :                 }
   15228           0 :                 if (talloc_str == NULL) {
   15229           0 :                         PyErr_NoMemory();
   15230           0 :                         return -1;
   15231             :                 }
   15232           0 :                 object->in.krb5ccname = talloc_str;
   15233             :         }
   15234           0 :         return 0;
   15235             : }
   15236             : 
   15237           0 : static PyObject *py_wbint_PamLogOff_in_get_uid(PyObject *obj, void *closure)
   15238             : {
   15239           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(obj);
   15240             :         PyObject *py_uid;
   15241           0 :         py_uid = PyLong_FromUnsignedLongLong(object->in.uid);
   15242           0 :         return py_uid;
   15243             : }
   15244             : 
   15245           0 : static int py_wbint_PamLogOff_in_set_uid(PyObject *py_obj, PyObject *value, void *closure)
   15246             : {
   15247           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(py_obj);
   15248           0 :         if (value == NULL) {
   15249           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.uid");
   15250           0 :                 return -1;
   15251             :         }
   15252             :         {
   15253           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.uid));
   15254           0 :                 if (PyLong_Check(value)) {
   15255             :                         unsigned long long test_var;
   15256           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   15257           0 :                         if (PyErr_Occurred() != NULL) {
   15258           0 :                                 return -1;
   15259             :                         }
   15260           0 :                         if (test_var > uint_max) {
   15261           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   15262             :                                   PyLong_Type.tp_name, uint_max, test_var);
   15263           0 :                                 return -1;
   15264             :                         }
   15265           0 :                         object->in.uid = test_var;
   15266             :                 } else {
   15267           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   15268             :                           PyLong_Type.tp_name);
   15269           0 :                         return -1;
   15270             :                 }
   15271             :         }
   15272           0 :         return 0;
   15273             : }
   15274             : 
   15275           0 : static PyObject *py_wbint_PamLogOff_get_result(PyObject *obj, void *closure)
   15276             : {
   15277           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(obj);
   15278             :         PyObject *py_result;
   15279           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   15280           0 :         return py_result;
   15281             : }
   15282             : 
   15283           0 : static int py_wbint_PamLogOff_set_result(PyObject *py_obj, PyObject *value, void *closure)
   15284             : {
   15285           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(py_obj);
   15286           0 :         if (value == NULL) {
   15287           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   15288           0 :                 return -1;
   15289             :         }
   15290           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   15291           0 :         return 0;
   15292             : }
   15293             : 
   15294             : static PyGetSetDef py_wbint_PamLogOff_getsetters[] = {
   15295             :         {
   15296             :                 .name = discard_const_p(char, "in_client_name"),
   15297             :                 .get = py_wbint_PamLogOff_in_get_client_name,
   15298             :                 .set = py_wbint_PamLogOff_in_set_client_name,
   15299             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   15300             :         },
   15301             :         {
   15302             :                 .name = discard_const_p(char, "in_client_pid"),
   15303             :                 .get = py_wbint_PamLogOff_in_get_client_pid,
   15304             :                 .set = py_wbint_PamLogOff_in_set_client_pid,
   15305             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
   15306             :         },
   15307             :         {
   15308             :                 .name = discard_const_p(char, "in_flags"),
   15309             :                 .get = py_wbint_PamLogOff_in_get_flags,
   15310             :                 .set = py_wbint_PamLogOff_in_set_flags,
   15311             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
   15312             :         },
   15313             :         {
   15314             :                 .name = discard_const_p(char, "in_user"),
   15315             :                 .get = py_wbint_PamLogOff_in_get_user,
   15316             :                 .set = py_wbint_PamLogOff_in_set_user,
   15317             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   15318             :         },
   15319             :         {
   15320             :                 .name = discard_const_p(char, "in_krb5ccname"),
   15321             :                 .get = py_wbint_PamLogOff_in_get_krb5ccname,
   15322             :                 .set = py_wbint_PamLogOff_in_set_krb5ccname,
   15323             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   15324             :         },
   15325             :         {
   15326             :                 .name = discard_const_p(char, "in_uid"),
   15327             :                 .get = py_wbint_PamLogOff_in_get_uid,
   15328             :                 .set = py_wbint_PamLogOff_in_set_uid,
   15329             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
   15330             :         },
   15331             :         {
   15332             :                 .name = discard_const_p(char, "result"),
   15333             :                 .get = py_wbint_PamLogOff_get_result,
   15334             :                 .set = py_wbint_PamLogOff_set_result,
   15335             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   15336             :         },
   15337             :         { .name = NULL }
   15338             : };
   15339             : 
   15340           0 : static PyObject *py_wbint_PamLogOff_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   15341             : {
   15342           0 :         PyObject *self = pytalloc_new(struct wbint_PamLogOff, type);
   15343           0 :         return self;
   15344             : }
   15345             : 
   15346           0 : static PyObject *py_wbint_PamLogOff_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   15347             : {
   15348             : 
   15349             : 
   15350           0 :         return PyLong_FromLong(23);
   15351             : }
   15352             : 
   15353           0 : static PyObject *py_wbint_PamLogOff_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   15354             : {
   15355           0 :         const struct ndr_interface_call *call = NULL;
   15356           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(py_obj);
   15357           0 :         PyObject *ret = NULL;
   15358           0 :         struct ndr_push *push = NULL;
   15359             :         DATA_BLOB blob;
   15360             :         enum ndr_err_code err;
   15361             : 
   15362           0 :         if (ndr_table_winbind.num_calls < 24) {
   15363           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamLogOff_ndr_pack");
   15364           0 :                 return NULL;
   15365             :         }
   15366           0 :         call = &ndr_table_winbind.calls[23];
   15367             : 
   15368           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   15369           0 :         if (push == NULL) {
   15370           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   15371           0 :                 return NULL;
   15372             :         }
   15373             : 
   15374           0 :         push->flags |= ndr_push_flags;
   15375             : 
   15376           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   15377           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   15378           0 :                 TALLOC_FREE(push);
   15379           0 :                 PyErr_SetNdrError(err);
   15380           0 :                 return NULL;
   15381             :         }
   15382           0 :         blob = ndr_push_blob(push);
   15383           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   15384           0 :         TALLOC_FREE(push);
   15385           0 :         return ret;
   15386             : }
   15387             : 
   15388           0 : static PyObject *py_wbint_PamLogOff_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   15389             : {
   15390           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   15391           0 :         PyObject *bigendian_obj = NULL;
   15392           0 :         PyObject *ndr64_obj = NULL;
   15393           0 :         uint32_t ndr_push_flags = 0;
   15394             : 
   15395           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   15396             :                 discard_const_p(char *, kwnames),
   15397             :                 &bigendian_obj,
   15398             :                 &ndr64_obj)) {
   15399           0 :                 return NULL;
   15400             :         }
   15401             : 
   15402           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   15403           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   15404             :         }
   15405           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   15406           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   15407             :         }
   15408             : 
   15409           0 :         return py_wbint_PamLogOff_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   15410             : }
   15411             : 
   15412           0 : static PyObject *py_wbint_PamLogOff_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   15413             : {
   15414           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   15415           0 :         PyObject *bigendian_obj = NULL;
   15416           0 :         PyObject *ndr64_obj = NULL;
   15417           0 :         uint32_t ndr_push_flags = 0;
   15418             : 
   15419           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   15420             :                 discard_const_p(char *, kwnames),
   15421             :                 &bigendian_obj,
   15422             :                 &ndr64_obj)) {
   15423           0 :                 return NULL;
   15424             :         }
   15425             : 
   15426           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   15427           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   15428             :         }
   15429           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   15430           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   15431             :         }
   15432             : 
   15433           0 :         return py_wbint_PamLogOff_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   15434             : }
   15435             : 
   15436           0 : static PyObject *py_wbint_PamLogOff_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   15437             : {
   15438           0 :         const struct ndr_interface_call *call = NULL;
   15439           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(py_obj);
   15440           0 :         struct ndr_pull *pull = NULL;
   15441             :         enum ndr_err_code err;
   15442             : 
   15443           0 :         if (ndr_table_winbind.num_calls < 24) {
   15444           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamLogOff_ndr_unpack");
   15445           0 :                 return NULL;
   15446             :         }
   15447           0 :         call = &ndr_table_winbind.calls[23];
   15448             : 
   15449           0 :         pull = ndr_pull_init_blob(blob, object);
   15450           0 :         if (pull == NULL) {
   15451           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   15452           0 :                 return NULL;
   15453             :         }
   15454             : 
   15455           0 :         pull->flags |= ndr_pull_flags;
   15456             : 
   15457           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   15458           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   15459           0 :                 TALLOC_FREE(pull);
   15460           0 :                 PyErr_SetNdrError(err);
   15461           0 :                 return NULL;
   15462             :         }
   15463           0 :         if (!allow_remaining) {
   15464             :                 uint32_t highest_ofs;
   15465             : 
   15466           0 :                 if (pull->offset > pull->relative_highest_offset) {
   15467           0 :                         highest_ofs = pull->offset;
   15468             :                 } else {
   15469           0 :                         highest_ofs = pull->relative_highest_offset;
   15470             :                 }
   15471           0 :                 if (highest_ofs < pull->data_size) {
   15472           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   15473             :                                 "not all bytes consumed ofs[%u] size[%u]",
   15474             :                                 highest_ofs, pull->data_size);
   15475           0 :                         TALLOC_FREE(pull);
   15476           0 :                         PyErr_SetNdrError(err);
   15477           0 :                         return NULL;
   15478             :                 }
   15479             :         }
   15480             : 
   15481           0 :         TALLOC_FREE(pull);
   15482           0 :         Py_RETURN_NONE;
   15483             : }
   15484             : 
   15485           0 : static PyObject *py_wbint_PamLogOff_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   15486             : {
   15487             :         DATA_BLOB blob;
   15488           0 :         Py_ssize_t blob_length = 0;
   15489           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   15490           0 :         PyObject *bigendian_obj = NULL;
   15491           0 :         PyObject *ndr64_obj = NULL;
   15492           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   15493           0 :         PyObject *allow_remaining_obj = NULL;
   15494           0 :         bool allow_remaining = false;
   15495             : 
   15496           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   15497             :                 discard_const_p(char *, kwnames),
   15498             :                 &blob.data, &blob_length,
   15499             :                 &bigendian_obj,
   15500             :                 &ndr64_obj,
   15501             :                 &allow_remaining_obj)) {
   15502           0 :                 return NULL;
   15503             :         }
   15504           0 :         blob.length = blob_length;
   15505             : 
   15506           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   15507           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   15508             :         }
   15509           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   15510           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   15511             :         }
   15512             : 
   15513           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   15514           0 :                 allow_remaining = true;
   15515             :         }
   15516             : 
   15517           0 :         return py_wbint_PamLogOff_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   15518             : }
   15519             : 
   15520           0 : static PyObject *py_wbint_PamLogOff_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   15521             : {
   15522             :         DATA_BLOB blob;
   15523           0 :         Py_ssize_t blob_length = 0;
   15524           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   15525           0 :         PyObject *bigendian_obj = NULL;
   15526           0 :         PyObject *ndr64_obj = NULL;
   15527           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   15528           0 :         PyObject *allow_remaining_obj = NULL;
   15529           0 :         bool allow_remaining = false;
   15530             : 
   15531           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   15532             :                 discard_const_p(char *, kwnames),
   15533             :                 &blob.data, &blob_length,
   15534             :                 &bigendian_obj,
   15535             :                 &ndr64_obj,
   15536             :                 &allow_remaining_obj)) {
   15537           0 :                 return NULL;
   15538             :         }
   15539           0 :         blob.length = blob_length;
   15540             : 
   15541           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   15542           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   15543             :         }
   15544           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   15545           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   15546             :         }
   15547             : 
   15548           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   15549           0 :                 allow_remaining = true;
   15550             :         }
   15551             : 
   15552           0 :         return py_wbint_PamLogOff_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   15553             : }
   15554             : 
   15555           0 : static PyObject *py_wbint_PamLogOff_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   15556             : {
   15557           0 :         const struct ndr_interface_call *call = NULL;
   15558           0 :         struct wbint_PamLogOff *object = (struct wbint_PamLogOff *)pytalloc_get_ptr(py_obj);
   15559             :         PyObject *ret;
   15560             :         char *retstr;
   15561             : 
   15562           0 :         if (ndr_table_winbind.num_calls < 24) {
   15563           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamLogOff_ndr_print");
   15564           0 :                 return NULL;
   15565             :         }
   15566           0 :         call = &ndr_table_winbind.calls[23];
   15567             : 
   15568           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   15569           0 :         ret = PyUnicode_FromString(retstr);
   15570           0 :         TALLOC_FREE(retstr);
   15571             : 
   15572           0 :         return ret;
   15573             : }
   15574             : 
   15575           0 : static PyObject *py_wbint_PamLogOff_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   15576             : {
   15577           0 :         return py_wbint_PamLogOff_ndr_print(py_obj, "wbint_PamLogOff_in", NDR_IN);
   15578             : }
   15579             : 
   15580           0 : static PyObject *py_wbint_PamLogOff_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   15581             : {
   15582           0 :         return py_wbint_PamLogOff_ndr_print(py_obj, "wbint_PamLogOff_out", NDR_OUT);
   15583             : }
   15584             : 
   15585             : static PyMethodDef py_wbint_PamLogOff_methods[] = {
   15586             :         { "opnum", (PyCFunction)py_wbint_PamLogOff_ndr_opnum, METH_NOARGS|METH_CLASS,
   15587             :                 "winbind.wbint_PamLogOff.opnum() -> 23 (0x17) " },
   15588             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamLogOff_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   15589             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   15590             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamLogOff_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   15591             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   15592             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamLogOff_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   15593             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   15594             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamLogOff_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   15595             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   15596             :         { "__ndr_print_in__", (PyCFunction)py_wbint_PamLogOff_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   15597             :         { "__ndr_print_out__", (PyCFunction)py_wbint_PamLogOff_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   15598             :         { NULL, NULL, 0, NULL }
   15599             : };
   15600             : 
   15601             : 
   15602             : static PyTypeObject wbint_PamLogOff_Type = {
   15603             :         PyVarObject_HEAD_INIT(NULL, 0)
   15604             :         .tp_name = "winbind.wbint_PamLogOff",
   15605             :         .tp_getset = py_wbint_PamLogOff_getsetters,
   15606             :         .tp_methods = py_wbint_PamLogOff_methods,
   15607             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   15608             :         .tp_new = py_wbint_PamLogOff_new,
   15609             : };
   15610             : 
   15611           0 : static bool pack_py_wbint_PamLogOff_args_in(PyObject *args, PyObject *kwargs, struct wbint_PamLogOff *r)
   15612             : {
   15613             :         PyObject *py_client_name;
   15614             :         PyObject *py_client_pid;
   15615             :         PyObject *py_flags;
   15616             :         PyObject *py_user;
   15617             :         PyObject *py_krb5ccname;
   15618             :         PyObject *py_uid;
   15619           0 :         const char *kwnames[] = {
   15620             :                 "client_name", "client_pid", "flags", "user", "krb5ccname", "uid", NULL
   15621             :         };
   15622             : 
   15623           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:wbint_PamLogOff", discard_const_p(char *, kwnames), &py_client_name, &py_client_pid, &py_flags, &py_user, &py_krb5ccname, &py_uid)) {
   15624           0 :                 return false;
   15625             :         }
   15626             : 
   15627           0 :         if (py_client_name == NULL) {
   15628           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_name");
   15629           0 :                 return false;
   15630             :         }
   15631           0 :         r->in.client_name = talloc_ptrtype(r, r->in.client_name);
   15632           0 :         if (r->in.client_name == NULL) {
   15633           0 :                 PyErr_NoMemory();
   15634           0 :                 return false;
   15635             :         }
   15636             :         {
   15637             :                 const char *test_str;
   15638             :                 const char *talloc_str;
   15639           0 :                 PyObject *unicode = NULL;
   15640           0 :                 if (PyUnicode_Check(py_client_name)) {
   15641           0 :                         unicode = PyUnicode_AsEncodedString(py_client_name, "utf-8", "ignore");
   15642           0 :                         if (unicode == NULL) {
   15643           0 :                                 PyErr_NoMemory();
   15644           0 :                                 return false;
   15645             :                         }
   15646           0 :                         test_str = PyBytes_AS_STRING(unicode);
   15647           0 :                 } else if (PyBytes_Check(py_client_name)) {
   15648           0 :                         test_str = PyBytes_AS_STRING(py_client_name);
   15649             :                 } else {
   15650           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_name)->tp_name);
   15651           0 :                         return false;
   15652             :                 }
   15653           0 :                 talloc_str = talloc_strdup(r, test_str);
   15654           0 :                 if (unicode != NULL) {
   15655           0 :                         Py_DECREF(unicode);
   15656             :                 }
   15657           0 :                 if (talloc_str == NULL) {
   15658           0 :                         PyErr_NoMemory();
   15659           0 :                         return false;
   15660             :                 }
   15661           0 :                 r->in.client_name = talloc_str;
   15662             :         }
   15663           0 :         if (py_client_pid == NULL) {
   15664           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_pid");
   15665           0 :                 return false;
   15666             :         }
   15667             :         {
   15668           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_pid));
   15669           0 :                 if (PyLong_Check(py_client_pid)) {
   15670             :                         unsigned long long test_var;
   15671           0 :                         test_var = PyLong_AsUnsignedLongLong(py_client_pid);
   15672           0 :                         if (PyErr_Occurred() != NULL) {
   15673           0 :                                 return false;
   15674             :                         }
   15675           0 :                         if (test_var > uint_max) {
   15676           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   15677             :                                   PyLong_Type.tp_name, uint_max, test_var);
   15678           0 :                                 return false;
   15679             :                         }
   15680           0 :                         r->in.client_pid = test_var;
   15681             :                 } else {
   15682           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   15683             :                           PyLong_Type.tp_name);
   15684           0 :                         return false;
   15685             :                 }
   15686             :         }
   15687           0 :         if (py_flags == NULL) {
   15688           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
   15689           0 :                 return false;
   15690             :         }
   15691             :         {
   15692           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
   15693           0 :                 if (PyLong_Check(py_flags)) {
   15694             :                         unsigned long long test_var;
   15695           0 :                         test_var = PyLong_AsUnsignedLongLong(py_flags);
   15696           0 :                         if (PyErr_Occurred() != NULL) {
   15697           0 :                                 return false;
   15698             :                         }
   15699           0 :                         if (test_var > uint_max) {
   15700           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   15701             :                                   PyLong_Type.tp_name, uint_max, test_var);
   15702           0 :                                 return false;
   15703             :                         }
   15704           0 :                         r->in.flags = test_var;
   15705             :                 } else {
   15706           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   15707             :                           PyLong_Type.tp_name);
   15708           0 :                         return false;
   15709             :                 }
   15710             :         }
   15711           0 :         if (py_user == NULL) {
   15712           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user");
   15713           0 :                 return false;
   15714             :         }
   15715           0 :         r->in.user = talloc_ptrtype(r, r->in.user);
   15716           0 :         if (r->in.user == NULL) {
   15717           0 :                 PyErr_NoMemory();
   15718           0 :                 return false;
   15719             :         }
   15720             :         {
   15721             :                 const char *test_str;
   15722             :                 const char *talloc_str;
   15723           0 :                 PyObject *unicode = NULL;
   15724           0 :                 if (PyUnicode_Check(py_user)) {
   15725           0 :                         unicode = PyUnicode_AsEncodedString(py_user, "utf-8", "ignore");
   15726           0 :                         if (unicode == NULL) {
   15727           0 :                                 PyErr_NoMemory();
   15728           0 :                                 return false;
   15729             :                         }
   15730           0 :                         test_str = PyBytes_AS_STRING(unicode);
   15731           0 :                 } else if (PyBytes_Check(py_user)) {
   15732           0 :                         test_str = PyBytes_AS_STRING(py_user);
   15733             :                 } else {
   15734           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_user)->tp_name);
   15735           0 :                         return false;
   15736             :                 }
   15737           0 :                 talloc_str = talloc_strdup(r, test_str);
   15738           0 :                 if (unicode != NULL) {
   15739           0 :                         Py_DECREF(unicode);
   15740             :                 }
   15741           0 :                 if (talloc_str == NULL) {
   15742           0 :                         PyErr_NoMemory();
   15743           0 :                         return false;
   15744             :                 }
   15745           0 :                 r->in.user = talloc_str;
   15746             :         }
   15747           0 :         if (py_krb5ccname == NULL) {
   15748           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.krb5ccname");
   15749           0 :                 return false;
   15750             :         }
   15751           0 :         r->in.krb5ccname = talloc_ptrtype(r, r->in.krb5ccname);
   15752           0 :         if (r->in.krb5ccname == NULL) {
   15753           0 :                 PyErr_NoMemory();
   15754           0 :                 return false;
   15755             :         }
   15756             :         {
   15757             :                 const char *test_str;
   15758             :                 const char *talloc_str;
   15759           0 :                 PyObject *unicode = NULL;
   15760           0 :                 if (PyUnicode_Check(py_krb5ccname)) {
   15761           0 :                         unicode = PyUnicode_AsEncodedString(py_krb5ccname, "utf-8", "ignore");
   15762           0 :                         if (unicode == NULL) {
   15763           0 :                                 PyErr_NoMemory();
   15764           0 :                                 return false;
   15765             :                         }
   15766           0 :                         test_str = PyBytes_AS_STRING(unicode);
   15767           0 :                 } else if (PyBytes_Check(py_krb5ccname)) {
   15768           0 :                         test_str = PyBytes_AS_STRING(py_krb5ccname);
   15769             :                 } else {
   15770           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_krb5ccname)->tp_name);
   15771           0 :                         return false;
   15772             :                 }
   15773           0 :                 talloc_str = talloc_strdup(r, test_str);
   15774           0 :                 if (unicode != NULL) {
   15775           0 :                         Py_DECREF(unicode);
   15776             :                 }
   15777           0 :                 if (talloc_str == NULL) {
   15778           0 :                         PyErr_NoMemory();
   15779           0 :                         return false;
   15780             :                 }
   15781           0 :                 r->in.krb5ccname = talloc_str;
   15782             :         }
   15783           0 :         if (py_uid == NULL) {
   15784           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.uid");
   15785           0 :                 return false;
   15786             :         }
   15787             :         {
   15788           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.uid));
   15789           0 :                 if (PyLong_Check(py_uid)) {
   15790             :                         unsigned long long test_var;
   15791           0 :                         test_var = PyLong_AsUnsignedLongLong(py_uid);
   15792           0 :                         if (PyErr_Occurred() != NULL) {
   15793           0 :                                 return false;
   15794             :                         }
   15795           0 :                         if (test_var > uint_max) {
   15796           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   15797             :                                   PyLong_Type.tp_name, uint_max, test_var);
   15798           0 :                                 return false;
   15799             :                         }
   15800           0 :                         r->in.uid = test_var;
   15801             :                 } else {
   15802           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   15803             :                           PyLong_Type.tp_name);
   15804           0 :                         return false;
   15805             :                 }
   15806             :         }
   15807           0 :         return true;
   15808             : }
   15809             : 
   15810           0 : static PyObject *unpack_py_wbint_PamLogOff_args_out(struct wbint_PamLogOff *r)
   15811             : {
   15812             :         PyObject *result;
   15813           0 :         result = Py_None;
   15814           0 :         Py_INCREF(result);
   15815           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   15816           0 :                 PyErr_SetNTSTATUS(r->out.result);
   15817           0 :                 return NULL;
   15818             :         }
   15819             : 
   15820           0 :         return result;
   15821             : }
   15822             : 
   15823             : 
   15824           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_client_name(PyObject *obj, void *closure)
   15825             : {
   15826           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(obj);
   15827             :         PyObject *py_client_name;
   15828           0 :         if (object->in.client_name == NULL) {
   15829           0 :                 Py_RETURN_NONE;
   15830             :         }
   15831           0 :         if (object->in.client_name == NULL) {
   15832           0 :                 py_client_name = Py_None;
   15833           0 :                 Py_INCREF(py_client_name);
   15834             :         } else {
   15835           0 :                 py_client_name = PyUnicode_Decode(object->in.client_name, strlen(object->in.client_name), "utf-8", "ignore");
   15836             :         }
   15837           0 :         return py_client_name;
   15838             : }
   15839             : 
   15840           0 : static int py_wbint_PamAuthCrapChangePassword_in_set_client_name(PyObject *py_obj, PyObject *value, void *closure)
   15841             : {
   15842           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(py_obj);
   15843           0 :         if (value == NULL) {
   15844           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_name");
   15845           0 :                 return -1;
   15846             :         }
   15847           0 :         object->in.client_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.client_name);
   15848           0 :         if (object->in.client_name == NULL) {
   15849           0 :                 PyErr_NoMemory();
   15850           0 :                 return -1;
   15851             :         }
   15852             :         {
   15853             :                 const char *test_str;
   15854             :                 const char *talloc_str;
   15855           0 :                 PyObject *unicode = NULL;
   15856           0 :                 if (PyUnicode_Check(value)) {
   15857           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   15858           0 :                         if (unicode == NULL) {
   15859           0 :                                 PyErr_NoMemory();
   15860           0 :                                 return -1;
   15861             :                         }
   15862           0 :                         test_str = PyBytes_AS_STRING(unicode);
   15863           0 :                 } else if (PyBytes_Check(value)) {
   15864           0 :                         test_str = PyBytes_AS_STRING(value);
   15865             :                 } else {
   15866           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   15867           0 :                         return -1;
   15868             :                 }
   15869           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   15870           0 :                 if (unicode != NULL) {
   15871           0 :                         Py_DECREF(unicode);
   15872             :                 }
   15873           0 :                 if (talloc_str == NULL) {
   15874           0 :                         PyErr_NoMemory();
   15875           0 :                         return -1;
   15876             :                 }
   15877           0 :                 object->in.client_name = talloc_str;
   15878             :         }
   15879           0 :         return 0;
   15880             : }
   15881             : 
   15882           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_client_pid(PyObject *obj, void *closure)
   15883             : {
   15884           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(obj);
   15885             :         PyObject *py_client_pid;
   15886           0 :         py_client_pid = PyLong_FromUnsignedLongLong(object->in.client_pid);
   15887           0 :         return py_client_pid;
   15888             : }
   15889             : 
   15890           0 : static int py_wbint_PamAuthCrapChangePassword_in_set_client_pid(PyObject *py_obj, PyObject *value, void *closure)
   15891             : {
   15892           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(py_obj);
   15893           0 :         if (value == NULL) {
   15894           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_pid");
   15895           0 :                 return -1;
   15896             :         }
   15897             :         {
   15898           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_pid));
   15899           0 :                 if (PyLong_Check(value)) {
   15900             :                         unsigned long long test_var;
   15901           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   15902           0 :                         if (PyErr_Occurred() != NULL) {
   15903           0 :                                 return -1;
   15904             :                         }
   15905           0 :                         if (test_var > uint_max) {
   15906           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   15907             :                                   PyLong_Type.tp_name, uint_max, test_var);
   15908           0 :                                 return -1;
   15909             :                         }
   15910           0 :                         object->in.client_pid = test_var;
   15911             :                 } else {
   15912           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   15913             :                           PyLong_Type.tp_name);
   15914           0 :                         return -1;
   15915             :                 }
   15916             :         }
   15917           0 :         return 0;
   15918             : }
   15919             : 
   15920           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_user(PyObject *obj, void *closure)
   15921             : {
   15922           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(obj);
   15923             :         PyObject *py_user;
   15924           0 :         if (object->in.user == NULL) {
   15925           0 :                 Py_RETURN_NONE;
   15926             :         }
   15927           0 :         if (object->in.user == NULL) {
   15928           0 :                 py_user = Py_None;
   15929           0 :                 Py_INCREF(py_user);
   15930             :         } else {
   15931           0 :                 py_user = PyUnicode_Decode(object->in.user, strlen(object->in.user), "utf-8", "ignore");
   15932             :         }
   15933           0 :         return py_user;
   15934             : }
   15935             : 
   15936           0 : static int py_wbint_PamAuthCrapChangePassword_in_set_user(PyObject *py_obj, PyObject *value, void *closure)
   15937             : {
   15938           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(py_obj);
   15939           0 :         if (value == NULL) {
   15940           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user");
   15941           0 :                 return -1;
   15942             :         }
   15943           0 :         object->in.user = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user);
   15944           0 :         if (object->in.user == NULL) {
   15945           0 :                 PyErr_NoMemory();
   15946           0 :                 return -1;
   15947             :         }
   15948             :         {
   15949             :                 const char *test_str;
   15950             :                 const char *talloc_str;
   15951           0 :                 PyObject *unicode = NULL;
   15952           0 :                 if (PyUnicode_Check(value)) {
   15953           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   15954           0 :                         if (unicode == NULL) {
   15955           0 :                                 PyErr_NoMemory();
   15956           0 :                                 return -1;
   15957             :                         }
   15958           0 :                         test_str = PyBytes_AS_STRING(unicode);
   15959           0 :                 } else if (PyBytes_Check(value)) {
   15960           0 :                         test_str = PyBytes_AS_STRING(value);
   15961             :                 } else {
   15962           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   15963           0 :                         return -1;
   15964             :                 }
   15965           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   15966           0 :                 if (unicode != NULL) {
   15967           0 :                         Py_DECREF(unicode);
   15968             :                 }
   15969           0 :                 if (talloc_str == NULL) {
   15970           0 :                         PyErr_NoMemory();
   15971           0 :                         return -1;
   15972             :                 }
   15973           0 :                 object->in.user = talloc_str;
   15974             :         }
   15975           0 :         return 0;
   15976             : }
   15977             : 
   15978           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_domain(PyObject *obj, void *closure)
   15979             : {
   15980           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(obj);
   15981             :         PyObject *py_domain;
   15982           0 :         if (object->in.domain == NULL) {
   15983           0 :                 Py_RETURN_NONE;
   15984             :         }
   15985           0 :         if (object->in.domain == NULL) {
   15986           0 :                 py_domain = Py_None;
   15987           0 :                 Py_INCREF(py_domain);
   15988             :         } else {
   15989           0 :                 py_domain = PyUnicode_Decode(object->in.domain, strlen(object->in.domain), "utf-8", "ignore");
   15990             :         }
   15991           0 :         return py_domain;
   15992             : }
   15993             : 
   15994           0 : static int py_wbint_PamAuthCrapChangePassword_in_set_domain(PyObject *py_obj, PyObject *value, void *closure)
   15995             : {
   15996           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(py_obj);
   15997           0 :         if (value == NULL) {
   15998           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain");
   15999           0 :                 return -1;
   16000             :         }
   16001           0 :         object->in.domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain);
   16002           0 :         if (object->in.domain == NULL) {
   16003           0 :                 PyErr_NoMemory();
   16004           0 :                 return -1;
   16005             :         }
   16006             :         {
   16007             :                 const char *test_str;
   16008             :                 const char *talloc_str;
   16009           0 :                 PyObject *unicode = NULL;
   16010           0 :                 if (PyUnicode_Check(value)) {
   16011           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   16012           0 :                         if (unicode == NULL) {
   16013           0 :                                 PyErr_NoMemory();
   16014           0 :                                 return -1;
   16015             :                         }
   16016           0 :                         test_str = PyBytes_AS_STRING(unicode);
   16017           0 :                 } else if (PyBytes_Check(value)) {
   16018           0 :                         test_str = PyBytes_AS_STRING(value);
   16019             :                 } else {
   16020           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   16021           0 :                         return -1;
   16022             :                 }
   16023           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   16024           0 :                 if (unicode != NULL) {
   16025           0 :                         Py_DECREF(unicode);
   16026             :                 }
   16027           0 :                 if (talloc_str == NULL) {
   16028           0 :                         PyErr_NoMemory();
   16029           0 :                         return -1;
   16030             :                 }
   16031           0 :                 object->in.domain = talloc_str;
   16032             :         }
   16033           0 :         return 0;
   16034             : }
   16035             : 
   16036           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_new_nt_pswd(PyObject *obj, void *closure)
   16037             : {
   16038           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(obj);
   16039             :         PyObject *py_new_nt_pswd;
   16040           0 :         py_new_nt_pswd = PyBytes_FromStringAndSize((char *)(object->in.new_nt_pswd).data, (object->in.new_nt_pswd).length);
   16041           0 :         return py_new_nt_pswd;
   16042             : }
   16043             : 
   16044           0 : static int py_wbint_PamAuthCrapChangePassword_in_set_new_nt_pswd(PyObject *py_obj, PyObject *value, void *closure)
   16045             : {
   16046           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(py_obj);
   16047           0 :         if (value == NULL) {
   16048           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_nt_pswd");
   16049           0 :                 return -1;
   16050             :         }
   16051           0 :         object->in.new_nt_pswd = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
   16052           0 :         return 0;
   16053             : }
   16054             : 
   16055           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_old_nt_hash_enc(PyObject *obj, void *closure)
   16056             : {
   16057           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(obj);
   16058             :         PyObject *py_old_nt_hash_enc;
   16059           0 :         py_old_nt_hash_enc = PyBytes_FromStringAndSize((char *)(object->in.old_nt_hash_enc).data, (object->in.old_nt_hash_enc).length);
   16060           0 :         return py_old_nt_hash_enc;
   16061             : }
   16062             : 
   16063           0 : static int py_wbint_PamAuthCrapChangePassword_in_set_old_nt_hash_enc(PyObject *py_obj, PyObject *value, void *closure)
   16064             : {
   16065           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(py_obj);
   16066           0 :         if (value == NULL) {
   16067           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.old_nt_hash_enc");
   16068           0 :                 return -1;
   16069             :         }
   16070           0 :         object->in.old_nt_hash_enc = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
   16071           0 :         return 0;
   16072             : }
   16073             : 
   16074           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_new_lm_pswd(PyObject *obj, void *closure)
   16075             : {
   16076           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(obj);
   16077             :         PyObject *py_new_lm_pswd;
   16078           0 :         py_new_lm_pswd = PyBytes_FromStringAndSize((char *)(object->in.new_lm_pswd).data, (object->in.new_lm_pswd).length);
   16079           0 :         return py_new_lm_pswd;
   16080             : }
   16081             : 
   16082           0 : static int py_wbint_PamAuthCrapChangePassword_in_set_new_lm_pswd(PyObject *py_obj, PyObject *value, void *closure)
   16083             : {
   16084           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(py_obj);
   16085           0 :         if (value == NULL) {
   16086           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_lm_pswd");
   16087           0 :                 return -1;
   16088             :         }
   16089           0 :         object->in.new_lm_pswd = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
   16090           0 :         return 0;
   16091             : }
   16092             : 
   16093           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_old_lm_hash_enc(PyObject *obj, void *closure)
   16094             : {
   16095           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(obj);
   16096             :         PyObject *py_old_lm_hash_enc;
   16097           0 :         py_old_lm_hash_enc = PyBytes_FromStringAndSize((char *)(object->in.old_lm_hash_enc).data, (object->in.old_lm_hash_enc).length);
   16098           0 :         return py_old_lm_hash_enc;
   16099             : }
   16100             : 
   16101           0 : static int py_wbint_PamAuthCrapChangePassword_in_set_old_lm_hash_enc(PyObject *py_obj, PyObject *value, void *closure)
   16102             : {
   16103           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(py_obj);
   16104           0 :         if (value == NULL) {
   16105           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.old_lm_hash_enc");
   16106           0 :                 return -1;
   16107             :         }
   16108           0 :         object->in.old_lm_hash_enc = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
   16109           0 :         return 0;
   16110             : }
   16111             : 
   16112           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_get_result(PyObject *obj, void *closure)
   16113             : {
   16114           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(obj);
   16115             :         PyObject *py_result;
   16116           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   16117           0 :         return py_result;
   16118             : }
   16119             : 
   16120           0 : static int py_wbint_PamAuthCrapChangePassword_set_result(PyObject *py_obj, PyObject *value, void *closure)
   16121             : {
   16122           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(py_obj);
   16123           0 :         if (value == NULL) {
   16124           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   16125           0 :                 return -1;
   16126             :         }
   16127           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   16128           0 :         return 0;
   16129             : }
   16130             : 
   16131             : static PyGetSetDef py_wbint_PamAuthCrapChangePassword_getsetters[] = {
   16132             :         {
   16133             :                 .name = discard_const_p(char, "in_client_name"),
   16134             :                 .get = py_wbint_PamAuthCrapChangePassword_in_get_client_name,
   16135             :                 .set = py_wbint_PamAuthCrapChangePassword_in_set_client_name,
   16136             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   16137             :         },
   16138             :         {
   16139             :                 .name = discard_const_p(char, "in_client_pid"),
   16140             :                 .get = py_wbint_PamAuthCrapChangePassword_in_get_client_pid,
   16141             :                 .set = py_wbint_PamAuthCrapChangePassword_in_set_client_pid,
   16142             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
   16143             :         },
   16144             :         {
   16145             :                 .name = discard_const_p(char, "in_user"),
   16146             :                 .get = py_wbint_PamAuthCrapChangePassword_in_get_user,
   16147             :                 .set = py_wbint_PamAuthCrapChangePassword_in_set_user,
   16148             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   16149             :         },
   16150             :         {
   16151             :                 .name = discard_const_p(char, "in_domain"),
   16152             :                 .get = py_wbint_PamAuthCrapChangePassword_in_get_domain,
   16153             :                 .set = py_wbint_PamAuthCrapChangePassword_in_set_domain,
   16154             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   16155             :         },
   16156             :         {
   16157             :                 .name = discard_const_p(char, "in_new_nt_pswd"),
   16158             :                 .get = py_wbint_PamAuthCrapChangePassword_in_get_new_nt_pswd,
   16159             :                 .set = py_wbint_PamAuthCrapChangePassword_in_set_new_nt_pswd,
   16160             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
   16161             :         },
   16162             :         {
   16163             :                 .name = discard_const_p(char, "in_old_nt_hash_enc"),
   16164             :                 .get = py_wbint_PamAuthCrapChangePassword_in_get_old_nt_hash_enc,
   16165             :                 .set = py_wbint_PamAuthCrapChangePassword_in_set_old_nt_hash_enc,
   16166             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
   16167             :         },
   16168             :         {
   16169             :                 .name = discard_const_p(char, "in_new_lm_pswd"),
   16170             :                 .get = py_wbint_PamAuthCrapChangePassword_in_get_new_lm_pswd,
   16171             :                 .set = py_wbint_PamAuthCrapChangePassword_in_set_new_lm_pswd,
   16172             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
   16173             :         },
   16174             :         {
   16175             :                 .name = discard_const_p(char, "in_old_lm_hash_enc"),
   16176             :                 .get = py_wbint_PamAuthCrapChangePassword_in_get_old_lm_hash_enc,
   16177             :                 .set = py_wbint_PamAuthCrapChangePassword_in_set_old_lm_hash_enc,
   16178             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
   16179             :         },
   16180             :         {
   16181             :                 .name = discard_const_p(char, "result"),
   16182             :                 .get = py_wbint_PamAuthCrapChangePassword_get_result,
   16183             :                 .set = py_wbint_PamAuthCrapChangePassword_set_result,
   16184             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   16185             :         },
   16186             :         { .name = NULL }
   16187             : };
   16188             : 
   16189           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   16190             : {
   16191           0 :         PyObject *self = pytalloc_new(struct wbint_PamAuthCrapChangePassword, type);
   16192           0 :         return self;
   16193             : }
   16194             : 
   16195           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   16196             : {
   16197             : 
   16198             : 
   16199           0 :         return PyLong_FromLong(24);
   16200             : }
   16201             : 
   16202           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   16203             : {
   16204           0 :         const struct ndr_interface_call *call = NULL;
   16205           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(py_obj);
   16206           0 :         PyObject *ret = NULL;
   16207           0 :         struct ndr_push *push = NULL;
   16208             :         DATA_BLOB blob;
   16209             :         enum ndr_err_code err;
   16210             : 
   16211           0 :         if (ndr_table_winbind.num_calls < 25) {
   16212           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthCrapChangePassword_ndr_pack");
   16213           0 :                 return NULL;
   16214             :         }
   16215           0 :         call = &ndr_table_winbind.calls[24];
   16216             : 
   16217           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   16218           0 :         if (push == NULL) {
   16219           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   16220           0 :                 return NULL;
   16221             :         }
   16222             : 
   16223           0 :         push->flags |= ndr_push_flags;
   16224             : 
   16225           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   16226           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   16227           0 :                 TALLOC_FREE(push);
   16228           0 :                 PyErr_SetNdrError(err);
   16229           0 :                 return NULL;
   16230             :         }
   16231           0 :         blob = ndr_push_blob(push);
   16232           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   16233           0 :         TALLOC_FREE(push);
   16234           0 :         return ret;
   16235             : }
   16236             : 
   16237           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   16238             : {
   16239           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   16240           0 :         PyObject *bigendian_obj = NULL;
   16241           0 :         PyObject *ndr64_obj = NULL;
   16242           0 :         uint32_t ndr_push_flags = 0;
   16243             : 
   16244           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   16245             :                 discard_const_p(char *, kwnames),
   16246             :                 &bigendian_obj,
   16247             :                 &ndr64_obj)) {
   16248           0 :                 return NULL;
   16249             :         }
   16250             : 
   16251           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   16252           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   16253             :         }
   16254           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   16255           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   16256             :         }
   16257             : 
   16258           0 :         return py_wbint_PamAuthCrapChangePassword_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   16259             : }
   16260             : 
   16261           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   16262             : {
   16263           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   16264           0 :         PyObject *bigendian_obj = NULL;
   16265           0 :         PyObject *ndr64_obj = NULL;
   16266           0 :         uint32_t ndr_push_flags = 0;
   16267             : 
   16268           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   16269             :                 discard_const_p(char *, kwnames),
   16270             :                 &bigendian_obj,
   16271             :                 &ndr64_obj)) {
   16272           0 :                 return NULL;
   16273             :         }
   16274             : 
   16275           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   16276           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   16277             :         }
   16278           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   16279           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   16280             :         }
   16281             : 
   16282           0 :         return py_wbint_PamAuthCrapChangePassword_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   16283             : }
   16284             : 
   16285           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   16286             : {
   16287           0 :         const struct ndr_interface_call *call = NULL;
   16288           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(py_obj);
   16289           0 :         struct ndr_pull *pull = NULL;
   16290             :         enum ndr_err_code err;
   16291             : 
   16292           0 :         if (ndr_table_winbind.num_calls < 25) {
   16293           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthCrapChangePassword_ndr_unpack");
   16294           0 :                 return NULL;
   16295             :         }
   16296           0 :         call = &ndr_table_winbind.calls[24];
   16297             : 
   16298           0 :         pull = ndr_pull_init_blob(blob, object);
   16299           0 :         if (pull == NULL) {
   16300           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   16301           0 :                 return NULL;
   16302             :         }
   16303             : 
   16304           0 :         pull->flags |= ndr_pull_flags;
   16305             : 
   16306           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   16307           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   16308           0 :                 TALLOC_FREE(pull);
   16309           0 :                 PyErr_SetNdrError(err);
   16310           0 :                 return NULL;
   16311             :         }
   16312           0 :         if (!allow_remaining) {
   16313             :                 uint32_t highest_ofs;
   16314             : 
   16315           0 :                 if (pull->offset > pull->relative_highest_offset) {
   16316           0 :                         highest_ofs = pull->offset;
   16317             :                 } else {
   16318           0 :                         highest_ofs = pull->relative_highest_offset;
   16319             :                 }
   16320           0 :                 if (highest_ofs < pull->data_size) {
   16321           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   16322             :                                 "not all bytes consumed ofs[%u] size[%u]",
   16323             :                                 highest_ofs, pull->data_size);
   16324           0 :                         TALLOC_FREE(pull);
   16325           0 :                         PyErr_SetNdrError(err);
   16326           0 :                         return NULL;
   16327             :                 }
   16328             :         }
   16329             : 
   16330           0 :         TALLOC_FREE(pull);
   16331           0 :         Py_RETURN_NONE;
   16332             : }
   16333             : 
   16334           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   16335             : {
   16336             :         DATA_BLOB blob;
   16337           0 :         Py_ssize_t blob_length = 0;
   16338           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   16339           0 :         PyObject *bigendian_obj = NULL;
   16340           0 :         PyObject *ndr64_obj = NULL;
   16341           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   16342           0 :         PyObject *allow_remaining_obj = NULL;
   16343           0 :         bool allow_remaining = false;
   16344             : 
   16345           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   16346             :                 discard_const_p(char *, kwnames),
   16347             :                 &blob.data, &blob_length,
   16348             :                 &bigendian_obj,
   16349             :                 &ndr64_obj,
   16350             :                 &allow_remaining_obj)) {
   16351           0 :                 return NULL;
   16352             :         }
   16353           0 :         blob.length = blob_length;
   16354             : 
   16355           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   16356           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   16357             :         }
   16358           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   16359           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   16360             :         }
   16361             : 
   16362           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   16363           0 :                 allow_remaining = true;
   16364             :         }
   16365             : 
   16366           0 :         return py_wbint_PamAuthCrapChangePassword_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   16367             : }
   16368             : 
   16369           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   16370             : {
   16371             :         DATA_BLOB blob;
   16372           0 :         Py_ssize_t blob_length = 0;
   16373           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   16374           0 :         PyObject *bigendian_obj = NULL;
   16375           0 :         PyObject *ndr64_obj = NULL;
   16376           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   16377           0 :         PyObject *allow_remaining_obj = NULL;
   16378           0 :         bool allow_remaining = false;
   16379             : 
   16380           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   16381             :                 discard_const_p(char *, kwnames),
   16382             :                 &blob.data, &blob_length,
   16383             :                 &bigendian_obj,
   16384             :                 &ndr64_obj,
   16385             :                 &allow_remaining_obj)) {
   16386           0 :                 return NULL;
   16387             :         }
   16388           0 :         blob.length = blob_length;
   16389             : 
   16390           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   16391           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   16392             :         }
   16393           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   16394           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   16395             :         }
   16396             : 
   16397           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   16398           0 :                 allow_remaining = true;
   16399             :         }
   16400             : 
   16401           0 :         return py_wbint_PamAuthCrapChangePassword_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   16402             : }
   16403             : 
   16404           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   16405             : {
   16406           0 :         const struct ndr_interface_call *call = NULL;
   16407           0 :         struct wbint_PamAuthCrapChangePassword *object = (struct wbint_PamAuthCrapChangePassword *)pytalloc_get_ptr(py_obj);
   16408             :         PyObject *ret;
   16409             :         char *retstr;
   16410             : 
   16411           0 :         if (ndr_table_winbind.num_calls < 25) {
   16412           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthCrapChangePassword_ndr_print");
   16413           0 :                 return NULL;
   16414             :         }
   16415           0 :         call = &ndr_table_winbind.calls[24];
   16416             : 
   16417           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   16418           0 :         ret = PyUnicode_FromString(retstr);
   16419           0 :         TALLOC_FREE(retstr);
   16420             : 
   16421           0 :         return ret;
   16422             : }
   16423             : 
   16424           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   16425             : {
   16426           0 :         return py_wbint_PamAuthCrapChangePassword_ndr_print(py_obj, "wbint_PamAuthCrapChangePassword_in", NDR_IN);
   16427             : }
   16428             : 
   16429           0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   16430             : {
   16431           0 :         return py_wbint_PamAuthCrapChangePassword_ndr_print(py_obj, "wbint_PamAuthCrapChangePassword_out", NDR_OUT);
   16432             : }
   16433             : 
   16434             : static PyMethodDef py_wbint_PamAuthCrapChangePassword_methods[] = {
   16435             :         { "opnum", (PyCFunction)py_wbint_PamAuthCrapChangePassword_ndr_opnum, METH_NOARGS|METH_CLASS,
   16436             :                 "winbind.wbint_PamAuthCrapChangePassword.opnum() -> 24 (0x18) " },
   16437             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrapChangePassword_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   16438             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   16439             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrapChangePassword_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   16440             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   16441             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrapChangePassword_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   16442             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   16443             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrapChangePassword_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   16444             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   16445             :         { "__ndr_print_in__", (PyCFunction)py_wbint_PamAuthCrapChangePassword_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   16446             :         { "__ndr_print_out__", (PyCFunction)py_wbint_PamAuthCrapChangePassword_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   16447             :         { NULL, NULL, 0, NULL }
   16448             : };
   16449             : 
   16450             : 
   16451             : static PyTypeObject wbint_PamAuthCrapChangePassword_Type = {
   16452             :         PyVarObject_HEAD_INIT(NULL, 0)
   16453             :         .tp_name = "winbind.wbint_PamAuthCrapChangePassword",
   16454             :         .tp_getset = py_wbint_PamAuthCrapChangePassword_getsetters,
   16455             :         .tp_methods = py_wbint_PamAuthCrapChangePassword_methods,
   16456             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   16457             :         .tp_new = py_wbint_PamAuthCrapChangePassword_new,
   16458             : };
   16459             : 
   16460           0 : static bool pack_py_wbint_PamAuthCrapChangePassword_args_in(PyObject *args, PyObject *kwargs, struct wbint_PamAuthCrapChangePassword *r)
   16461             : {
   16462             :         PyObject *py_client_name;
   16463             :         PyObject *py_client_pid;
   16464             :         PyObject *py_user;
   16465             :         PyObject *py_domain;
   16466             :         PyObject *py_new_nt_pswd;
   16467             :         PyObject *py_old_nt_hash_enc;
   16468             :         PyObject *py_new_lm_pswd;
   16469             :         PyObject *py_old_lm_hash_enc;
   16470           0 :         const char *kwnames[] = {
   16471             :                 "client_name", "client_pid", "user", "domain", "new_nt_pswd", "old_nt_hash_enc", "new_lm_pswd", "old_lm_hash_enc", NULL
   16472             :         };
   16473             : 
   16474           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOO:wbint_PamAuthCrapChangePassword", discard_const_p(char *, kwnames), &py_client_name, &py_client_pid, &py_user, &py_domain, &py_new_nt_pswd, &py_old_nt_hash_enc, &py_new_lm_pswd, &py_old_lm_hash_enc)) {
   16475           0 :                 return false;
   16476             :         }
   16477             : 
   16478           0 :         if (py_client_name == NULL) {
   16479           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_name");
   16480           0 :                 return false;
   16481             :         }
   16482           0 :         r->in.client_name = talloc_ptrtype(r, r->in.client_name);
   16483           0 :         if (r->in.client_name == NULL) {
   16484           0 :                 PyErr_NoMemory();
   16485           0 :                 return false;
   16486             :         }
   16487             :         {
   16488             :                 const char *test_str;
   16489             :                 const char *talloc_str;
   16490           0 :                 PyObject *unicode = NULL;
   16491           0 :                 if (PyUnicode_Check(py_client_name)) {
   16492           0 :                         unicode = PyUnicode_AsEncodedString(py_client_name, "utf-8", "ignore");
   16493           0 :                         if (unicode == NULL) {
   16494           0 :                                 PyErr_NoMemory();
   16495           0 :                                 return false;
   16496             :                         }
   16497           0 :                         test_str = PyBytes_AS_STRING(unicode);
   16498           0 :                 } else if (PyBytes_Check(py_client_name)) {
   16499           0 :                         test_str = PyBytes_AS_STRING(py_client_name);
   16500             :                 } else {
   16501           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_name)->tp_name);
   16502           0 :                         return false;
   16503             :                 }
   16504           0 :                 talloc_str = talloc_strdup(r, test_str);
   16505           0 :                 if (unicode != NULL) {
   16506           0 :                         Py_DECREF(unicode);
   16507             :                 }
   16508           0 :                 if (talloc_str == NULL) {
   16509           0 :                         PyErr_NoMemory();
   16510           0 :                         return false;
   16511             :                 }
   16512           0 :                 r->in.client_name = talloc_str;
   16513             :         }
   16514           0 :         if (py_client_pid == NULL) {
   16515           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_pid");
   16516           0 :                 return false;
   16517             :         }
   16518             :         {
   16519           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_pid));
   16520           0 :                 if (PyLong_Check(py_client_pid)) {
   16521             :                         unsigned long long test_var;
   16522           0 :                         test_var = PyLong_AsUnsignedLongLong(py_client_pid);
   16523           0 :                         if (PyErr_Occurred() != NULL) {
   16524           0 :                                 return false;
   16525             :                         }
   16526           0 :                         if (test_var > uint_max) {
   16527           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   16528             :                                   PyLong_Type.tp_name, uint_max, test_var);
   16529           0 :                                 return false;
   16530             :                         }
   16531           0 :                         r->in.client_pid = test_var;
   16532             :                 } else {
   16533           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   16534             :                           PyLong_Type.tp_name);
   16535           0 :                         return false;
   16536             :                 }
   16537             :         }
   16538           0 :         if (py_user == NULL) {
   16539           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user");
   16540           0 :                 return false;
   16541             :         }
   16542           0 :         r->in.user = talloc_ptrtype(r, r->in.user);
   16543           0 :         if (r->in.user == NULL) {
   16544           0 :                 PyErr_NoMemory();
   16545           0 :                 return false;
   16546             :         }
   16547             :         {
   16548             :                 const char *test_str;
   16549             :                 const char *talloc_str;
   16550           0 :                 PyObject *unicode = NULL;
   16551           0 :                 if (PyUnicode_Check(py_user)) {
   16552           0 :                         unicode = PyUnicode_AsEncodedString(py_user, "utf-8", "ignore");
   16553           0 :                         if (unicode == NULL) {
   16554           0 :                                 PyErr_NoMemory();
   16555           0 :                                 return false;
   16556             :                         }
   16557           0 :                         test_str = PyBytes_AS_STRING(unicode);
   16558           0 :                 } else if (PyBytes_Check(py_user)) {
   16559           0 :                         test_str = PyBytes_AS_STRING(py_user);
   16560             :                 } else {
   16561           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_user)->tp_name);
   16562           0 :                         return false;
   16563             :                 }
   16564           0 :                 talloc_str = talloc_strdup(r, test_str);
   16565           0 :                 if (unicode != NULL) {
   16566           0 :                         Py_DECREF(unicode);
   16567             :                 }
   16568           0 :                 if (talloc_str == NULL) {
   16569           0 :                         PyErr_NoMemory();
   16570           0 :                         return false;
   16571             :                 }
   16572           0 :                 r->in.user = talloc_str;
   16573             :         }
   16574           0 :         if (py_domain == NULL) {
   16575           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain");
   16576           0 :                 return false;
   16577             :         }
   16578           0 :         r->in.domain = talloc_ptrtype(r, r->in.domain);
   16579           0 :         if (r->in.domain == NULL) {
   16580           0 :                 PyErr_NoMemory();
   16581           0 :                 return false;
   16582             :         }
   16583             :         {
   16584             :                 const char *test_str;
   16585             :                 const char *talloc_str;
   16586           0 :                 PyObject *unicode = NULL;
   16587           0 :                 if (PyUnicode_Check(py_domain)) {
   16588           0 :                         unicode = PyUnicode_AsEncodedString(py_domain, "utf-8", "ignore");
   16589           0 :                         if (unicode == NULL) {
   16590           0 :                                 PyErr_NoMemory();
   16591           0 :                                 return false;
   16592             :                         }
   16593           0 :                         test_str = PyBytes_AS_STRING(unicode);
   16594           0 :                 } else if (PyBytes_Check(py_domain)) {
   16595           0 :                         test_str = PyBytes_AS_STRING(py_domain);
   16596             :                 } else {
   16597           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain)->tp_name);
   16598           0 :                         return false;
   16599             :                 }
   16600           0 :                 talloc_str = talloc_strdup(r, test_str);
   16601           0 :                 if (unicode != NULL) {
   16602           0 :                         Py_DECREF(unicode);
   16603             :                 }
   16604           0 :                 if (talloc_str == NULL) {
   16605           0 :                         PyErr_NoMemory();
   16606           0 :                         return false;
   16607             :                 }
   16608           0 :                 r->in.domain = talloc_str;
   16609             :         }
   16610           0 :         if (py_new_nt_pswd == NULL) {
   16611           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_nt_pswd");
   16612           0 :                 return false;
   16613             :         }
   16614           0 :         r->in.new_nt_pswd = data_blob_talloc(r, PyBytes_AS_STRING(py_new_nt_pswd), PyBytes_GET_SIZE(py_new_nt_pswd));
   16615           0 :         if (py_old_nt_hash_enc == NULL) {
   16616           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.old_nt_hash_enc");
   16617           0 :                 return false;
   16618             :         }
   16619           0 :         r->in.old_nt_hash_enc = data_blob_talloc(r, PyBytes_AS_STRING(py_old_nt_hash_enc), PyBytes_GET_SIZE(py_old_nt_hash_enc));
   16620           0 :         if (py_new_lm_pswd == NULL) {
   16621           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_lm_pswd");
   16622           0 :                 return false;
   16623             :         }
   16624           0 :         r->in.new_lm_pswd = data_blob_talloc(r, PyBytes_AS_STRING(py_new_lm_pswd), PyBytes_GET_SIZE(py_new_lm_pswd));
   16625           0 :         if (py_old_lm_hash_enc == NULL) {
   16626           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.old_lm_hash_enc");
   16627           0 :                 return false;
   16628             :         }
   16629           0 :         r->in.old_lm_hash_enc = data_blob_talloc(r, PyBytes_AS_STRING(py_old_lm_hash_enc), PyBytes_GET_SIZE(py_old_lm_hash_enc));
   16630           0 :         return true;
   16631             : }
   16632             : 
   16633           0 : static PyObject *unpack_py_wbint_PamAuthCrapChangePassword_args_out(struct wbint_PamAuthCrapChangePassword *r)
   16634             : {
   16635             :         PyObject *result;
   16636           0 :         result = Py_None;
   16637           0 :         Py_INCREF(result);
   16638           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   16639           0 :                 PyErr_SetNTSTATUS(r->out.result);
   16640           0 :                 return NULL;
   16641             :         }
   16642             : 
   16643           0 :         return result;
   16644             : }
   16645             : 
   16646             : 
   16647           0 : static PyObject *py_wbint_PamAuthChangePassword_in_get_client_name(PyObject *obj, void *closure)
   16648             : {
   16649           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(obj);
   16650             :         PyObject *py_client_name;
   16651           0 :         if (object->in.client_name == NULL) {
   16652           0 :                 Py_RETURN_NONE;
   16653             :         }
   16654           0 :         if (object->in.client_name == NULL) {
   16655           0 :                 py_client_name = Py_None;
   16656           0 :                 Py_INCREF(py_client_name);
   16657             :         } else {
   16658           0 :                 py_client_name = PyUnicode_Decode(object->in.client_name, strlen(object->in.client_name), "utf-8", "ignore");
   16659             :         }
   16660           0 :         return py_client_name;
   16661             : }
   16662             : 
   16663           0 : static int py_wbint_PamAuthChangePassword_in_set_client_name(PyObject *py_obj, PyObject *value, void *closure)
   16664             : {
   16665           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(py_obj);
   16666           0 :         if (value == NULL) {
   16667           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_name");
   16668           0 :                 return -1;
   16669             :         }
   16670           0 :         object->in.client_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.client_name);
   16671           0 :         if (object->in.client_name == NULL) {
   16672           0 :                 PyErr_NoMemory();
   16673           0 :                 return -1;
   16674             :         }
   16675             :         {
   16676             :                 const char *test_str;
   16677             :                 const char *talloc_str;
   16678           0 :                 PyObject *unicode = NULL;
   16679           0 :                 if (PyUnicode_Check(value)) {
   16680           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   16681           0 :                         if (unicode == NULL) {
   16682           0 :                                 PyErr_NoMemory();
   16683           0 :                                 return -1;
   16684             :                         }
   16685           0 :                         test_str = PyBytes_AS_STRING(unicode);
   16686           0 :                 } else if (PyBytes_Check(value)) {
   16687           0 :                         test_str = PyBytes_AS_STRING(value);
   16688             :                 } else {
   16689           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   16690           0 :                         return -1;
   16691             :                 }
   16692           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   16693           0 :                 if (unicode != NULL) {
   16694           0 :                         Py_DECREF(unicode);
   16695             :                 }
   16696           0 :                 if (talloc_str == NULL) {
   16697           0 :                         PyErr_NoMemory();
   16698           0 :                         return -1;
   16699             :                 }
   16700           0 :                 object->in.client_name = talloc_str;
   16701             :         }
   16702           0 :         return 0;
   16703             : }
   16704             : 
   16705           0 : static PyObject *py_wbint_PamAuthChangePassword_in_get_client_pid(PyObject *obj, void *closure)
   16706             : {
   16707           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(obj);
   16708             :         PyObject *py_client_pid;
   16709           0 :         py_client_pid = PyLong_FromUnsignedLongLong(object->in.client_pid);
   16710           0 :         return py_client_pid;
   16711             : }
   16712             : 
   16713           0 : static int py_wbint_PamAuthChangePassword_in_set_client_pid(PyObject *py_obj, PyObject *value, void *closure)
   16714             : {
   16715           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(py_obj);
   16716           0 :         if (value == NULL) {
   16717           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_pid");
   16718           0 :                 return -1;
   16719             :         }
   16720             :         {
   16721           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_pid));
   16722           0 :                 if (PyLong_Check(value)) {
   16723             :                         unsigned long long test_var;
   16724           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   16725           0 :                         if (PyErr_Occurred() != NULL) {
   16726           0 :                                 return -1;
   16727             :                         }
   16728           0 :                         if (test_var > uint_max) {
   16729           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   16730             :                                   PyLong_Type.tp_name, uint_max, test_var);
   16731           0 :                                 return -1;
   16732             :                         }
   16733           0 :                         object->in.client_pid = test_var;
   16734             :                 } else {
   16735           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   16736             :                           PyLong_Type.tp_name);
   16737           0 :                         return -1;
   16738             :                 }
   16739             :         }
   16740           0 :         return 0;
   16741             : }
   16742             : 
   16743           0 : static PyObject *py_wbint_PamAuthChangePassword_in_get_flags(PyObject *obj, void *closure)
   16744             : {
   16745           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(obj);
   16746             :         PyObject *py_flags;
   16747           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
   16748           0 :         return py_flags;
   16749             : }
   16750             : 
   16751           0 : static int py_wbint_PamAuthChangePassword_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
   16752             : {
   16753           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(py_obj);
   16754           0 :         if (value == NULL) {
   16755           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
   16756           0 :                 return -1;
   16757             :         }
   16758             :         {
   16759           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
   16760           0 :                 if (PyLong_Check(value)) {
   16761             :                         unsigned long long test_var;
   16762           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   16763           0 :                         if (PyErr_Occurred() != NULL) {
   16764           0 :                                 return -1;
   16765             :                         }
   16766           0 :                         if (test_var > uint_max) {
   16767           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   16768             :                                   PyLong_Type.tp_name, uint_max, test_var);
   16769           0 :                                 return -1;
   16770             :                         }
   16771           0 :                         object->in.flags = test_var;
   16772             :                 } else {
   16773           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   16774             :                           PyLong_Type.tp_name);
   16775           0 :                         return -1;
   16776             :                 }
   16777             :         }
   16778           0 :         return 0;
   16779             : }
   16780             : 
   16781           0 : static PyObject *py_wbint_PamAuthChangePassword_in_get_user(PyObject *obj, void *closure)
   16782             : {
   16783           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(obj);
   16784             :         PyObject *py_user;
   16785           0 :         if (object->in.user == NULL) {
   16786           0 :                 Py_RETURN_NONE;
   16787             :         }
   16788           0 :         if (object->in.user == NULL) {
   16789           0 :                 py_user = Py_None;
   16790           0 :                 Py_INCREF(py_user);
   16791             :         } else {
   16792           0 :                 py_user = PyUnicode_Decode(object->in.user, strlen(object->in.user), "utf-8", "ignore");
   16793             :         }
   16794           0 :         return py_user;
   16795             : }
   16796             : 
   16797           0 : static int py_wbint_PamAuthChangePassword_in_set_user(PyObject *py_obj, PyObject *value, void *closure)
   16798             : {
   16799           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(py_obj);
   16800           0 :         if (value == NULL) {
   16801           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user");
   16802           0 :                 return -1;
   16803             :         }
   16804           0 :         object->in.user = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user);
   16805           0 :         if (object->in.user == NULL) {
   16806           0 :                 PyErr_NoMemory();
   16807           0 :                 return -1;
   16808             :         }
   16809             :         {
   16810             :                 const char *test_str;
   16811             :                 const char *talloc_str;
   16812           0 :                 PyObject *unicode = NULL;
   16813           0 :                 if (PyUnicode_Check(value)) {
   16814           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   16815           0 :                         if (unicode == NULL) {
   16816           0 :                                 PyErr_NoMemory();
   16817           0 :                                 return -1;
   16818             :                         }
   16819           0 :                         test_str = PyBytes_AS_STRING(unicode);
   16820           0 :                 } else if (PyBytes_Check(value)) {
   16821           0 :                         test_str = PyBytes_AS_STRING(value);
   16822             :                 } else {
   16823           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   16824           0 :                         return -1;
   16825             :                 }
   16826           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   16827           0 :                 if (unicode != NULL) {
   16828           0 :                         Py_DECREF(unicode);
   16829             :                 }
   16830           0 :                 if (talloc_str == NULL) {
   16831           0 :                         PyErr_NoMemory();
   16832           0 :                         return -1;
   16833             :                 }
   16834           0 :                 object->in.user = talloc_str;
   16835             :         }
   16836           0 :         return 0;
   16837             : }
   16838             : 
   16839           0 : static PyObject *py_wbint_PamAuthChangePassword_in_get_old_password(PyObject *obj, void *closure)
   16840             : {
   16841           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(obj);
   16842             :         PyObject *py_old_password;
   16843           0 :         if (object->in.old_password == NULL) {
   16844           0 :                 Py_RETURN_NONE;
   16845             :         }
   16846           0 :         if (object->in.old_password == NULL) {
   16847           0 :                 py_old_password = Py_None;
   16848           0 :                 Py_INCREF(py_old_password);
   16849             :         } else {
   16850           0 :                 py_old_password = PyUnicode_Decode(object->in.old_password, strlen(object->in.old_password), "utf-8", "ignore");
   16851             :         }
   16852           0 :         return py_old_password;
   16853             : }
   16854             : 
   16855           0 : static int py_wbint_PamAuthChangePassword_in_set_old_password(PyObject *py_obj, PyObject *value, void *closure)
   16856             : {
   16857           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(py_obj);
   16858           0 :         if (value == NULL) {
   16859           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.old_password");
   16860           0 :                 return -1;
   16861             :         }
   16862           0 :         object->in.old_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.old_password);
   16863           0 :         if (object->in.old_password == NULL) {
   16864           0 :                 PyErr_NoMemory();
   16865           0 :                 return -1;
   16866             :         }
   16867             :         {
   16868             :                 const char *test_str;
   16869             :                 const char *talloc_str;
   16870           0 :                 PyObject *unicode = NULL;
   16871           0 :                 if (PyUnicode_Check(value)) {
   16872           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   16873           0 :                         if (unicode == NULL) {
   16874           0 :                                 PyErr_NoMemory();
   16875           0 :                                 return -1;
   16876             :                         }
   16877           0 :                         test_str = PyBytes_AS_STRING(unicode);
   16878           0 :                 } else if (PyBytes_Check(value)) {
   16879           0 :                         test_str = PyBytes_AS_STRING(value);
   16880             :                 } else {
   16881           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   16882           0 :                         return -1;
   16883             :                 }
   16884           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   16885           0 :                 if (unicode != NULL) {
   16886           0 :                         Py_DECREF(unicode);
   16887             :                 }
   16888           0 :                 if (talloc_str == NULL) {
   16889           0 :                         PyErr_NoMemory();
   16890           0 :                         return -1;
   16891             :                 }
   16892           0 :                 object->in.old_password = talloc_str;
   16893             :         }
   16894           0 :         return 0;
   16895             : }
   16896             : 
   16897           0 : static PyObject *py_wbint_PamAuthChangePassword_in_get_new_password(PyObject *obj, void *closure)
   16898             : {
   16899           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(obj);
   16900             :         PyObject *py_new_password;
   16901           0 :         if (object->in.new_password == NULL) {
   16902           0 :                 Py_RETURN_NONE;
   16903             :         }
   16904           0 :         if (object->in.new_password == NULL) {
   16905           0 :                 py_new_password = Py_None;
   16906           0 :                 Py_INCREF(py_new_password);
   16907             :         } else {
   16908           0 :                 py_new_password = PyUnicode_Decode(object->in.new_password, strlen(object->in.new_password), "utf-8", "ignore");
   16909             :         }
   16910           0 :         return py_new_password;
   16911             : }
   16912             : 
   16913           0 : static int py_wbint_PamAuthChangePassword_in_set_new_password(PyObject *py_obj, PyObject *value, void *closure)
   16914             : {
   16915           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(py_obj);
   16916           0 :         if (value == NULL) {
   16917           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_password");
   16918           0 :                 return -1;
   16919             :         }
   16920           0 :         object->in.new_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.new_password);
   16921           0 :         if (object->in.new_password == NULL) {
   16922           0 :                 PyErr_NoMemory();
   16923           0 :                 return -1;
   16924             :         }
   16925             :         {
   16926             :                 const char *test_str;
   16927             :                 const char *talloc_str;
   16928           0 :                 PyObject *unicode = NULL;
   16929           0 :                 if (PyUnicode_Check(value)) {
   16930           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   16931           0 :                         if (unicode == NULL) {
   16932           0 :                                 PyErr_NoMemory();
   16933           0 :                                 return -1;
   16934             :                         }
   16935           0 :                         test_str = PyBytes_AS_STRING(unicode);
   16936           0 :                 } else if (PyBytes_Check(value)) {
   16937           0 :                         test_str = PyBytes_AS_STRING(value);
   16938             :                 } else {
   16939           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   16940           0 :                         return -1;
   16941             :                 }
   16942           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   16943           0 :                 if (unicode != NULL) {
   16944           0 :                         Py_DECREF(unicode);
   16945             :                 }
   16946           0 :                 if (talloc_str == NULL) {
   16947           0 :                         PyErr_NoMemory();
   16948           0 :                         return -1;
   16949             :                 }
   16950           0 :                 object->in.new_password = talloc_str;
   16951             :         }
   16952           0 :         return 0;
   16953             : }
   16954             : 
   16955           0 : static PyObject *py_wbint_PamAuthChangePassword_out_get_dominfo(PyObject *obj, void *closure)
   16956             : {
   16957           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(obj);
   16958             :         PyObject *py_dominfo;
   16959           0 :         if (object->out.dominfo == NULL) {
   16960           0 :                 Py_RETURN_NONE;
   16961             :         }
   16962           0 :         if (*object->out.dominfo == NULL) {
   16963           0 :                 py_dominfo = Py_None;
   16964           0 :                 Py_INCREF(py_dominfo);
   16965             :         } else {
   16966           0 :                 py_dominfo = pytalloc_reference_ex(samr_DomInfo1_Type, *object->out.dominfo, *object->out.dominfo);
   16967             :         }
   16968           0 :         return py_dominfo;
   16969             : }
   16970             : 
   16971           0 : static int py_wbint_PamAuthChangePassword_out_set_dominfo(PyObject *py_obj, PyObject *value, void *closure)
   16972             : {
   16973           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(py_obj);
   16974           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dominfo));
   16975           0 :         if (value == NULL) {
   16976           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dominfo");
   16977           0 :                 return -1;
   16978             :         }
   16979           0 :         object->out.dominfo = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dominfo);
   16980           0 :         if (object->out.dominfo == NULL) {
   16981           0 :                 PyErr_NoMemory();
   16982           0 :                 return -1;
   16983             :         }
   16984           0 :         if (value == Py_None) {
   16985           0 :                 *object->out.dominfo = NULL;
   16986             :         } else {
   16987           0 :                 *object->out.dominfo = NULL;
   16988           0 :                 PY_CHECK_TYPE(samr_DomInfo1_Type, value, return -1;);
   16989           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   16990           0 :                         PyErr_NoMemory();
   16991           0 :                         return -1;
   16992             :                 }
   16993           0 :                 *object->out.dominfo = (struct samr_DomInfo1 *)pytalloc_get_ptr(value);
   16994             :         }
   16995           0 :         return 0;
   16996             : }
   16997             : 
   16998           0 : static PyObject *py_wbint_PamAuthChangePassword_out_get_reject_reason(PyObject *obj, void *closure)
   16999             : {
   17000           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(obj);
   17001             :         PyObject *py_reject_reason;
   17002           0 :         if (object->out.reject_reason == NULL) {
   17003           0 :                 Py_RETURN_NONE;
   17004             :         }
   17005           0 :         py_reject_reason = PyLong_FromUnsignedLongLong((uint32_t)*object->out.reject_reason);
   17006           0 :         return py_reject_reason;
   17007             : }
   17008             : 
   17009           0 : static int py_wbint_PamAuthChangePassword_out_set_reject_reason(PyObject *py_obj, PyObject *value, void *closure)
   17010             : {
   17011           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(py_obj);
   17012           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.reject_reason));
   17013           0 :         if (value == NULL) {
   17014           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.reject_reason");
   17015           0 :                 return -1;
   17016             :         }
   17017           0 :         object->out.reject_reason = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.reject_reason);
   17018           0 :         if (object->out.reject_reason == NULL) {
   17019           0 :                 PyErr_NoMemory();
   17020           0 :                 return -1;
   17021             :         }
   17022             :         {
   17023           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.reject_reason));
   17024           0 :                 if (PyLong_Check(value)) {
   17025             :                         unsigned long long test_var;
   17026           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   17027           0 :                         if (PyErr_Occurred() != NULL) {
   17028           0 :                                 return -1;
   17029             :                         }
   17030           0 :                         if (test_var > uint_max) {
   17031           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   17032             :                                   PyLong_Type.tp_name, uint_max, test_var);
   17033           0 :                                 return -1;
   17034             :                         }
   17035           0 :                         *object->out.reject_reason = test_var;
   17036             :                 } else {
   17037           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   17038             :                           PyLong_Type.tp_name);
   17039           0 :                         return -1;
   17040             :                 }
   17041             :         }
   17042           0 :         return 0;
   17043             : }
   17044             : 
   17045           0 : static PyObject *py_wbint_PamAuthChangePassword_get_result(PyObject *obj, void *closure)
   17046             : {
   17047           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(obj);
   17048             :         PyObject *py_result;
   17049           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   17050           0 :         return py_result;
   17051             : }
   17052             : 
   17053           0 : static int py_wbint_PamAuthChangePassword_set_result(PyObject *py_obj, PyObject *value, void *closure)
   17054             : {
   17055           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(py_obj);
   17056           0 :         if (value == NULL) {
   17057           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   17058           0 :                 return -1;
   17059             :         }
   17060           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   17061           0 :         return 0;
   17062             : }
   17063             : 
   17064             : static PyGetSetDef py_wbint_PamAuthChangePassword_getsetters[] = {
   17065             :         {
   17066             :                 .name = discard_const_p(char, "in_client_name"),
   17067             :                 .get = py_wbint_PamAuthChangePassword_in_get_client_name,
   17068             :                 .set = py_wbint_PamAuthChangePassword_in_set_client_name,
   17069             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   17070             :         },
   17071             :         {
   17072             :                 .name = discard_const_p(char, "in_client_pid"),
   17073             :                 .get = py_wbint_PamAuthChangePassword_in_get_client_pid,
   17074             :                 .set = py_wbint_PamAuthChangePassword_in_set_client_pid,
   17075             :                 .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
   17076             :         },
   17077             :         {
   17078             :                 .name = discard_const_p(char, "in_flags"),
   17079             :                 .get = py_wbint_PamAuthChangePassword_in_get_flags,
   17080             :                 .set = py_wbint_PamAuthChangePassword_in_set_flags,
   17081             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
   17082             :         },
   17083             :         {
   17084             :                 .name = discard_const_p(char, "in_user"),
   17085             :                 .get = py_wbint_PamAuthChangePassword_in_get_user,
   17086             :                 .set = py_wbint_PamAuthChangePassword_in_set_user,
   17087             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   17088             :         },
   17089             :         {
   17090             :                 .name = discard_const_p(char, "in_old_password"),
   17091             :                 .get = py_wbint_PamAuthChangePassword_in_get_old_password,
   17092             :                 .set = py_wbint_PamAuthChangePassword_in_set_old_password,
   17093             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   17094             :         },
   17095             :         {
   17096             :                 .name = discard_const_p(char, "in_new_password"),
   17097             :                 .get = py_wbint_PamAuthChangePassword_in_get_new_password,
   17098             :                 .set = py_wbint_PamAuthChangePassword_in_set_new_password,
   17099             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   17100             :         },
   17101             :         {
   17102             :                 .name = discard_const_p(char, "out_dominfo"),
   17103             :                 .get = py_wbint_PamAuthChangePassword_out_get_dominfo,
   17104             :                 .set = py_wbint_PamAuthChangePassword_out_set_dominfo,
   17105             :                 .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomInfo1")
   17106             :         },
   17107             :         {
   17108             :                 .name = discard_const_p(char, "out_reject_reason"),
   17109             :                 .get = py_wbint_PamAuthChangePassword_out_get_reject_reason,
   17110             :                 .set = py_wbint_PamAuthChangePassword_out_set_reject_reason,
   17111             :                 .doc = discard_const_p(char, "PIDL-generated element of base type samPwdChangeReason")
   17112             :         },
   17113             :         {
   17114             :                 .name = discard_const_p(char, "result"),
   17115             :                 .get = py_wbint_PamAuthChangePassword_get_result,
   17116             :                 .set = py_wbint_PamAuthChangePassword_set_result,
   17117             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   17118             :         },
   17119             :         { .name = NULL }
   17120             : };
   17121             : 
   17122           0 : static PyObject *py_wbint_PamAuthChangePassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   17123             : {
   17124           0 :         PyObject *self = pytalloc_new(struct wbint_PamAuthChangePassword, type);
   17125           0 :         struct wbint_PamAuthChangePassword *_self = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(self);
   17126           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
   17127             :         /* a pointer to a NULL pointer */
   17128           0 :         _self->out.dominfo = talloc_zero(mem_ctx, struct samr_DomInfo1 *);
   17129           0 :         _self->out.reject_reason = talloc_zero(mem_ctx, enum samPwdChangeReason);
   17130           0 :         return self;
   17131             : }
   17132             : 
   17133           0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   17134             : {
   17135             : 
   17136             : 
   17137           0 :         return PyLong_FromLong(25);
   17138             : }
   17139             : 
   17140           0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   17141             : {
   17142           0 :         const struct ndr_interface_call *call = NULL;
   17143           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(py_obj);
   17144           0 :         PyObject *ret = NULL;
   17145           0 :         struct ndr_push *push = NULL;
   17146             :         DATA_BLOB blob;
   17147             :         enum ndr_err_code err;
   17148             : 
   17149           0 :         if (ndr_table_winbind.num_calls < 26) {
   17150           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthChangePassword_ndr_pack");
   17151           0 :                 return NULL;
   17152             :         }
   17153           0 :         call = &ndr_table_winbind.calls[25];
   17154             : 
   17155           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   17156           0 :         if (push == NULL) {
   17157           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   17158           0 :                 return NULL;
   17159             :         }
   17160             : 
   17161           0 :         push->flags |= ndr_push_flags;
   17162             : 
   17163           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   17164           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   17165           0 :                 TALLOC_FREE(push);
   17166           0 :                 PyErr_SetNdrError(err);
   17167           0 :                 return NULL;
   17168             :         }
   17169           0 :         blob = ndr_push_blob(push);
   17170           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   17171           0 :         TALLOC_FREE(push);
   17172           0 :         return ret;
   17173             : }
   17174             : 
   17175           0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   17176             : {
   17177           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   17178           0 :         PyObject *bigendian_obj = NULL;
   17179           0 :         PyObject *ndr64_obj = NULL;
   17180           0 :         uint32_t ndr_push_flags = 0;
   17181             : 
   17182           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   17183             :                 discard_const_p(char *, kwnames),
   17184             :                 &bigendian_obj,
   17185             :                 &ndr64_obj)) {
   17186           0 :                 return NULL;
   17187             :         }
   17188             : 
   17189           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   17190           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   17191             :         }
   17192           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   17193           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   17194             :         }
   17195             : 
   17196           0 :         return py_wbint_PamAuthChangePassword_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   17197             : }
   17198             : 
   17199           0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   17200             : {
   17201           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   17202           0 :         PyObject *bigendian_obj = NULL;
   17203           0 :         PyObject *ndr64_obj = NULL;
   17204           0 :         uint32_t ndr_push_flags = 0;
   17205             : 
   17206           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   17207             :                 discard_const_p(char *, kwnames),
   17208             :                 &bigendian_obj,
   17209             :                 &ndr64_obj)) {
   17210           0 :                 return NULL;
   17211             :         }
   17212             : 
   17213           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   17214           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   17215             :         }
   17216           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   17217           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   17218             :         }
   17219             : 
   17220           0 :         return py_wbint_PamAuthChangePassword_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   17221             : }
   17222             : 
   17223           0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   17224             : {
   17225           0 :         const struct ndr_interface_call *call = NULL;
   17226           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(py_obj);
   17227           0 :         struct ndr_pull *pull = NULL;
   17228             :         enum ndr_err_code err;
   17229             : 
   17230           0 :         if (ndr_table_winbind.num_calls < 26) {
   17231           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthChangePassword_ndr_unpack");
   17232           0 :                 return NULL;
   17233             :         }
   17234           0 :         call = &ndr_table_winbind.calls[25];
   17235             : 
   17236           0 :         pull = ndr_pull_init_blob(blob, object);
   17237           0 :         if (pull == NULL) {
   17238           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   17239           0 :                 return NULL;
   17240             :         }
   17241             : 
   17242           0 :         pull->flags |= ndr_pull_flags;
   17243             : 
   17244           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   17245           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   17246           0 :                 TALLOC_FREE(pull);
   17247           0 :                 PyErr_SetNdrError(err);
   17248           0 :                 return NULL;
   17249             :         }
   17250           0 :         if (!allow_remaining) {
   17251             :                 uint32_t highest_ofs;
   17252             : 
   17253           0 :                 if (pull->offset > pull->relative_highest_offset) {
   17254           0 :                         highest_ofs = pull->offset;
   17255             :                 } else {
   17256           0 :                         highest_ofs = pull->relative_highest_offset;
   17257             :                 }
   17258           0 :                 if (highest_ofs < pull->data_size) {
   17259           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   17260             :                                 "not all bytes consumed ofs[%u] size[%u]",
   17261             :                                 highest_ofs, pull->data_size);
   17262           0 :                         TALLOC_FREE(pull);
   17263           0 :                         PyErr_SetNdrError(err);
   17264           0 :                         return NULL;
   17265             :                 }
   17266             :         }
   17267             : 
   17268           0 :         TALLOC_FREE(pull);
   17269           0 :         Py_RETURN_NONE;
   17270             : }
   17271             : 
   17272           0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   17273             : {
   17274             :         DATA_BLOB blob;
   17275           0 :         Py_ssize_t blob_length = 0;
   17276           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   17277           0 :         PyObject *bigendian_obj = NULL;
   17278           0 :         PyObject *ndr64_obj = NULL;
   17279           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   17280           0 :         PyObject *allow_remaining_obj = NULL;
   17281           0 :         bool allow_remaining = false;
   17282             : 
   17283           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   17284             :                 discard_const_p(char *, kwnames),
   17285             :                 &blob.data, &blob_length,
   17286             :                 &bigendian_obj,
   17287             :                 &ndr64_obj,
   17288             :                 &allow_remaining_obj)) {
   17289           0 :                 return NULL;
   17290             :         }
   17291           0 :         blob.length = blob_length;
   17292             : 
   17293           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   17294           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   17295             :         }
   17296           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   17297           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   17298             :         }
   17299             : 
   17300           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   17301           0 :                 allow_remaining = true;
   17302             :         }
   17303             : 
   17304           0 :         return py_wbint_PamAuthChangePassword_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   17305             : }
   17306             : 
   17307           0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   17308             : {
   17309             :         DATA_BLOB blob;
   17310           0 :         Py_ssize_t blob_length = 0;
   17311           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   17312           0 :         PyObject *bigendian_obj = NULL;
   17313           0 :         PyObject *ndr64_obj = NULL;
   17314           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   17315           0 :         PyObject *allow_remaining_obj = NULL;
   17316           0 :         bool allow_remaining = false;
   17317             : 
   17318           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   17319             :                 discard_const_p(char *, kwnames),
   17320             :                 &blob.data, &blob_length,
   17321             :                 &bigendian_obj,
   17322             :                 &ndr64_obj,
   17323             :                 &allow_remaining_obj)) {
   17324           0 :                 return NULL;
   17325             :         }
   17326           0 :         blob.length = blob_length;
   17327             : 
   17328           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   17329           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   17330             :         }
   17331           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   17332           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   17333             :         }
   17334             : 
   17335           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   17336           0 :                 allow_remaining = true;
   17337             :         }
   17338             : 
   17339           0 :         return py_wbint_PamAuthChangePassword_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   17340             : }
   17341             : 
   17342           0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   17343             : {
   17344           0 :         const struct ndr_interface_call *call = NULL;
   17345           0 :         struct wbint_PamAuthChangePassword *object = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(py_obj);
   17346             :         PyObject *ret;
   17347             :         char *retstr;
   17348             : 
   17349           0 :         if (ndr_table_winbind.num_calls < 26) {
   17350           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthChangePassword_ndr_print");
   17351           0 :                 return NULL;
   17352             :         }
   17353           0 :         call = &ndr_table_winbind.calls[25];
   17354             : 
   17355           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   17356           0 :         ret = PyUnicode_FromString(retstr);
   17357           0 :         TALLOC_FREE(retstr);
   17358             : 
   17359           0 :         return ret;
   17360             : }
   17361             : 
   17362           0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   17363             : {
   17364           0 :         return py_wbint_PamAuthChangePassword_ndr_print(py_obj, "wbint_PamAuthChangePassword_in", NDR_IN);
   17365             : }
   17366             : 
   17367           0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   17368             : {
   17369           0 :         return py_wbint_PamAuthChangePassword_ndr_print(py_obj, "wbint_PamAuthChangePassword_out", NDR_OUT);
   17370             : }
   17371             : 
   17372             : static PyMethodDef py_wbint_PamAuthChangePassword_methods[] = {
   17373             :         { "opnum", (PyCFunction)py_wbint_PamAuthChangePassword_ndr_opnum, METH_NOARGS|METH_CLASS,
   17374             :                 "winbind.wbint_PamAuthChangePassword.opnum() -> 25 (0x19) " },
   17375             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthChangePassword_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   17376             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   17377             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthChangePassword_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   17378             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   17379             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthChangePassword_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   17380             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   17381             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthChangePassword_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   17382             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   17383             :         { "__ndr_print_in__", (PyCFunction)py_wbint_PamAuthChangePassword_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   17384             :         { "__ndr_print_out__", (PyCFunction)py_wbint_PamAuthChangePassword_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   17385             :         { NULL, NULL, 0, NULL }
   17386             : };
   17387             : 
   17388             : 
   17389             : static PyTypeObject wbint_PamAuthChangePassword_Type = {
   17390             :         PyVarObject_HEAD_INIT(NULL, 0)
   17391             :         .tp_name = "winbind.wbint_PamAuthChangePassword",
   17392             :         .tp_getset = py_wbint_PamAuthChangePassword_getsetters,
   17393             :         .tp_methods = py_wbint_PamAuthChangePassword_methods,
   17394             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   17395             :         .tp_new = py_wbint_PamAuthChangePassword_new,
   17396             : };
   17397             : 
   17398           0 : static bool pack_py_wbint_PamAuthChangePassword_args_in(PyObject *args, PyObject *kwargs, struct wbint_PamAuthChangePassword *r)
   17399             : {
   17400             :         PyObject *py_client_name;
   17401             :         PyObject *py_client_pid;
   17402             :         PyObject *py_flags;
   17403             :         PyObject *py_user;
   17404             :         PyObject *py_old_password;
   17405             :         PyObject *py_new_password;
   17406           0 :         const char *kwnames[] = {
   17407             :                 "client_name", "client_pid", "flags", "user", "old_password", "new_password", NULL
   17408             :         };
   17409             : 
   17410           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:wbint_PamAuthChangePassword", discard_const_p(char *, kwnames), &py_client_name, &py_client_pid, &py_flags, &py_user, &py_old_password, &py_new_password)) {
   17411           0 :                 return false;
   17412             :         }
   17413             : 
   17414           0 :         if (py_client_name == NULL) {
   17415           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_name");
   17416           0 :                 return false;
   17417             :         }
   17418           0 :         r->in.client_name = talloc_ptrtype(r, r->in.client_name);
   17419           0 :         if (r->in.client_name == NULL) {
   17420           0 :                 PyErr_NoMemory();
   17421           0 :                 return false;
   17422             :         }
   17423             :         {
   17424             :                 const char *test_str;
   17425             :                 const char *talloc_str;
   17426           0 :                 PyObject *unicode = NULL;
   17427           0 :                 if (PyUnicode_Check(py_client_name)) {
   17428           0 :                         unicode = PyUnicode_AsEncodedString(py_client_name, "utf-8", "ignore");
   17429           0 :                         if (unicode == NULL) {
   17430           0 :                                 PyErr_NoMemory();
   17431           0 :                                 return false;
   17432             :                         }
   17433           0 :                         test_str = PyBytes_AS_STRING(unicode);
   17434           0 :                 } else if (PyBytes_Check(py_client_name)) {
   17435           0 :                         test_str = PyBytes_AS_STRING(py_client_name);
   17436             :                 } else {
   17437           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_name)->tp_name);
   17438           0 :                         return false;
   17439             :                 }
   17440           0 :                 talloc_str = talloc_strdup(r, test_str);
   17441           0 :                 if (unicode != NULL) {
   17442           0 :                         Py_DECREF(unicode);
   17443             :                 }
   17444           0 :                 if (talloc_str == NULL) {
   17445           0 :                         PyErr_NoMemory();
   17446           0 :                         return false;
   17447             :                 }
   17448           0 :                 r->in.client_name = talloc_str;
   17449             :         }
   17450           0 :         if (py_client_pid == NULL) {
   17451           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_pid");
   17452           0 :                 return false;
   17453             :         }
   17454             :         {
   17455           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_pid));
   17456           0 :                 if (PyLong_Check(py_client_pid)) {
   17457             :                         unsigned long long test_var;
   17458           0 :                         test_var = PyLong_AsUnsignedLongLong(py_client_pid);
   17459           0 :                         if (PyErr_Occurred() != NULL) {
   17460           0 :                                 return false;
   17461             :                         }
   17462           0 :                         if (test_var > uint_max) {
   17463           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   17464             :                                   PyLong_Type.tp_name, uint_max, test_var);
   17465           0 :                                 return false;
   17466             :                         }
   17467           0 :                         r->in.client_pid = test_var;
   17468             :                 } else {
   17469           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   17470             :                           PyLong_Type.tp_name);
   17471           0 :                         return false;
   17472             :                 }
   17473             :         }
   17474           0 :         if (py_flags == NULL) {
   17475           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
   17476           0 :                 return false;
   17477             :         }
   17478             :         {
   17479           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
   17480           0 :                 if (PyLong_Check(py_flags)) {
   17481             :                         unsigned long long test_var;
   17482           0 :                         test_var = PyLong_AsUnsignedLongLong(py_flags);
   17483           0 :                         if (PyErr_Occurred() != NULL) {
   17484           0 :                                 return false;
   17485             :                         }
   17486           0 :                         if (test_var > uint_max) {
   17487           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   17488             :                                   PyLong_Type.tp_name, uint_max, test_var);
   17489           0 :                                 return false;
   17490             :                         }
   17491           0 :                         r->in.flags = test_var;
   17492             :                 } else {
   17493           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   17494             :                           PyLong_Type.tp_name);
   17495           0 :                         return false;
   17496             :                 }
   17497             :         }
   17498           0 :         if (py_user == NULL) {
   17499           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user");
   17500           0 :                 return false;
   17501             :         }
   17502           0 :         r->in.user = talloc_ptrtype(r, r->in.user);
   17503           0 :         if (r->in.user == NULL) {
   17504           0 :                 PyErr_NoMemory();
   17505           0 :                 return false;
   17506             :         }
   17507             :         {
   17508             :                 const char *test_str;
   17509             :                 const char *talloc_str;
   17510           0 :                 PyObject *unicode = NULL;
   17511           0 :                 if (PyUnicode_Check(py_user)) {
   17512           0 :                         unicode = PyUnicode_AsEncodedString(py_user, "utf-8", "ignore");
   17513           0 :                         if (unicode == NULL) {
   17514           0 :                                 PyErr_NoMemory();
   17515           0 :                                 return false;
   17516             :                         }
   17517           0 :                         test_str = PyBytes_AS_STRING(unicode);
   17518           0 :                 } else if (PyBytes_Check(py_user)) {
   17519           0 :                         test_str = PyBytes_AS_STRING(py_user);
   17520             :                 } else {
   17521           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_user)->tp_name);
   17522           0 :                         return false;
   17523             :                 }
   17524           0 :                 talloc_str = talloc_strdup(r, test_str);
   17525           0 :                 if (unicode != NULL) {
   17526           0 :                         Py_DECREF(unicode);
   17527             :                 }
   17528           0 :                 if (talloc_str == NULL) {
   17529           0 :                         PyErr_NoMemory();
   17530           0 :                         return false;
   17531             :                 }
   17532           0 :                 r->in.user = talloc_str;
   17533             :         }
   17534           0 :         if (py_old_password == NULL) {
   17535           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.old_password");
   17536           0 :                 return false;
   17537             :         }
   17538           0 :         r->in.old_password = talloc_ptrtype(r, r->in.old_password);
   17539           0 :         if (r->in.old_password == NULL) {
   17540           0 :                 PyErr_NoMemory();
   17541           0 :                 return false;
   17542             :         }
   17543             :         {
   17544             :                 const char *test_str;
   17545             :                 const char *talloc_str;
   17546           0 :                 PyObject *unicode = NULL;
   17547           0 :                 if (PyUnicode_Check(py_old_password)) {
   17548           0 :                         unicode = PyUnicode_AsEncodedString(py_old_password, "utf-8", "ignore");
   17549           0 :                         if (unicode == NULL) {
   17550           0 :                                 PyErr_NoMemory();
   17551           0 :                                 return false;
   17552             :                         }
   17553           0 :                         test_str = PyBytes_AS_STRING(unicode);
   17554           0 :                 } else if (PyBytes_Check(py_old_password)) {
   17555           0 :                         test_str = PyBytes_AS_STRING(py_old_password);
   17556             :                 } else {
   17557           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_old_password)->tp_name);
   17558           0 :                         return false;
   17559             :                 }
   17560           0 :                 talloc_str = talloc_strdup(r, test_str);
   17561           0 :                 if (unicode != NULL) {
   17562           0 :                         Py_DECREF(unicode);
   17563             :                 }
   17564           0 :                 if (talloc_str == NULL) {
   17565           0 :                         PyErr_NoMemory();
   17566           0 :                         return false;
   17567             :                 }
   17568           0 :                 r->in.old_password = talloc_str;
   17569             :         }
   17570           0 :         if (py_new_password == NULL) {
   17571           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_password");
   17572           0 :                 return false;
   17573             :         }
   17574           0 :         r->in.new_password = talloc_ptrtype(r, r->in.new_password);
   17575           0 :         if (r->in.new_password == NULL) {
   17576           0 :                 PyErr_NoMemory();
   17577           0 :                 return false;
   17578             :         }
   17579             :         {
   17580             :                 const char *test_str;
   17581             :                 const char *talloc_str;
   17582           0 :                 PyObject *unicode = NULL;
   17583           0 :                 if (PyUnicode_Check(py_new_password)) {
   17584           0 :                         unicode = PyUnicode_AsEncodedString(py_new_password, "utf-8", "ignore");
   17585           0 :                         if (unicode == NULL) {
   17586           0 :                                 PyErr_NoMemory();
   17587           0 :                                 return false;
   17588             :                         }
   17589           0 :                         test_str = PyBytes_AS_STRING(unicode);
   17590           0 :                 } else if (PyBytes_Check(py_new_password)) {
   17591           0 :                         test_str = PyBytes_AS_STRING(py_new_password);
   17592             :                 } else {
   17593           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_new_password)->tp_name);
   17594           0 :                         return false;
   17595             :                 }
   17596           0 :                 talloc_str = talloc_strdup(r, test_str);
   17597           0 :                 if (unicode != NULL) {
   17598           0 :                         Py_DECREF(unicode);
   17599             :                 }
   17600           0 :                 if (talloc_str == NULL) {
   17601           0 :                         PyErr_NoMemory();
   17602           0 :                         return false;
   17603             :                 }
   17604           0 :                 r->in.new_password = talloc_str;
   17605             :         }
   17606           0 :         return true;
   17607             : }
   17608             : 
   17609           0 : static PyObject *unpack_py_wbint_PamAuthChangePassword_args_out(struct wbint_PamAuthChangePassword *r)
   17610             : {
   17611             :         PyObject *result;
   17612             :         PyObject *py_dominfo;
   17613             :         PyObject *py_reject_reason;
   17614           0 :         result = PyTuple_New(2);
   17615           0 :         if (*r->out.dominfo == NULL) {
   17616           0 :                 py_dominfo = Py_None;
   17617           0 :                 Py_INCREF(py_dominfo);
   17618             :         } else {
   17619           0 :                 py_dominfo = pytalloc_reference_ex(samr_DomInfo1_Type, *r->out.dominfo, *r->out.dominfo);
   17620             :         }
   17621           0 :         PyTuple_SetItem(result, 0, py_dominfo);
   17622           0 :         py_reject_reason = PyLong_FromUnsignedLongLong((uint32_t)*r->out.reject_reason);
   17623           0 :         PyTuple_SetItem(result, 1, py_reject_reason);
   17624           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   17625           0 :                 PyErr_SetNTSTATUS(r->out.result);
   17626           0 :                 return NULL;
   17627             :         }
   17628             : 
   17629           0 :         return result;
   17630             : }
   17631             : 
   17632             : 
   17633           0 : static PyObject *py_wbint_InitConnection_in_get_dcname(PyObject *obj, void *closure)
   17634             : {
   17635           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(obj);
   17636             :         PyObject *py_dcname;
   17637           0 :         if (object->in.dcname == NULL) {
   17638           0 :                 Py_RETURN_NONE;
   17639             :         }
   17640           0 :         if (object->in.dcname == NULL) {
   17641           0 :                 py_dcname = Py_None;
   17642           0 :                 Py_INCREF(py_dcname);
   17643             :         } else {
   17644           0 :                 py_dcname = PyUnicode_Decode(object->in.dcname, strlen(object->in.dcname), "utf-8", "ignore");
   17645             :         }
   17646           0 :         return py_dcname;
   17647             : }
   17648             : 
   17649           0 : static int py_wbint_InitConnection_in_set_dcname(PyObject *py_obj, PyObject *value, void *closure)
   17650             : {
   17651           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(py_obj);
   17652           0 :         if (value == NULL) {
   17653           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dcname");
   17654           0 :                 return -1;
   17655             :         }
   17656           0 :         object->in.dcname = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dcname);
   17657           0 :         if (object->in.dcname == NULL) {
   17658           0 :                 PyErr_NoMemory();
   17659           0 :                 return -1;
   17660             :         }
   17661             :         {
   17662             :                 const char *test_str;
   17663             :                 const char *talloc_str;
   17664           0 :                 PyObject *unicode = NULL;
   17665           0 :                 if (PyUnicode_Check(value)) {
   17666           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   17667           0 :                         if (unicode == NULL) {
   17668           0 :                                 PyErr_NoMemory();
   17669           0 :                                 return -1;
   17670             :                         }
   17671           0 :                         test_str = PyBytes_AS_STRING(unicode);
   17672           0 :                 } else if (PyBytes_Check(value)) {
   17673           0 :                         test_str = PyBytes_AS_STRING(value);
   17674             :                 } else {
   17675           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   17676           0 :                         return -1;
   17677             :                 }
   17678           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   17679           0 :                 if (unicode != NULL) {
   17680           0 :                         Py_DECREF(unicode);
   17681             :                 }
   17682           0 :                 if (talloc_str == NULL) {
   17683           0 :                         PyErr_NoMemory();
   17684           0 :                         return -1;
   17685             :                 }
   17686           0 :                 object->in.dcname = talloc_str;
   17687             :         }
   17688           0 :         return 0;
   17689             : }
   17690             : 
   17691           0 : static PyObject *py_wbint_InitConnection_out_get_name(PyObject *obj, void *closure)
   17692             : {
   17693           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(obj);
   17694             :         PyObject *py_name;
   17695           0 :         if (object->out.name == NULL) {
   17696           0 :                 Py_RETURN_NONE;
   17697             :         }
   17698           0 :         if (*object->out.name == NULL) {
   17699           0 :                 py_name = Py_None;
   17700           0 :                 Py_INCREF(py_name);
   17701             :         } else {
   17702           0 :                 if (*object->out.name == NULL) {
   17703           0 :                         py_name = Py_None;
   17704           0 :                         Py_INCREF(py_name);
   17705             :                 } else {
   17706           0 :                         py_name = PyUnicode_Decode(*object->out.name, strlen(*object->out.name), "utf-8", "ignore");
   17707             :                 }
   17708             :         }
   17709           0 :         return py_name;
   17710             : }
   17711             : 
   17712           0 : static int py_wbint_InitConnection_out_set_name(PyObject *py_obj, PyObject *value, void *closure)
   17713             : {
   17714           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(py_obj);
   17715           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.name));
   17716           0 :         if (value == NULL) {
   17717           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.name");
   17718           0 :                 return -1;
   17719             :         }
   17720           0 :         object->out.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.name);
   17721           0 :         if (object->out.name == NULL) {
   17722           0 :                 PyErr_NoMemory();
   17723           0 :                 return -1;
   17724             :         }
   17725           0 :         if (value == Py_None) {
   17726           0 :                 *object->out.name = NULL;
   17727             :         } else {
   17728           0 :                 *object->out.name = NULL;
   17729             :                 {
   17730             :                         const char *test_str;
   17731             :                         const char *talloc_str;
   17732           0 :                         PyObject *unicode = NULL;
   17733           0 :                         if (PyUnicode_Check(value)) {
   17734           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   17735           0 :                                 if (unicode == NULL) {
   17736           0 :                                         PyErr_NoMemory();
   17737           0 :                                         return -1;
   17738             :                                 }
   17739           0 :                                 test_str = PyBytes_AS_STRING(unicode);
   17740           0 :                         } else if (PyBytes_Check(value)) {
   17741           0 :                                 test_str = PyBytes_AS_STRING(value);
   17742             :                         } else {
   17743           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   17744           0 :                                 return -1;
   17745             :                         }
   17746           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   17747           0 :                         if (unicode != NULL) {
   17748           0 :                                 Py_DECREF(unicode);
   17749             :                         }
   17750           0 :                         if (talloc_str == NULL) {
   17751           0 :                                 PyErr_NoMemory();
   17752           0 :                                 return -1;
   17753             :                         }
   17754           0 :                         *object->out.name = talloc_str;
   17755             :                 }
   17756             :         }
   17757           0 :         return 0;
   17758             : }
   17759             : 
   17760           0 : static PyObject *py_wbint_InitConnection_out_get_alt_name(PyObject *obj, void *closure)
   17761             : {
   17762           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(obj);
   17763             :         PyObject *py_alt_name;
   17764           0 :         if (object->out.alt_name == NULL) {
   17765           0 :                 Py_RETURN_NONE;
   17766             :         }
   17767           0 :         if (*object->out.alt_name == NULL) {
   17768           0 :                 py_alt_name = Py_None;
   17769           0 :                 Py_INCREF(py_alt_name);
   17770             :         } else {
   17771           0 :                 if (*object->out.alt_name == NULL) {
   17772           0 :                         py_alt_name = Py_None;
   17773           0 :                         Py_INCREF(py_alt_name);
   17774             :                 } else {
   17775           0 :                         py_alt_name = PyUnicode_Decode(*object->out.alt_name, strlen(*object->out.alt_name), "utf-8", "ignore");
   17776             :                 }
   17777             :         }
   17778           0 :         return py_alt_name;
   17779             : }
   17780             : 
   17781           0 : static int py_wbint_InitConnection_out_set_alt_name(PyObject *py_obj, PyObject *value, void *closure)
   17782             : {
   17783           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(py_obj);
   17784           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.alt_name));
   17785           0 :         if (value == NULL) {
   17786           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.alt_name");
   17787           0 :                 return -1;
   17788             :         }
   17789           0 :         object->out.alt_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.alt_name);
   17790           0 :         if (object->out.alt_name == NULL) {
   17791           0 :                 PyErr_NoMemory();
   17792           0 :                 return -1;
   17793             :         }
   17794           0 :         if (value == Py_None) {
   17795           0 :                 *object->out.alt_name = NULL;
   17796             :         } else {
   17797           0 :                 *object->out.alt_name = NULL;
   17798             :                 {
   17799             :                         const char *test_str;
   17800             :                         const char *talloc_str;
   17801           0 :                         PyObject *unicode = NULL;
   17802           0 :                         if (PyUnicode_Check(value)) {
   17803           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   17804           0 :                                 if (unicode == NULL) {
   17805           0 :                                         PyErr_NoMemory();
   17806           0 :                                         return -1;
   17807             :                                 }
   17808           0 :                                 test_str = PyBytes_AS_STRING(unicode);
   17809           0 :                         } else if (PyBytes_Check(value)) {
   17810           0 :                                 test_str = PyBytes_AS_STRING(value);
   17811             :                         } else {
   17812           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   17813           0 :                                 return -1;
   17814             :                         }
   17815           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   17816           0 :                         if (unicode != NULL) {
   17817           0 :                                 Py_DECREF(unicode);
   17818             :                         }
   17819           0 :                         if (talloc_str == NULL) {
   17820           0 :                                 PyErr_NoMemory();
   17821           0 :                                 return -1;
   17822             :                         }
   17823           0 :                         *object->out.alt_name = talloc_str;
   17824             :                 }
   17825             :         }
   17826           0 :         return 0;
   17827             : }
   17828             : 
   17829           0 : static PyObject *py_wbint_InitConnection_out_get_sid(PyObject *obj, void *closure)
   17830             : {
   17831           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(obj);
   17832             :         PyObject *py_sid;
   17833           0 :         if (object->out.sid == NULL) {
   17834           0 :                 Py_RETURN_NONE;
   17835             :         }
   17836           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, object->out.sid, object->out.sid);
   17837           0 :         return py_sid;
   17838             : }
   17839             : 
   17840           0 : static int py_wbint_InitConnection_out_set_sid(PyObject *py_obj, PyObject *value, void *closure)
   17841             : {
   17842           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(py_obj);
   17843           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sid));
   17844           0 :         if (value == NULL) {
   17845           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sid");
   17846           0 :                 return -1;
   17847             :         }
   17848           0 :         object->out.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sid);
   17849           0 :         if (object->out.sid == NULL) {
   17850           0 :                 PyErr_NoMemory();
   17851           0 :                 return -1;
   17852             :         }
   17853           0 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
   17854           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   17855           0 :                 PyErr_NoMemory();
   17856           0 :                 return -1;
   17857             :         }
   17858           0 :         object->out.sid = (struct dom_sid *)pytalloc_get_ptr(value);
   17859           0 :         return 0;
   17860             : }
   17861             : 
   17862           0 : static PyObject *py_wbint_InitConnection_out_get_flags(PyObject *obj, void *closure)
   17863             : {
   17864           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(obj);
   17865             :         PyObject *py_flags;
   17866           0 :         if (object->out.flags == NULL) {
   17867           0 :                 Py_RETURN_NONE;
   17868             :         }
   17869           0 :         py_flags = PyLong_FromLong((uint16_t)*object->out.flags);
   17870           0 :         return py_flags;
   17871             : }
   17872             : 
   17873           0 : static int py_wbint_InitConnection_out_set_flags(PyObject *py_obj, PyObject *value, void *closure)
   17874             : {
   17875           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(py_obj);
   17876           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.flags));
   17877           0 :         if (value == NULL) {
   17878           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.flags");
   17879           0 :                 return -1;
   17880             :         }
   17881           0 :         object->out.flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.flags);
   17882           0 :         if (object->out.flags == NULL) {
   17883           0 :                 PyErr_NoMemory();
   17884           0 :                 return -1;
   17885             :         }
   17886             :         {
   17887           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.flags));
   17888           0 :                 if (PyLong_Check(value)) {
   17889             :                         unsigned long long test_var;
   17890           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   17891           0 :                         if (PyErr_Occurred() != NULL) {
   17892           0 :                                 return -1;
   17893             :                         }
   17894           0 :                         if (test_var > uint_max) {
   17895           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   17896             :                                   PyLong_Type.tp_name, uint_max, test_var);
   17897           0 :                                 return -1;
   17898             :                         }
   17899           0 :                         *object->out.flags = test_var;
   17900             :                 } else {
   17901           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   17902             :                           PyLong_Type.tp_name);
   17903           0 :                         return -1;
   17904             :                 }
   17905             :         }
   17906           0 :         return 0;
   17907             : }
   17908             : 
   17909           0 : static PyObject *py_wbint_InitConnection_get_result(PyObject *obj, void *closure)
   17910             : {
   17911           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(obj);
   17912             :         PyObject *py_result;
   17913           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   17914           0 :         return py_result;
   17915             : }
   17916             : 
   17917           0 : static int py_wbint_InitConnection_set_result(PyObject *py_obj, PyObject *value, void *closure)
   17918             : {
   17919           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(py_obj);
   17920           0 :         if (value == NULL) {
   17921           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   17922           0 :                 return -1;
   17923             :         }
   17924           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   17925           0 :         return 0;
   17926             : }
   17927             : 
   17928             : static PyGetSetDef py_wbint_InitConnection_getsetters[] = {
   17929             :         {
   17930             :                 .name = discard_const_p(char, "in_dcname"),
   17931             :                 .get = py_wbint_InitConnection_in_get_dcname,
   17932             :                 .set = py_wbint_InitConnection_in_set_dcname,
   17933             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   17934             :         },
   17935             :         {
   17936             :                 .name = discard_const_p(char, "out_name"),
   17937             :                 .get = py_wbint_InitConnection_out_get_name,
   17938             :                 .set = py_wbint_InitConnection_out_set_name,
   17939             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   17940             :         },
   17941             :         {
   17942             :                 .name = discard_const_p(char, "out_alt_name"),
   17943             :                 .get = py_wbint_InitConnection_out_get_alt_name,
   17944             :                 .set = py_wbint_InitConnection_out_set_alt_name,
   17945             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   17946             :         },
   17947             :         {
   17948             :                 .name = discard_const_p(char, "out_sid"),
   17949             :                 .get = py_wbint_InitConnection_out_get_sid,
   17950             :                 .set = py_wbint_InitConnection_out_set_sid,
   17951             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
   17952             :         },
   17953             :         {
   17954             :                 .name = discard_const_p(char, "out_flags"),
   17955             :                 .get = py_wbint_InitConnection_out_get_flags,
   17956             :                 .set = py_wbint_InitConnection_out_set_flags,
   17957             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DomainInfoFlags")
   17958             :         },
   17959             :         {
   17960             :                 .name = discard_const_p(char, "result"),
   17961             :                 .get = py_wbint_InitConnection_get_result,
   17962             :                 .set = py_wbint_InitConnection_set_result,
   17963             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   17964             :         },
   17965             :         { .name = NULL }
   17966             : };
   17967             : 
   17968           0 : static PyObject *py_wbint_InitConnection_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   17969             : {
   17970           0 :         PyObject *self = pytalloc_new(struct wbint_InitConnection, type);
   17971           0 :         struct wbint_InitConnection *_self = (struct wbint_InitConnection *)pytalloc_get_ptr(self);
   17972           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
   17973           0 :         _self->out.sid = talloc_zero(mem_ctx, struct dom_sid);
   17974           0 :         _self->out.flags = talloc_zero(mem_ctx, enum DomainInfoFlags);
   17975           0 :         return self;
   17976             : }
   17977             : 
   17978           0 : static PyObject *py_wbint_InitConnection_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   17979             : {
   17980             : 
   17981             : 
   17982           0 :         return PyLong_FromLong(26);
   17983             : }
   17984             : 
   17985           0 : static PyObject *py_wbint_InitConnection_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   17986             : {
   17987           0 :         const struct ndr_interface_call *call = NULL;
   17988           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(py_obj);
   17989           0 :         PyObject *ret = NULL;
   17990           0 :         struct ndr_push *push = NULL;
   17991             :         DATA_BLOB blob;
   17992             :         enum ndr_err_code err;
   17993             : 
   17994           0 :         if (ndr_table_winbind.num_calls < 27) {
   17995           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_InitConnection_ndr_pack");
   17996           0 :                 return NULL;
   17997             :         }
   17998           0 :         call = &ndr_table_winbind.calls[26];
   17999             : 
   18000           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   18001           0 :         if (push == NULL) {
   18002           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   18003           0 :                 return NULL;
   18004             :         }
   18005             : 
   18006           0 :         push->flags |= ndr_push_flags;
   18007             : 
   18008           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   18009           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   18010           0 :                 TALLOC_FREE(push);
   18011           0 :                 PyErr_SetNdrError(err);
   18012           0 :                 return NULL;
   18013             :         }
   18014           0 :         blob = ndr_push_blob(push);
   18015           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   18016           0 :         TALLOC_FREE(push);
   18017           0 :         return ret;
   18018             : }
   18019             : 
   18020           0 : static PyObject *py_wbint_InitConnection_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   18021             : {
   18022           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   18023           0 :         PyObject *bigendian_obj = NULL;
   18024           0 :         PyObject *ndr64_obj = NULL;
   18025           0 :         uint32_t ndr_push_flags = 0;
   18026             : 
   18027           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   18028             :                 discard_const_p(char *, kwnames),
   18029             :                 &bigendian_obj,
   18030             :                 &ndr64_obj)) {
   18031           0 :                 return NULL;
   18032             :         }
   18033             : 
   18034           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   18035           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   18036             :         }
   18037           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   18038           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   18039             :         }
   18040             : 
   18041           0 :         return py_wbint_InitConnection_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   18042             : }
   18043             : 
   18044           0 : static PyObject *py_wbint_InitConnection_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   18045             : {
   18046           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   18047           0 :         PyObject *bigendian_obj = NULL;
   18048           0 :         PyObject *ndr64_obj = NULL;
   18049           0 :         uint32_t ndr_push_flags = 0;
   18050             : 
   18051           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   18052             :                 discard_const_p(char *, kwnames),
   18053             :                 &bigendian_obj,
   18054             :                 &ndr64_obj)) {
   18055           0 :                 return NULL;
   18056             :         }
   18057             : 
   18058           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   18059           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   18060             :         }
   18061           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   18062           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   18063             :         }
   18064             : 
   18065           0 :         return py_wbint_InitConnection_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   18066             : }
   18067             : 
   18068           0 : static PyObject *py_wbint_InitConnection_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   18069             : {
   18070           0 :         const struct ndr_interface_call *call = NULL;
   18071           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(py_obj);
   18072           0 :         struct ndr_pull *pull = NULL;
   18073             :         enum ndr_err_code err;
   18074             : 
   18075           0 :         if (ndr_table_winbind.num_calls < 27) {
   18076           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_InitConnection_ndr_unpack");
   18077           0 :                 return NULL;
   18078             :         }
   18079           0 :         call = &ndr_table_winbind.calls[26];
   18080             : 
   18081           0 :         pull = ndr_pull_init_blob(blob, object);
   18082           0 :         if (pull == NULL) {
   18083           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   18084           0 :                 return NULL;
   18085             :         }
   18086             : 
   18087           0 :         pull->flags |= ndr_pull_flags;
   18088             : 
   18089           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   18090           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   18091           0 :                 TALLOC_FREE(pull);
   18092           0 :                 PyErr_SetNdrError(err);
   18093           0 :                 return NULL;
   18094             :         }
   18095           0 :         if (!allow_remaining) {
   18096             :                 uint32_t highest_ofs;
   18097             : 
   18098           0 :                 if (pull->offset > pull->relative_highest_offset) {
   18099           0 :                         highest_ofs = pull->offset;
   18100             :                 } else {
   18101           0 :                         highest_ofs = pull->relative_highest_offset;
   18102             :                 }
   18103           0 :                 if (highest_ofs < pull->data_size) {
   18104           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   18105             :                                 "not all bytes consumed ofs[%u] size[%u]",
   18106             :                                 highest_ofs, pull->data_size);
   18107           0 :                         TALLOC_FREE(pull);
   18108           0 :                         PyErr_SetNdrError(err);
   18109           0 :                         return NULL;
   18110             :                 }
   18111             :         }
   18112             : 
   18113           0 :         TALLOC_FREE(pull);
   18114           0 :         Py_RETURN_NONE;
   18115             : }
   18116             : 
   18117           0 : static PyObject *py_wbint_InitConnection_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   18118             : {
   18119             :         DATA_BLOB blob;
   18120           0 :         Py_ssize_t blob_length = 0;
   18121           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   18122           0 :         PyObject *bigendian_obj = NULL;
   18123           0 :         PyObject *ndr64_obj = NULL;
   18124           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   18125           0 :         PyObject *allow_remaining_obj = NULL;
   18126           0 :         bool allow_remaining = false;
   18127             : 
   18128           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   18129             :                 discard_const_p(char *, kwnames),
   18130             :                 &blob.data, &blob_length,
   18131             :                 &bigendian_obj,
   18132             :                 &ndr64_obj,
   18133             :                 &allow_remaining_obj)) {
   18134           0 :                 return NULL;
   18135             :         }
   18136           0 :         blob.length = blob_length;
   18137             : 
   18138           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   18139           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   18140             :         }
   18141           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   18142           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   18143             :         }
   18144             : 
   18145           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   18146           0 :                 allow_remaining = true;
   18147             :         }
   18148             : 
   18149           0 :         return py_wbint_InitConnection_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   18150             : }
   18151             : 
   18152           0 : static PyObject *py_wbint_InitConnection_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   18153             : {
   18154             :         DATA_BLOB blob;
   18155           0 :         Py_ssize_t blob_length = 0;
   18156           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   18157           0 :         PyObject *bigendian_obj = NULL;
   18158           0 :         PyObject *ndr64_obj = NULL;
   18159           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   18160           0 :         PyObject *allow_remaining_obj = NULL;
   18161           0 :         bool allow_remaining = false;
   18162             : 
   18163           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   18164             :                 discard_const_p(char *, kwnames),
   18165             :                 &blob.data, &blob_length,
   18166             :                 &bigendian_obj,
   18167             :                 &ndr64_obj,
   18168             :                 &allow_remaining_obj)) {
   18169           0 :                 return NULL;
   18170             :         }
   18171           0 :         blob.length = blob_length;
   18172             : 
   18173           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   18174           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   18175             :         }
   18176           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   18177           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   18178             :         }
   18179             : 
   18180           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   18181           0 :                 allow_remaining = true;
   18182             :         }
   18183             : 
   18184           0 :         return py_wbint_InitConnection_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   18185             : }
   18186             : 
   18187           0 : static PyObject *py_wbint_InitConnection_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   18188             : {
   18189           0 :         const struct ndr_interface_call *call = NULL;
   18190           0 :         struct wbint_InitConnection *object = (struct wbint_InitConnection *)pytalloc_get_ptr(py_obj);
   18191             :         PyObject *ret;
   18192             :         char *retstr;
   18193             : 
   18194           0 :         if (ndr_table_winbind.num_calls < 27) {
   18195           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_InitConnection_ndr_print");
   18196           0 :                 return NULL;
   18197             :         }
   18198           0 :         call = &ndr_table_winbind.calls[26];
   18199             : 
   18200           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   18201           0 :         ret = PyUnicode_FromString(retstr);
   18202           0 :         TALLOC_FREE(retstr);
   18203             : 
   18204           0 :         return ret;
   18205             : }
   18206             : 
   18207           0 : static PyObject *py_wbint_InitConnection_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   18208             : {
   18209           0 :         return py_wbint_InitConnection_ndr_print(py_obj, "wbint_InitConnection_in", NDR_IN);
   18210             : }
   18211             : 
   18212           0 : static PyObject *py_wbint_InitConnection_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   18213             : {
   18214           0 :         return py_wbint_InitConnection_ndr_print(py_obj, "wbint_InitConnection_out", NDR_OUT);
   18215             : }
   18216             : 
   18217             : static PyMethodDef py_wbint_InitConnection_methods[] = {
   18218             :         { "opnum", (PyCFunction)py_wbint_InitConnection_ndr_opnum, METH_NOARGS|METH_CLASS,
   18219             :                 "winbind.wbint_InitConnection.opnum() -> 26 (0x1a) " },
   18220             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_InitConnection_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   18221             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   18222             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_InitConnection_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   18223             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   18224             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_InitConnection_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   18225             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   18226             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_InitConnection_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   18227             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   18228             :         { "__ndr_print_in__", (PyCFunction)py_wbint_InitConnection_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   18229             :         { "__ndr_print_out__", (PyCFunction)py_wbint_InitConnection_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   18230             :         { NULL, NULL, 0, NULL }
   18231             : };
   18232             : 
   18233             : 
   18234             : static PyTypeObject wbint_InitConnection_Type = {
   18235             :         PyVarObject_HEAD_INIT(NULL, 0)
   18236             :         .tp_name = "winbind.wbint_InitConnection",
   18237             :         .tp_getset = py_wbint_InitConnection_getsetters,
   18238             :         .tp_methods = py_wbint_InitConnection_methods,
   18239             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   18240             :         .tp_new = py_wbint_InitConnection_new,
   18241             : };
   18242             : 
   18243           0 : static bool pack_py_wbint_InitConnection_args_in(PyObject *args, PyObject *kwargs, struct wbint_InitConnection *r)
   18244             : {
   18245             :         PyObject *py_dcname;
   18246           0 :         const char *kwnames[] = {
   18247             :                 "dcname", NULL
   18248             :         };
   18249             : 
   18250           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_InitConnection", discard_const_p(char *, kwnames), &py_dcname)) {
   18251           0 :                 return false;
   18252             :         }
   18253             : 
   18254           0 :         if (py_dcname == NULL) {
   18255           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dcname");
   18256           0 :                 return false;
   18257             :         }
   18258           0 :         r->in.dcname = talloc_ptrtype(r, r->in.dcname);
   18259           0 :         if (r->in.dcname == NULL) {
   18260           0 :                 PyErr_NoMemory();
   18261           0 :                 return false;
   18262             :         }
   18263             :         {
   18264             :                 const char *test_str;
   18265             :                 const char *talloc_str;
   18266           0 :                 PyObject *unicode = NULL;
   18267           0 :                 if (PyUnicode_Check(py_dcname)) {
   18268           0 :                         unicode = PyUnicode_AsEncodedString(py_dcname, "utf-8", "ignore");
   18269           0 :                         if (unicode == NULL) {
   18270           0 :                                 PyErr_NoMemory();
   18271           0 :                                 return false;
   18272             :                         }
   18273           0 :                         test_str = PyBytes_AS_STRING(unicode);
   18274           0 :                 } else if (PyBytes_Check(py_dcname)) {
   18275           0 :                         test_str = PyBytes_AS_STRING(py_dcname);
   18276             :                 } else {
   18277           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_dcname)->tp_name);
   18278           0 :                         return false;
   18279             :                 }
   18280           0 :                 talloc_str = talloc_strdup(r, test_str);
   18281           0 :                 if (unicode != NULL) {
   18282           0 :                         Py_DECREF(unicode);
   18283             :                 }
   18284           0 :                 if (talloc_str == NULL) {
   18285           0 :                         PyErr_NoMemory();
   18286           0 :                         return false;
   18287             :                 }
   18288           0 :                 r->in.dcname = talloc_str;
   18289             :         }
   18290           0 :         return true;
   18291             : }
   18292             : 
   18293           0 : static PyObject *unpack_py_wbint_InitConnection_args_out(struct wbint_InitConnection *r)
   18294             : {
   18295             :         PyObject *result;
   18296             :         PyObject *py_name;
   18297             :         PyObject *py_alt_name;
   18298             :         PyObject *py_sid;
   18299             :         PyObject *py_flags;
   18300           0 :         result = PyTuple_New(4);
   18301           0 :         if (*r->out.name == NULL) {
   18302           0 :                 py_name = Py_None;
   18303           0 :                 Py_INCREF(py_name);
   18304             :         } else {
   18305           0 :                 if (*r->out.name == NULL) {
   18306           0 :                         py_name = Py_None;
   18307           0 :                         Py_INCREF(py_name);
   18308             :                 } else {
   18309           0 :                         py_name = PyUnicode_Decode(*r->out.name, strlen(*r->out.name), "utf-8", "ignore");
   18310             :                 }
   18311             :         }
   18312           0 :         PyTuple_SetItem(result, 0, py_name);
   18313           0 :         if (*r->out.alt_name == NULL) {
   18314           0 :                 py_alt_name = Py_None;
   18315           0 :                 Py_INCREF(py_alt_name);
   18316             :         } else {
   18317           0 :                 if (*r->out.alt_name == NULL) {
   18318           0 :                         py_alt_name = Py_None;
   18319           0 :                         Py_INCREF(py_alt_name);
   18320             :                 } else {
   18321           0 :                         py_alt_name = PyUnicode_Decode(*r->out.alt_name, strlen(*r->out.alt_name), "utf-8", "ignore");
   18322             :                 }
   18323             :         }
   18324           0 :         PyTuple_SetItem(result, 1, py_alt_name);
   18325           0 :         py_sid = pytalloc_reference_ex(dom_sid_Type, r->out.sid, r->out.sid);
   18326           0 :         PyTuple_SetItem(result, 2, py_sid);
   18327           0 :         py_flags = PyLong_FromLong((uint16_t)*r->out.flags);
   18328           0 :         PyTuple_SetItem(result, 3, py_flags);
   18329           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   18330           0 :                 PyErr_SetNTSTATUS(r->out.result);
   18331           0 :                 return NULL;
   18332             :         }
   18333             : 
   18334           0 :         return result;
   18335             : }
   18336             : 
   18337             : 
   18338           0 : static PyObject *py_winbind_SamLogon_in_get_logon_level(PyObject *obj, void *closure)
   18339             : {
   18340           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(obj);
   18341             :         PyObject *py_logon_level;
   18342           0 :         py_logon_level = PyLong_FromLong((uint16_t)object->in.logon_level);
   18343           0 :         return py_logon_level;
   18344             : }
   18345             : 
   18346           0 : static int py_winbind_SamLogon_in_set_logon_level(PyObject *py_obj, PyObject *value, void *closure)
   18347             : {
   18348           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj);
   18349           0 :         if (value == NULL) {
   18350           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_level");
   18351           0 :                 return -1;
   18352             :         }
   18353             :         {
   18354           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.logon_level));
   18355           0 :                 if (PyLong_Check(value)) {
   18356             :                         unsigned long long test_var;
   18357           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   18358           0 :                         if (PyErr_Occurred() != NULL) {
   18359           0 :                                 return -1;
   18360             :                         }
   18361           0 :                         if (test_var > uint_max) {
   18362           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   18363             :                                   PyLong_Type.tp_name, uint_max, test_var);
   18364           0 :                                 return -1;
   18365             :                         }
   18366           0 :                         object->in.logon_level = test_var;
   18367             :                 } else {
   18368           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   18369             :                           PyLong_Type.tp_name);
   18370           0 :                         return -1;
   18371             :                 }
   18372             :         }
   18373           0 :         return 0;
   18374             : }
   18375             : 
   18376           0 : static PyObject *py_winbind_SamLogon_in_get_logon(PyObject *obj, void *closure)
   18377             : {
   18378           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(obj);
   18379             :         PyObject *py_logon;
   18380           0 :         py_logon = pyrpc_import_union(netr_LogonLevel_Type, pytalloc_get_mem_ctx(obj), object->in.logon_level, &object->in.logon, "union netr_LogonLevel");
   18381           0 :         if (py_logon == NULL) {
   18382           0 :                 return NULL;
   18383             :         }
   18384           0 :         return py_logon;
   18385             : }
   18386             : 
   18387           0 : static int py_winbind_SamLogon_in_set_logon(PyObject *py_obj, PyObject *value, void *closure)
   18388             : {
   18389           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj);
   18390           0 :         if (value == NULL) {
   18391           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon");
   18392           0 :                 return -1;
   18393             :         }
   18394             :         {
   18395             :                 union netr_LogonLevel *logon_switch_0;
   18396           0 :                 logon_switch_0 = (union netr_LogonLevel *)pyrpc_export_union(netr_LogonLevel_Type, pytalloc_get_mem_ctx(py_obj), object->in.logon_level, value, "union netr_LogonLevel");
   18397           0 :                 if (logon_switch_0 == NULL) {
   18398           0 :                         return -1;
   18399             :                 }
   18400           0 :                 object->in.logon = *logon_switch_0;
   18401             :         }
   18402           0 :         return 0;
   18403             : }
   18404             : 
   18405           0 : static PyObject *py_winbind_SamLogon_in_get_validation_level(PyObject *obj, void *closure)
   18406             : {
   18407           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(obj);
   18408             :         PyObject *py_validation_level;
   18409           0 :         py_validation_level = PyLong_FromLong((uint16_t)object->in.validation_level);
   18410           0 :         return py_validation_level;
   18411             : }
   18412             : 
   18413           0 : static int py_winbind_SamLogon_in_set_validation_level(PyObject *py_obj, PyObject *value, void *closure)
   18414             : {
   18415           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj);
   18416           0 :         if (value == NULL) {
   18417           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.validation_level");
   18418           0 :                 return -1;
   18419             :         }
   18420             :         {
   18421           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.validation_level));
   18422           0 :                 if (PyLong_Check(value)) {
   18423             :                         unsigned long long test_var;
   18424           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   18425           0 :                         if (PyErr_Occurred() != NULL) {
   18426           0 :                                 return -1;
   18427             :                         }
   18428           0 :                         if (test_var > uint_max) {
   18429           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   18430             :                                   PyLong_Type.tp_name, uint_max, test_var);
   18431           0 :                                 return -1;
   18432             :                         }
   18433           0 :                         object->in.validation_level = test_var;
   18434             :                 } else {
   18435           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   18436             :                           PyLong_Type.tp_name);
   18437           0 :                         return -1;
   18438             :                 }
   18439             :         }
   18440           0 :         return 0;
   18441             : }
   18442             : 
   18443           0 : static PyObject *py_winbind_SamLogon_out_get_validation(PyObject *obj, void *closure)
   18444             : {
   18445           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(obj);
   18446             :         PyObject *py_validation;
   18447           0 :         py_validation = pyrpc_import_union(netr_Validation_Type, pytalloc_get_mem_ctx(obj), object->in.validation_level, &object->out.validation, "union netr_Validation");
   18448           0 :         if (py_validation == NULL) {
   18449           0 :                 return NULL;
   18450             :         }
   18451           0 :         return py_validation;
   18452             : }
   18453             : 
   18454           0 : static int py_winbind_SamLogon_out_set_validation(PyObject *py_obj, PyObject *value, void *closure)
   18455             : {
   18456           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj);
   18457           0 :         if (value == NULL) {
   18458           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.validation");
   18459           0 :                 return -1;
   18460             :         }
   18461             :         {
   18462             :                 union netr_Validation *validation_switch_0;
   18463           0 :                 validation_switch_0 = (union netr_Validation *)pyrpc_export_union(netr_Validation_Type, pytalloc_get_mem_ctx(py_obj), object->in.validation_level, value, "union netr_Validation");
   18464           0 :                 if (validation_switch_0 == NULL) {
   18465           0 :                         return -1;
   18466             :                 }
   18467           0 :                 object->out.validation = *validation_switch_0;
   18468             :         }
   18469           0 :         return 0;
   18470             : }
   18471             : 
   18472           0 : static PyObject *py_winbind_SamLogon_out_get_authoritative(PyObject *obj, void *closure)
   18473             : {
   18474           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(obj);
   18475             :         PyObject *py_authoritative;
   18476           0 :         py_authoritative = PyLong_FromLong((uint16_t)object->out.authoritative);
   18477           0 :         return py_authoritative;
   18478             : }
   18479             : 
   18480           0 : static int py_winbind_SamLogon_out_set_authoritative(PyObject *py_obj, PyObject *value, void *closure)
   18481             : {
   18482           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj);
   18483           0 :         if (value == NULL) {
   18484           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.authoritative");
   18485           0 :                 return -1;
   18486             :         }
   18487             :         {
   18488           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.authoritative));
   18489           0 :                 if (PyLong_Check(value)) {
   18490             :                         unsigned long long test_var;
   18491           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   18492           0 :                         if (PyErr_Occurred() != NULL) {
   18493           0 :                                 return -1;
   18494             :                         }
   18495           0 :                         if (test_var > uint_max) {
   18496           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   18497             :                                   PyLong_Type.tp_name, uint_max, test_var);
   18498           0 :                                 return -1;
   18499             :                         }
   18500           0 :                         object->out.authoritative = test_var;
   18501             :                 } else {
   18502           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   18503             :                           PyLong_Type.tp_name);
   18504           0 :                         return -1;
   18505             :                 }
   18506             :         }
   18507           0 :         return 0;
   18508             : }
   18509             : 
   18510           0 : static PyObject *py_winbind_SamLogon_get_result(PyObject *obj, void *closure)
   18511             : {
   18512           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(obj);
   18513             :         PyObject *py_result;
   18514           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   18515           0 :         return py_result;
   18516             : }
   18517             : 
   18518           0 : static int py_winbind_SamLogon_set_result(PyObject *py_obj, PyObject *value, void *closure)
   18519             : {
   18520           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj);
   18521           0 :         if (value == NULL) {
   18522           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   18523           0 :                 return -1;
   18524             :         }
   18525           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   18526           0 :         return 0;
   18527             : }
   18528             : 
   18529             : static PyGetSetDef py_winbind_SamLogon_getsetters[] = {
   18530             :         {
   18531             :                 .name = discard_const_p(char, "in_logon_level"),
   18532             :                 .get = py_winbind_SamLogon_in_get_logon_level,
   18533             :                 .set = py_winbind_SamLogon_in_set_logon_level,
   18534             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
   18535             :         },
   18536             :         {
   18537             :                 .name = discard_const_p(char, "in_logon"),
   18538             :                 .get = py_winbind_SamLogon_in_get_logon,
   18539             :                 .set = py_winbind_SamLogon_in_set_logon,
   18540             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonLevel")
   18541             :         },
   18542             :         {
   18543             :                 .name = discard_const_p(char, "in_validation_level"),
   18544             :                 .get = py_winbind_SamLogon_in_get_validation_level,
   18545             :                 .set = py_winbind_SamLogon_in_set_validation_level,
   18546             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
   18547             :         },
   18548             :         {
   18549             :                 .name = discard_const_p(char, "out_validation"),
   18550             :                 .get = py_winbind_SamLogon_out_get_validation,
   18551             :                 .set = py_winbind_SamLogon_out_set_validation,
   18552             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_Validation")
   18553             :         },
   18554             :         {
   18555             :                 .name = discard_const_p(char, "out_authoritative"),
   18556             :                 .get = py_winbind_SamLogon_out_get_authoritative,
   18557             :                 .set = py_winbind_SamLogon_out_set_authoritative,
   18558             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
   18559             :         },
   18560             :         {
   18561             :                 .name = discard_const_p(char, "result"),
   18562             :                 .get = py_winbind_SamLogon_get_result,
   18563             :                 .set = py_winbind_SamLogon_set_result,
   18564             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   18565             :         },
   18566             :         { .name = NULL }
   18567             : };
   18568             : 
   18569           0 : static PyObject *py_winbind_SamLogon_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   18570             : {
   18571           0 :         PyObject *self = pytalloc_new(struct winbind_SamLogon, type);
   18572           0 :         return self;
   18573             : }
   18574             : 
   18575           0 : static PyObject *py_winbind_SamLogon_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   18576             : {
   18577             : 
   18578             : 
   18579           0 :         return PyLong_FromLong(27);
   18580             : }
   18581             : 
   18582           0 : static PyObject *py_winbind_SamLogon_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   18583             : {
   18584           0 :         const struct ndr_interface_call *call = NULL;
   18585           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj);
   18586           0 :         PyObject *ret = NULL;
   18587           0 :         struct ndr_push *push = NULL;
   18588             :         DATA_BLOB blob;
   18589             :         enum ndr_err_code err;
   18590             : 
   18591           0 :         if (ndr_table_winbind.num_calls < 28) {
   18592           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SamLogon_ndr_pack");
   18593           0 :                 return NULL;
   18594             :         }
   18595           0 :         call = &ndr_table_winbind.calls[27];
   18596             : 
   18597           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   18598           0 :         if (push == NULL) {
   18599           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   18600           0 :                 return NULL;
   18601             :         }
   18602             : 
   18603           0 :         push->flags |= ndr_push_flags;
   18604             : 
   18605           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   18606           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   18607           0 :                 TALLOC_FREE(push);
   18608           0 :                 PyErr_SetNdrError(err);
   18609           0 :                 return NULL;
   18610             :         }
   18611           0 :         blob = ndr_push_blob(push);
   18612           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   18613           0 :         TALLOC_FREE(push);
   18614           0 :         return ret;
   18615             : }
   18616             : 
   18617           0 : static PyObject *py_winbind_SamLogon_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   18618             : {
   18619           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   18620           0 :         PyObject *bigendian_obj = NULL;
   18621           0 :         PyObject *ndr64_obj = NULL;
   18622           0 :         uint32_t ndr_push_flags = 0;
   18623             : 
   18624           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   18625             :                 discard_const_p(char *, kwnames),
   18626             :                 &bigendian_obj,
   18627             :                 &ndr64_obj)) {
   18628           0 :                 return NULL;
   18629             :         }
   18630             : 
   18631           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   18632           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   18633             :         }
   18634           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   18635           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   18636             :         }
   18637             : 
   18638           0 :         return py_winbind_SamLogon_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   18639             : }
   18640             : 
   18641           0 : static PyObject *py_winbind_SamLogon_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   18642             : {
   18643           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   18644           0 :         PyObject *bigendian_obj = NULL;
   18645           0 :         PyObject *ndr64_obj = NULL;
   18646           0 :         uint32_t ndr_push_flags = 0;
   18647             : 
   18648           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   18649             :                 discard_const_p(char *, kwnames),
   18650             :                 &bigendian_obj,
   18651             :                 &ndr64_obj)) {
   18652           0 :                 return NULL;
   18653             :         }
   18654             : 
   18655           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   18656           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   18657             :         }
   18658           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   18659           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   18660             :         }
   18661             : 
   18662           0 :         return py_winbind_SamLogon_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   18663             : }
   18664             : 
   18665           0 : static PyObject *py_winbind_SamLogon_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   18666             : {
   18667           0 :         const struct ndr_interface_call *call = NULL;
   18668           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj);
   18669           0 :         struct ndr_pull *pull = NULL;
   18670             :         enum ndr_err_code err;
   18671             : 
   18672           0 :         if (ndr_table_winbind.num_calls < 28) {
   18673           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SamLogon_ndr_unpack");
   18674           0 :                 return NULL;
   18675             :         }
   18676           0 :         call = &ndr_table_winbind.calls[27];
   18677             : 
   18678           0 :         pull = ndr_pull_init_blob(blob, object);
   18679           0 :         if (pull == NULL) {
   18680           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   18681           0 :                 return NULL;
   18682             :         }
   18683             : 
   18684           0 :         pull->flags |= ndr_pull_flags;
   18685             : 
   18686           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   18687           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   18688           0 :                 TALLOC_FREE(pull);
   18689           0 :                 PyErr_SetNdrError(err);
   18690           0 :                 return NULL;
   18691             :         }
   18692           0 :         if (!allow_remaining) {
   18693             :                 uint32_t highest_ofs;
   18694             : 
   18695           0 :                 if (pull->offset > pull->relative_highest_offset) {
   18696           0 :                         highest_ofs = pull->offset;
   18697             :                 } else {
   18698           0 :                         highest_ofs = pull->relative_highest_offset;
   18699             :                 }
   18700           0 :                 if (highest_ofs < pull->data_size) {
   18701           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   18702             :                                 "not all bytes consumed ofs[%u] size[%u]",
   18703             :                                 highest_ofs, pull->data_size);
   18704           0 :                         TALLOC_FREE(pull);
   18705           0 :                         PyErr_SetNdrError(err);
   18706           0 :                         return NULL;
   18707             :                 }
   18708             :         }
   18709             : 
   18710           0 :         TALLOC_FREE(pull);
   18711           0 :         Py_RETURN_NONE;
   18712             : }
   18713             : 
   18714           0 : static PyObject *py_winbind_SamLogon_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   18715             : {
   18716             :         DATA_BLOB blob;
   18717           0 :         Py_ssize_t blob_length = 0;
   18718           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   18719           0 :         PyObject *bigendian_obj = NULL;
   18720           0 :         PyObject *ndr64_obj = NULL;
   18721           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   18722           0 :         PyObject *allow_remaining_obj = NULL;
   18723           0 :         bool allow_remaining = false;
   18724             : 
   18725           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   18726             :                 discard_const_p(char *, kwnames),
   18727             :                 &blob.data, &blob_length,
   18728             :                 &bigendian_obj,
   18729             :                 &ndr64_obj,
   18730             :                 &allow_remaining_obj)) {
   18731           0 :                 return NULL;
   18732             :         }
   18733           0 :         blob.length = blob_length;
   18734             : 
   18735           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   18736           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   18737             :         }
   18738           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   18739           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   18740             :         }
   18741             : 
   18742           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   18743           0 :                 allow_remaining = true;
   18744             :         }
   18745             : 
   18746           0 :         return py_winbind_SamLogon_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   18747             : }
   18748             : 
   18749           0 : static PyObject *py_winbind_SamLogon_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   18750             : {
   18751             :         DATA_BLOB blob;
   18752           0 :         Py_ssize_t blob_length = 0;
   18753           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   18754           0 :         PyObject *bigendian_obj = NULL;
   18755           0 :         PyObject *ndr64_obj = NULL;
   18756           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   18757           0 :         PyObject *allow_remaining_obj = NULL;
   18758           0 :         bool allow_remaining = false;
   18759             : 
   18760           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   18761             :                 discard_const_p(char *, kwnames),
   18762             :                 &blob.data, &blob_length,
   18763             :                 &bigendian_obj,
   18764             :                 &ndr64_obj,
   18765             :                 &allow_remaining_obj)) {
   18766           0 :                 return NULL;
   18767             :         }
   18768           0 :         blob.length = blob_length;
   18769             : 
   18770           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   18771           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   18772             :         }
   18773           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   18774           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   18775             :         }
   18776             : 
   18777           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   18778           0 :                 allow_remaining = true;
   18779             :         }
   18780             : 
   18781           0 :         return py_winbind_SamLogon_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   18782             : }
   18783             : 
   18784           0 : static PyObject *py_winbind_SamLogon_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   18785             : {
   18786           0 :         const struct ndr_interface_call *call = NULL;
   18787           0 :         struct winbind_SamLogon *object = (struct winbind_SamLogon *)pytalloc_get_ptr(py_obj);
   18788             :         PyObject *ret;
   18789             :         char *retstr;
   18790             : 
   18791           0 :         if (ndr_table_winbind.num_calls < 28) {
   18792           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SamLogon_ndr_print");
   18793           0 :                 return NULL;
   18794             :         }
   18795           0 :         call = &ndr_table_winbind.calls[27];
   18796             : 
   18797           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   18798           0 :         ret = PyUnicode_FromString(retstr);
   18799           0 :         TALLOC_FREE(retstr);
   18800             : 
   18801           0 :         return ret;
   18802             : }
   18803             : 
   18804           0 : static PyObject *py_winbind_SamLogon_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   18805             : {
   18806           0 :         return py_winbind_SamLogon_ndr_print(py_obj, "winbind_SamLogon_in", NDR_IN);
   18807             : }
   18808             : 
   18809           0 : static PyObject *py_winbind_SamLogon_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   18810             : {
   18811           0 :         return py_winbind_SamLogon_ndr_print(py_obj, "winbind_SamLogon_out", NDR_OUT);
   18812             : }
   18813             : 
   18814             : static PyMethodDef py_winbind_SamLogon_methods[] = {
   18815             :         { "opnum", (PyCFunction)py_winbind_SamLogon_ndr_opnum, METH_NOARGS|METH_CLASS,
   18816             :                 "winbind.SamLogon.opnum() -> 27 (0x1b) " },
   18817             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SamLogon_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   18818             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   18819             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SamLogon_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   18820             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   18821             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SamLogon_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   18822             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   18823             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SamLogon_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   18824             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   18825             :         { "__ndr_print_in__", (PyCFunction)py_winbind_SamLogon_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   18826             :         { "__ndr_print_out__", (PyCFunction)py_winbind_SamLogon_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   18827             :         { NULL, NULL, 0, NULL }
   18828             : };
   18829             : 
   18830             : 
   18831             : static PyTypeObject winbind_SamLogon_Type = {
   18832             :         PyVarObject_HEAD_INIT(NULL, 0)
   18833             :         .tp_name = "winbind.SamLogon",
   18834             :         .tp_getset = py_winbind_SamLogon_getsetters,
   18835             :         .tp_methods = py_winbind_SamLogon_methods,
   18836             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   18837             :         .tp_new = py_winbind_SamLogon_new,
   18838             : };
   18839             : 
   18840           0 : static bool pack_py_winbind_SamLogon_args_in(PyObject *args, PyObject *kwargs, struct winbind_SamLogon *r)
   18841             : {
   18842             :         PyObject *py_logon_level;
   18843             :         PyObject *py_logon;
   18844             :         PyObject *py_validation_level;
   18845           0 :         const char *kwnames[] = {
   18846             :                 "logon_level", "logon", "validation_level", NULL
   18847             :         };
   18848             : 
   18849           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:winbind_SamLogon", discard_const_p(char *, kwnames), &py_logon_level, &py_logon, &py_validation_level)) {
   18850           0 :                 return false;
   18851             :         }
   18852             : 
   18853           0 :         if (py_logon_level == NULL) {
   18854           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_level");
   18855           0 :                 return false;
   18856             :         }
   18857             :         {
   18858           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.logon_level));
   18859           0 :                 if (PyLong_Check(py_logon_level)) {
   18860             :                         unsigned long long test_var;
   18861           0 :                         test_var = PyLong_AsUnsignedLongLong(py_logon_level);
   18862           0 :                         if (PyErr_Occurred() != NULL) {
   18863           0 :                                 return false;
   18864             :                         }
   18865           0 :                         if (test_var > uint_max) {
   18866           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   18867             :                                   PyLong_Type.tp_name, uint_max, test_var);
   18868           0 :                                 return false;
   18869             :                         }
   18870           0 :                         r->in.logon_level = test_var;
   18871             :                 } else {
   18872           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   18873             :                           PyLong_Type.tp_name);
   18874           0 :                         return false;
   18875             :                 }
   18876             :         }
   18877           0 :         if (py_logon == NULL) {
   18878           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon");
   18879           0 :                 return false;
   18880             :         }
   18881             :         {
   18882             :                 union netr_LogonLevel *logon_switch_0;
   18883           0 :                 logon_switch_0 = (union netr_LogonLevel *)pyrpc_export_union(netr_LogonLevel_Type, r, r->in.logon_level, py_logon, "union netr_LogonLevel");
   18884           0 :                 if (logon_switch_0 == NULL) {
   18885           0 :                         return false;
   18886             :                 }
   18887           0 :                 r->in.logon = *logon_switch_0;
   18888             :         }
   18889           0 :         if (py_validation_level == NULL) {
   18890           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.validation_level");
   18891           0 :                 return false;
   18892             :         }
   18893             :         {
   18894           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.validation_level));
   18895           0 :                 if (PyLong_Check(py_validation_level)) {
   18896             :                         unsigned long long test_var;
   18897           0 :                         test_var = PyLong_AsUnsignedLongLong(py_validation_level);
   18898           0 :                         if (PyErr_Occurred() != NULL) {
   18899           0 :                                 return false;
   18900             :                         }
   18901           0 :                         if (test_var > uint_max) {
   18902           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   18903             :                                   PyLong_Type.tp_name, uint_max, test_var);
   18904           0 :                                 return false;
   18905             :                         }
   18906           0 :                         r->in.validation_level = test_var;
   18907             :                 } else {
   18908           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   18909             :                           PyLong_Type.tp_name);
   18910           0 :                         return false;
   18911             :                 }
   18912             :         }
   18913           0 :         return true;
   18914             : }
   18915             : 
   18916           0 : static PyObject *unpack_py_winbind_SamLogon_args_out(struct winbind_SamLogon *r)
   18917             : {
   18918             :         PyObject *result;
   18919             :         PyObject *py_validation;
   18920             :         PyObject *py_authoritative;
   18921           0 :         result = PyTuple_New(2);
   18922           0 :         py_validation = pyrpc_import_union(netr_Validation_Type, r, r->in.validation_level, &r->out.validation, "union netr_Validation");
   18923           0 :         if (py_validation == NULL) {
   18924           0 :                 return NULL;
   18925             :         }
   18926           0 :         PyTuple_SetItem(result, 0, py_validation);
   18927           0 :         py_authoritative = PyLong_FromLong((uint16_t)r->out.authoritative);
   18928           0 :         PyTuple_SetItem(result, 1, py_authoritative);
   18929           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   18930           0 :                 PyErr_SetNTSTATUS(r->out.result);
   18931           0 :                 return NULL;
   18932             :         }
   18933             : 
   18934           0 :         return result;
   18935             : }
   18936             : 
   18937             : 
   18938           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_site_name(PyObject *obj, void *closure)
   18939             : {
   18940           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
   18941             :         PyObject *py_site_name;
   18942           0 :         if (object->in.site_name == NULL) {
   18943           0 :                 Py_RETURN_NONE;
   18944             :         }
   18945           0 :         if (object->in.site_name == NULL) {
   18946           0 :                 py_site_name = Py_None;
   18947           0 :                 Py_INCREF(py_site_name);
   18948             :         } else {
   18949           0 :                 if (object->in.site_name == NULL) {
   18950           0 :                         py_site_name = Py_None;
   18951           0 :                         Py_INCREF(py_site_name);
   18952             :                 } else {
   18953           0 :                         py_site_name = PyUnicode_Decode(object->in.site_name, strlen(object->in.site_name), "utf-8", "ignore");
   18954             :                 }
   18955             :         }
   18956           0 :         return py_site_name;
   18957             : }
   18958             : 
   18959           0 : static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure)
   18960             : {
   18961           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
   18962           0 :         if (value == NULL) {
   18963           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.site_name");
   18964           0 :                 return -1;
   18965             :         }
   18966           0 :         if (value == Py_None) {
   18967           0 :                 object->in.site_name = NULL;
   18968             :         } else {
   18969           0 :                 object->in.site_name = NULL;
   18970             :                 {
   18971             :                         const char *test_str;
   18972             :                         const char *talloc_str;
   18973           0 :                         PyObject *unicode = NULL;
   18974           0 :                         if (PyUnicode_Check(value)) {
   18975           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   18976           0 :                                 if (unicode == NULL) {
   18977           0 :                                         PyErr_NoMemory();
   18978           0 :                                         return -1;
   18979             :                                 }
   18980           0 :                                 test_str = PyBytes_AS_STRING(unicode);
   18981           0 :                         } else if (PyBytes_Check(value)) {
   18982           0 :                                 test_str = PyBytes_AS_STRING(value);
   18983             :                         } else {
   18984           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   18985           0 :                                 return -1;
   18986             :                         }
   18987           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   18988           0 :                         if (unicode != NULL) {
   18989           0 :                                 Py_DECREF(unicode);
   18990             :                         }
   18991           0 :                         if (talloc_str == NULL) {
   18992           0 :                                 PyErr_NoMemory();
   18993           0 :                                 return -1;
   18994             :                         }
   18995           0 :                         object->in.site_name = talloc_str;
   18996             :                 }
   18997             :         }
   18998           0 :         return 0;
   18999             : }
   19000             : 
   19001           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_ttl(PyObject *obj, void *closure)
   19002             : {
   19003           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
   19004             :         PyObject *py_dns_ttl;
   19005           0 :         py_dns_ttl = PyLong_FromUnsignedLongLong((uint32_t)object->in.dns_ttl);
   19006           0 :         return py_dns_ttl;
   19007             : }
   19008             : 
   19009           0 : static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_ttl(PyObject *py_obj, PyObject *value, void *closure)
   19010             : {
   19011           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
   19012           0 :         if (value == NULL) {
   19013           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dns_ttl");
   19014           0 :                 return -1;
   19015             :         }
   19016             :         {
   19017           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dns_ttl));
   19018           0 :                 if (PyLong_Check(value)) {
   19019             :                         unsigned long long test_var;
   19020           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   19021           0 :                         if (PyErr_Occurred() != NULL) {
   19022           0 :                                 return -1;
   19023             :                         }
   19024           0 :                         if (test_var > uint_max) {
   19025           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   19026             :                                   PyLong_Type.tp_name, uint_max, test_var);
   19027           0 :                                 return -1;
   19028             :                         }
   19029           0 :                         object->in.dns_ttl = test_var;
   19030             :                 } else {
   19031           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   19032             :                           PyLong_Type.tp_name);
   19033           0 :                         return -1;
   19034             :                 }
   19035             :         }
   19036           0 :         return 0;
   19037             : }
   19038             : 
   19039           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_names(PyObject *obj, void *closure)
   19040             : {
   19041           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
   19042             :         PyObject *py_dns_names;
   19043           0 :         if (object->in.dns_names == NULL) {
   19044           0 :                 Py_RETURN_NONE;
   19045             :         }
   19046           0 :         py_dns_names = pytalloc_reference_ex(NL_DNS_NAME_INFO_ARRAY_Type, object->in.dns_names, object->in.dns_names);
   19047           0 :         return py_dns_names;
   19048             : }
   19049             : 
   19050           0 : static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_names(PyObject *py_obj, PyObject *value, void *closure)
   19051             : {
   19052           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
   19053           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dns_names));
   19054           0 :         if (value == NULL) {
   19055           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dns_names");
   19056           0 :                 return -1;
   19057             :         }
   19058           0 :         object->in.dns_names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dns_names);
   19059           0 :         if (object->in.dns_names == NULL) {
   19060           0 :                 PyErr_NoMemory();
   19061           0 :                 return -1;
   19062             :         }
   19063           0 :         PY_CHECK_TYPE(NL_DNS_NAME_INFO_ARRAY_Type, value, return -1;);
   19064           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   19065           0 :                 PyErr_NoMemory();
   19066           0 :                 return -1;
   19067             :         }
   19068           0 :         object->in.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(value);
   19069           0 :         return 0;
   19070             : }
   19071             : 
   19072           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_out_get_dns_names(PyObject *obj, void *closure)
   19073             : {
   19074           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
   19075             :         PyObject *py_dns_names;
   19076           0 :         if (object->out.dns_names == NULL) {
   19077           0 :                 Py_RETURN_NONE;
   19078             :         }
   19079           0 :         py_dns_names = pytalloc_reference_ex(NL_DNS_NAME_INFO_ARRAY_Type, object->out.dns_names, object->out.dns_names);
   19080           0 :         return py_dns_names;
   19081             : }
   19082             : 
   19083           0 : static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_out_set_dns_names(PyObject *py_obj, PyObject *value, void *closure)
   19084             : {
   19085           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
   19086           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dns_names));
   19087           0 :         if (value == NULL) {
   19088           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dns_names");
   19089           0 :                 return -1;
   19090             :         }
   19091           0 :         object->out.dns_names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dns_names);
   19092           0 :         if (object->out.dns_names == NULL) {
   19093           0 :                 PyErr_NoMemory();
   19094           0 :                 return -1;
   19095             :         }
   19096           0 :         PY_CHECK_TYPE(NL_DNS_NAME_INFO_ARRAY_Type, value, return -1;);
   19097           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   19098           0 :                 PyErr_NoMemory();
   19099           0 :                 return -1;
   19100             :         }
   19101           0 :         object->out.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(value);
   19102           0 :         return 0;
   19103             : }
   19104             : 
   19105           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_get_result(PyObject *obj, void *closure)
   19106             : {
   19107           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
   19108             :         PyObject *py_result;
   19109           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   19110           0 :         return py_result;
   19111             : }
   19112             : 
   19113           0 : static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_set_result(PyObject *py_obj, PyObject *value, void *closure)
   19114             : {
   19115           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
   19116           0 :         if (value == NULL) {
   19117           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   19118           0 :                 return -1;
   19119             :         }
   19120           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   19121           0 :         return 0;
   19122             : }
   19123             : 
   19124             : static PyGetSetDef py_winbind_DsrUpdateReadOnlyServerDnsRecords_getsetters[] = {
   19125             :         {
   19126             :                 .name = discard_const_p(char, "in_site_name"),
   19127             :                 .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_site_name,
   19128             :                 .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_site_name,
   19129             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
   19130             :         },
   19131             :         {
   19132             :                 .name = discard_const_p(char, "in_dns_ttl"),
   19133             :                 .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_ttl,
   19134             :                 .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_ttl,
   19135             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
   19136             :         },
   19137             :         {
   19138             :                 .name = discard_const_p(char, "in_dns_names"),
   19139             :                 .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_names,
   19140             :                 .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_names,
   19141             :                 .doc = discard_const_p(char, "PIDL-generated element of base type NL_DNS_NAME_INFO_ARRAY")
   19142             :         },
   19143             :         {
   19144             :                 .name = discard_const_p(char, "out_dns_names"),
   19145             :                 .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_out_get_dns_names,
   19146             :                 .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_out_set_dns_names,
   19147             :                 .doc = discard_const_p(char, "PIDL-generated element of base type NL_DNS_NAME_INFO_ARRAY")
   19148             :         },
   19149             :         {
   19150             :                 .name = discard_const_p(char, "result"),
   19151             :                 .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_get_result,
   19152             :                 .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_set_result,
   19153             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   19154             :         },
   19155             :         { .name = NULL }
   19156             : };
   19157             : 
   19158           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   19159             : {
   19160           0 :         PyObject *self = pytalloc_new(struct winbind_DsrUpdateReadOnlyServerDnsRecords, type);
   19161           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *_self = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(self);
   19162           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
   19163           0 :         _self->in.dns_names = talloc_zero(mem_ctx, struct NL_DNS_NAME_INFO_ARRAY);
   19164           0 :         _self->out.dns_names = talloc_zero(mem_ctx, struct NL_DNS_NAME_INFO_ARRAY);
   19165           0 :         return self;
   19166             : }
   19167             : 
   19168           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   19169             : {
   19170             : 
   19171             : 
   19172           0 :         return PyLong_FromLong(28);
   19173             : }
   19174             : 
   19175           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   19176             : {
   19177           0 :         const struct ndr_interface_call *call = NULL;
   19178           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
   19179           0 :         PyObject *ret = NULL;
   19180           0 :         struct ndr_push *push = NULL;
   19181             :         DATA_BLOB blob;
   19182             :         enum ndr_err_code err;
   19183             : 
   19184           0 :         if (ndr_table_winbind.num_calls < 29) {
   19185           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack");
   19186           0 :                 return NULL;
   19187             :         }
   19188           0 :         call = &ndr_table_winbind.calls[28];
   19189             : 
   19190           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   19191           0 :         if (push == NULL) {
   19192           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   19193           0 :                 return NULL;
   19194             :         }
   19195             : 
   19196           0 :         push->flags |= ndr_push_flags;
   19197             : 
   19198           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   19199           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   19200           0 :                 TALLOC_FREE(push);
   19201           0 :                 PyErr_SetNdrError(err);
   19202           0 :                 return NULL;
   19203             :         }
   19204           0 :         blob = ndr_push_blob(push);
   19205           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   19206           0 :         TALLOC_FREE(push);
   19207           0 :         return ret;
   19208             : }
   19209             : 
   19210           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   19211             : {
   19212           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   19213           0 :         PyObject *bigendian_obj = NULL;
   19214           0 :         PyObject *ndr64_obj = NULL;
   19215           0 :         uint32_t ndr_push_flags = 0;
   19216             : 
   19217           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   19218             :                 discard_const_p(char *, kwnames),
   19219             :                 &bigendian_obj,
   19220             :                 &ndr64_obj)) {
   19221           0 :                 return NULL;
   19222             :         }
   19223             : 
   19224           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   19225           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   19226             :         }
   19227           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   19228           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   19229             :         }
   19230             : 
   19231           0 :         return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   19232             : }
   19233             : 
   19234           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   19235             : {
   19236           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   19237           0 :         PyObject *bigendian_obj = NULL;
   19238           0 :         PyObject *ndr64_obj = NULL;
   19239           0 :         uint32_t ndr_push_flags = 0;
   19240             : 
   19241           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   19242             :                 discard_const_p(char *, kwnames),
   19243             :                 &bigendian_obj,
   19244             :                 &ndr64_obj)) {
   19245           0 :                 return NULL;
   19246             :         }
   19247             : 
   19248           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   19249           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   19250             :         }
   19251           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   19252           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   19253             :         }
   19254             : 
   19255           0 :         return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   19256             : }
   19257             : 
   19258           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   19259             : {
   19260           0 :         const struct ndr_interface_call *call = NULL;
   19261           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
   19262           0 :         struct ndr_pull *pull = NULL;
   19263             :         enum ndr_err_code err;
   19264             : 
   19265           0 :         if (ndr_table_winbind.num_calls < 29) {
   19266           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack");
   19267           0 :                 return NULL;
   19268             :         }
   19269           0 :         call = &ndr_table_winbind.calls[28];
   19270             : 
   19271           0 :         pull = ndr_pull_init_blob(blob, object);
   19272           0 :         if (pull == NULL) {
   19273           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   19274           0 :                 return NULL;
   19275             :         }
   19276             : 
   19277           0 :         pull->flags |= ndr_pull_flags;
   19278             : 
   19279           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   19280           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   19281           0 :                 TALLOC_FREE(pull);
   19282           0 :                 PyErr_SetNdrError(err);
   19283           0 :                 return NULL;
   19284             :         }
   19285           0 :         if (!allow_remaining) {
   19286             :                 uint32_t highest_ofs;
   19287             : 
   19288           0 :                 if (pull->offset > pull->relative_highest_offset) {
   19289           0 :                         highest_ofs = pull->offset;
   19290             :                 } else {
   19291           0 :                         highest_ofs = pull->relative_highest_offset;
   19292             :                 }
   19293           0 :                 if (highest_ofs < pull->data_size) {
   19294           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   19295             :                                 "not all bytes consumed ofs[%u] size[%u]",
   19296             :                                 highest_ofs, pull->data_size);
   19297           0 :                         TALLOC_FREE(pull);
   19298           0 :                         PyErr_SetNdrError(err);
   19299           0 :                         return NULL;
   19300             :                 }
   19301             :         }
   19302             : 
   19303           0 :         TALLOC_FREE(pull);
   19304           0 :         Py_RETURN_NONE;
   19305             : }
   19306             : 
   19307           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   19308             : {
   19309             :         DATA_BLOB blob;
   19310           0 :         Py_ssize_t blob_length = 0;
   19311           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   19312           0 :         PyObject *bigendian_obj = NULL;
   19313           0 :         PyObject *ndr64_obj = NULL;
   19314           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   19315           0 :         PyObject *allow_remaining_obj = NULL;
   19316           0 :         bool allow_remaining = false;
   19317             : 
   19318           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   19319             :                 discard_const_p(char *, kwnames),
   19320             :                 &blob.data, &blob_length,
   19321             :                 &bigendian_obj,
   19322             :                 &ndr64_obj,
   19323             :                 &allow_remaining_obj)) {
   19324           0 :                 return NULL;
   19325             :         }
   19326           0 :         blob.length = blob_length;
   19327             : 
   19328           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   19329           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   19330             :         }
   19331           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   19332           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   19333             :         }
   19334             : 
   19335           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   19336           0 :                 allow_remaining = true;
   19337             :         }
   19338             : 
   19339           0 :         return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   19340             : }
   19341             : 
   19342           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   19343             : {
   19344             :         DATA_BLOB blob;
   19345           0 :         Py_ssize_t blob_length = 0;
   19346           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   19347           0 :         PyObject *bigendian_obj = NULL;
   19348           0 :         PyObject *ndr64_obj = NULL;
   19349           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   19350           0 :         PyObject *allow_remaining_obj = NULL;
   19351           0 :         bool allow_remaining = false;
   19352             : 
   19353           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   19354             :                 discard_const_p(char *, kwnames),
   19355             :                 &blob.data, &blob_length,
   19356             :                 &bigendian_obj,
   19357             :                 &ndr64_obj,
   19358             :                 &allow_remaining_obj)) {
   19359           0 :                 return NULL;
   19360             :         }
   19361           0 :         blob.length = blob_length;
   19362             : 
   19363           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   19364           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   19365             :         }
   19366           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   19367           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   19368             :         }
   19369             : 
   19370           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   19371           0 :                 allow_remaining = true;
   19372             :         }
   19373             : 
   19374           0 :         return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   19375             : }
   19376             : 
   19377           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   19378             : {
   19379           0 :         const struct ndr_interface_call *call = NULL;
   19380           0 :         struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
   19381             :         PyObject *ret;
   19382             :         char *retstr;
   19383             : 
   19384           0 :         if (ndr_table_winbind.num_calls < 29) {
   19385           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print");
   19386           0 :                 return NULL;
   19387             :         }
   19388           0 :         call = &ndr_table_winbind.calls[28];
   19389             : 
   19390           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   19391           0 :         ret = PyUnicode_FromString(retstr);
   19392           0 :         TALLOC_FREE(retstr);
   19393             : 
   19394           0 :         return ret;
   19395             : }
   19396             : 
   19397           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   19398             : {
   19399           0 :         return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print(py_obj, "winbind_DsrUpdateReadOnlyServerDnsRecords_in", NDR_IN);
   19400             : }
   19401             : 
   19402           0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   19403             : {
   19404           0 :         return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print(py_obj, "winbind_DsrUpdateReadOnlyServerDnsRecords_out", NDR_OUT);
   19405             : }
   19406             : 
   19407             : static PyMethodDef py_winbind_DsrUpdateReadOnlyServerDnsRecords_methods[] = {
   19408             :         { "opnum", (PyCFunction)py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_opnum, METH_NOARGS|METH_CLASS,
   19409             :                 "winbind.DsrUpdateReadOnlyServerDnsRecords.opnum() -> 28 (0x1c) " },
   19410             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   19411             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   19412             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   19413             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   19414             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   19415             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   19416             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   19417             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   19418             :         { "__ndr_print_in__", (PyCFunction)py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   19419             :         { "__ndr_print_out__", (PyCFunction)py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   19420             :         { NULL, NULL, 0, NULL }
   19421             : };
   19422             : 
   19423             : 
   19424             : static PyTypeObject winbind_DsrUpdateReadOnlyServerDnsRecords_Type = {
   19425             :         PyVarObject_HEAD_INIT(NULL, 0)
   19426             :         .tp_name = "winbind.DsrUpdateReadOnlyServerDnsRecords",
   19427             :         .tp_getset = py_winbind_DsrUpdateReadOnlyServerDnsRecords_getsetters,
   19428             :         .tp_methods = py_winbind_DsrUpdateReadOnlyServerDnsRecords_methods,
   19429             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   19430             :         .tp_new = py_winbind_DsrUpdateReadOnlyServerDnsRecords_new,
   19431             : };
   19432             : 
   19433           5 : static bool pack_py_winbind_DsrUpdateReadOnlyServerDnsRecords_args_in(PyObject *args, PyObject *kwargs, struct winbind_DsrUpdateReadOnlyServerDnsRecords *r)
   19434             : {
   19435             :         PyObject *py_site_name;
   19436             :         PyObject *py_dns_ttl;
   19437             :         PyObject *py_dns_names;
   19438           5 :         const char *kwnames[] = {
   19439             :                 "site_name", "dns_ttl", "dns_names", NULL
   19440             :         };
   19441             : 
   19442           5 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:winbind_DsrUpdateReadOnlyServerDnsRecords", discard_const_p(char *, kwnames), &py_site_name, &py_dns_ttl, &py_dns_names)) {
   19443           0 :                 return false;
   19444             :         }
   19445             : 
   19446           5 :         if (py_site_name == NULL) {
   19447           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.site_name");
   19448           0 :                 return false;
   19449             :         }
   19450           5 :         if (py_site_name == Py_None) {
   19451           0 :                 r->in.site_name = NULL;
   19452             :         } else {
   19453           5 :                 r->in.site_name = NULL;
   19454             :                 {
   19455             :                         const char *test_str;
   19456             :                         const char *talloc_str;
   19457           5 :                         PyObject *unicode = NULL;
   19458           5 :                         if (PyUnicode_Check(py_site_name)) {
   19459           5 :                                 unicode = PyUnicode_AsEncodedString(py_site_name, "utf-8", "ignore");
   19460           5 :                                 if (unicode == NULL) {
   19461           0 :                                         PyErr_NoMemory();
   19462           0 :                                         return false;
   19463             :                                 }
   19464           5 :                                 test_str = PyBytes_AS_STRING(unicode);
   19465           0 :                         } else if (PyBytes_Check(py_site_name)) {
   19466           0 :                                 test_str = PyBytes_AS_STRING(py_site_name);
   19467             :                         } else {
   19468           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_site_name)->tp_name);
   19469           0 :                                 return false;
   19470             :                         }
   19471           5 :                         talloc_str = talloc_strdup(r, test_str);
   19472           5 :                         if (unicode != NULL) {
   19473           5 :                                 Py_DECREF(unicode);
   19474             :                         }
   19475           5 :                         if (talloc_str == NULL) {
   19476           0 :                                 PyErr_NoMemory();
   19477           0 :                                 return false;
   19478             :                         }
   19479           5 :                         r->in.site_name = talloc_str;
   19480             :                 }
   19481             :         }
   19482           5 :         if (py_dns_ttl == NULL) {
   19483           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dns_ttl");
   19484           0 :                 return false;
   19485             :         }
   19486             :         {
   19487           5 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dns_ttl));
   19488           5 :                 if (PyLong_Check(py_dns_ttl)) {
   19489             :                         unsigned long long test_var;
   19490           5 :                         test_var = PyLong_AsUnsignedLongLong(py_dns_ttl);
   19491           5 :                         if (PyErr_Occurred() != NULL) {
   19492           0 :                                 return false;
   19493             :                         }
   19494           5 :                         if (test_var > uint_max) {
   19495           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   19496             :                                   PyLong_Type.tp_name, uint_max, test_var);
   19497           0 :                                 return false;
   19498             :                         }
   19499           5 :                         r->in.dns_ttl = test_var;
   19500             :                 } else {
   19501           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   19502             :                           PyLong_Type.tp_name);
   19503           0 :                         return false;
   19504             :                 }
   19505             :         }
   19506           5 :         if (py_dns_names == NULL) {
   19507           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dns_names");
   19508           0 :                 return false;
   19509             :         }
   19510           5 :         r->in.dns_names = talloc_ptrtype(r, r->in.dns_names);
   19511           5 :         if (r->in.dns_names == NULL) {
   19512           0 :                 PyErr_NoMemory();
   19513           0 :                 return false;
   19514             :         }
   19515           5 :         PY_CHECK_TYPE(NL_DNS_NAME_INFO_ARRAY_Type, py_dns_names, return false;);
   19516           5 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_dns_names)) == NULL) {
   19517           0 :                 PyErr_NoMemory();
   19518           0 :                 return false;
   19519             :         }
   19520           5 :         r->in.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(py_dns_names);
   19521           5 :         return true;
   19522             : }
   19523             : 
   19524           5 : static PyObject *unpack_py_winbind_DsrUpdateReadOnlyServerDnsRecords_args_out(struct winbind_DsrUpdateReadOnlyServerDnsRecords *r)
   19525             : {
   19526             :         PyObject *result;
   19527             :         PyObject *py_dns_names;
   19528           5 :         py_dns_names = pytalloc_reference_ex(NL_DNS_NAME_INFO_ARRAY_Type, r->out.dns_names, r->out.dns_names);
   19529           5 :         result = py_dns_names;
   19530           5 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   19531           0 :                 PyErr_SetNTSTATUS(r->out.result);
   19532           0 :                 return NULL;
   19533             :         }
   19534             : 
   19535           5 :         return result;
   19536             : }
   19537             : 
   19538             : 
   19539           0 : static PyObject *py_winbind_LogonControl_in_get_function_code(PyObject *obj, void *closure)
   19540             : {
   19541           0 :         struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(obj);
   19542             :         PyObject *py_function_code;
   19543           0 :         py_function_code = PyLong_FromUnsignedLongLong((uint32_t)object->in.function_code);
   19544           0 :         return py_function_code;
   19545             : }
   19546             : 
   19547           0 : static int py_winbind_LogonControl_in_set_function_code(PyObject *py_obj, PyObject *value, void *closure)
   19548             : {
   19549           0 :         struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj);
   19550           0 :         if (value == NULL) {
   19551           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.function_code");
   19552           0 :                 return -1;
   19553             :         }
   19554             :         {
   19555           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.function_code));
   19556           0 :                 if (PyLong_Check(value)) {
   19557             :                         unsigned long long test_var;
   19558           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   19559           0 :                         if (PyErr_Occurred() != NULL) {
   19560           0 :                                 return -1;
   19561             :                         }
   19562           0 :                         if (test_var > uint_max) {
   19563           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   19564             :                                   PyLong_Type.tp_name, uint_max, test_var);
   19565           0 :                                 return -1;
   19566             :                         }
   19567           0 :                         object->in.function_code = test_var;
   19568             :                 } else {
   19569           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   19570             :                           PyLong_Type.tp_name);
   19571           0 :                         return -1;
   19572             :                 }
   19573             :         }
   19574           0 :         return 0;
   19575             : }
   19576             : 
   19577           0 : static PyObject *py_winbind_LogonControl_in_get_level(PyObject *obj, void *closure)
   19578             : {
   19579           0 :         struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(obj);
   19580             :         PyObject *py_level;
   19581           0 :         py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level);
   19582           0 :         return py_level;
   19583             : }
   19584             : 
   19585           0 : static int py_winbind_LogonControl_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
   19586             : {
   19587           0 :         struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj);
   19588           0 :         if (value == NULL) {
   19589           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
   19590           0 :                 return -1;
   19591             :         }
   19592             :         {
   19593           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
   19594           0 :                 if (PyLong_Check(value)) {
   19595             :                         unsigned long long test_var;
   19596           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   19597           0 :                         if (PyErr_Occurred() != NULL) {
   19598           0 :                                 return -1;
   19599             :                         }
   19600           0 :                         if (test_var > uint_max) {
   19601           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   19602             :                                   PyLong_Type.tp_name, uint_max, test_var);
   19603           0 :                                 return -1;
   19604             :                         }
   19605           0 :                         object->in.level = test_var;
   19606             :                 } else {
   19607           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   19608             :                           PyLong_Type.tp_name);
   19609           0 :                         return -1;
   19610             :                 }
   19611             :         }
   19612           0 :         return 0;
   19613             : }
   19614             : 
   19615           0 : static PyObject *py_winbind_LogonControl_in_get_data(PyObject *obj, void *closure)
   19616             : {
   19617           0 :         struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(obj);
   19618             :         PyObject *py_data;
   19619           0 :         if (object->in.data == NULL) {
   19620           0 :                 Py_RETURN_NONE;
   19621             :         }
   19622           0 :         py_data = pyrpc_import_union(netr_CONTROL_DATA_INFORMATION_Type, object->in.data, object->in.function_code, object->in.data, "union netr_CONTROL_DATA_INFORMATION");
   19623           0 :         if (py_data == NULL) {
   19624           0 :                 return NULL;
   19625             :         }
   19626           0 :         return py_data;
   19627             : }
   19628             : 
   19629           0 : static int py_winbind_LogonControl_in_set_data(PyObject *py_obj, PyObject *value, void *closure)
   19630             : {
   19631           0 :         struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj);
   19632           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.data));
   19633           0 :         if (value == NULL) {
   19634           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.data");
   19635           0 :                 return -1;
   19636             :         }
   19637           0 :         object->in.data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.data);
   19638           0 :         if (object->in.data == NULL) {
   19639           0 :                 PyErr_NoMemory();
   19640           0 :                 return -1;
   19641             :         }
   19642             :         {
   19643             :                 union netr_CONTROL_DATA_INFORMATION *data_switch_1;
   19644           0 :                 data_switch_1 = (union netr_CONTROL_DATA_INFORMATION *)pyrpc_export_union(netr_CONTROL_DATA_INFORMATION_Type, pytalloc_get_mem_ctx(py_obj), object->in.function_code, value, "union netr_CONTROL_DATA_INFORMATION");
   19645           0 :                 if (data_switch_1 == NULL) {
   19646           0 :                         return -1;
   19647             :                 }
   19648           0 :                 object->in.data = data_switch_1;
   19649             :         }
   19650           0 :         return 0;
   19651             : }
   19652             : 
   19653           0 : static PyObject *py_winbind_LogonControl_out_get_query(PyObject *obj, void *closure)
   19654             : {
   19655           0 :         struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(obj);
   19656             :         PyObject *py_query;
   19657           0 :         if (object->out.query == NULL) {
   19658           0 :                 Py_RETURN_NONE;
   19659             :         }
   19660           0 :         py_query = pyrpc_import_union(netr_CONTROL_QUERY_INFORMATION_Type, object->out.query, object->in.level, object->out.query, "union netr_CONTROL_QUERY_INFORMATION");
   19661           0 :         if (py_query == NULL) {
   19662           0 :                 return NULL;
   19663             :         }
   19664           0 :         return py_query;
   19665             : }
   19666             : 
   19667           0 : static int py_winbind_LogonControl_out_set_query(PyObject *py_obj, PyObject *value, void *closure)
   19668             : {
   19669           0 :         struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj);
   19670           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.query));
   19671           0 :         if (value == NULL) {
   19672           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.query");
   19673           0 :                 return -1;
   19674             :         }
   19675           0 :         object->out.query = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.query);
   19676           0 :         if (object->out.query == NULL) {
   19677           0 :                 PyErr_NoMemory();
   19678           0 :                 return -1;
   19679             :         }
   19680             :         {
   19681             :                 union netr_CONTROL_QUERY_INFORMATION *query_switch_1;
   19682           0 :                 query_switch_1 = (union netr_CONTROL_QUERY_INFORMATION *)pyrpc_export_union(netr_CONTROL_QUERY_INFORMATION_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union netr_CONTROL_QUERY_INFORMATION");
   19683           0 :                 if (query_switch_1 == NULL) {
   19684           0 :                         return -1;
   19685             :                 }
   19686           0 :                 object->out.query = query_switch_1;
   19687             :         }
   19688           0 :         return 0;
   19689             : }
   19690             : 
   19691           0 : static PyObject *py_winbind_LogonControl_get_result(PyObject *obj, void *closure)
   19692             : {
   19693           0 :         struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(obj);
   19694             :         PyObject *py_result;
   19695           0 :         py_result = PyErr_FromWERROR(object->out.result);
   19696           0 :         return py_result;
   19697             : }
   19698             : 
   19699           0 : static int py_winbind_LogonControl_set_result(PyObject *py_obj, PyObject *value, void *closure)
   19700             : {
   19701           0 :         struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj);
   19702           0 :         if (value == NULL) {
   19703           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   19704           0 :                 return -1;
   19705             :         }
   19706           0 :         object->out.result = W_ERROR(PyLong_AsLong(value));
   19707           0 :         return 0;
   19708             : }
   19709             : 
   19710             : static PyGetSetDef py_winbind_LogonControl_getsetters[] = {
   19711             :         {
   19712             :                 .name = discard_const_p(char, "in_function_code"),
   19713             :                 .get = py_winbind_LogonControl_in_get_function_code,
   19714             :                 .set = py_winbind_LogonControl_in_set_function_code,
   19715             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonControlCode")
   19716             :         },
   19717             :         {
   19718             :                 .name = discard_const_p(char, "in_level"),
   19719             :                 .get = py_winbind_LogonControl_in_get_level,
   19720             :                 .set = py_winbind_LogonControl_in_set_level,
   19721             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
   19722             :         },
   19723             :         {
   19724             :                 .name = discard_const_p(char, "in_data"),
   19725             :                 .get = py_winbind_LogonControl_in_get_data,
   19726             :                 .set = py_winbind_LogonControl_in_set_data,
   19727             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_CONTROL_DATA_INFORMATION")
   19728             :         },
   19729             :         {
   19730             :                 .name = discard_const_p(char, "out_query"),
   19731             :                 .get = py_winbind_LogonControl_out_get_query,
   19732             :                 .set = py_winbind_LogonControl_out_set_query,
   19733             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_CONTROL_QUERY_INFORMATION")
   19734             :         },
   19735             :         {
   19736             :                 .name = discard_const_p(char, "result"),
   19737             :                 .get = py_winbind_LogonControl_get_result,
   19738             :                 .set = py_winbind_LogonControl_set_result,
   19739             :                 .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
   19740             :         },
   19741             :         { .name = NULL }
   19742             : };
   19743             : 
   19744           0 : static PyObject *py_winbind_LogonControl_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   19745             : {
   19746           0 :         PyObject *self = pytalloc_new(struct winbind_LogonControl, type);
   19747           0 :         struct winbind_LogonControl *_self = (struct winbind_LogonControl *)pytalloc_get_ptr(self);
   19748           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
   19749           0 :         _self->in.data = talloc_zero(mem_ctx, union netr_CONTROL_DATA_INFORMATION);
   19750           0 :         _self->out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
   19751           0 :         return self;
   19752             : }
   19753             : 
   19754           0 : static PyObject *py_winbind_LogonControl_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   19755             : {
   19756             : 
   19757             : 
   19758           0 :         return PyLong_FromLong(29);
   19759             : }
   19760             : 
   19761           0 : static PyObject *py_winbind_LogonControl_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   19762             : {
   19763           0 :         const struct ndr_interface_call *call = NULL;
   19764           0 :         struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj);
   19765           0 :         PyObject *ret = NULL;
   19766           0 :         struct ndr_push *push = NULL;
   19767             :         DATA_BLOB blob;
   19768             :         enum ndr_err_code err;
   19769             : 
   19770           0 :         if (ndr_table_winbind.num_calls < 30) {
   19771           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_LogonControl_ndr_pack");
   19772           0 :                 return NULL;
   19773             :         }
   19774           0 :         call = &ndr_table_winbind.calls[29];
   19775             : 
   19776           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   19777           0 :         if (push == NULL) {
   19778           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   19779           0 :                 return NULL;
   19780             :         }
   19781             : 
   19782           0 :         push->flags |= ndr_push_flags;
   19783             : 
   19784           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   19785           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   19786           0 :                 TALLOC_FREE(push);
   19787           0 :                 PyErr_SetNdrError(err);
   19788           0 :                 return NULL;
   19789             :         }
   19790           0 :         blob = ndr_push_blob(push);
   19791           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   19792           0 :         TALLOC_FREE(push);
   19793           0 :         return ret;
   19794             : }
   19795             : 
   19796           0 : static PyObject *py_winbind_LogonControl_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   19797             : {
   19798           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   19799           0 :         PyObject *bigendian_obj = NULL;
   19800           0 :         PyObject *ndr64_obj = NULL;
   19801           0 :         uint32_t ndr_push_flags = 0;
   19802             : 
   19803           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   19804             :                 discard_const_p(char *, kwnames),
   19805             :                 &bigendian_obj,
   19806             :                 &ndr64_obj)) {
   19807           0 :                 return NULL;
   19808             :         }
   19809             : 
   19810           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   19811           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   19812             :         }
   19813           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   19814           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   19815             :         }
   19816             : 
   19817           0 :         return py_winbind_LogonControl_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   19818             : }
   19819             : 
   19820           0 : static PyObject *py_winbind_LogonControl_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   19821             : {
   19822           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   19823           0 :         PyObject *bigendian_obj = NULL;
   19824           0 :         PyObject *ndr64_obj = NULL;
   19825           0 :         uint32_t ndr_push_flags = 0;
   19826             : 
   19827           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   19828             :                 discard_const_p(char *, kwnames),
   19829             :                 &bigendian_obj,
   19830             :                 &ndr64_obj)) {
   19831           0 :                 return NULL;
   19832             :         }
   19833             : 
   19834           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   19835           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   19836             :         }
   19837           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   19838           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   19839             :         }
   19840             : 
   19841           0 :         return py_winbind_LogonControl_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   19842             : }
   19843             : 
   19844           0 : static PyObject *py_winbind_LogonControl_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   19845             : {
   19846           0 :         const struct ndr_interface_call *call = NULL;
   19847           0 :         struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj);
   19848           0 :         struct ndr_pull *pull = NULL;
   19849             :         enum ndr_err_code err;
   19850             : 
   19851           0 :         if (ndr_table_winbind.num_calls < 30) {
   19852           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_LogonControl_ndr_unpack");
   19853           0 :                 return NULL;
   19854             :         }
   19855           0 :         call = &ndr_table_winbind.calls[29];
   19856             : 
   19857           0 :         pull = ndr_pull_init_blob(blob, object);
   19858           0 :         if (pull == NULL) {
   19859           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   19860           0 :                 return NULL;
   19861             :         }
   19862             : 
   19863           0 :         pull->flags |= ndr_pull_flags;
   19864             : 
   19865           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   19866           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   19867           0 :                 TALLOC_FREE(pull);
   19868           0 :                 PyErr_SetNdrError(err);
   19869           0 :                 return NULL;
   19870             :         }
   19871           0 :         if (!allow_remaining) {
   19872             :                 uint32_t highest_ofs;
   19873             : 
   19874           0 :                 if (pull->offset > pull->relative_highest_offset) {
   19875           0 :                         highest_ofs = pull->offset;
   19876             :                 } else {
   19877           0 :                         highest_ofs = pull->relative_highest_offset;
   19878             :                 }
   19879           0 :                 if (highest_ofs < pull->data_size) {
   19880           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   19881             :                                 "not all bytes consumed ofs[%u] size[%u]",
   19882             :                                 highest_ofs, pull->data_size);
   19883           0 :                         TALLOC_FREE(pull);
   19884           0 :                         PyErr_SetNdrError(err);
   19885           0 :                         return NULL;
   19886             :                 }
   19887             :         }
   19888             : 
   19889           0 :         TALLOC_FREE(pull);
   19890           0 :         Py_RETURN_NONE;
   19891             : }
   19892             : 
   19893           0 : static PyObject *py_winbind_LogonControl_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   19894             : {
   19895             :         DATA_BLOB blob;
   19896           0 :         Py_ssize_t blob_length = 0;
   19897           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   19898           0 :         PyObject *bigendian_obj = NULL;
   19899           0 :         PyObject *ndr64_obj = NULL;
   19900           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   19901           0 :         PyObject *allow_remaining_obj = NULL;
   19902           0 :         bool allow_remaining = false;
   19903             : 
   19904           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   19905             :                 discard_const_p(char *, kwnames),
   19906             :                 &blob.data, &blob_length,
   19907             :                 &bigendian_obj,
   19908             :                 &ndr64_obj,
   19909             :                 &allow_remaining_obj)) {
   19910           0 :                 return NULL;
   19911             :         }
   19912           0 :         blob.length = blob_length;
   19913             : 
   19914           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   19915           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   19916             :         }
   19917           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   19918           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   19919             :         }
   19920             : 
   19921           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   19922           0 :                 allow_remaining = true;
   19923             :         }
   19924             : 
   19925           0 :         return py_winbind_LogonControl_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   19926             : }
   19927             : 
   19928           0 : static PyObject *py_winbind_LogonControl_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   19929             : {
   19930             :         DATA_BLOB blob;
   19931           0 :         Py_ssize_t blob_length = 0;
   19932           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   19933           0 :         PyObject *bigendian_obj = NULL;
   19934           0 :         PyObject *ndr64_obj = NULL;
   19935           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   19936           0 :         PyObject *allow_remaining_obj = NULL;
   19937           0 :         bool allow_remaining = false;
   19938             : 
   19939           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   19940             :                 discard_const_p(char *, kwnames),
   19941             :                 &blob.data, &blob_length,
   19942             :                 &bigendian_obj,
   19943             :                 &ndr64_obj,
   19944             :                 &allow_remaining_obj)) {
   19945           0 :                 return NULL;
   19946             :         }
   19947           0 :         blob.length = blob_length;
   19948             : 
   19949           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   19950           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   19951             :         }
   19952           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   19953           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   19954             :         }
   19955             : 
   19956           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   19957           0 :                 allow_remaining = true;
   19958             :         }
   19959             : 
   19960           0 :         return py_winbind_LogonControl_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   19961             : }
   19962             : 
   19963           0 : static PyObject *py_winbind_LogonControl_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   19964             : {
   19965           0 :         const struct ndr_interface_call *call = NULL;
   19966           0 :         struct winbind_LogonControl *object = (struct winbind_LogonControl *)pytalloc_get_ptr(py_obj);
   19967             :         PyObject *ret;
   19968             :         char *retstr;
   19969             : 
   19970           0 :         if (ndr_table_winbind.num_calls < 30) {
   19971           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_LogonControl_ndr_print");
   19972           0 :                 return NULL;
   19973             :         }
   19974           0 :         call = &ndr_table_winbind.calls[29];
   19975             : 
   19976           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   19977           0 :         ret = PyUnicode_FromString(retstr);
   19978           0 :         TALLOC_FREE(retstr);
   19979             : 
   19980           0 :         return ret;
   19981             : }
   19982             : 
   19983           0 : static PyObject *py_winbind_LogonControl_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   19984             : {
   19985           0 :         return py_winbind_LogonControl_ndr_print(py_obj, "winbind_LogonControl_in", NDR_IN);
   19986             : }
   19987             : 
   19988           0 : static PyObject *py_winbind_LogonControl_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   19989             : {
   19990           0 :         return py_winbind_LogonControl_ndr_print(py_obj, "winbind_LogonControl_out", NDR_OUT);
   19991             : }
   19992             : 
   19993             : static PyMethodDef py_winbind_LogonControl_methods[] = {
   19994             :         { "opnum", (PyCFunction)py_winbind_LogonControl_ndr_opnum, METH_NOARGS|METH_CLASS,
   19995             :                 "winbind.LogonControl.opnum() -> 29 (0x1d) " },
   19996             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_LogonControl_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   19997             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   19998             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_LogonControl_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   19999             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   20000             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_LogonControl_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   20001             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   20002             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_LogonControl_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   20003             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   20004             :         { "__ndr_print_in__", (PyCFunction)py_winbind_LogonControl_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   20005             :         { "__ndr_print_out__", (PyCFunction)py_winbind_LogonControl_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   20006             :         { NULL, NULL, 0, NULL }
   20007             : };
   20008             : 
   20009             : 
   20010             : static PyTypeObject winbind_LogonControl_Type = {
   20011             :         PyVarObject_HEAD_INIT(NULL, 0)
   20012             :         .tp_name = "winbind.LogonControl",
   20013             :         .tp_getset = py_winbind_LogonControl_getsetters,
   20014             :         .tp_methods = py_winbind_LogonControl_methods,
   20015             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   20016             :         .tp_new = py_winbind_LogonControl_new,
   20017             : };
   20018             : 
   20019           0 : static bool pack_py_winbind_LogonControl_args_in(PyObject *args, PyObject *kwargs, struct winbind_LogonControl *r)
   20020             : {
   20021             :         PyObject *py_function_code;
   20022             :         PyObject *py_level;
   20023             :         PyObject *py_data;
   20024           0 :         const char *kwnames[] = {
   20025             :                 "function_code", "level", "data", NULL
   20026             :         };
   20027             : 
   20028           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:winbind_LogonControl", discard_const_p(char *, kwnames), &py_function_code, &py_level, &py_data)) {
   20029           0 :                 return false;
   20030             :         }
   20031             : 
   20032           0 :         if (py_function_code == NULL) {
   20033           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.function_code");
   20034           0 :                 return false;
   20035             :         }
   20036             :         {
   20037           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.function_code));
   20038           0 :                 if (PyLong_Check(py_function_code)) {
   20039             :                         unsigned long long test_var;
   20040           0 :                         test_var = PyLong_AsUnsignedLongLong(py_function_code);
   20041           0 :                         if (PyErr_Occurred() != NULL) {
   20042           0 :                                 return false;
   20043             :                         }
   20044           0 :                         if (test_var > uint_max) {
   20045           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   20046             :                                   PyLong_Type.tp_name, uint_max, test_var);
   20047           0 :                                 return false;
   20048             :                         }
   20049           0 :                         r->in.function_code = test_var;
   20050             :                 } else {
   20051           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   20052             :                           PyLong_Type.tp_name);
   20053           0 :                         return false;
   20054             :                 }
   20055             :         }
   20056           0 :         if (py_level == NULL) {
   20057           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
   20058           0 :                 return false;
   20059             :         }
   20060             :         {
   20061           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
   20062           0 :                 if (PyLong_Check(py_level)) {
   20063             :                         unsigned long long test_var;
   20064           0 :                         test_var = PyLong_AsUnsignedLongLong(py_level);
   20065           0 :                         if (PyErr_Occurred() != NULL) {
   20066           0 :                                 return false;
   20067             :                         }
   20068           0 :                         if (test_var > uint_max) {
   20069           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   20070             :                                   PyLong_Type.tp_name, uint_max, test_var);
   20071           0 :                                 return false;
   20072             :                         }
   20073           0 :                         r->in.level = test_var;
   20074             :                 } else {
   20075           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   20076             :                           PyLong_Type.tp_name);
   20077           0 :                         return false;
   20078             :                 }
   20079             :         }
   20080           0 :         if (py_data == NULL) {
   20081           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.data");
   20082           0 :                 return false;
   20083             :         }
   20084           0 :         r->in.data = talloc_ptrtype(r, r->in.data);
   20085           0 :         if (r->in.data == NULL) {
   20086           0 :                 PyErr_NoMemory();
   20087           0 :                 return false;
   20088             :         }
   20089             :         {
   20090             :                 union netr_CONTROL_DATA_INFORMATION *data_switch_1;
   20091           0 :                 data_switch_1 = (union netr_CONTROL_DATA_INFORMATION *)pyrpc_export_union(netr_CONTROL_DATA_INFORMATION_Type, r, r->in.function_code, py_data, "union netr_CONTROL_DATA_INFORMATION");
   20092           0 :                 if (data_switch_1 == NULL) {
   20093           0 :                         return false;
   20094             :                 }
   20095           0 :                 r->in.data = data_switch_1;
   20096             :         }
   20097           0 :         return true;
   20098             : }
   20099             : 
   20100           0 : static PyObject *unpack_py_winbind_LogonControl_args_out(struct winbind_LogonControl *r)
   20101             : {
   20102             :         PyObject *result;
   20103             :         PyObject *py_query;
   20104           0 :         py_query = pyrpc_import_union(netr_CONTROL_QUERY_INFORMATION_Type, r->out.query, r->in.level, r->out.query, "union netr_CONTROL_QUERY_INFORMATION");
   20105           0 :         if (py_query == NULL) {
   20106           0 :                 return NULL;
   20107             :         }
   20108           0 :         result = py_query;
   20109           0 :         if (!W_ERROR_IS_OK(r->out.result)) {
   20110           0 :                 PyErr_SetWERROR(r->out.result);
   20111           0 :                 return NULL;
   20112             :         }
   20113             : 
   20114           0 :         return result;
   20115             : }
   20116             : 
   20117             : 
   20118           0 : static PyObject *py_winbind_GetForestTrustInformation_in_get_trusted_domain_name(PyObject *obj, void *closure)
   20119             : {
   20120           0 :         struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(obj);
   20121             :         PyObject *py_trusted_domain_name;
   20122           0 :         if (object->in.trusted_domain_name == NULL) {
   20123           0 :                 Py_RETURN_NONE;
   20124             :         }
   20125           0 :         if (object->in.trusted_domain_name == NULL) {
   20126           0 :                 py_trusted_domain_name = Py_None;
   20127           0 :                 Py_INCREF(py_trusted_domain_name);
   20128             :         } else {
   20129           0 :                 if (object->in.trusted_domain_name == NULL) {
   20130           0 :                         py_trusted_domain_name = Py_None;
   20131           0 :                         Py_INCREF(py_trusted_domain_name);
   20132             :                 } else {
   20133           0 :                         py_trusted_domain_name = PyUnicode_Decode(object->in.trusted_domain_name, strlen(object->in.trusted_domain_name), "utf-8", "ignore");
   20134             :                 }
   20135             :         }
   20136           0 :         return py_trusted_domain_name;
   20137             : }
   20138             : 
   20139           0 : static int py_winbind_GetForestTrustInformation_in_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure)
   20140             : {
   20141           0 :         struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
   20142           0 :         if (value == NULL) {
   20143           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trusted_domain_name");
   20144           0 :                 return -1;
   20145             :         }
   20146           0 :         if (value == Py_None) {
   20147           0 :                 object->in.trusted_domain_name = NULL;
   20148             :         } else {
   20149           0 :                 object->in.trusted_domain_name = NULL;
   20150             :                 {
   20151             :                         const char *test_str;
   20152             :                         const char *talloc_str;
   20153           0 :                         PyObject *unicode = NULL;
   20154           0 :                         if (PyUnicode_Check(value)) {
   20155           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
   20156           0 :                                 if (unicode == NULL) {
   20157           0 :                                         PyErr_NoMemory();
   20158           0 :                                         return -1;
   20159             :                                 }
   20160           0 :                                 test_str = PyBytes_AS_STRING(unicode);
   20161           0 :                         } else if (PyBytes_Check(value)) {
   20162           0 :                                 test_str = PyBytes_AS_STRING(value);
   20163             :                         } else {
   20164           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
   20165           0 :                                 return -1;
   20166             :                         }
   20167           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
   20168           0 :                         if (unicode != NULL) {
   20169           0 :                                 Py_DECREF(unicode);
   20170             :                         }
   20171           0 :                         if (talloc_str == NULL) {
   20172           0 :                                 PyErr_NoMemory();
   20173           0 :                                 return -1;
   20174             :                         }
   20175           0 :                         object->in.trusted_domain_name = talloc_str;
   20176             :                 }
   20177             :         }
   20178           0 :         return 0;
   20179             : }
   20180             : 
   20181           0 : static PyObject *py_winbind_GetForestTrustInformation_in_get_flags(PyObject *obj, void *closure)
   20182             : {
   20183           0 :         struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(obj);
   20184             :         PyObject *py_flags;
   20185           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
   20186           0 :         return py_flags;
   20187             : }
   20188             : 
   20189           0 : static int py_winbind_GetForestTrustInformation_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
   20190             : {
   20191           0 :         struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
   20192           0 :         if (value == NULL) {
   20193           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
   20194           0 :                 return -1;
   20195             :         }
   20196             :         {
   20197           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
   20198           0 :                 if (PyLong_Check(value)) {
   20199             :                         unsigned long long test_var;
   20200           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
   20201           0 :                         if (PyErr_Occurred() != NULL) {
   20202           0 :                                 return -1;
   20203             :                         }
   20204           0 :                         if (test_var > uint_max) {
   20205           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   20206             :                                   PyLong_Type.tp_name, uint_max, test_var);
   20207           0 :                                 return -1;
   20208             :                         }
   20209           0 :                         object->in.flags = test_var;
   20210             :                 } else {
   20211           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   20212             :                           PyLong_Type.tp_name);
   20213           0 :                         return -1;
   20214             :                 }
   20215             :         }
   20216           0 :         return 0;
   20217             : }
   20218             : 
   20219           0 : static PyObject *py_winbind_GetForestTrustInformation_out_get_forest_trust_info(PyObject *obj, void *closure)
   20220             : {
   20221           0 :         struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(obj);
   20222             :         PyObject *py_forest_trust_info;
   20223           0 :         if (object->out.forest_trust_info == NULL) {
   20224           0 :                 Py_RETURN_NONE;
   20225             :         }
   20226           0 :         if (*object->out.forest_trust_info == NULL) {
   20227           0 :                 py_forest_trust_info = Py_None;
   20228           0 :                 Py_INCREF(py_forest_trust_info);
   20229             :         } else {
   20230           0 :                 py_forest_trust_info = pytalloc_reference_ex(lsa_ForestTrustInformation_Type, *object->out.forest_trust_info, *object->out.forest_trust_info);
   20231             :         }
   20232           0 :         return py_forest_trust_info;
   20233             : }
   20234             : 
   20235           0 : static int py_winbind_GetForestTrustInformation_out_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure)
   20236             : {
   20237           0 :         struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
   20238           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.forest_trust_info));
   20239           0 :         if (value == NULL) {
   20240           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.forest_trust_info");
   20241           0 :                 return -1;
   20242             :         }
   20243           0 :         object->out.forest_trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.forest_trust_info);
   20244           0 :         if (object->out.forest_trust_info == NULL) {
   20245           0 :                 PyErr_NoMemory();
   20246           0 :                 return -1;
   20247             :         }
   20248           0 :         if (value == Py_None) {
   20249           0 :                 *object->out.forest_trust_info = NULL;
   20250             :         } else {
   20251           0 :                 *object->out.forest_trust_info = NULL;
   20252           0 :                 PY_CHECK_TYPE(lsa_ForestTrustInformation_Type, value, return -1;);
   20253           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   20254           0 :                         PyErr_NoMemory();
   20255           0 :                         return -1;
   20256             :                 }
   20257           0 :                 *object->out.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(value);
   20258             :         }
   20259           0 :         return 0;
   20260             : }
   20261             : 
   20262           0 : static PyObject *py_winbind_GetForestTrustInformation_get_result(PyObject *obj, void *closure)
   20263             : {
   20264           0 :         struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(obj);
   20265             :         PyObject *py_result;
   20266           0 :         py_result = PyErr_FromWERROR(object->out.result);
   20267           0 :         return py_result;
   20268             : }
   20269             : 
   20270           0 : static int py_winbind_GetForestTrustInformation_set_result(PyObject *py_obj, PyObject *value, void *closure)
   20271             : {
   20272           0 :         struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
   20273           0 :         if (value == NULL) {
   20274           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   20275           0 :                 return -1;
   20276             :         }
   20277           0 :         object->out.result = W_ERROR(PyLong_AsLong(value));
   20278           0 :         return 0;
   20279             : }
   20280             : 
   20281             : static PyGetSetDef py_winbind_GetForestTrustInformation_getsetters[] = {
   20282             :         {
   20283             :                 .name = discard_const_p(char, "in_trusted_domain_name"),
   20284             :                 .get = py_winbind_GetForestTrustInformation_in_get_trusted_domain_name,
   20285             :                 .set = py_winbind_GetForestTrustInformation_in_set_trusted_domain_name,
   20286             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
   20287             :         },
   20288             :         {
   20289             :                 .name = discard_const_p(char, "in_flags"),
   20290             :                 .get = py_winbind_GetForestTrustInformation_in_get_flags,
   20291             :                 .set = py_winbind_GetForestTrustInformation_in_set_flags,
   20292             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
   20293             :         },
   20294             :         {
   20295             :                 .name = discard_const_p(char, "out_forest_trust_info"),
   20296             :                 .get = py_winbind_GetForestTrustInformation_out_get_forest_trust_info,
   20297             :                 .set = py_winbind_GetForestTrustInformation_out_set_forest_trust_info,
   20298             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustInformation")
   20299             :         },
   20300             :         {
   20301             :                 .name = discard_const_p(char, "result"),
   20302             :                 .get = py_winbind_GetForestTrustInformation_get_result,
   20303             :                 .set = py_winbind_GetForestTrustInformation_set_result,
   20304             :                 .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
   20305             :         },
   20306             :         { .name = NULL }
   20307             : };
   20308             : 
   20309           0 : static PyObject *py_winbind_GetForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   20310             : {
   20311           0 :         PyObject *self = pytalloc_new(struct winbind_GetForestTrustInformation, type);
   20312           0 :         struct winbind_GetForestTrustInformation *_self = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(self);
   20313           0 :         TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
   20314             :         /* a pointer to a NULL pointer */
   20315           0 :         _self->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *);
   20316           0 :         return self;
   20317             : }
   20318             : 
   20319           0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   20320             : {
   20321             : 
   20322             : 
   20323           0 :         return PyLong_FromLong(30);
   20324             : }
   20325             : 
   20326           0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   20327             : {
   20328           0 :         const struct ndr_interface_call *call = NULL;
   20329           0 :         struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
   20330           0 :         PyObject *ret = NULL;
   20331           0 :         struct ndr_push *push = NULL;
   20332             :         DATA_BLOB blob;
   20333             :         enum ndr_err_code err;
   20334             : 
   20335           0 :         if (ndr_table_winbind.num_calls < 31) {
   20336           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_GetForestTrustInformation_ndr_pack");
   20337           0 :                 return NULL;
   20338             :         }
   20339           0 :         call = &ndr_table_winbind.calls[30];
   20340             : 
   20341           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   20342           0 :         if (push == NULL) {
   20343           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   20344           0 :                 return NULL;
   20345             :         }
   20346             : 
   20347           0 :         push->flags |= ndr_push_flags;
   20348             : 
   20349           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   20350           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   20351           0 :                 TALLOC_FREE(push);
   20352           0 :                 PyErr_SetNdrError(err);
   20353           0 :                 return NULL;
   20354             :         }
   20355           0 :         blob = ndr_push_blob(push);
   20356           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   20357           0 :         TALLOC_FREE(push);
   20358           0 :         return ret;
   20359             : }
   20360             : 
   20361           0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   20362             : {
   20363           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   20364           0 :         PyObject *bigendian_obj = NULL;
   20365           0 :         PyObject *ndr64_obj = NULL;
   20366           0 :         uint32_t ndr_push_flags = 0;
   20367             : 
   20368           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   20369             :                 discard_const_p(char *, kwnames),
   20370             :                 &bigendian_obj,
   20371             :                 &ndr64_obj)) {
   20372           0 :                 return NULL;
   20373             :         }
   20374             : 
   20375           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   20376           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   20377             :         }
   20378           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   20379           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   20380             :         }
   20381             : 
   20382           0 :         return py_winbind_GetForestTrustInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   20383             : }
   20384             : 
   20385           0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   20386             : {
   20387           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   20388           0 :         PyObject *bigendian_obj = NULL;
   20389           0 :         PyObject *ndr64_obj = NULL;
   20390           0 :         uint32_t ndr_push_flags = 0;
   20391             : 
   20392           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   20393             :                 discard_const_p(char *, kwnames),
   20394             :                 &bigendian_obj,
   20395             :                 &ndr64_obj)) {
   20396           0 :                 return NULL;
   20397             :         }
   20398             : 
   20399           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   20400           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   20401             :         }
   20402           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   20403           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   20404             :         }
   20405             : 
   20406           0 :         return py_winbind_GetForestTrustInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   20407             : }
   20408             : 
   20409           0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   20410             : {
   20411           0 :         const struct ndr_interface_call *call = NULL;
   20412           0 :         struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
   20413           0 :         struct ndr_pull *pull = NULL;
   20414             :         enum ndr_err_code err;
   20415             : 
   20416           0 :         if (ndr_table_winbind.num_calls < 31) {
   20417           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_GetForestTrustInformation_ndr_unpack");
   20418           0 :                 return NULL;
   20419             :         }
   20420           0 :         call = &ndr_table_winbind.calls[30];
   20421             : 
   20422           0 :         pull = ndr_pull_init_blob(blob, object);
   20423           0 :         if (pull == NULL) {
   20424           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   20425           0 :                 return NULL;
   20426             :         }
   20427             : 
   20428           0 :         pull->flags |= ndr_pull_flags;
   20429             : 
   20430           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   20431           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   20432           0 :                 TALLOC_FREE(pull);
   20433           0 :                 PyErr_SetNdrError(err);
   20434           0 :                 return NULL;
   20435             :         }
   20436           0 :         if (!allow_remaining) {
   20437             :                 uint32_t highest_ofs;
   20438             : 
   20439           0 :                 if (pull->offset > pull->relative_highest_offset) {
   20440           0 :                         highest_ofs = pull->offset;
   20441             :                 } else {
   20442           0 :                         highest_ofs = pull->relative_highest_offset;
   20443             :                 }
   20444           0 :                 if (highest_ofs < pull->data_size) {
   20445           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   20446             :                                 "not all bytes consumed ofs[%u] size[%u]",
   20447             :                                 highest_ofs, pull->data_size);
   20448           0 :                         TALLOC_FREE(pull);
   20449           0 :                         PyErr_SetNdrError(err);
   20450           0 :                         return NULL;
   20451             :                 }
   20452             :         }
   20453             : 
   20454           0 :         TALLOC_FREE(pull);
   20455           0 :         Py_RETURN_NONE;
   20456             : }
   20457             : 
   20458           0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   20459             : {
   20460             :         DATA_BLOB blob;
   20461           0 :         Py_ssize_t blob_length = 0;
   20462           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   20463           0 :         PyObject *bigendian_obj = NULL;
   20464           0 :         PyObject *ndr64_obj = NULL;
   20465           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   20466           0 :         PyObject *allow_remaining_obj = NULL;
   20467           0 :         bool allow_remaining = false;
   20468             : 
   20469           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   20470             :                 discard_const_p(char *, kwnames),
   20471             :                 &blob.data, &blob_length,
   20472             :                 &bigendian_obj,
   20473             :                 &ndr64_obj,
   20474             :                 &allow_remaining_obj)) {
   20475           0 :                 return NULL;
   20476             :         }
   20477           0 :         blob.length = blob_length;
   20478             : 
   20479           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   20480           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   20481             :         }
   20482           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   20483           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   20484             :         }
   20485             : 
   20486           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   20487           0 :                 allow_remaining = true;
   20488             :         }
   20489             : 
   20490           0 :         return py_winbind_GetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   20491             : }
   20492             : 
   20493           0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   20494             : {
   20495             :         DATA_BLOB blob;
   20496           0 :         Py_ssize_t blob_length = 0;
   20497           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   20498           0 :         PyObject *bigendian_obj = NULL;
   20499           0 :         PyObject *ndr64_obj = NULL;
   20500           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   20501           0 :         PyObject *allow_remaining_obj = NULL;
   20502           0 :         bool allow_remaining = false;
   20503             : 
   20504           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   20505             :                 discard_const_p(char *, kwnames),
   20506             :                 &blob.data, &blob_length,
   20507             :                 &bigendian_obj,
   20508             :                 &ndr64_obj,
   20509             :                 &allow_remaining_obj)) {
   20510           0 :                 return NULL;
   20511             :         }
   20512           0 :         blob.length = blob_length;
   20513             : 
   20514           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   20515           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   20516             :         }
   20517           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   20518           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   20519             :         }
   20520             : 
   20521           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   20522           0 :                 allow_remaining = true;
   20523             :         }
   20524             : 
   20525           0 :         return py_winbind_GetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   20526             : }
   20527             : 
   20528           0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   20529             : {
   20530           0 :         const struct ndr_interface_call *call = NULL;
   20531           0 :         struct winbind_GetForestTrustInformation *object = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
   20532             :         PyObject *ret;
   20533             :         char *retstr;
   20534             : 
   20535           0 :         if (ndr_table_winbind.num_calls < 31) {
   20536           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_GetForestTrustInformation_ndr_print");
   20537           0 :                 return NULL;
   20538             :         }
   20539           0 :         call = &ndr_table_winbind.calls[30];
   20540             : 
   20541           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   20542           0 :         ret = PyUnicode_FromString(retstr);
   20543           0 :         TALLOC_FREE(retstr);
   20544             : 
   20545           0 :         return ret;
   20546             : }
   20547             : 
   20548           0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   20549             : {
   20550           0 :         return py_winbind_GetForestTrustInformation_ndr_print(py_obj, "winbind_GetForestTrustInformation_in", NDR_IN);
   20551             : }
   20552             : 
   20553           0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   20554             : {
   20555           0 :         return py_winbind_GetForestTrustInformation_ndr_print(py_obj, "winbind_GetForestTrustInformation_out", NDR_OUT);
   20556             : }
   20557             : 
   20558             : static PyMethodDef py_winbind_GetForestTrustInformation_methods[] = {
   20559             :         { "opnum", (PyCFunction)py_winbind_GetForestTrustInformation_ndr_opnum, METH_NOARGS|METH_CLASS,
   20560             :                 "winbind.GetForestTrustInformation.opnum() -> 30 (0x1e) " },
   20561             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_GetForestTrustInformation_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   20562             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   20563             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_GetForestTrustInformation_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   20564             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   20565             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_GetForestTrustInformation_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   20566             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   20567             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_GetForestTrustInformation_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   20568             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   20569             :         { "__ndr_print_in__", (PyCFunction)py_winbind_GetForestTrustInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   20570             :         { "__ndr_print_out__", (PyCFunction)py_winbind_GetForestTrustInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   20571             :         { NULL, NULL, 0, NULL }
   20572             : };
   20573             : 
   20574             : 
   20575             : static PyTypeObject winbind_GetForestTrustInformation_Type = {
   20576             :         PyVarObject_HEAD_INIT(NULL, 0)
   20577             :         .tp_name = "winbind.GetForestTrustInformation",
   20578             :         .tp_getset = py_winbind_GetForestTrustInformation_getsetters,
   20579             :         .tp_methods = py_winbind_GetForestTrustInformation_methods,
   20580             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   20581             :         .tp_new = py_winbind_GetForestTrustInformation_new,
   20582             : };
   20583             : 
   20584           0 : static bool pack_py_winbind_GetForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct winbind_GetForestTrustInformation *r)
   20585             : {
   20586             :         PyObject *py_trusted_domain_name;
   20587             :         PyObject *py_flags;
   20588           0 :         const char *kwnames[] = {
   20589             :                 "trusted_domain_name", "flags", NULL
   20590             :         };
   20591             : 
   20592           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:winbind_GetForestTrustInformation", discard_const_p(char *, kwnames), &py_trusted_domain_name, &py_flags)) {
   20593           0 :                 return false;
   20594             :         }
   20595             : 
   20596           0 :         if (py_trusted_domain_name == NULL) {
   20597           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trusted_domain_name");
   20598           0 :                 return false;
   20599             :         }
   20600           0 :         if (py_trusted_domain_name == Py_None) {
   20601           0 :                 r->in.trusted_domain_name = NULL;
   20602             :         } else {
   20603           0 :                 r->in.trusted_domain_name = NULL;
   20604             :                 {
   20605             :                         const char *test_str;
   20606             :                         const char *talloc_str;
   20607           0 :                         PyObject *unicode = NULL;
   20608           0 :                         if (PyUnicode_Check(py_trusted_domain_name)) {
   20609           0 :                                 unicode = PyUnicode_AsEncodedString(py_trusted_domain_name, "utf-8", "ignore");
   20610           0 :                                 if (unicode == NULL) {
   20611           0 :                                         PyErr_NoMemory();
   20612           0 :                                         return false;
   20613             :                                 }
   20614           0 :                                 test_str = PyBytes_AS_STRING(unicode);
   20615           0 :                         } else if (PyBytes_Check(py_trusted_domain_name)) {
   20616           0 :                                 test_str = PyBytes_AS_STRING(py_trusted_domain_name);
   20617             :                         } else {
   20618           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_trusted_domain_name)->tp_name);
   20619           0 :                                 return false;
   20620             :                         }
   20621           0 :                         talloc_str = talloc_strdup(r, test_str);
   20622           0 :                         if (unicode != NULL) {
   20623           0 :                                 Py_DECREF(unicode);
   20624             :                         }
   20625           0 :                         if (talloc_str == NULL) {
   20626           0 :                                 PyErr_NoMemory();
   20627           0 :                                 return false;
   20628             :                         }
   20629           0 :                         r->in.trusted_domain_name = talloc_str;
   20630             :                 }
   20631             :         }
   20632           0 :         if (py_flags == NULL) {
   20633           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
   20634           0 :                 return false;
   20635             :         }
   20636             :         {
   20637           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
   20638           0 :                 if (PyLong_Check(py_flags)) {
   20639             :                         unsigned long long test_var;
   20640           0 :                         test_var = PyLong_AsUnsignedLongLong(py_flags);
   20641           0 :                         if (PyErr_Occurred() != NULL) {
   20642           0 :                                 return false;
   20643             :                         }
   20644           0 :                         if (test_var > uint_max) {
   20645           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
   20646             :                                   PyLong_Type.tp_name, uint_max, test_var);
   20647           0 :                                 return false;
   20648             :                         }
   20649           0 :                         r->in.flags = test_var;
   20650             :                 } else {
   20651           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
   20652             :                           PyLong_Type.tp_name);
   20653           0 :                         return false;
   20654             :                 }
   20655             :         }
   20656           0 :         return true;
   20657             : }
   20658             : 
   20659           0 : static PyObject *unpack_py_winbind_GetForestTrustInformation_args_out(struct winbind_GetForestTrustInformation *r)
   20660             : {
   20661             :         PyObject *result;
   20662             :         PyObject *py_forest_trust_info;
   20663           0 :         if (*r->out.forest_trust_info == NULL) {
   20664           0 :                 py_forest_trust_info = Py_None;
   20665           0 :                 Py_INCREF(py_forest_trust_info);
   20666             :         } else {
   20667           0 :                 py_forest_trust_info = pytalloc_reference_ex(lsa_ForestTrustInformation_Type, *r->out.forest_trust_info, *r->out.forest_trust_info);
   20668             :         }
   20669           0 :         result = py_forest_trust_info;
   20670           0 :         if (!W_ERROR_IS_OK(r->out.result)) {
   20671           0 :                 PyErr_SetWERROR(r->out.result);
   20672           0 :                 return NULL;
   20673             :         }
   20674             : 
   20675           0 :         return result;
   20676             : }
   20677             : 
   20678             : 
   20679           0 : static PyObject *py_winbind_SendToSam_in_get_message(PyObject *obj, void *closure)
   20680             : {
   20681           0 :         struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(obj);
   20682             :         PyObject *py_message;
   20683           0 :         py_message = pytalloc_reference_ex(netr_SendToSamBase_Type, pytalloc_get_mem_ctx(obj), &object->in.message);
   20684           0 :         return py_message;
   20685             : }
   20686             : 
   20687           0 : static int py_winbind_SendToSam_in_set_message(PyObject *py_obj, PyObject *value, void *closure)
   20688             : {
   20689           0 :         struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(py_obj);
   20690           0 :         if (value == NULL) {
   20691           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.message");
   20692           0 :                 return -1;
   20693             :         }
   20694           0 :         PY_CHECK_TYPE(netr_SendToSamBase_Type, value, return -1;);
   20695           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
   20696           0 :                 PyErr_NoMemory();
   20697           0 :                 return -1;
   20698             :         }
   20699           0 :         object->in.message = *(struct netr_SendToSamBase *)pytalloc_get_ptr(value);
   20700           0 :         return 0;
   20701             : }
   20702             : 
   20703           0 : static PyObject *py_winbind_SendToSam_get_result(PyObject *obj, void *closure)
   20704             : {
   20705           0 :         struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(obj);
   20706             :         PyObject *py_result;
   20707           0 :         py_result = PyErr_FromNTSTATUS(object->out.result);
   20708           0 :         return py_result;
   20709             : }
   20710             : 
   20711           0 : static int py_winbind_SendToSam_set_result(PyObject *py_obj, PyObject *value, void *closure)
   20712             : {
   20713           0 :         struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(py_obj);
   20714           0 :         if (value == NULL) {
   20715           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
   20716           0 :                 return -1;
   20717             :         }
   20718           0 :         object->out.result = NT_STATUS(PyLong_AsLong(value));
   20719           0 :         return 0;
   20720             : }
   20721             : 
   20722             : static PyGetSetDef py_winbind_SendToSam_getsetters[] = {
   20723             :         {
   20724             :                 .name = discard_const_p(char, "in_message"),
   20725             :                 .get = py_winbind_SendToSam_in_get_message,
   20726             :                 .set = py_winbind_SendToSam_in_set_message,
   20727             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_SendToSamBase")
   20728             :         },
   20729             :         {
   20730             :                 .name = discard_const_p(char, "result"),
   20731             :                 .get = py_winbind_SendToSam_get_result,
   20732             :                 .set = py_winbind_SendToSam_set_result,
   20733             :                 .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
   20734             :         },
   20735             :         { .name = NULL }
   20736             : };
   20737             : 
   20738           0 : static PyObject *py_winbind_SendToSam_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   20739             : {
   20740           0 :         PyObject *self = pytalloc_new(struct winbind_SendToSam, type);
   20741           0 :         return self;
   20742             : }
   20743             : 
   20744           0 : static PyObject *py_winbind_SendToSam_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
   20745             : {
   20746             : 
   20747             : 
   20748           0 :         return PyLong_FromLong(31);
   20749             : }
   20750             : 
   20751           0 : static PyObject *py_winbind_SendToSam_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
   20752             : {
   20753           0 :         const struct ndr_interface_call *call = NULL;
   20754           0 :         struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(py_obj);
   20755           0 :         PyObject *ret = NULL;
   20756           0 :         struct ndr_push *push = NULL;
   20757             :         DATA_BLOB blob;
   20758             :         enum ndr_err_code err;
   20759             : 
   20760           0 :         if (ndr_table_winbind.num_calls < 32) {
   20761           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SendToSam_ndr_pack");
   20762           0 :                 return NULL;
   20763             :         }
   20764           0 :         call = &ndr_table_winbind.calls[31];
   20765             : 
   20766           0 :         push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
   20767           0 :         if (push == NULL) {
   20768           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   20769           0 :                 return NULL;
   20770             :         }
   20771             : 
   20772           0 :         push->flags |= ndr_push_flags;
   20773             : 
   20774           0 :         err = call->ndr_push(push, ndr_inout_flags, object);
   20775           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   20776           0 :                 TALLOC_FREE(push);
   20777           0 :                 PyErr_SetNdrError(err);
   20778           0 :                 return NULL;
   20779             :         }
   20780           0 :         blob = ndr_push_blob(push);
   20781           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
   20782           0 :         TALLOC_FREE(push);
   20783           0 :         return ret;
   20784             : }
   20785             : 
   20786           0 : static PyObject *py_winbind_SendToSam_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   20787             : {
   20788           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   20789           0 :         PyObject *bigendian_obj = NULL;
   20790           0 :         PyObject *ndr64_obj = NULL;
   20791           0 :         uint32_t ndr_push_flags = 0;
   20792             : 
   20793           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
   20794             :                 discard_const_p(char *, kwnames),
   20795             :                 &bigendian_obj,
   20796             :                 &ndr64_obj)) {
   20797           0 :                 return NULL;
   20798             :         }
   20799             : 
   20800           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   20801           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   20802             :         }
   20803           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   20804           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   20805             :         }
   20806             : 
   20807           0 :         return py_winbind_SendToSam_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
   20808             : }
   20809             : 
   20810           0 : static PyObject *py_winbind_SendToSam_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   20811             : {
   20812           0 :         const char * const kwnames[] = { "bigendian", "ndr64", NULL };
   20813           0 :         PyObject *bigendian_obj = NULL;
   20814           0 :         PyObject *ndr64_obj = NULL;
   20815           0 :         uint32_t ndr_push_flags = 0;
   20816             : 
   20817           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
   20818             :                 discard_const_p(char *, kwnames),
   20819             :                 &bigendian_obj,
   20820             :                 &ndr64_obj)) {
   20821           0 :                 return NULL;
   20822             :         }
   20823             : 
   20824           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   20825           0 :                 ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
   20826             :         }
   20827           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   20828           0 :                 ndr_push_flags |= LIBNDR_FLAG_NDR64;
   20829             :         }
   20830             : 
   20831           0 :         return py_winbind_SendToSam_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
   20832             : }
   20833             : 
   20834           0 : static PyObject *py_winbind_SendToSam_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
   20835             : {
   20836           0 :         const struct ndr_interface_call *call = NULL;
   20837           0 :         struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(py_obj);
   20838           0 :         struct ndr_pull *pull = NULL;
   20839             :         enum ndr_err_code err;
   20840             : 
   20841           0 :         if (ndr_table_winbind.num_calls < 32) {
   20842           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SendToSam_ndr_unpack");
   20843           0 :                 return NULL;
   20844             :         }
   20845           0 :         call = &ndr_table_winbind.calls[31];
   20846             : 
   20847           0 :         pull = ndr_pull_init_blob(blob, object);
   20848           0 :         if (pull == NULL) {
   20849           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
   20850           0 :                 return NULL;
   20851             :         }
   20852             : 
   20853           0 :         pull->flags |= ndr_pull_flags;
   20854             : 
   20855           0 :         err = call->ndr_pull(pull, ndr_inout_flags, object);
   20856           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
   20857           0 :                 TALLOC_FREE(pull);
   20858           0 :                 PyErr_SetNdrError(err);
   20859           0 :                 return NULL;
   20860             :         }
   20861           0 :         if (!allow_remaining) {
   20862             :                 uint32_t highest_ofs;
   20863             : 
   20864           0 :                 if (pull->offset > pull->relative_highest_offset) {
   20865           0 :                         highest_ofs = pull->offset;
   20866             :                 } else {
   20867           0 :                         highest_ofs = pull->relative_highest_offset;
   20868             :                 }
   20869           0 :                 if (highest_ofs < pull->data_size) {
   20870           0 :                         err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
   20871             :                                 "not all bytes consumed ofs[%u] size[%u]",
   20872             :                                 highest_ofs, pull->data_size);
   20873           0 :                         TALLOC_FREE(pull);
   20874           0 :                         PyErr_SetNdrError(err);
   20875           0 :                         return NULL;
   20876             :                 }
   20877             :         }
   20878             : 
   20879           0 :         TALLOC_FREE(pull);
   20880           0 :         Py_RETURN_NONE;
   20881             : }
   20882             : 
   20883           0 : static PyObject *py_winbind_SendToSam_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   20884             : {
   20885             :         DATA_BLOB blob;
   20886           0 :         Py_ssize_t blob_length = 0;
   20887           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   20888           0 :         PyObject *bigendian_obj = NULL;
   20889           0 :         PyObject *ndr64_obj = NULL;
   20890           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   20891           0 :         PyObject *allow_remaining_obj = NULL;
   20892           0 :         bool allow_remaining = false;
   20893             : 
   20894           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
   20895             :                 discard_const_p(char *, kwnames),
   20896             :                 &blob.data, &blob_length,
   20897             :                 &bigendian_obj,
   20898             :                 &ndr64_obj,
   20899             :                 &allow_remaining_obj)) {
   20900           0 :                 return NULL;
   20901             :         }
   20902           0 :         blob.length = blob_length;
   20903             : 
   20904           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   20905           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   20906             :         }
   20907           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   20908           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   20909             :         }
   20910             : 
   20911           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   20912           0 :                 allow_remaining = true;
   20913             :         }
   20914             : 
   20915           0 :         return py_winbind_SendToSam_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
   20916             : }
   20917             : 
   20918           0 : static PyObject *py_winbind_SendToSam_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
   20919             : {
   20920             :         DATA_BLOB blob;
   20921           0 :         Py_ssize_t blob_length = 0;
   20922           0 :         const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
   20923           0 :         PyObject *bigendian_obj = NULL;
   20924           0 :         PyObject *ndr64_obj = NULL;
   20925           0 :         uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
   20926           0 :         PyObject *allow_remaining_obj = NULL;
   20927           0 :         bool allow_remaining = false;
   20928             : 
   20929           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
   20930             :                 discard_const_p(char *, kwnames),
   20931             :                 &blob.data, &blob_length,
   20932             :                 &bigendian_obj,
   20933             :                 &ndr64_obj,
   20934             :                 &allow_remaining_obj)) {
   20935           0 :                 return NULL;
   20936             :         }
   20937           0 :         blob.length = blob_length;
   20938             : 
   20939           0 :         if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
   20940           0 :                 ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
   20941             :         }
   20942           0 :         if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
   20943           0 :                 ndr_pull_flags |= LIBNDR_FLAG_NDR64;
   20944             :         }
   20945             : 
   20946           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
   20947           0 :                 allow_remaining = true;
   20948             :         }
   20949             : 
   20950           0 :         return py_winbind_SendToSam_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
   20951             : }
   20952             : 
   20953           0 : static PyObject *py_winbind_SendToSam_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
   20954             : {
   20955           0 :         const struct ndr_interface_call *call = NULL;
   20956           0 :         struct winbind_SendToSam *object = (struct winbind_SendToSam *)pytalloc_get_ptr(py_obj);
   20957             :         PyObject *ret;
   20958             :         char *retstr;
   20959             : 
   20960           0 :         if (ndr_table_winbind.num_calls < 32) {
   20961           0 :                 PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SendToSam_ndr_print");
   20962           0 :                 return NULL;
   20963             :         }
   20964           0 :         call = &ndr_table_winbind.calls[31];
   20965             : 
   20966           0 :         retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
   20967           0 :         ret = PyUnicode_FromString(retstr);
   20968           0 :         TALLOC_FREE(retstr);
   20969             : 
   20970           0 :         return ret;
   20971             : }
   20972             : 
   20973           0 : static PyObject *py_winbind_SendToSam_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   20974             : {
   20975           0 :         return py_winbind_SendToSam_ndr_print(py_obj, "winbind_SendToSam_in", NDR_IN);
   20976             : }
   20977             : 
   20978           0 : static PyObject *py_winbind_SendToSam_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
   20979             : {
   20980           0 :         return py_winbind_SendToSam_ndr_print(py_obj, "winbind_SendToSam_out", NDR_OUT);
   20981             : }
   20982             : 
   20983             : static PyMethodDef py_winbind_SendToSam_methods[] = {
   20984             :         { "opnum", (PyCFunction)py_winbind_SendToSam_ndr_opnum, METH_NOARGS|METH_CLASS,
   20985             :                 "winbind.SendToSam.opnum() -> 31 (0x1f) " },
   20986             :         { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SendToSam_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
   20987             :                 "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
   20988             :         { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SendToSam_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
   20989             :                 "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
   20990             :         { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SendToSam_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
   20991             :                 "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
   20992             :         { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SendToSam_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
   20993             :                 "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
   20994             :         { "__ndr_print_in__", (PyCFunction)py_winbind_SendToSam_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
   20995             :         { "__ndr_print_out__", (PyCFunction)py_winbind_SendToSam_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
   20996             :         { NULL, NULL, 0, NULL }
   20997             : };
   20998             : 
   20999             : 
   21000             : static PyTypeObject winbind_SendToSam_Type = {
   21001             :         PyVarObject_HEAD_INIT(NULL, 0)
   21002             :         .tp_name = "winbind.SendToSam",
   21003             :         .tp_getset = py_winbind_SendToSam_getsetters,
   21004             :         .tp_methods = py_winbind_SendToSam_methods,
   21005             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   21006             :         .tp_new = py_winbind_SendToSam_new,
   21007             : };
   21008             : 
   21009           0 : static bool pack_py_winbind_SendToSam_args_in(PyObject *args, PyObject *kwargs, struct winbind_SendToSam *r)
   21010             : {
   21011             :         PyObject *py_message;
   21012           0 :         const char *kwnames[] = {
   21013             :                 "message", NULL
   21014             :         };
   21015             : 
   21016           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winbind_SendToSam", discard_const_p(char *, kwnames), &py_message)) {
   21017           0 :                 return false;
   21018             :         }
   21019             : 
   21020           0 :         if (py_message == NULL) {
   21021           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.message");
   21022           0 :                 return false;
   21023             :         }
   21024           0 :         PY_CHECK_TYPE(netr_SendToSamBase_Type, py_message, return false;);
   21025           0 :         if (talloc_reference(r, pytalloc_get_mem_ctx(py_message)) == NULL) {
   21026           0 :                 PyErr_NoMemory();
   21027           0 :                 return false;
   21028             :         }
   21029           0 :         r->in.message = *(struct netr_SendToSamBase *)pytalloc_get_ptr(py_message);
   21030           0 :         return true;
   21031             : }
   21032             : 
   21033           0 : static PyObject *unpack_py_winbind_SendToSam_args_out(struct winbind_SendToSam *r)
   21034             : {
   21035             :         PyObject *result;
   21036           0 :         result = Py_None;
   21037           0 :         Py_INCREF(result);
   21038           0 :         if (NT_STATUS_IS_ERR(r->out.result)) {
   21039           0 :                 PyErr_SetNTSTATUS(r->out.result);
   21040           0 :                 return NULL;
   21041             :         }
   21042             : 
   21043           0 :         return result;
   21044             : }
   21045             : 
   21046             : const struct PyNdrRpcMethodDef py_ndr_winbind_methods[] = {
   21047             :         { "wbint_Ping", "S.wbint_Ping(in_data) -> out_data", (py_dcerpc_call_fn)dcerpc_wbint_Ping_r, (py_data_pack_fn)pack_py_wbint_Ping_args_in, (py_data_unpack_fn)unpack_py_wbint_Ping_args_out, 0, &ndr_table_winbind },
   21048             :         { "wbint_LookupSid", "S.wbint_LookupSid(sid) -> (type, domain, name)", (py_dcerpc_call_fn)dcerpc_wbint_LookupSid_r, (py_data_pack_fn)pack_py_wbint_LookupSid_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupSid_args_out, 1, &ndr_table_winbind },
   21049             :         { "wbint_LookupSids", "S.wbint_LookupSids(sids) -> (domains, names)", (py_dcerpc_call_fn)dcerpc_wbint_LookupSids_r, (py_data_pack_fn)pack_py_wbint_LookupSids_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupSids_args_out, 2, &ndr_table_winbind },
   21050             :         { "wbint_LookupName", "S.wbint_LookupName(domain, name, flags) -> (type, sid)", (py_dcerpc_call_fn)dcerpc_wbint_LookupName_r, (py_data_pack_fn)pack_py_wbint_LookupName_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupName_args_out, 3, &ndr_table_winbind },
   21051             :         { "wbint_Sids2UnixIDs", "S.wbint_Sids2UnixIDs(domains, ids) -> ids", (py_dcerpc_call_fn)dcerpc_wbint_Sids2UnixIDs_r, (py_data_pack_fn)pack_py_wbint_Sids2UnixIDs_args_in, (py_data_unpack_fn)unpack_py_wbint_Sids2UnixIDs_args_out, 4, &ndr_table_winbind },
   21052             :         { "wbint_UnixIDs2Sids", "S.wbint_UnixIDs2Sids(domain_name, domain_sid, num_ids, xids) -> (xids, sids)", (py_dcerpc_call_fn)dcerpc_wbint_UnixIDs2Sids_r, (py_data_pack_fn)pack_py_wbint_UnixIDs2Sids_args_in, (py_data_unpack_fn)unpack_py_wbint_UnixIDs2Sids_args_out, 5, &ndr_table_winbind },
   21053             :         { "wbint_AllocateUid", "S.wbint_AllocateUid() -> uid", (py_dcerpc_call_fn)dcerpc_wbint_AllocateUid_r, (py_data_pack_fn)pack_py_wbint_AllocateUid_args_in, (py_data_unpack_fn)unpack_py_wbint_AllocateUid_args_out, 6, &ndr_table_winbind },
   21054             :         { "wbint_AllocateGid", "S.wbint_AllocateGid() -> gid", (py_dcerpc_call_fn)dcerpc_wbint_AllocateGid_r, (py_data_pack_fn)pack_py_wbint_AllocateGid_args_in, (py_data_unpack_fn)unpack_py_wbint_AllocateGid_args_out, 7, &ndr_table_winbind },
   21055             :         { "wbint_GetNssInfo", "S.wbint_GetNssInfo(info) -> info", (py_dcerpc_call_fn)dcerpc_wbint_GetNssInfo_r, (py_data_pack_fn)pack_py_wbint_GetNssInfo_args_in, (py_data_unpack_fn)unpack_py_wbint_GetNssInfo_args_out, 8, &ndr_table_winbind },
   21056             :         { "wbint_LookupUserAliases", "S.wbint_LookupUserAliases(sids) -> rids", (py_dcerpc_call_fn)dcerpc_wbint_LookupUserAliases_r, (py_data_pack_fn)pack_py_wbint_LookupUserAliases_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupUserAliases_args_out, 9, &ndr_table_winbind },
   21057             :         { "wbint_LookupUserGroups", "S.wbint_LookupUserGroups(sid) -> sids", (py_dcerpc_call_fn)dcerpc_wbint_LookupUserGroups_r, (py_data_pack_fn)pack_py_wbint_LookupUserGroups_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupUserGroups_args_out, 10, &ndr_table_winbind },
   21058             :         { "wbint_QuerySequenceNumber", "S.wbint_QuerySequenceNumber() -> sequence", (py_dcerpc_call_fn)dcerpc_wbint_QuerySequenceNumber_r, (py_data_pack_fn)pack_py_wbint_QuerySequenceNumber_args_in, (py_data_unpack_fn)unpack_py_wbint_QuerySequenceNumber_args_out, 11, &ndr_table_winbind },
   21059             :         { "wbint_LookupGroupMembers", "S.wbint_LookupGroupMembers(sid, type) -> members", (py_dcerpc_call_fn)dcerpc_wbint_LookupGroupMembers_r, (py_data_pack_fn)pack_py_wbint_LookupGroupMembers_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupGroupMembers_args_out, 12, &ndr_table_winbind },
   21060             :         { "wbint_QueryGroupList", "S.wbint_QueryGroupList() -> groups", (py_dcerpc_call_fn)dcerpc_wbint_QueryGroupList_r, (py_data_pack_fn)pack_py_wbint_QueryGroupList_args_in, (py_data_unpack_fn)unpack_py_wbint_QueryGroupList_args_out, 13, &ndr_table_winbind },
   21061             :         { "wbint_QueryUserRidList", "S.wbint_QueryUserRidList() -> rids", (py_dcerpc_call_fn)dcerpc_wbint_QueryUserRidList_r, (py_data_pack_fn)pack_py_wbint_QueryUserRidList_args_in, (py_data_unpack_fn)unpack_py_wbint_QueryUserRidList_args_out, 14, &ndr_table_winbind },
   21062             :         { "wbint_DsGetDcName", "S.wbint_DsGetDcName(domain_name, domain_guid, site_name, flags) -> dc_info", (py_dcerpc_call_fn)dcerpc_wbint_DsGetDcName_r, (py_data_pack_fn)pack_py_wbint_DsGetDcName_args_in, (py_data_unpack_fn)unpack_py_wbint_DsGetDcName_args_out, 15, &ndr_table_winbind },
   21063             :         { "wbint_LookupRids", "S.wbint_LookupRids(domain_sid, rids) -> (domain_name, names)", (py_dcerpc_call_fn)dcerpc_wbint_LookupRids_r, (py_data_pack_fn)pack_py_wbint_LookupRids_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupRids_args_out, 16, &ndr_table_winbind },
   21064             :         { "wbint_CheckMachineAccount", "S.wbint_CheckMachineAccount() -> None", (py_dcerpc_call_fn)dcerpc_wbint_CheckMachineAccount_r, (py_data_pack_fn)pack_py_wbint_CheckMachineAccount_args_in, (py_data_unpack_fn)unpack_py_wbint_CheckMachineAccount_args_out, 17, &ndr_table_winbind },
   21065             :         { "wbint_ChangeMachineAccount", "S.wbint_ChangeMachineAccount(dcname) -> None", (py_dcerpc_call_fn)dcerpc_wbint_ChangeMachineAccount_r, (py_data_pack_fn)pack_py_wbint_ChangeMachineAccount_args_in, (py_data_unpack_fn)unpack_py_wbint_ChangeMachineAccount_args_out, 18, &ndr_table_winbind },
   21066             :         { "wbint_PingDc", "S.wbint_PingDc() -> dcname", (py_dcerpc_call_fn)dcerpc_wbint_PingDc_r, (py_data_pack_fn)pack_py_wbint_PingDc_args_in, (py_data_unpack_fn)unpack_py_wbint_PingDc_args_out, 19, &ndr_table_winbind },
   21067             :         { "wbint_ListTrustedDomains", "S.wbint_ListTrustedDomains(client_name, client_pid) -> domains", (py_dcerpc_call_fn)dcerpc_wbint_ListTrustedDomains_r, (py_data_pack_fn)pack_py_wbint_ListTrustedDomains_args_in, (py_data_unpack_fn)unpack_py_wbint_ListTrustedDomains_args_out, 20, &ndr_table_winbind },
   21068             :         { "wbint_PamAuth", "S.wbint_PamAuth(client_name, client_pid, flags, info, require_membership_of_sid) -> validation", (py_dcerpc_call_fn)dcerpc_wbint_PamAuth_r, (py_data_pack_fn)pack_py_wbint_PamAuth_args_in, (py_data_unpack_fn)unpack_py_wbint_PamAuth_args_out, 21, &ndr_table_winbind },
   21069             :         { "wbint_PamAuthCrap", "S.wbint_PamAuthCrap(client_name, client_pid, flags, user, domain, workstation, lm_resp, nt_resp, chal, logon_parameters, require_membership_of_sid) -> (authoritative, validation)", (py_dcerpc_call_fn)dcerpc_wbint_PamAuthCrap_r, (py_data_pack_fn)pack_py_wbint_PamAuthCrap_args_in, (py_data_unpack_fn)unpack_py_wbint_PamAuthCrap_args_out, 22, &ndr_table_winbind },
   21070             :         { "wbint_PamLogOff", "S.wbint_PamLogOff(client_name, client_pid, flags, user, krb5ccname, uid) -> None", (py_dcerpc_call_fn)dcerpc_wbint_PamLogOff_r, (py_data_pack_fn)pack_py_wbint_PamLogOff_args_in, (py_data_unpack_fn)unpack_py_wbint_PamLogOff_args_out, 23, &ndr_table_winbind },
   21071             :         { "wbint_PamAuthCrapChangePassword", "S.wbint_PamAuthCrapChangePassword(client_name, client_pid, user, domain, new_nt_pswd, old_nt_hash_enc, new_lm_pswd, old_lm_hash_enc) -> None", (py_dcerpc_call_fn)dcerpc_wbint_PamAuthCrapChangePassword_r, (py_data_pack_fn)pack_py_wbint_PamAuthCrapChangePassword_args_in, (py_data_unpack_fn)unpack_py_wbint_PamAuthCrapChangePassword_args_out, 24, &ndr_table_winbind },
   21072             :         { "wbint_PamAuthChangePassword", "S.wbint_PamAuthChangePassword(client_name, client_pid, flags, user, old_password, new_password) -> (dominfo, reject_reason)", (py_dcerpc_call_fn)dcerpc_wbint_PamAuthChangePassword_r, (py_data_pack_fn)pack_py_wbint_PamAuthChangePassword_args_in, (py_data_unpack_fn)unpack_py_wbint_PamAuthChangePassword_args_out, 25, &ndr_table_winbind },
   21073             :         { "wbint_InitConnection", "S.wbint_InitConnection(dcname) -> (name, alt_name, sid, flags)", (py_dcerpc_call_fn)dcerpc_wbint_InitConnection_r, (py_data_pack_fn)pack_py_wbint_InitConnection_args_in, (py_data_unpack_fn)unpack_py_wbint_InitConnection_args_out, 26, &ndr_table_winbind },
   21074             :         { "SamLogon", "S.SamLogon(logon_level, logon, validation_level) -> (validation, authoritative)", (py_dcerpc_call_fn)dcerpc_winbind_SamLogon_r, (py_data_pack_fn)pack_py_winbind_SamLogon_args_in, (py_data_unpack_fn)unpack_py_winbind_SamLogon_args_out, 27, &ndr_table_winbind },
   21075             :         { "DsrUpdateReadOnlyServerDnsRecords", "S.DsrUpdateReadOnlyServerDnsRecords(site_name, dns_ttl, dns_names) -> dns_names", (py_dcerpc_call_fn)dcerpc_winbind_DsrUpdateReadOnlyServerDnsRecords_r, (py_data_pack_fn)pack_py_winbind_DsrUpdateReadOnlyServerDnsRecords_args_in, (py_data_unpack_fn)unpack_py_winbind_DsrUpdateReadOnlyServerDnsRecords_args_out, 28, &ndr_table_winbind },
   21076             :         { "LogonControl", "S.LogonControl(function_code, level, data) -> query", (py_dcerpc_call_fn)dcerpc_winbind_LogonControl_r, (py_data_pack_fn)pack_py_winbind_LogonControl_args_in, (py_data_unpack_fn)unpack_py_winbind_LogonControl_args_out, 29, &ndr_table_winbind },
   21077             :         { "GetForestTrustInformation", "S.GetForestTrustInformation(trusted_domain_name, flags) -> forest_trust_info", (py_dcerpc_call_fn)dcerpc_winbind_GetForestTrustInformation_r, (py_data_pack_fn)pack_py_winbind_GetForestTrustInformation_args_in, (py_data_unpack_fn)unpack_py_winbind_GetForestTrustInformation_args_out, 30, &ndr_table_winbind },
   21078             :         { "SendToSam", "S.SendToSam(message) -> None", (py_dcerpc_call_fn)dcerpc_winbind_SendToSam_r, (py_data_pack_fn)pack_py_winbind_SendToSam_args_in, (py_data_unpack_fn)unpack_py_winbind_SendToSam_args_out, 31, &ndr_table_winbind },
   21079             :         {0}
   21080             : };
   21081             : 
   21082           2 : static PyObject *interface_winbind_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   21083             : {
   21084           2 :         return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_winbind);
   21085             : }
   21086             : 
   21087             : #define PY_DOC_WINBIND "winbind parent-child protocol"
   21088             : static PyTypeObject winbind_InterfaceType = {
   21089             :         PyVarObject_HEAD_INIT(NULL, 0)
   21090             :         .tp_name = "winbind.winbind",
   21091             :         .tp_basicsize = sizeof(dcerpc_InterfaceObject),
   21092             :         .tp_doc = "winbind(binding, lp_ctx=None, credentials=None) -> connection\n"
   21093             : "\n"
   21094             : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
   21095             : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
   21096             : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_WINBIND,
   21097             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   21098             :         .tp_new = interface_winbind_new,
   21099             : };
   21100             : 
   21101           0 : static PyObject *syntax_winbind_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   21102             : {
   21103           0 :         return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_winbind.syntax_id);
   21104             : }
   21105             : 
   21106             : #define PY_DOC_WINBIND_SYNTAX "winbind parent-child protocol"
   21107             : static PyTypeObject winbind_SyntaxType = {
   21108             :         PyVarObject_HEAD_INIT(NULL, 0)
   21109             :         .tp_name = "winbind.winbind_abstract_syntax",
   21110             :         .tp_doc = "winbind_abstract_syntax()\n"PY_DOC_WINBIND_SYNTAX,
   21111             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
   21112             :         .tp_new = syntax_winbind_new,
   21113             : };
   21114             : 
   21115             : static PyMethodDef winbind_methods[] = {
   21116             :         { NULL, NULL, 0, NULL }
   21117             : };
   21118             : 
   21119             : static struct PyModuleDef moduledef = {
   21120             :         PyModuleDef_HEAD_INIT,
   21121             :         .m_name = "winbind",
   21122             :         .m_doc = "winbind DCE/RPC",
   21123             :         .m_size = -1,
   21124             :         .m_methods = winbind_methods,
   21125             : };
   21126         106 : MODULE_INIT_FUNC(winbind)
   21127             : {
   21128         106 :         PyObject *m = NULL;
   21129         106 :         PyObject *dep_samba_dcerpc_lsa = NULL;
   21130         106 :         PyObject *dep_samba_dcerpc_netlogon = NULL;
   21131         106 :         PyObject *dep_samba_dcerpc_samr = NULL;
   21132         106 :         PyObject *dep_samba_dcerpc_misc = NULL;
   21133         106 :         PyObject *dep_samba_dcerpc_security = NULL;
   21134         106 :         PyObject *dep_samba_dcerpc_idmap = NULL;
   21135         106 :         PyObject *dep_talloc = NULL;
   21136         106 :         PyObject *dep_samba_dcerpc_base = NULL;
   21137             : 
   21138         106 :         dep_samba_dcerpc_lsa = PyImport_ImportModule("samba.dcerpc.lsa");
   21139         106 :         if (dep_samba_dcerpc_lsa == NULL)
   21140           0 :                 goto out;
   21141             : 
   21142         106 :         dep_samba_dcerpc_netlogon = PyImport_ImportModule("samba.dcerpc.netlogon");
   21143         106 :         if (dep_samba_dcerpc_netlogon == NULL)
   21144           0 :                 goto out;
   21145             : 
   21146         106 :         dep_samba_dcerpc_samr = PyImport_ImportModule("samba.dcerpc.samr");
   21147         106 :         if (dep_samba_dcerpc_samr == NULL)
   21148           0 :                 goto out;
   21149             : 
   21150         106 :         dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
   21151         106 :         if (dep_samba_dcerpc_misc == NULL)
   21152           0 :                 goto out;
   21153             : 
   21154         106 :         dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
   21155         106 :         if (dep_samba_dcerpc_security == NULL)
   21156           0 :                 goto out;
   21157             : 
   21158         106 :         dep_samba_dcerpc_idmap = PyImport_ImportModule("samba.dcerpc.idmap");
   21159         106 :         if (dep_samba_dcerpc_idmap == NULL)
   21160           0 :                 goto out;
   21161             : 
   21162         106 :         dep_talloc = PyImport_ImportModule("talloc");
   21163         106 :         if (dep_talloc == NULL)
   21164           0 :                 goto out;
   21165             : 
   21166         106 :         dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
   21167         106 :         if (dep_samba_dcerpc_base == NULL)
   21168           0 :                 goto out;
   21169             : 
   21170         106 :         unixid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_idmap, "unixid");
   21171         106 :         if (unixid_Type == NULL)
   21172           0 :                 goto out;
   21173             : 
   21174         106 :         BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
   21175         106 :         if (BaseObject_Type == NULL)
   21176           0 :                 goto out;
   21177             : 
   21178         106 :         dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
   21179         106 :         if (dom_sid_Type == NULL)
   21180           0 :                 goto out;
   21181             : 
   21182         106 :         netr_Validation_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_Validation");
   21183         106 :         if (netr_Validation_Type == NULL)
   21184           0 :                 goto out;
   21185             : 
   21186         106 :         lsa_SidArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "SidArray");
   21187         106 :         if (lsa_SidArray_Type == NULL)
   21188           0 :                 goto out;
   21189             : 
   21190         106 :         lsa_RefDomainList_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "RefDomainList");
   21191         106 :         if (lsa_RefDomainList_Type == NULL)
   21192           0 :                 goto out;
   21193             : 
   21194         106 :         lsa_TransNameArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "TransNameArray");
   21195         106 :         if (lsa_TransNameArray_Type == NULL)
   21196           0 :                 goto out;
   21197             : 
   21198         106 :         GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
   21199         106 :         if (GUID_Type == NULL)
   21200           0 :                 goto out;
   21201             : 
   21202         106 :         netr_DsRGetDCNameInfo_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_DsRGetDCNameInfo");
   21203         106 :         if (netr_DsRGetDCNameInfo_Type == NULL)
   21204           0 :                 goto out;
   21205             : 
   21206         106 :         netr_DomainTrustList_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_DomainTrustList");
   21207         106 :         if (netr_DomainTrustList_Type == NULL)
   21208           0 :                 goto out;
   21209             : 
   21210         106 :         samr_DomInfo1_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_samr, "DomInfo1");
   21211         106 :         if (samr_DomInfo1_Type == NULL)
   21212           0 :                 goto out;
   21213             : 
   21214         106 :         netr_LogonLevel_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_LogonLevel");
   21215         106 :         if (netr_LogonLevel_Type == NULL)
   21216           0 :                 goto out;
   21217             : 
   21218         106 :         NL_DNS_NAME_INFO_ARRAY_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "NL_DNS_NAME_INFO_ARRAY");
   21219         106 :         if (NL_DNS_NAME_INFO_ARRAY_Type == NULL)
   21220           0 :                 goto out;
   21221             : 
   21222         106 :         netr_CONTROL_DATA_INFORMATION_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_CONTROL_DATA_INFORMATION");
   21223         106 :         if (netr_CONTROL_DATA_INFORMATION_Type == NULL)
   21224           0 :                 goto out;
   21225             : 
   21226         106 :         netr_CONTROL_QUERY_INFORMATION_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_CONTROL_QUERY_INFORMATION");
   21227         106 :         if (netr_CONTROL_QUERY_INFORMATION_Type == NULL)
   21228           0 :                 goto out;
   21229             : 
   21230         106 :         lsa_ForestTrustInformation_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "ForestTrustInformation");
   21231         106 :         if (lsa_ForestTrustInformation_Type == NULL)
   21232           0 :                 goto out;
   21233             : 
   21234         106 :         netr_SendToSamBase_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_SendToSamBase");
   21235         106 :         if (netr_SendToSamBase_Type == NULL)
   21236           0 :                 goto out;
   21237             : 
   21238         106 :         ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
   21239         106 :         if (ClientConnection_Type == NULL)
   21240           0 :                 goto out;
   21241             : 
   21242         106 :         ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
   21243         106 :         if (ndr_syntax_id_Type == NULL)
   21244           0 :                 goto out;
   21245             : 
   21246         106 :         wbint_TransID_Type.tp_base = BaseObject_Type;
   21247         106 :         wbint_TransID_Type.tp_basicsize = pytalloc_BaseObject_size();
   21248             : 
   21249         106 :         wbint_TransIDArray_Type.tp_base = BaseObject_Type;
   21250         106 :         wbint_TransIDArray_Type.tp_basicsize = pytalloc_BaseObject_size();
   21251             : 
   21252         106 :         wbint_userinfo_Type.tp_base = BaseObject_Type;
   21253         106 :         wbint_userinfo_Type.tp_basicsize = pytalloc_BaseObject_size();
   21254             : 
   21255         106 :         wbint_SidArray_Type.tp_base = BaseObject_Type;
   21256         106 :         wbint_SidArray_Type.tp_basicsize = pytalloc_BaseObject_size();
   21257             : 
   21258         106 :         wbint_RidArray_Type.tp_base = BaseObject_Type;
   21259         106 :         wbint_RidArray_Type.tp_basicsize = pytalloc_BaseObject_size();
   21260             : 
   21261         106 :         wbint_Principal_Type.tp_base = BaseObject_Type;
   21262         106 :         wbint_Principal_Type.tp_basicsize = pytalloc_BaseObject_size();
   21263             : 
   21264         106 :         wbint_Principals_Type.tp_base = BaseObject_Type;
   21265         106 :         wbint_Principals_Type.tp_basicsize = pytalloc_BaseObject_size();
   21266             : 
   21267         106 :         wbint_userinfos_Type.tp_base = BaseObject_Type;
   21268         106 :         wbint_userinfos_Type.tp_basicsize = pytalloc_BaseObject_size();
   21269             : 
   21270         106 :         wbint_Validation_Type.tp_base = BaseObject_Type;
   21271         106 :         wbint_Validation_Type.tp_basicsize = pytalloc_BaseObject_size();
   21272             : 
   21273         106 :         wbint_AuthUserInfo_Type.tp_base = BaseObject_Type;
   21274         106 :         wbint_AuthUserInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
   21275             : 
   21276         106 :         wbint_PamAuthCrapValidation_Type.tp_base = BaseObject_Type;
   21277         106 :         wbint_PamAuthCrapValidation_Type.tp_basicsize = pytalloc_BaseObject_size();
   21278             : 
   21279         106 :         wbint_Ping_Type.tp_base = BaseObject_Type;
   21280         106 :         wbint_Ping_Type.tp_basicsize = pytalloc_BaseObject_size();
   21281             : 
   21282         106 :         wbint_LookupSid_Type.tp_base = BaseObject_Type;
   21283         106 :         wbint_LookupSid_Type.tp_basicsize = pytalloc_BaseObject_size();
   21284             : 
   21285         106 :         wbint_LookupSids_Type.tp_base = BaseObject_Type;
   21286         106 :         wbint_LookupSids_Type.tp_basicsize = pytalloc_BaseObject_size();
   21287             : 
   21288         106 :         wbint_LookupName_Type.tp_base = BaseObject_Type;
   21289         106 :         wbint_LookupName_Type.tp_basicsize = pytalloc_BaseObject_size();
   21290             : 
   21291         106 :         wbint_Sids2UnixIDs_Type.tp_base = BaseObject_Type;
   21292         106 :         wbint_Sids2UnixIDs_Type.tp_basicsize = pytalloc_BaseObject_size();
   21293             : 
   21294         106 :         wbint_UnixIDs2Sids_Type.tp_base = BaseObject_Type;
   21295         106 :         wbint_UnixIDs2Sids_Type.tp_basicsize = pytalloc_BaseObject_size();
   21296             : 
   21297         106 :         wbint_AllocateUid_Type.tp_base = BaseObject_Type;
   21298         106 :         wbint_AllocateUid_Type.tp_basicsize = pytalloc_BaseObject_size();
   21299             : 
   21300         106 :         wbint_AllocateGid_Type.tp_base = BaseObject_Type;
   21301         106 :         wbint_AllocateGid_Type.tp_basicsize = pytalloc_BaseObject_size();
   21302             : 
   21303         106 :         wbint_GetNssInfo_Type.tp_base = BaseObject_Type;
   21304         106 :         wbint_GetNssInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
   21305             : 
   21306         106 :         wbint_LookupUserAliases_Type.tp_base = BaseObject_Type;
   21307         106 :         wbint_LookupUserAliases_Type.tp_basicsize = pytalloc_BaseObject_size();
   21308             : 
   21309         106 :         wbint_LookupUserGroups_Type.tp_base = BaseObject_Type;
   21310         106 :         wbint_LookupUserGroups_Type.tp_basicsize = pytalloc_BaseObject_size();
   21311             : 
   21312         106 :         wbint_QuerySequenceNumber_Type.tp_base = BaseObject_Type;
   21313         106 :         wbint_QuerySequenceNumber_Type.tp_basicsize = pytalloc_BaseObject_size();
   21314             : 
   21315         106 :         wbint_LookupGroupMembers_Type.tp_base = BaseObject_Type;
   21316         106 :         wbint_LookupGroupMembers_Type.tp_basicsize = pytalloc_BaseObject_size();
   21317             : 
   21318         106 :         wbint_QueryGroupList_Type.tp_base = BaseObject_Type;
   21319         106 :         wbint_QueryGroupList_Type.tp_basicsize = pytalloc_BaseObject_size();
   21320             : 
   21321         106 :         wbint_QueryUserRidList_Type.tp_base = BaseObject_Type;
   21322         106 :         wbint_QueryUserRidList_Type.tp_basicsize = pytalloc_BaseObject_size();
   21323             : 
   21324         106 :         wbint_DsGetDcName_Type.tp_base = BaseObject_Type;
   21325         106 :         wbint_DsGetDcName_Type.tp_basicsize = pytalloc_BaseObject_size();
   21326             : 
   21327         106 :         wbint_LookupRids_Type.tp_base = BaseObject_Type;
   21328         106 :         wbint_LookupRids_Type.tp_basicsize = pytalloc_BaseObject_size();
   21329             : 
   21330         106 :         wbint_CheckMachineAccount_Type.tp_base = BaseObject_Type;
   21331         106 :         wbint_CheckMachineAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
   21332             : 
   21333         106 :         wbint_ChangeMachineAccount_Type.tp_base = BaseObject_Type;
   21334         106 :         wbint_ChangeMachineAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
   21335             : 
   21336         106 :         wbint_PingDc_Type.tp_base = BaseObject_Type;
   21337         106 :         wbint_PingDc_Type.tp_basicsize = pytalloc_BaseObject_size();
   21338             : 
   21339         106 :         wbint_ListTrustedDomains_Type.tp_base = BaseObject_Type;
   21340         106 :         wbint_ListTrustedDomains_Type.tp_basicsize = pytalloc_BaseObject_size();
   21341             : 
   21342         106 :         wbint_PamAuth_Type.tp_base = BaseObject_Type;
   21343         106 :         wbint_PamAuth_Type.tp_basicsize = pytalloc_BaseObject_size();
   21344             : 
   21345         106 :         wbint_PamAuthCrap_Type.tp_base = BaseObject_Type;
   21346         106 :         wbint_PamAuthCrap_Type.tp_basicsize = pytalloc_BaseObject_size();
   21347             : 
   21348         106 :         wbint_PamLogOff_Type.tp_base = BaseObject_Type;
   21349         106 :         wbint_PamLogOff_Type.tp_basicsize = pytalloc_BaseObject_size();
   21350             : 
   21351         106 :         wbint_PamAuthCrapChangePassword_Type.tp_base = BaseObject_Type;
   21352         106 :         wbint_PamAuthCrapChangePassword_Type.tp_basicsize = pytalloc_BaseObject_size();
   21353             : 
   21354         106 :         wbint_PamAuthChangePassword_Type.tp_base = BaseObject_Type;
   21355         106 :         wbint_PamAuthChangePassword_Type.tp_basicsize = pytalloc_BaseObject_size();
   21356             : 
   21357         106 :         wbint_InitConnection_Type.tp_base = BaseObject_Type;
   21358         106 :         wbint_InitConnection_Type.tp_basicsize = pytalloc_BaseObject_size();
   21359             : 
   21360         106 :         winbind_SamLogon_Type.tp_base = BaseObject_Type;
   21361         106 :         winbind_SamLogon_Type.tp_basicsize = pytalloc_BaseObject_size();
   21362             : 
   21363         106 :         winbind_DsrUpdateReadOnlyServerDnsRecords_Type.tp_base = BaseObject_Type;
   21364         106 :         winbind_DsrUpdateReadOnlyServerDnsRecords_Type.tp_basicsize = pytalloc_BaseObject_size();
   21365             : 
   21366         106 :         winbind_LogonControl_Type.tp_base = BaseObject_Type;
   21367         106 :         winbind_LogonControl_Type.tp_basicsize = pytalloc_BaseObject_size();
   21368             : 
   21369         106 :         winbind_GetForestTrustInformation_Type.tp_base = BaseObject_Type;
   21370         106 :         winbind_GetForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
   21371             : 
   21372         106 :         winbind_SendToSam_Type.tp_base = BaseObject_Type;
   21373         106 :         winbind_SendToSam_Type.tp_basicsize = pytalloc_BaseObject_size();
   21374             : 
   21375         106 :         winbind_InterfaceType.tp_base = ClientConnection_Type;
   21376             : 
   21377         106 :         winbind_SyntaxType.tp_base = ndr_syntax_id_Type;
   21378         106 :         winbind_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
   21379             : 
   21380         106 :         if (PyType_Ready(&wbint_TransID_Type) < 0)
   21381           0 :                 goto out;
   21382         106 :         if (PyType_Ready(&wbint_TransIDArray_Type) < 0)
   21383           0 :                 goto out;
   21384         106 :         if (PyType_Ready(&wbint_userinfo_Type) < 0)
   21385           0 :                 goto out;
   21386         106 :         if (PyType_Ready(&wbint_SidArray_Type) < 0)
   21387           0 :                 goto out;
   21388         106 :         if (PyType_Ready(&wbint_RidArray_Type) < 0)
   21389           0 :                 goto out;
   21390         106 :         if (PyType_Ready(&wbint_Principal_Type) < 0)
   21391           0 :                 goto out;
   21392         106 :         if (PyType_Ready(&wbint_Principals_Type) < 0)
   21393           0 :                 goto out;
   21394         106 :         if (PyType_Ready(&wbint_userinfos_Type) < 0)
   21395           0 :                 goto out;
   21396         106 :         if (PyType_Ready(&wbint_Validation_Type) < 0)
   21397           0 :                 goto out;
   21398         106 :         if (PyType_Ready(&wbint_AuthUserInfo_Type) < 0)
   21399           0 :                 goto out;
   21400         106 :         if (PyType_Ready(&wbint_PamAuthCrapValidation_Type) < 0)
   21401           0 :                 goto out;
   21402         106 :         if (PyType_Ready(&wbint_Ping_Type) < 0)
   21403           0 :                 goto out;
   21404         106 :         if (PyType_Ready(&wbint_LookupSid_Type) < 0)
   21405           0 :                 goto out;
   21406         106 :         if (PyType_Ready(&wbint_LookupSids_Type) < 0)
   21407           0 :                 goto out;
   21408         106 :         if (PyType_Ready(&wbint_LookupName_Type) < 0)
   21409           0 :                 goto out;
   21410         106 :         if (PyType_Ready(&wbint_Sids2UnixIDs_Type) < 0)
   21411           0 :                 goto out;
   21412         106 :         if (PyType_Ready(&wbint_UnixIDs2Sids_Type) < 0)
   21413           0 :                 goto out;
   21414         106 :         if (PyType_Ready(&wbint_AllocateUid_Type) < 0)
   21415           0 :                 goto out;
   21416         106 :         if (PyType_Ready(&wbint_AllocateGid_Type) < 0)
   21417           0 :                 goto out;
   21418         106 :         if (PyType_Ready(&wbint_GetNssInfo_Type) < 0)
   21419           0 :                 goto out;
   21420         106 :         if (PyType_Ready(&wbint_LookupUserAliases_Type) < 0)
   21421           0 :                 goto out;
   21422         106 :         if (PyType_Ready(&wbint_LookupUserGroups_Type) < 0)
   21423           0 :                 goto out;
   21424         106 :         if (PyType_Ready(&wbint_QuerySequenceNumber_Type) < 0)
   21425           0 :                 goto out;
   21426         106 :         if (PyType_Ready(&wbint_LookupGroupMembers_Type) < 0)
   21427           0 :                 goto out;
   21428         106 :         if (PyType_Ready(&wbint_QueryGroupList_Type) < 0)
   21429           0 :                 goto out;
   21430         106 :         if (PyType_Ready(&wbint_QueryUserRidList_Type) < 0)
   21431           0 :                 goto out;
   21432         106 :         if (PyType_Ready(&wbint_DsGetDcName_Type) < 0)
   21433           0 :                 goto out;
   21434         106 :         if (PyType_Ready(&wbint_LookupRids_Type) < 0)
   21435           0 :                 goto out;
   21436         106 :         if (PyType_Ready(&wbint_CheckMachineAccount_Type) < 0)
   21437           0 :                 goto out;
   21438         106 :         if (PyType_Ready(&wbint_ChangeMachineAccount_Type) < 0)
   21439           0 :                 goto out;
   21440         106 :         if (PyType_Ready(&wbint_PingDc_Type) < 0)
   21441           0 :                 goto out;
   21442         106 :         if (PyType_Ready(&wbint_ListTrustedDomains_Type) < 0)
   21443           0 :                 goto out;
   21444         106 :         if (PyType_Ready(&wbint_PamAuth_Type) < 0)
   21445           0 :                 goto out;
   21446         106 :         if (PyType_Ready(&wbint_PamAuthCrap_Type) < 0)
   21447           0 :                 goto out;
   21448         106 :         if (PyType_Ready(&wbint_PamLogOff_Type) < 0)
   21449           0 :                 goto out;
   21450         106 :         if (PyType_Ready(&wbint_PamAuthCrapChangePassword_Type) < 0)
   21451           0 :                 goto out;
   21452         106 :         if (PyType_Ready(&wbint_PamAuthChangePassword_Type) < 0)
   21453           0 :                 goto out;
   21454         106 :         if (PyType_Ready(&wbint_InitConnection_Type) < 0)
   21455           0 :                 goto out;
   21456         106 :         if (PyType_Ready(&winbind_SamLogon_Type) < 0)
   21457           0 :                 goto out;
   21458         106 :         if (PyType_Ready(&winbind_DsrUpdateReadOnlyServerDnsRecords_Type) < 0)
   21459           0 :                 goto out;
   21460         106 :         if (PyType_Ready(&winbind_LogonControl_Type) < 0)
   21461           0 :                 goto out;
   21462         106 :         if (PyType_Ready(&winbind_GetForestTrustInformation_Type) < 0)
   21463           0 :                 goto out;
   21464         106 :         if (PyType_Ready(&winbind_SendToSam_Type) < 0)
   21465           0 :                 goto out;
   21466         106 :         if (PyType_Ready(&winbind_InterfaceType) < 0)
   21467           0 :                 goto out;
   21468         106 :         if (PyType_Ready(&winbind_SyntaxType) < 0)
   21469           0 :                 goto out;
   21470         106 :         if (!PyInterface_AddNdrRpcMethods(&winbind_InterfaceType, py_ndr_winbind_methods))
   21471           0 :                 return NULL;
   21472             : 
   21473             : #ifdef PY_WBINT_TRANSID_PATCH
   21474             :         PY_WBINT_TRANSID_PATCH(&wbint_TransID_Type);
   21475             : #endif
   21476             : #ifdef PY_WBINT_TRANSIDARRAY_PATCH
   21477             :         PY_WBINT_TRANSIDARRAY_PATCH(&wbint_TransIDArray_Type);
   21478             : #endif
   21479             : #ifdef PY_WBINT_USERINFO_PATCH
   21480             :         PY_WBINT_USERINFO_PATCH(&wbint_userinfo_Type);
   21481             : #endif
   21482             : #ifdef PY_WBINT_SIDARRAY_PATCH
   21483             :         PY_WBINT_SIDARRAY_PATCH(&wbint_SidArray_Type);
   21484             : #endif
   21485             : #ifdef PY_WBINT_RIDARRAY_PATCH
   21486             :         PY_WBINT_RIDARRAY_PATCH(&wbint_RidArray_Type);
   21487             : #endif
   21488             : #ifdef PY_WBINT_PRINCIPAL_PATCH
   21489             :         PY_WBINT_PRINCIPAL_PATCH(&wbint_Principal_Type);
   21490             : #endif
   21491             : #ifdef PY_WBINT_PRINCIPALS_PATCH
   21492             :         PY_WBINT_PRINCIPALS_PATCH(&wbint_Principals_Type);
   21493             : #endif
   21494             : #ifdef PY_WBINT_USERINFOS_PATCH
   21495             :         PY_WBINT_USERINFOS_PATCH(&wbint_userinfos_Type);
   21496             : #endif
   21497             : #ifdef PY_WBINT_VALIDATION_PATCH
   21498             :         PY_WBINT_VALIDATION_PATCH(&wbint_Validation_Type);
   21499             : #endif
   21500             : #ifdef PY_WBINT_AUTHUSERINFO_PATCH
   21501             :         PY_WBINT_AUTHUSERINFO_PATCH(&wbint_AuthUserInfo_Type);
   21502             : #endif
   21503             : #ifdef PY_WBINT_PAMAUTHCRAPVALIDATION_PATCH
   21504             :         PY_WBINT_PAMAUTHCRAPVALIDATION_PATCH(&wbint_PamAuthCrapValidation_Type);
   21505             : #endif
   21506             : #ifdef PY_WBINT_PING_PATCH
   21507             :         PY_WBINT_PING_PATCH(&wbint_Ping_Type);
   21508             : #endif
   21509             : #ifdef PY_WBINT_LOOKUPSID_PATCH
   21510             :         PY_WBINT_LOOKUPSID_PATCH(&wbint_LookupSid_Type);
   21511             : #endif
   21512             : #ifdef PY_WBINT_LOOKUPSIDS_PATCH
   21513             :         PY_WBINT_LOOKUPSIDS_PATCH(&wbint_LookupSids_Type);
   21514             : #endif
   21515             : #ifdef PY_WBINT_LOOKUPNAME_PATCH
   21516             :         PY_WBINT_LOOKUPNAME_PATCH(&wbint_LookupName_Type);
   21517             : #endif
   21518             : #ifdef PY_WBINT_SIDS2UNIXIDS_PATCH
   21519             :         PY_WBINT_SIDS2UNIXIDS_PATCH(&wbint_Sids2UnixIDs_Type);
   21520             : #endif
   21521             : #ifdef PY_WBINT_UNIXIDS2SIDS_PATCH
   21522             :         PY_WBINT_UNIXIDS2SIDS_PATCH(&wbint_UnixIDs2Sids_Type);
   21523             : #endif
   21524             : #ifdef PY_WBINT_ALLOCATEUID_PATCH
   21525             :         PY_WBINT_ALLOCATEUID_PATCH(&wbint_AllocateUid_Type);
   21526             : #endif
   21527             : #ifdef PY_WBINT_ALLOCATEGID_PATCH
   21528             :         PY_WBINT_ALLOCATEGID_PATCH(&wbint_AllocateGid_Type);
   21529             : #endif
   21530             : #ifdef PY_WBINT_GETNSSINFO_PATCH
   21531             :         PY_WBINT_GETNSSINFO_PATCH(&wbint_GetNssInfo_Type);
   21532             : #endif
   21533             : #ifdef PY_WBINT_LOOKUPUSERALIASES_PATCH
   21534             :         PY_WBINT_LOOKUPUSERALIASES_PATCH(&wbint_LookupUserAliases_Type);
   21535             : #endif
   21536             : #ifdef PY_WBINT_LOOKUPUSERGROUPS_PATCH
   21537             :         PY_WBINT_LOOKUPUSERGROUPS_PATCH(&wbint_LookupUserGroups_Type);
   21538             : #endif
   21539             : #ifdef PY_WBINT_QUERYSEQUENCENUMBER_PATCH
   21540             :         PY_WBINT_QUERYSEQUENCENUMBER_PATCH(&wbint_QuerySequenceNumber_Type);
   21541             : #endif
   21542             : #ifdef PY_WBINT_LOOKUPGROUPMEMBERS_PATCH
   21543             :         PY_WBINT_LOOKUPGROUPMEMBERS_PATCH(&wbint_LookupGroupMembers_Type);
   21544             : #endif
   21545             : #ifdef PY_WBINT_QUERYGROUPLIST_PATCH
   21546             :         PY_WBINT_QUERYGROUPLIST_PATCH(&wbint_QueryGroupList_Type);
   21547             : #endif
   21548             : #ifdef PY_WBINT_QUERYUSERRIDLIST_PATCH
   21549             :         PY_WBINT_QUERYUSERRIDLIST_PATCH(&wbint_QueryUserRidList_Type);
   21550             : #endif
   21551             : #ifdef PY_WBINT_DSGETDCNAME_PATCH
   21552             :         PY_WBINT_DSGETDCNAME_PATCH(&wbint_DsGetDcName_Type);
   21553             : #endif
   21554             : #ifdef PY_WBINT_LOOKUPRIDS_PATCH
   21555             :         PY_WBINT_LOOKUPRIDS_PATCH(&wbint_LookupRids_Type);
   21556             : #endif
   21557             : #ifdef PY_WBINT_CHECKMACHINEACCOUNT_PATCH
   21558             :         PY_WBINT_CHECKMACHINEACCOUNT_PATCH(&wbint_CheckMachineAccount_Type);
   21559             : #endif
   21560             : #ifdef PY_WBINT_CHANGEMACHINEACCOUNT_PATCH
   21561             :         PY_WBINT_CHANGEMACHINEACCOUNT_PATCH(&wbint_ChangeMachineAccount_Type);
   21562             : #endif
   21563             : #ifdef PY_WBINT_PINGDC_PATCH
   21564             :         PY_WBINT_PINGDC_PATCH(&wbint_PingDc_Type);
   21565             : #endif
   21566             : #ifdef PY_WBINT_LISTTRUSTEDDOMAINS_PATCH
   21567             :         PY_WBINT_LISTTRUSTEDDOMAINS_PATCH(&wbint_ListTrustedDomains_Type);
   21568             : #endif
   21569             : #ifdef PY_WBINT_PAMAUTH_PATCH
   21570             :         PY_WBINT_PAMAUTH_PATCH(&wbint_PamAuth_Type);
   21571             : #endif
   21572             : #ifdef PY_WBINT_PAMAUTHCRAP_PATCH
   21573             :         PY_WBINT_PAMAUTHCRAP_PATCH(&wbint_PamAuthCrap_Type);
   21574             : #endif
   21575             : #ifdef PY_WBINT_PAMLOGOFF_PATCH
   21576             :         PY_WBINT_PAMLOGOFF_PATCH(&wbint_PamLogOff_Type);
   21577             : #endif
   21578             : #ifdef PY_WBINT_PAMAUTHCRAPCHANGEPASSWORD_PATCH
   21579             :         PY_WBINT_PAMAUTHCRAPCHANGEPASSWORD_PATCH(&wbint_PamAuthCrapChangePassword_Type);
   21580             : #endif
   21581             : #ifdef PY_WBINT_PAMAUTHCHANGEPASSWORD_PATCH
   21582             :         PY_WBINT_PAMAUTHCHANGEPASSWORD_PATCH(&wbint_PamAuthChangePassword_Type);
   21583             : #endif
   21584             : #ifdef PY_WBINT_INITCONNECTION_PATCH
   21585             :         PY_WBINT_INITCONNECTION_PATCH(&wbint_InitConnection_Type);
   21586             : #endif
   21587             : #ifdef PY_SAMLOGON_PATCH
   21588             :         PY_SAMLOGON_PATCH(&winbind_SamLogon_Type);
   21589             : #endif
   21590             : #ifdef PY_DSRUPDATEREADONLYSERVERDNSRECORDS_PATCH
   21591             :         PY_DSRUPDATEREADONLYSERVERDNSRECORDS_PATCH(&winbind_DsrUpdateReadOnlyServerDnsRecords_Type);
   21592             : #endif
   21593             : #ifdef PY_LOGONCONTROL_PATCH
   21594             :         PY_LOGONCONTROL_PATCH(&winbind_LogonControl_Type);
   21595             : #endif
   21596             : #ifdef PY_GETFORESTTRUSTINFORMATION_PATCH
   21597             :         PY_GETFORESTTRUSTINFORMATION_PATCH(&winbind_GetForestTrustInformation_Type);
   21598             : #endif
   21599             : #ifdef PY_SENDTOSAM_PATCH
   21600             :         PY_SENDTOSAM_PATCH(&winbind_SendToSam_Type);
   21601             : #endif
   21602             : #ifdef PY_WINBIND_PATCH
   21603             :         PY_WINBIND_PATCH(&winbind_InterfaceType);
   21604             : #endif
   21605             : #ifdef PY_WINBIND_ABSTRACT_SYNTAX_PATCH
   21606             :         PY_WINBIND_ABSTRACT_SYNTAX_PATCH(&winbind_SyntaxType);
   21607             : #endif
   21608             : #ifdef PY_ABSTRACT_SYNTAX_PATCH
   21609             :         PY_ABSTRACT_SYNTAX_PATCH(&winbind_SyntaxType);
   21610             : #endif
   21611             : 
   21612         106 :         m = PyModule_Create(&moduledef);
   21613         106 :         if (m == NULL)
   21614           0 :                 goto out;
   21615             : 
   21616         106 :         PyModule_AddObject(m, "WB_DOMINFO_DOMAIN_UNKNOWN", PyLong_FromLong((uint16_t)WB_DOMINFO_DOMAIN_UNKNOWN));
   21617         106 :         PyModule_AddObject(m, "WB_DOMINFO_DOMAIN_NATIVE", PyLong_FromLong((uint16_t)WB_DOMINFO_DOMAIN_NATIVE));
   21618         106 :         PyModule_AddObject(m, "WB_DOMINFO_DOMAIN_AD", PyLong_FromLong((uint16_t)WB_DOMINFO_DOMAIN_AD));
   21619         106 :         PyModule_AddObject(m, "WB_DOMINFO_DOMAIN_PRIMARY", PyLong_FromLong((uint16_t)WB_DOMINFO_DOMAIN_PRIMARY));
   21620         106 :         PyModule_AddObject(m, "WB_DOMINFO_DOMAIN_OFFLINE", PyLong_FromLong((uint16_t)WB_DOMINFO_DOMAIN_OFFLINE));
   21621         106 :         Py_INCREF((PyObject *)(void *)&wbint_TransID_Type);
   21622         106 :         PyModule_AddObject(m, "wbint_TransID", (PyObject *)(void *)&wbint_TransID_Type);
   21623         106 :         Py_INCREF((PyObject *)(void *)&wbint_TransIDArray_Type);
   21624         106 :         PyModule_AddObject(m, "wbint_TransIDArray", (PyObject *)(void *)&wbint_TransIDArray_Type);
   21625         106 :         Py_INCREF((PyObject *)(void *)&wbint_userinfo_Type);
   21626         106 :         PyModule_AddObject(m, "wbint_userinfo", (PyObject *)(void *)&wbint_userinfo_Type);
   21627         106 :         Py_INCREF((PyObject *)(void *)&wbint_SidArray_Type);
   21628         106 :         PyModule_AddObject(m, "wbint_SidArray", (PyObject *)(void *)&wbint_SidArray_Type);
   21629         106 :         Py_INCREF((PyObject *)(void *)&wbint_RidArray_Type);
   21630         106 :         PyModule_AddObject(m, "wbint_RidArray", (PyObject *)(void *)&wbint_RidArray_Type);
   21631         106 :         Py_INCREF((PyObject *)(void *)&wbint_Principal_Type);
   21632         106 :         PyModule_AddObject(m, "wbint_Principal", (PyObject *)(void *)&wbint_Principal_Type);
   21633         106 :         Py_INCREF((PyObject *)(void *)&wbint_Principals_Type);
   21634         106 :         PyModule_AddObject(m, "wbint_Principals", (PyObject *)(void *)&wbint_Principals_Type);
   21635         106 :         Py_INCREF((PyObject *)(void *)&wbint_userinfos_Type);
   21636         106 :         PyModule_AddObject(m, "wbint_userinfos", (PyObject *)(void *)&wbint_userinfos_Type);
   21637         106 :         Py_INCREF((PyObject *)(void *)&wbint_Validation_Type);
   21638         106 :         PyModule_AddObject(m, "wbint_Validation", (PyObject *)(void *)&wbint_Validation_Type);
   21639         106 :         Py_INCREF((PyObject *)(void *)&wbint_AuthUserInfo_Type);
   21640         106 :         PyModule_AddObject(m, "wbint_AuthUserInfo", (PyObject *)(void *)&wbint_AuthUserInfo_Type);
   21641         106 :         Py_INCREF((PyObject *)(void *)&wbint_PamAuthCrapValidation_Type);
   21642         106 :         PyModule_AddObject(m, "wbint_PamAuthCrapValidation", (PyObject *)(void *)&wbint_PamAuthCrapValidation_Type);
   21643         106 :         Py_INCREF((PyObject *)(void *)&wbint_Ping_Type);
   21644         106 :         PyModule_AddObject(m, "wbint_Ping", (PyObject *)(void *)&wbint_Ping_Type);
   21645         106 :         Py_INCREF((PyObject *)(void *)&wbint_LookupSid_Type);
   21646         106 :         PyModule_AddObject(m, "wbint_LookupSid", (PyObject *)(void *)&wbint_LookupSid_Type);
   21647         106 :         Py_INCREF((PyObject *)(void *)&wbint_LookupSids_Type);
   21648         106 :         PyModule_AddObject(m, "wbint_LookupSids", (PyObject *)(void *)&wbint_LookupSids_Type);
   21649         106 :         Py_INCREF((PyObject *)(void *)&wbint_LookupName_Type);
   21650         106 :         PyModule_AddObject(m, "wbint_LookupName", (PyObject *)(void *)&wbint_LookupName_Type);
   21651         106 :         Py_INCREF((PyObject *)(void *)&wbint_Sids2UnixIDs_Type);
   21652         106 :         PyModule_AddObject(m, "wbint_Sids2UnixIDs", (PyObject *)(void *)&wbint_Sids2UnixIDs_Type);
   21653         106 :         Py_INCREF((PyObject *)(void *)&wbint_UnixIDs2Sids_Type);
   21654         106 :         PyModule_AddObject(m, "wbint_UnixIDs2Sids", (PyObject *)(void *)&wbint_UnixIDs2Sids_Type);
   21655         106 :         Py_INCREF((PyObject *)(void *)&wbint_AllocateUid_Type);
   21656         106 :         PyModule_AddObject(m, "wbint_AllocateUid", (PyObject *)(void *)&wbint_AllocateUid_Type);
   21657         106 :         Py_INCREF((PyObject *)(void *)&wbint_AllocateGid_Type);
   21658         106 :         PyModule_AddObject(m, "wbint_AllocateGid", (PyObject *)(void *)&wbint_AllocateGid_Type);
   21659         106 :         Py_INCREF((PyObject *)(void *)&wbint_GetNssInfo_Type);
   21660         106 :         PyModule_AddObject(m, "wbint_GetNssInfo", (PyObject *)(void *)&wbint_GetNssInfo_Type);
   21661         106 :         Py_INCREF((PyObject *)(void *)&wbint_LookupUserAliases_Type);
   21662         106 :         PyModule_AddObject(m, "wbint_LookupUserAliases", (PyObject *)(void *)&wbint_LookupUserAliases_Type);
   21663         106 :         Py_INCREF((PyObject *)(void *)&wbint_LookupUserGroups_Type);
   21664         106 :         PyModule_AddObject(m, "wbint_LookupUserGroups", (PyObject *)(void *)&wbint_LookupUserGroups_Type);
   21665         106 :         Py_INCREF((PyObject *)(void *)&wbint_QuerySequenceNumber_Type);
   21666         106 :         PyModule_AddObject(m, "wbint_QuerySequenceNumber", (PyObject *)(void *)&wbint_QuerySequenceNumber_Type);
   21667         106 :         Py_INCREF((PyObject *)(void *)&wbint_LookupGroupMembers_Type);
   21668         106 :         PyModule_AddObject(m, "wbint_LookupGroupMembers", (PyObject *)(void *)&wbint_LookupGroupMembers_Type);
   21669         106 :         Py_INCREF((PyObject *)(void *)&wbint_QueryGroupList_Type);
   21670         106 :         PyModule_AddObject(m, "wbint_QueryGroupList", (PyObject *)(void *)&wbint_QueryGroupList_Type);
   21671         106 :         Py_INCREF((PyObject *)(void *)&wbint_QueryUserRidList_Type);
   21672         106 :         PyModule_AddObject(m, "wbint_QueryUserRidList", (PyObject *)(void *)&wbint_QueryUserRidList_Type);
   21673         106 :         Py_INCREF((PyObject *)(void *)&wbint_DsGetDcName_Type);
   21674         106 :         PyModule_AddObject(m, "wbint_DsGetDcName", (PyObject *)(void *)&wbint_DsGetDcName_Type);
   21675         106 :         Py_INCREF((PyObject *)(void *)&wbint_LookupRids_Type);
   21676         106 :         PyModule_AddObject(m, "wbint_LookupRids", (PyObject *)(void *)&wbint_LookupRids_Type);
   21677         106 :         Py_INCREF((PyObject *)(void *)&wbint_CheckMachineAccount_Type);
   21678         106 :         PyModule_AddObject(m, "wbint_CheckMachineAccount", (PyObject *)(void *)&wbint_CheckMachineAccount_Type);
   21679         106 :         Py_INCREF((PyObject *)(void *)&wbint_ChangeMachineAccount_Type);
   21680         106 :         PyModule_AddObject(m, "wbint_ChangeMachineAccount", (PyObject *)(void *)&wbint_ChangeMachineAccount_Type);
   21681         106 :         Py_INCREF((PyObject *)(void *)&wbint_PingDc_Type);
   21682         106 :         PyModule_AddObject(m, "wbint_PingDc", (PyObject *)(void *)&wbint_PingDc_Type);
   21683         106 :         Py_INCREF((PyObject *)(void *)&wbint_ListTrustedDomains_Type);
   21684         106 :         PyModule_AddObject(m, "wbint_ListTrustedDomains", (PyObject *)(void *)&wbint_ListTrustedDomains_Type);
   21685         106 :         Py_INCREF((PyObject *)(void *)&wbint_PamAuth_Type);
   21686         106 :         PyModule_AddObject(m, "wbint_PamAuth", (PyObject *)(void *)&wbint_PamAuth_Type);
   21687         106 :         Py_INCREF((PyObject *)(void *)&wbint_PamAuthCrap_Type);
   21688         106 :         PyModule_AddObject(m, "wbint_PamAuthCrap", (PyObject *)(void *)&wbint_PamAuthCrap_Type);
   21689         106 :         Py_INCREF((PyObject *)(void *)&wbint_PamLogOff_Type);
   21690         106 :         PyModule_AddObject(m, "wbint_PamLogOff", (PyObject *)(void *)&wbint_PamLogOff_Type);
   21691         106 :         Py_INCREF((PyObject *)(void *)&wbint_PamAuthCrapChangePassword_Type);
   21692         106 :         PyModule_AddObject(m, "wbint_PamAuthCrapChangePassword", (PyObject *)(void *)&wbint_PamAuthCrapChangePassword_Type);
   21693         106 :         Py_INCREF((PyObject *)(void *)&wbint_PamAuthChangePassword_Type);
   21694         106 :         PyModule_AddObject(m, "wbint_PamAuthChangePassword", (PyObject *)(void *)&wbint_PamAuthChangePassword_Type);
   21695         106 :         Py_INCREF((PyObject *)(void *)&wbint_InitConnection_Type);
   21696         106 :         PyModule_AddObject(m, "wbint_InitConnection", (PyObject *)(void *)&wbint_InitConnection_Type);
   21697         106 :         Py_INCREF((PyObject *)(void *)&winbind_SamLogon_Type);
   21698         106 :         PyModule_AddObject(m, "SamLogon", (PyObject *)(void *)&winbind_SamLogon_Type);
   21699         106 :         Py_INCREF((PyObject *)(void *)&winbind_DsrUpdateReadOnlyServerDnsRecords_Type);
   21700         106 :         PyModule_AddObject(m, "DsrUpdateReadOnlyServerDnsRecords", (PyObject *)(void *)&winbind_DsrUpdateReadOnlyServerDnsRecords_Type);
   21701         106 :         Py_INCREF((PyObject *)(void *)&winbind_LogonControl_Type);
   21702         106 :         PyModule_AddObject(m, "LogonControl", (PyObject *)(void *)&winbind_LogonControl_Type);
   21703         106 :         Py_INCREF((PyObject *)(void *)&winbind_GetForestTrustInformation_Type);
   21704         106 :         PyModule_AddObject(m, "GetForestTrustInformation", (PyObject *)(void *)&winbind_GetForestTrustInformation_Type);
   21705         106 :         Py_INCREF((PyObject *)(void *)&winbind_SendToSam_Type);
   21706         106 :         PyModule_AddObject(m, "SendToSam", (PyObject *)(void *)&winbind_SendToSam_Type);
   21707         106 :         Py_INCREF((PyObject *)(void *)&winbind_InterfaceType);
   21708         106 :         PyModule_AddObject(m, "winbind", (PyObject *)(void *)&winbind_InterfaceType);
   21709         106 :         Py_INCREF((PyObject *)(void *)&winbind_SyntaxType);
   21710         106 :         PyModule_AddObject(m, "winbind_abstract_syntax", (PyObject *)(void *)&winbind_SyntaxType);
   21711         106 :         Py_INCREF((PyObject *)(void *)&winbind_SyntaxType);
   21712         106 :         PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&winbind_SyntaxType);
   21713             : #ifdef PY_MOD_WINBIND_PATCH
   21714             :         PY_MOD_WINBIND_PATCH(m);
   21715             : #endif
   21716         106 :         out:
   21717         106 :         Py_XDECREF(dep_samba_dcerpc_lsa);
   21718         106 :         Py_XDECREF(dep_samba_dcerpc_netlogon);
   21719         106 :         Py_XDECREF(dep_samba_dcerpc_samr);
   21720         106 :         Py_XDECREF(dep_samba_dcerpc_misc);
   21721         106 :         Py_XDECREF(dep_samba_dcerpc_security);
   21722         106 :         Py_XDECREF(dep_samba_dcerpc_idmap);
   21723         106 :         Py_XDECREF(dep_talloc);
   21724         106 :         Py_XDECREF(dep_samba_dcerpc_base);
   21725         106 :         return m;
   21726             : 
   21727             : }

Generated by: LCOV version 1.14