git add -f bin/default/librpc/gen_ndr/*.{c,h,ndr,pidl} bin/default/source*/librpc...
[metze/samba/wip.git] / bin / default / librpc / gen_ndr / py_lsa.c
1
2 /* Python wrapper functions auto-generated by pidl */
3 #include <Python.h>
4 #include "includes.h"
5 #include <pytalloc.h>
6 #include "librpc/rpc/pyrpc.h"
7 #include "librpc/rpc/pyrpc_util.h"
8 #include "bin/default/librpc/gen_ndr/ndr_lsa.h"
9 #include "bin/default/librpc/gen_ndr/ndr_lsa_c.h"
10
11 /*
12  * These functions are here to ensure they can be optomised out by
13  * the compiler based on the constant input values
14  */
15
16 static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
17 {
18         switch (var_size) {
19         case 8:
20                 return UINT64_MAX;
21         case 4:
22                 return UINT32_MAX;
23         case 2:
24                 return UINT16_MAX;
25         case 1:
26                 return UINT8_MAX;
27         }
28
29         return 0;
30 }
31
32 static inline long long ndr_sizeof2intmax(size_t var_size)
33 {
34         switch (var_size) {
35         case 8:
36                 return INT64_MAX;
37         case 4:
38                 return INT32_MAX;
39         case 2:
40                 return INT16_MAX;
41         case 1:
42                 return INT8_MAX;
43         }
44
45         return 0;
46 }
47
48 static inline PyObject *ndr_PyLong_FromLongLong(long long v)
49 {
50         if (v > LONG_MAX || v < LONG_MIN) {
51                 return PyLong_FromLongLong(v);
52         } else {
53                 return PyInt_FromLong(v);
54         }
55 }
56
57 static inline PyObject *ndr_PyLong_FromUnsignedLongLong(unsigned long long v)
58 {
59         if (v > LONG_MAX) {
60                 return PyLong_FromUnsignedLongLong(v);
61         } else {
62                 return PyInt_FromLong(v);
63         }
64 }
65
66 #include "librpc/gen_ndr/misc.h"
67 #include "librpc/gen_ndr/security.h"
68 static PyTypeObject lsa_String_Type;
69 static PyTypeObject lsa_StringLarge_Type;
70 static PyTypeObject lsa_Strings_Type;
71 static PyTypeObject lsa_AsciiString_Type;
72 static PyTypeObject lsa_AsciiStringLarge_Type;
73 static PyTypeObject lsa_BinaryString_Type;
74 static PyTypeObject lsa_LUID_Type;
75 static PyTypeObject lsa_PrivEntry_Type;
76 static PyTypeObject lsa_PrivArray_Type;
77 static PyTypeObject lsa_QosInfo_Type;
78 static PyTypeObject lsa_ObjectAttribute_Type;
79 static PyTypeObject lsa_AuditLogInfo_Type;
80 static PyTypeObject lsa_AuditEventsInfo_Type;
81 static PyTypeObject lsa_DomainInfo_Type;
82 static PyTypeObject lsa_PDAccountInfo_Type;
83 static PyTypeObject lsa_ServerRole_Type;
84 static PyTypeObject lsa_ReplicaSourceInfo_Type;
85 static PyTypeObject lsa_DefaultQuotaInfo_Type;
86 static PyTypeObject lsa_ModificationInfo_Type;
87 static PyTypeObject lsa_AuditFullSetInfo_Type;
88 static PyTypeObject lsa_AuditFullQueryInfo_Type;
89 static PyTypeObject lsa_DnsDomainInfo_Type;
90 PyObject *py_import_lsa_PolicyInformation(TALLOC_CTX *mem_ctx, int level, union lsa_PolicyInformation *in);
91 union lsa_PolicyInformation *py_export_lsa_PolicyInformation(TALLOC_CTX *mem_ctx, int level, PyObject *in);
92 static PyTypeObject lsa_SidPtr_Type;
93 static PyTypeObject lsa_SidArray_Type;
94 static PyTypeObject lsa_DomainList_Type;
95 static PyTypeObject lsa_TranslatedSid_Type;
96 static PyTypeObject lsa_TransSidArray_Type;
97 static PyTypeObject lsa_RefDomainList_Type;
98 static PyTypeObject lsa_TranslatedName_Type;
99 static PyTypeObject lsa_TransNameArray_Type;
100 static PyTypeObject lsa_LUIDAttribute_Type;
101 static PyTypeObject lsa_PrivilegeSet_Type;
102 static PyTypeObject lsa_DATA_BUF_Type;
103 static PyTypeObject lsa_DATA_BUF2_Type;
104 static PyTypeObject lsa_TrustDomainInfoName_Type;
105 static PyTypeObject lsa_TrustDomainInfoControllers_Type;
106 static PyTypeObject lsa_TrustDomainInfoPosixOffset_Type;
107 static PyTypeObject lsa_TrustDomainInfoPassword_Type;
108 static PyTypeObject lsa_TrustDomainInfoBasic_Type;
109 static PyTypeObject lsa_TrustDomainInfoInfoEx_Type;
110 static PyTypeObject lsa_TrustDomainInfoBuffer_Type;
111 static PyTypeObject lsa_TrustDomainInfoAuthInfo_Type;
112 static PyTypeObject lsa_TrustDomainInfoFullInfo_Type;
113 static PyTypeObject lsa_TrustDomainInfoAuthInfoInternal_Type;
114 static PyTypeObject lsa_TrustDomainInfoFullInfoInternal_Type;
115 static PyTypeObject lsa_TrustDomainInfoInfoEx2Internal_Type;
116 static PyTypeObject lsa_TrustDomainInfoFullInfo2Internal_Type;
117 static PyTypeObject lsa_TrustDomainInfoSupportedEncTypes_Type;
118 PyObject *py_import_lsa_TrustedDomainInfo(TALLOC_CTX *mem_ctx, int level, union lsa_TrustedDomainInfo *in);
119 union lsa_TrustedDomainInfo *py_export_lsa_TrustedDomainInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in);
120 static PyTypeObject lsa_DATA_BUF_PTR_Type;
121 static PyTypeObject lsa_RightAttribute_Type;
122 static PyTypeObject lsa_RightSet_Type;
123 static PyTypeObject lsa_DomainListEx_Type;
124 static PyTypeObject lsa_DomainInfoKerberos_Type;
125 static PyTypeObject lsa_DomainInfoEfs_Type;
126 PyObject *py_import_lsa_DomainInformationPolicy(TALLOC_CTX *mem_ctx, int level, union lsa_DomainInformationPolicy *in);
127 union lsa_DomainInformationPolicy *py_export_lsa_DomainInformationPolicy(TALLOC_CTX *mem_ctx, int level, PyObject *in);
128 static PyTypeObject lsa_TranslatedName2_Type;
129 static PyTypeObject lsa_TransNameArray2_Type;
130 static PyTypeObject lsa_TranslatedSid2_Type;
131 static PyTypeObject lsa_TransSidArray2_Type;
132 static PyTypeObject lsa_TranslatedSid3_Type;
133 static PyTypeObject lsa_TransSidArray3_Type;
134 static PyTypeObject lsa_ForestTrustBinaryData_Type;
135 static PyTypeObject lsa_ForestTrustDomainInfo_Type;
136 PyObject *py_import_lsa_ForestTrustData(TALLOC_CTX *mem_ctx, int level, union lsa_ForestTrustData *in);
137 union lsa_ForestTrustData *py_export_lsa_ForestTrustData(TALLOC_CTX *mem_ctx, int level, PyObject *in);
138 static PyTypeObject lsa_ForestTrustRecord_Type;
139 static PyTypeObject lsa_ForestTrustInformation_Type;
140 static PyTypeObject lsa_ForestTrustCollisionRecord_Type;
141 static PyTypeObject lsa_ForestTrustCollisionInfo_Type;
142 static PyTypeObject lsarpc_InterfaceType;
143
144 void initlsa(void);static PyTypeObject *Object_Type;
145 static PyTypeObject *security_descriptor_Type;
146 static PyTypeObject *dom_sid_Type;
147 static PyTypeObject *GUID_Type;
148 static PyTypeObject *policy_handle_Type;
149 static PyTypeObject *sec_desc_buf_Type;
150 static PyTypeObject *ClientConnection_Type;
151 static PyTypeObject *ndr_syntax_id_Type;
152
153 static PyObject *py_lsa_String_get_length(PyObject *obj, void *closure)
154 {
155         struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(obj);
156         PyObject *py_length;
157         py_length = PyInt_FromLong((uint16_t)object->length);
158         return py_length;
159 }
160
161 static int py_lsa_String_set_length(PyObject *py_obj, PyObject *value, void *closure)
162 {
163         struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
164         {
165                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
166                 if (PyLong_Check(value)) {
167                         unsigned long long test_var;
168                         test_var = PyLong_AsUnsignedLongLong(value);
169                         if (PyErr_Occurred() != NULL) {
170                                 return -1;
171                         }
172                         if (test_var > uint_max) {
173                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
174                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
175                                 return -1;
176                         }
177                         object->length = test_var;
178                 } else if (PyInt_Check(value)) {
179                         long test_var;
180                         test_var = PyInt_AsLong(value);
181                         if (test_var < 0 || test_var > uint_max) {
182                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
183                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
184                                 return -1;
185                         }
186                         object->length = test_var;
187                 } else {
188                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
189                           PyInt_Type.tp_name, PyLong_Type.tp_name);
190                         return -1;
191                 }
192         }
193         return 0;
194 }
195
196 static PyObject *py_lsa_String_get_size(PyObject *obj, void *closure)
197 {
198         struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(obj);
199         PyObject *py_size;
200         py_size = PyInt_FromLong((uint16_t)object->size);
201         return py_size;
202 }
203
204 static int py_lsa_String_set_size(PyObject *py_obj, PyObject *value, void *closure)
205 {
206         struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
207         {
208                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
209                 if (PyLong_Check(value)) {
210                         unsigned long long test_var;
211                         test_var = PyLong_AsUnsignedLongLong(value);
212                         if (PyErr_Occurred() != NULL) {
213                                 return -1;
214                         }
215                         if (test_var > uint_max) {
216                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
217                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
218                                 return -1;
219                         }
220                         object->size = test_var;
221                 } else if (PyInt_Check(value)) {
222                         long test_var;
223                         test_var = PyInt_AsLong(value);
224                         if (test_var < 0 || test_var > uint_max) {
225                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
226                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
227                                 return -1;
228                         }
229                         object->size = test_var;
230                 } else {
231                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
232                           PyInt_Type.tp_name, PyLong_Type.tp_name);
233                         return -1;
234                 }
235         }
236         return 0;
237 }
238
239 static PyObject *py_lsa_String_get_string(PyObject *obj, void *closure)
240 {
241         struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(obj);
242         PyObject *py_string;
243         if (object->string == NULL) {
244                 py_string = Py_None;
245                 Py_INCREF(py_string);
246         } else {
247                 if (object->string == NULL) {
248                         py_string = Py_None;
249                         Py_INCREF(py_string);
250                 } else {
251                         py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
252                 }
253         }
254         return py_string;
255 }
256
257 static int py_lsa_String_set_string(PyObject *py_obj, PyObject *value, void *closure)
258 {
259         struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
260         if (value == Py_None) {
261                 object->string = NULL;
262         } else {
263                 object->string = NULL;
264                 if (PyUnicode_Check(value)) {
265                         object->string = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
266                 } else if (PyString_Check(value)) {
267                         object->string = PyString_AS_STRING(value);
268                 } else {
269                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
270                         return -1;
271                 }
272         }
273         return 0;
274 }
275
276 static PyGetSetDef py_lsa_String_getsetters[] = {
277         { discard_const_p(char, "length"), py_lsa_String_get_length, py_lsa_String_set_length },
278         { discard_const_p(char, "size"), py_lsa_String_get_size, py_lsa_String_set_size },
279         { discard_const_p(char, "string"), py_lsa_String_get_string, py_lsa_String_set_string },
280         { NULL }
281 };
282
283 static PyObject *py_lsa_String_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
284 {
285         return pytalloc_new(struct lsa_String, type);
286 }
287
288 static PyObject *py_lsa_String_ndr_pack(PyObject *py_obj)
289 {
290         struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
291         DATA_BLOB blob;
292         enum ndr_err_code err;
293         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_String);
294         if (err != NDR_ERR_SUCCESS) {
295                 PyErr_SetNdrError(err);
296                 return NULL;
297         }
298
299         return PyString_FromStringAndSize((char *)blob.data, blob.length);
300 }
301
302 static PyObject *py_lsa_String_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
303 {
304         struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
305         DATA_BLOB blob;
306         int blob_length = 0;
307         enum ndr_err_code err;
308         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
309         PyObject *allow_remaining_obj = NULL;
310         bool allow_remaining = false;
311
312         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
313                 discard_const_p(char *, kwnames),
314                 &blob.data, &blob_length,
315                 &allow_remaining_obj)) {
316                 return NULL;
317         }
318         blob.length = blob_length;
319
320         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
321                 allow_remaining = true;
322         }
323
324         if (allow_remaining) {
325                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_String);
326         } else {
327                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_String);
328         }
329         if (err != NDR_ERR_SUCCESS) {
330                 PyErr_SetNdrError(err);
331                 return NULL;
332         }
333
334         Py_RETURN_NONE;
335 }
336
337 static PyObject *py_lsa_String_ndr_print(PyObject *py_obj)
338 {
339         struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
340         PyObject *ret;
341         char *retstr;
342
343         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_String, "lsa_String", object);
344         ret = PyString_FromString(retstr);
345         talloc_free(retstr);
346
347         return ret;
348 }
349
350 static PyMethodDef py_lsa_String_methods[] = {
351         { "__ndr_pack__", (PyCFunction)py_lsa_String_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
352         { "__ndr_unpack__", (PyCFunction)py_lsa_String_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
353         { "__ndr_print__", (PyCFunction)py_lsa_String_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
354         { NULL, NULL, 0, NULL }
355 };
356
357
358 static PyTypeObject lsa_String_Type = {
359         PyObject_HEAD_INIT(NULL) 0,
360         .tp_name = "lsa.String",
361         .tp_getset = py_lsa_String_getsetters,
362         .tp_methods = py_lsa_String_methods,
363         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
364         .tp_basicsize = sizeof(pytalloc_Object),
365         .tp_new = py_lsa_String_new,
366 };
367
368
369 static PyObject *py_lsa_StringLarge_get_length(PyObject *obj, void *closure)
370 {
371         struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(obj);
372         PyObject *py_length;
373         py_length = PyInt_FromLong((uint16_t)object->length);
374         return py_length;
375 }
376
377 static int py_lsa_StringLarge_set_length(PyObject *py_obj, PyObject *value, void *closure)
378 {
379         struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
380         {
381                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
382                 if (PyLong_Check(value)) {
383                         unsigned long long test_var;
384                         test_var = PyLong_AsUnsignedLongLong(value);
385                         if (PyErr_Occurred() != NULL) {
386                                 return -1;
387                         }
388                         if (test_var > uint_max) {
389                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
390                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
391                                 return -1;
392                         }
393                         object->length = test_var;
394                 } else if (PyInt_Check(value)) {
395                         long test_var;
396                         test_var = PyInt_AsLong(value);
397                         if (test_var < 0 || test_var > uint_max) {
398                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
399                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
400                                 return -1;
401                         }
402                         object->length = test_var;
403                 } else {
404                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
405                           PyInt_Type.tp_name, PyLong_Type.tp_name);
406                         return -1;
407                 }
408         }
409         return 0;
410 }
411
412 static PyObject *py_lsa_StringLarge_get_size(PyObject *obj, void *closure)
413 {
414         struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(obj);
415         PyObject *py_size;
416         py_size = PyInt_FromLong((uint16_t)object->size);
417         return py_size;
418 }
419
420 static int py_lsa_StringLarge_set_size(PyObject *py_obj, PyObject *value, void *closure)
421 {
422         struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
423         {
424                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
425                 if (PyLong_Check(value)) {
426                         unsigned long long test_var;
427                         test_var = PyLong_AsUnsignedLongLong(value);
428                         if (PyErr_Occurred() != NULL) {
429                                 return -1;
430                         }
431                         if (test_var > uint_max) {
432                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
433                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
434                                 return -1;
435                         }
436                         object->size = test_var;
437                 } else if (PyInt_Check(value)) {
438                         long test_var;
439                         test_var = PyInt_AsLong(value);
440                         if (test_var < 0 || test_var > uint_max) {
441                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
442                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
443                                 return -1;
444                         }
445                         object->size = test_var;
446                 } else {
447                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
448                           PyInt_Type.tp_name, PyLong_Type.tp_name);
449                         return -1;
450                 }
451         }
452         return 0;
453 }
454
455 static PyObject *py_lsa_StringLarge_get_string(PyObject *obj, void *closure)
456 {
457         struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(obj);
458         PyObject *py_string;
459         if (object->string == NULL) {
460                 py_string = Py_None;
461                 Py_INCREF(py_string);
462         } else {
463                 if (object->string == NULL) {
464                         py_string = Py_None;
465                         Py_INCREF(py_string);
466                 } else {
467                         py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
468                 }
469         }
470         return py_string;
471 }
472
473 static int py_lsa_StringLarge_set_string(PyObject *py_obj, PyObject *value, void *closure)
474 {
475         struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
476         if (value == Py_None) {
477                 object->string = NULL;
478         } else {
479                 object->string = NULL;
480                 if (PyUnicode_Check(value)) {
481                         object->string = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
482                 } else if (PyString_Check(value)) {
483                         object->string = PyString_AS_STRING(value);
484                 } else {
485                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
486                         return -1;
487                 }
488         }
489         return 0;
490 }
491
492 static PyGetSetDef py_lsa_StringLarge_getsetters[] = {
493         { discard_const_p(char, "length"), py_lsa_StringLarge_get_length, py_lsa_StringLarge_set_length },
494         { discard_const_p(char, "size"), py_lsa_StringLarge_get_size, py_lsa_StringLarge_set_size },
495         { discard_const_p(char, "string"), py_lsa_StringLarge_get_string, py_lsa_StringLarge_set_string },
496         { NULL }
497 };
498
499 static PyObject *py_lsa_StringLarge_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
500 {
501         return pytalloc_new(struct lsa_StringLarge, type);
502 }
503
504 static PyObject *py_lsa_StringLarge_ndr_pack(PyObject *py_obj)
505 {
506         struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
507         DATA_BLOB blob;
508         enum ndr_err_code err;
509         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_StringLarge);
510         if (err != NDR_ERR_SUCCESS) {
511                 PyErr_SetNdrError(err);
512                 return NULL;
513         }
514
515         return PyString_FromStringAndSize((char *)blob.data, blob.length);
516 }
517
518 static PyObject *py_lsa_StringLarge_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
519 {
520         struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
521         DATA_BLOB blob;
522         int blob_length = 0;
523         enum ndr_err_code err;
524         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
525         PyObject *allow_remaining_obj = NULL;
526         bool allow_remaining = false;
527
528         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
529                 discard_const_p(char *, kwnames),
530                 &blob.data, &blob_length,
531                 &allow_remaining_obj)) {
532                 return NULL;
533         }
534         blob.length = blob_length;
535
536         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
537                 allow_remaining = true;
538         }
539
540         if (allow_remaining) {
541                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_StringLarge);
542         } else {
543                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_StringLarge);
544         }
545         if (err != NDR_ERR_SUCCESS) {
546                 PyErr_SetNdrError(err);
547                 return NULL;
548         }
549
550         Py_RETURN_NONE;
551 }
552
553 static PyObject *py_lsa_StringLarge_ndr_print(PyObject *py_obj)
554 {
555         struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
556         PyObject *ret;
557         char *retstr;
558
559         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_StringLarge, "lsa_StringLarge", object);
560         ret = PyString_FromString(retstr);
561         talloc_free(retstr);
562
563         return ret;
564 }
565
566 static PyMethodDef py_lsa_StringLarge_methods[] = {
567         { "__ndr_pack__", (PyCFunction)py_lsa_StringLarge_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
568         { "__ndr_unpack__", (PyCFunction)py_lsa_StringLarge_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
569         { "__ndr_print__", (PyCFunction)py_lsa_StringLarge_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
570         { NULL, NULL, 0, NULL }
571 };
572
573
574 static PyTypeObject lsa_StringLarge_Type = {
575         PyObject_HEAD_INIT(NULL) 0,
576         .tp_name = "lsa.StringLarge",
577         .tp_getset = py_lsa_StringLarge_getsetters,
578         .tp_methods = py_lsa_StringLarge_methods,
579         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
580         .tp_basicsize = sizeof(pytalloc_Object),
581         .tp_new = py_lsa_StringLarge_new,
582 };
583
584
585 static PyObject *py_lsa_Strings_get_count(PyObject *obj, void *closure)
586 {
587         struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(obj);
588         PyObject *py_count;
589         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
590         return py_count;
591 }
592
593 static int py_lsa_Strings_set_count(PyObject *py_obj, PyObject *value, void *closure)
594 {
595         struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
596         {
597                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
598                 if (PyLong_Check(value)) {
599                         unsigned long long test_var;
600                         test_var = PyLong_AsUnsignedLongLong(value);
601                         if (PyErr_Occurred() != NULL) {
602                                 return -1;
603                         }
604                         if (test_var > uint_max) {
605                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
606                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
607                                 return -1;
608                         }
609                         object->count = test_var;
610                 } else if (PyInt_Check(value)) {
611                         long test_var;
612                         test_var = PyInt_AsLong(value);
613                         if (test_var < 0 || test_var > uint_max) {
614                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
615                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
616                                 return -1;
617                         }
618                         object->count = test_var;
619                 } else {
620                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
621                           PyInt_Type.tp_name, PyLong_Type.tp_name);
622                         return -1;
623                 }
624         }
625         return 0;
626 }
627
628 static PyObject *py_lsa_Strings_get_names(PyObject *obj, void *closure)
629 {
630         struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(obj);
631         PyObject *py_names;
632         if (object->names == NULL) {
633                 py_names = Py_None;
634                 Py_INCREF(py_names);
635         } else {
636                 py_names = PyList_New(object->count);
637                 if (py_names == NULL) {
638                         return NULL;
639                 }
640                 {
641                         int names_cntr_1;
642                         for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
643                                 PyObject *py_names_1;
644                                 py_names_1 = pytalloc_reference_ex(&lsa_String_Type, object->names, &object->names[names_cntr_1]);
645                                 PyList_SetItem(py_names, names_cntr_1, py_names_1);
646                         }
647                 }
648         }
649         return py_names;
650 }
651
652 static int py_lsa_Strings_set_names(PyObject *py_obj, PyObject *value, void *closure)
653 {
654         struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
655         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
656         if (value == Py_None) {
657                 object->names = NULL;
658         } else {
659                 object->names = NULL;
660                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
661                 {
662                         int names_cntr_1;
663                         object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
664                         if (!object->names) { return -1;; }
665                         talloc_set_name_const(object->names, "ARRAY: object->names");
666                         for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
667                                 PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
668                                 if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
669                                         PyErr_NoMemory();
670                                         return -1;
671                                 }
672                                 object->names[names_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
673                         }
674                 }
675         }
676         return 0;
677 }
678
679 static PyGetSetDef py_lsa_Strings_getsetters[] = {
680         { discard_const_p(char, "count"), py_lsa_Strings_get_count, py_lsa_Strings_set_count },
681         { discard_const_p(char, "names"), py_lsa_Strings_get_names, py_lsa_Strings_set_names },
682         { NULL }
683 };
684
685 static PyObject *py_lsa_Strings_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
686 {
687         return pytalloc_new(struct lsa_Strings, type);
688 }
689
690 static PyObject *py_lsa_Strings_ndr_pack(PyObject *py_obj)
691 {
692         struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
693         DATA_BLOB blob;
694         enum ndr_err_code err;
695         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_Strings);
696         if (err != NDR_ERR_SUCCESS) {
697                 PyErr_SetNdrError(err);
698                 return NULL;
699         }
700
701         return PyString_FromStringAndSize((char *)blob.data, blob.length);
702 }
703
704 static PyObject *py_lsa_Strings_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
705 {
706         struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
707         DATA_BLOB blob;
708         int blob_length = 0;
709         enum ndr_err_code err;
710         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
711         PyObject *allow_remaining_obj = NULL;
712         bool allow_remaining = false;
713
714         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
715                 discard_const_p(char *, kwnames),
716                 &blob.data, &blob_length,
717                 &allow_remaining_obj)) {
718                 return NULL;
719         }
720         blob.length = blob_length;
721
722         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
723                 allow_remaining = true;
724         }
725
726         if (allow_remaining) {
727                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_Strings);
728         } else {
729                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_Strings);
730         }
731         if (err != NDR_ERR_SUCCESS) {
732                 PyErr_SetNdrError(err);
733                 return NULL;
734         }
735
736         Py_RETURN_NONE;
737 }
738
739 static PyObject *py_lsa_Strings_ndr_print(PyObject *py_obj)
740 {
741         struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
742         PyObject *ret;
743         char *retstr;
744
745         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_Strings, "lsa_Strings", object);
746         ret = PyString_FromString(retstr);
747         talloc_free(retstr);
748
749         return ret;
750 }
751
752 static PyMethodDef py_lsa_Strings_methods[] = {
753         { "__ndr_pack__", (PyCFunction)py_lsa_Strings_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
754         { "__ndr_unpack__", (PyCFunction)py_lsa_Strings_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
755         { "__ndr_print__", (PyCFunction)py_lsa_Strings_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
756         { NULL, NULL, 0, NULL }
757 };
758
759
760 static PyTypeObject lsa_Strings_Type = {
761         PyObject_HEAD_INIT(NULL) 0,
762         .tp_name = "lsa.Strings",
763         .tp_getset = py_lsa_Strings_getsetters,
764         .tp_methods = py_lsa_Strings_methods,
765         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
766         .tp_basicsize = sizeof(pytalloc_Object),
767         .tp_new = py_lsa_Strings_new,
768 };
769
770
771 static PyObject *py_lsa_AsciiString_get_length(PyObject *obj, void *closure)
772 {
773         struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(obj);
774         PyObject *py_length;
775         py_length = PyInt_FromLong((uint16_t)object->length);
776         return py_length;
777 }
778
779 static int py_lsa_AsciiString_set_length(PyObject *py_obj, PyObject *value, void *closure)
780 {
781         struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
782         {
783                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
784                 if (PyLong_Check(value)) {
785                         unsigned long long test_var;
786                         test_var = PyLong_AsUnsignedLongLong(value);
787                         if (PyErr_Occurred() != NULL) {
788                                 return -1;
789                         }
790                         if (test_var > uint_max) {
791                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
792                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
793                                 return -1;
794                         }
795                         object->length = test_var;
796                 } else if (PyInt_Check(value)) {
797                         long test_var;
798                         test_var = PyInt_AsLong(value);
799                         if (test_var < 0 || test_var > uint_max) {
800                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
801                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
802                                 return -1;
803                         }
804                         object->length = test_var;
805                 } else {
806                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
807                           PyInt_Type.tp_name, PyLong_Type.tp_name);
808                         return -1;
809                 }
810         }
811         return 0;
812 }
813
814 static PyObject *py_lsa_AsciiString_get_size(PyObject *obj, void *closure)
815 {
816         struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(obj);
817         PyObject *py_size;
818         py_size = PyInt_FromLong((uint16_t)object->size);
819         return py_size;
820 }
821
822 static int py_lsa_AsciiString_set_size(PyObject *py_obj, PyObject *value, void *closure)
823 {
824         struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
825         {
826                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
827                 if (PyLong_Check(value)) {
828                         unsigned long long test_var;
829                         test_var = PyLong_AsUnsignedLongLong(value);
830                         if (PyErr_Occurred() != NULL) {
831                                 return -1;
832                         }
833                         if (test_var > uint_max) {
834                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
835                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
836                                 return -1;
837                         }
838                         object->size = test_var;
839                 } else if (PyInt_Check(value)) {
840                         long test_var;
841                         test_var = PyInt_AsLong(value);
842                         if (test_var < 0 || test_var > uint_max) {
843                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
844                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
845                                 return -1;
846                         }
847                         object->size = test_var;
848                 } else {
849                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
850                           PyInt_Type.tp_name, PyLong_Type.tp_name);
851                         return -1;
852                 }
853         }
854         return 0;
855 }
856
857 static PyObject *py_lsa_AsciiString_get_string(PyObject *obj, void *closure)
858 {
859         struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(obj);
860         PyObject *py_string;
861         if (object->string == NULL) {
862                 py_string = Py_None;
863                 Py_INCREF(py_string);
864         } else {
865                 if (object->string == NULL) {
866                         py_string = Py_None;
867                         Py_INCREF(py_string);
868                 } else {
869                         py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
870                 }
871         }
872         return py_string;
873 }
874
875 static int py_lsa_AsciiString_set_string(PyObject *py_obj, PyObject *value, void *closure)
876 {
877         struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
878         if (value == Py_None) {
879                 object->string = NULL;
880         } else {
881                 object->string = NULL;
882                 if (PyUnicode_Check(value)) {
883                         object->string = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
884                 } else if (PyString_Check(value)) {
885                         object->string = PyString_AS_STRING(value);
886                 } else {
887                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
888                         return -1;
889                 }
890         }
891         return 0;
892 }
893
894 static PyGetSetDef py_lsa_AsciiString_getsetters[] = {
895         { discard_const_p(char, "length"), py_lsa_AsciiString_get_length, py_lsa_AsciiString_set_length },
896         { discard_const_p(char, "size"), py_lsa_AsciiString_get_size, py_lsa_AsciiString_set_size },
897         { discard_const_p(char, "string"), py_lsa_AsciiString_get_string, py_lsa_AsciiString_set_string },
898         { NULL }
899 };
900
901 static PyObject *py_lsa_AsciiString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
902 {
903         return pytalloc_new(struct lsa_AsciiString, type);
904 }
905
906 static PyObject *py_lsa_AsciiString_ndr_pack(PyObject *py_obj)
907 {
908         struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
909         DATA_BLOB blob;
910         enum ndr_err_code err;
911         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_AsciiString);
912         if (err != NDR_ERR_SUCCESS) {
913                 PyErr_SetNdrError(err);
914                 return NULL;
915         }
916
917         return PyString_FromStringAndSize((char *)blob.data, blob.length);
918 }
919
920 static PyObject *py_lsa_AsciiString_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
921 {
922         struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
923         DATA_BLOB blob;
924         int blob_length = 0;
925         enum ndr_err_code err;
926         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
927         PyObject *allow_remaining_obj = NULL;
928         bool allow_remaining = false;
929
930         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
931                 discard_const_p(char *, kwnames),
932                 &blob.data, &blob_length,
933                 &allow_remaining_obj)) {
934                 return NULL;
935         }
936         blob.length = blob_length;
937
938         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
939                 allow_remaining = true;
940         }
941
942         if (allow_remaining) {
943                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiString);
944         } else {
945                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiString);
946         }
947         if (err != NDR_ERR_SUCCESS) {
948                 PyErr_SetNdrError(err);
949                 return NULL;
950         }
951
952         Py_RETURN_NONE;
953 }
954
955 static PyObject *py_lsa_AsciiString_ndr_print(PyObject *py_obj)
956 {
957         struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
958         PyObject *ret;
959         char *retstr;
960
961         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_AsciiString, "lsa_AsciiString", object);
962         ret = PyString_FromString(retstr);
963         talloc_free(retstr);
964
965         return ret;
966 }
967
968 static PyMethodDef py_lsa_AsciiString_methods[] = {
969         { "__ndr_pack__", (PyCFunction)py_lsa_AsciiString_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
970         { "__ndr_unpack__", (PyCFunction)py_lsa_AsciiString_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
971         { "__ndr_print__", (PyCFunction)py_lsa_AsciiString_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
972         { NULL, NULL, 0, NULL }
973 };
974
975
976 static PyTypeObject lsa_AsciiString_Type = {
977         PyObject_HEAD_INIT(NULL) 0,
978         .tp_name = "lsa.AsciiString",
979         .tp_getset = py_lsa_AsciiString_getsetters,
980         .tp_methods = py_lsa_AsciiString_methods,
981         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
982         .tp_basicsize = sizeof(pytalloc_Object),
983         .tp_new = py_lsa_AsciiString_new,
984 };
985
986
987 static PyObject *py_lsa_AsciiStringLarge_get_length(PyObject *obj, void *closure)
988 {
989         struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(obj);
990         PyObject *py_length;
991         py_length = PyInt_FromLong((uint16_t)object->length);
992         return py_length;
993 }
994
995 static int py_lsa_AsciiStringLarge_set_length(PyObject *py_obj, PyObject *value, void *closure)
996 {
997         struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
998         {
999                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
1000                 if (PyLong_Check(value)) {
1001                         unsigned long long test_var;
1002                         test_var = PyLong_AsUnsignedLongLong(value);
1003                         if (PyErr_Occurred() != NULL) {
1004                                 return -1;
1005                         }
1006                         if (test_var > uint_max) {
1007                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1008                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1009                                 return -1;
1010                         }
1011                         object->length = test_var;
1012                 } else if (PyInt_Check(value)) {
1013                         long test_var;
1014                         test_var = PyInt_AsLong(value);
1015                         if (test_var < 0 || test_var > uint_max) {
1016                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1017                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1018                                 return -1;
1019                         }
1020                         object->length = test_var;
1021                 } else {
1022                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1023                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1024                         return -1;
1025                 }
1026         }
1027         return 0;
1028 }
1029
1030 static PyObject *py_lsa_AsciiStringLarge_get_size(PyObject *obj, void *closure)
1031 {
1032         struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(obj);
1033         PyObject *py_size;
1034         py_size = PyInt_FromLong((uint16_t)object->size);
1035         return py_size;
1036 }
1037
1038 static int py_lsa_AsciiStringLarge_set_size(PyObject *py_obj, PyObject *value, void *closure)
1039 {
1040         struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1041         {
1042                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
1043                 if (PyLong_Check(value)) {
1044                         unsigned long long test_var;
1045                         test_var = PyLong_AsUnsignedLongLong(value);
1046                         if (PyErr_Occurred() != NULL) {
1047                                 return -1;
1048                         }
1049                         if (test_var > uint_max) {
1050                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1051                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1052                                 return -1;
1053                         }
1054                         object->size = test_var;
1055                 } else if (PyInt_Check(value)) {
1056                         long test_var;
1057                         test_var = PyInt_AsLong(value);
1058                         if (test_var < 0 || test_var > uint_max) {
1059                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1060                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1061                                 return -1;
1062                         }
1063                         object->size = test_var;
1064                 } else {
1065                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1066                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1067                         return -1;
1068                 }
1069         }
1070         return 0;
1071 }
1072
1073 static PyObject *py_lsa_AsciiStringLarge_get_string(PyObject *obj, void *closure)
1074 {
1075         struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(obj);
1076         PyObject *py_string;
1077         if (object->string == NULL) {
1078                 py_string = Py_None;
1079                 Py_INCREF(py_string);
1080         } else {
1081                 if (object->string == NULL) {
1082                         py_string = Py_None;
1083                         Py_INCREF(py_string);
1084                 } else {
1085                         py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
1086                 }
1087         }
1088         return py_string;
1089 }
1090
1091 static int py_lsa_AsciiStringLarge_set_string(PyObject *py_obj, PyObject *value, void *closure)
1092 {
1093         struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1094         if (value == Py_None) {
1095                 object->string = NULL;
1096         } else {
1097                 object->string = NULL;
1098                 if (PyUnicode_Check(value)) {
1099                         object->string = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
1100                 } else if (PyString_Check(value)) {
1101                         object->string = PyString_AS_STRING(value);
1102                 } else {
1103                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1104                         return -1;
1105                 }
1106         }
1107         return 0;
1108 }
1109
1110 static PyGetSetDef py_lsa_AsciiStringLarge_getsetters[] = {
1111         { discard_const_p(char, "length"), py_lsa_AsciiStringLarge_get_length, py_lsa_AsciiStringLarge_set_length },
1112         { discard_const_p(char, "size"), py_lsa_AsciiStringLarge_get_size, py_lsa_AsciiStringLarge_set_size },
1113         { discard_const_p(char, "string"), py_lsa_AsciiStringLarge_get_string, py_lsa_AsciiStringLarge_set_string },
1114         { NULL }
1115 };
1116
1117 static PyObject *py_lsa_AsciiStringLarge_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1118 {
1119         return pytalloc_new(struct lsa_AsciiStringLarge, type);
1120 }
1121
1122 static PyObject *py_lsa_AsciiStringLarge_ndr_pack(PyObject *py_obj)
1123 {
1124         struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1125         DATA_BLOB blob;
1126         enum ndr_err_code err;
1127         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_AsciiStringLarge);
1128         if (err != NDR_ERR_SUCCESS) {
1129                 PyErr_SetNdrError(err);
1130                 return NULL;
1131         }
1132
1133         return PyString_FromStringAndSize((char *)blob.data, blob.length);
1134 }
1135
1136 static PyObject *py_lsa_AsciiStringLarge_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1137 {
1138         struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1139         DATA_BLOB blob;
1140         int blob_length = 0;
1141         enum ndr_err_code err;
1142         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1143         PyObject *allow_remaining_obj = NULL;
1144         bool allow_remaining = false;
1145
1146         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
1147                 discard_const_p(char *, kwnames),
1148                 &blob.data, &blob_length,
1149                 &allow_remaining_obj)) {
1150                 return NULL;
1151         }
1152         blob.length = blob_length;
1153
1154         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1155                 allow_remaining = true;
1156         }
1157
1158         if (allow_remaining) {
1159                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiStringLarge);
1160         } else {
1161                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiStringLarge);
1162         }
1163         if (err != NDR_ERR_SUCCESS) {
1164                 PyErr_SetNdrError(err);
1165                 return NULL;
1166         }
1167
1168         Py_RETURN_NONE;
1169 }
1170
1171 static PyObject *py_lsa_AsciiStringLarge_ndr_print(PyObject *py_obj)
1172 {
1173         struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1174         PyObject *ret;
1175         char *retstr;
1176
1177         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_AsciiStringLarge, "lsa_AsciiStringLarge", object);
1178         ret = PyString_FromString(retstr);
1179         talloc_free(retstr);
1180
1181         return ret;
1182 }
1183
1184 static PyMethodDef py_lsa_AsciiStringLarge_methods[] = {
1185         { "__ndr_pack__", (PyCFunction)py_lsa_AsciiStringLarge_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1186         { "__ndr_unpack__", (PyCFunction)py_lsa_AsciiStringLarge_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1187         { "__ndr_print__", (PyCFunction)py_lsa_AsciiStringLarge_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
1188         { NULL, NULL, 0, NULL }
1189 };
1190
1191
1192 static PyTypeObject lsa_AsciiStringLarge_Type = {
1193         PyObject_HEAD_INIT(NULL) 0,
1194         .tp_name = "lsa.AsciiStringLarge",
1195         .tp_getset = py_lsa_AsciiStringLarge_getsetters,
1196         .tp_methods = py_lsa_AsciiStringLarge_methods,
1197         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1198         .tp_basicsize = sizeof(pytalloc_Object),
1199         .tp_new = py_lsa_AsciiStringLarge_new,
1200 };
1201
1202
1203 static PyObject *py_lsa_BinaryString_get_length(PyObject *obj, void *closure)
1204 {
1205         struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(obj);
1206         PyObject *py_length;
1207         py_length = PyInt_FromLong((uint16_t)object->length);
1208         return py_length;
1209 }
1210
1211 static int py_lsa_BinaryString_set_length(PyObject *py_obj, PyObject *value, void *closure)
1212 {
1213         struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1214         {
1215                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
1216                 if (PyLong_Check(value)) {
1217                         unsigned long long test_var;
1218                         test_var = PyLong_AsUnsignedLongLong(value);
1219                         if (PyErr_Occurred() != NULL) {
1220                                 return -1;
1221                         }
1222                         if (test_var > uint_max) {
1223                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1224                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1225                                 return -1;
1226                         }
1227                         object->length = test_var;
1228                 } else if (PyInt_Check(value)) {
1229                         long test_var;
1230                         test_var = PyInt_AsLong(value);
1231                         if (test_var < 0 || test_var > uint_max) {
1232                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1233                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1234                                 return -1;
1235                         }
1236                         object->length = test_var;
1237                 } else {
1238                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1239                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1240                         return -1;
1241                 }
1242         }
1243         return 0;
1244 }
1245
1246 static PyObject *py_lsa_BinaryString_get_size(PyObject *obj, void *closure)
1247 {
1248         struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(obj);
1249         PyObject *py_size;
1250         py_size = PyInt_FromLong((uint16_t)object->size);
1251         return py_size;
1252 }
1253
1254 static int py_lsa_BinaryString_set_size(PyObject *py_obj, PyObject *value, void *closure)
1255 {
1256         struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1257         {
1258                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
1259                 if (PyLong_Check(value)) {
1260                         unsigned long long test_var;
1261                         test_var = PyLong_AsUnsignedLongLong(value);
1262                         if (PyErr_Occurred() != NULL) {
1263                                 return -1;
1264                         }
1265                         if (test_var > uint_max) {
1266                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1267                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1268                                 return -1;
1269                         }
1270                         object->size = test_var;
1271                 } else if (PyInt_Check(value)) {
1272                         long test_var;
1273                         test_var = PyInt_AsLong(value);
1274                         if (test_var < 0 || test_var > uint_max) {
1275                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1276                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1277                                 return -1;
1278                         }
1279                         object->size = test_var;
1280                 } else {
1281                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1282                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1283                         return -1;
1284                 }
1285         }
1286         return 0;
1287 }
1288
1289 static PyObject *py_lsa_BinaryString_get_array(PyObject *obj, void *closure)
1290 {
1291         struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(obj);
1292         PyObject *py_array;
1293         if (object->array == NULL) {
1294                 py_array = Py_None;
1295                 Py_INCREF(py_array);
1296         } else {
1297                 py_array = PyList_New(object->length / 2);
1298                 if (py_array == NULL) {
1299                         return NULL;
1300                 }
1301                 {
1302                         int array_cntr_1;
1303                         for (array_cntr_1 = 0; array_cntr_1 < (object->length / 2); array_cntr_1++) {
1304                                 PyObject *py_array_1;
1305                                 py_array_1 = PyInt_FromLong((uint16_t)object->array[array_cntr_1]);
1306                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
1307                         }
1308                 }
1309         }
1310         return py_array;
1311 }
1312
1313 static int py_lsa_BinaryString_set_array(PyObject *py_obj, PyObject *value, void *closure)
1314 {
1315         struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1316         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
1317         if (value == Py_None) {
1318                 object->array = NULL;
1319         } else {
1320                 object->array = NULL;
1321                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1322                 {
1323                         int array_cntr_1;
1324                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
1325                         if (!object->array) { return -1;; }
1326                         talloc_set_name_const(object->array, "ARRAY: object->array");
1327                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
1328                                 {
1329                                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->array[array_cntr_1]));
1330                                         if (PyLong_Check(PyList_GET_ITEM(value, array_cntr_1))) {
1331                                                 unsigned long long test_var;
1332                                                 test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, array_cntr_1));
1333                                                 if (PyErr_Occurred() != NULL) {
1334                                                         return -1;
1335                                                 }
1336                                                 if (test_var > uint_max) {
1337                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1338                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1339                                                         return -1;
1340                                                 }
1341                                                 object->array[array_cntr_1] = test_var;
1342                                         } else if (PyInt_Check(PyList_GET_ITEM(value, array_cntr_1))) {
1343                                                 long test_var;
1344                                                 test_var = PyInt_AsLong(PyList_GET_ITEM(value, array_cntr_1));
1345                                                 if (test_var < 0 || test_var > uint_max) {
1346                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1347                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1348                                                         return -1;
1349                                                 }
1350                                                 object->array[array_cntr_1] = test_var;
1351                                         } else {
1352                                                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1353                                                   PyInt_Type.tp_name, PyLong_Type.tp_name);
1354                                                 return -1;
1355                                         }
1356                                 }
1357                         }
1358                 }
1359         }
1360         return 0;
1361 }
1362
1363 static PyGetSetDef py_lsa_BinaryString_getsetters[] = {
1364         { discard_const_p(char, "length"), py_lsa_BinaryString_get_length, py_lsa_BinaryString_set_length },
1365         { discard_const_p(char, "size"), py_lsa_BinaryString_get_size, py_lsa_BinaryString_set_size },
1366         { discard_const_p(char, "array"), py_lsa_BinaryString_get_array, py_lsa_BinaryString_set_array },
1367         { NULL }
1368 };
1369
1370 static PyObject *py_lsa_BinaryString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1371 {
1372         return pytalloc_new(struct lsa_BinaryString, type);
1373 }
1374
1375 static PyObject *py_lsa_BinaryString_ndr_pack(PyObject *py_obj)
1376 {
1377         struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1378         DATA_BLOB blob;
1379         enum ndr_err_code err;
1380         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_BinaryString);
1381         if (err != NDR_ERR_SUCCESS) {
1382                 PyErr_SetNdrError(err);
1383                 return NULL;
1384         }
1385
1386         return PyString_FromStringAndSize((char *)blob.data, blob.length);
1387 }
1388
1389 static PyObject *py_lsa_BinaryString_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1390 {
1391         struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1392         DATA_BLOB blob;
1393         int blob_length = 0;
1394         enum ndr_err_code err;
1395         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1396         PyObject *allow_remaining_obj = NULL;
1397         bool allow_remaining = false;
1398
1399         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
1400                 discard_const_p(char *, kwnames),
1401                 &blob.data, &blob_length,
1402                 &allow_remaining_obj)) {
1403                 return NULL;
1404         }
1405         blob.length = blob_length;
1406
1407         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1408                 allow_remaining = true;
1409         }
1410
1411         if (allow_remaining) {
1412                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_BinaryString);
1413         } else {
1414                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_BinaryString);
1415         }
1416         if (err != NDR_ERR_SUCCESS) {
1417                 PyErr_SetNdrError(err);
1418                 return NULL;
1419         }
1420
1421         Py_RETURN_NONE;
1422 }
1423
1424 static PyObject *py_lsa_BinaryString_ndr_print(PyObject *py_obj)
1425 {
1426         struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1427         PyObject *ret;
1428         char *retstr;
1429
1430         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_BinaryString, "lsa_BinaryString", object);
1431         ret = PyString_FromString(retstr);
1432         talloc_free(retstr);
1433
1434         return ret;
1435 }
1436
1437 static PyMethodDef py_lsa_BinaryString_methods[] = {
1438         { "__ndr_pack__", (PyCFunction)py_lsa_BinaryString_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1439         { "__ndr_unpack__", (PyCFunction)py_lsa_BinaryString_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1440         { "__ndr_print__", (PyCFunction)py_lsa_BinaryString_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
1441         { NULL, NULL, 0, NULL }
1442 };
1443
1444
1445 static PyTypeObject lsa_BinaryString_Type = {
1446         PyObject_HEAD_INIT(NULL) 0,
1447         .tp_name = "lsa.BinaryString",
1448         .tp_getset = py_lsa_BinaryString_getsetters,
1449         .tp_methods = py_lsa_BinaryString_methods,
1450         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1451         .tp_basicsize = sizeof(pytalloc_Object),
1452         .tp_new = py_lsa_BinaryString_new,
1453 };
1454
1455
1456 static PyObject *py_lsa_LUID_get_low(PyObject *obj, void *closure)
1457 {
1458         struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(obj);
1459         PyObject *py_low;
1460         py_low = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->low);
1461         return py_low;
1462 }
1463
1464 static int py_lsa_LUID_set_low(PyObject *py_obj, PyObject *value, void *closure)
1465 {
1466         struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(py_obj);
1467         {
1468                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->low));
1469                 if (PyLong_Check(value)) {
1470                         unsigned long long test_var;
1471                         test_var = PyLong_AsUnsignedLongLong(value);
1472                         if (PyErr_Occurred() != NULL) {
1473                                 return -1;
1474                         }
1475                         if (test_var > uint_max) {
1476                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1477                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1478                                 return -1;
1479                         }
1480                         object->low = test_var;
1481                 } else if (PyInt_Check(value)) {
1482                         long test_var;
1483                         test_var = PyInt_AsLong(value);
1484                         if (test_var < 0 || test_var > uint_max) {
1485                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1486                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1487                                 return -1;
1488                         }
1489                         object->low = test_var;
1490                 } else {
1491                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1492                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1493                         return -1;
1494                 }
1495         }
1496         return 0;
1497 }
1498
1499 static PyObject *py_lsa_LUID_get_high(PyObject *obj, void *closure)
1500 {
1501         struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(obj);
1502         PyObject *py_high;
1503         py_high = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->high);
1504         return py_high;
1505 }
1506
1507 static int py_lsa_LUID_set_high(PyObject *py_obj, PyObject *value, void *closure)
1508 {
1509         struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(py_obj);
1510         {
1511                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->high));
1512                 if (PyLong_Check(value)) {
1513                         unsigned long long test_var;
1514                         test_var = PyLong_AsUnsignedLongLong(value);
1515                         if (PyErr_Occurred() != NULL) {
1516                                 return -1;
1517                         }
1518                         if (test_var > uint_max) {
1519                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1520                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1521                                 return -1;
1522                         }
1523                         object->high = test_var;
1524                 } else if (PyInt_Check(value)) {
1525                         long test_var;
1526                         test_var = PyInt_AsLong(value);
1527                         if (test_var < 0 || test_var > uint_max) {
1528                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1529                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1530                                 return -1;
1531                         }
1532                         object->high = test_var;
1533                 } else {
1534                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1535                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1536                         return -1;
1537                 }
1538         }
1539         return 0;
1540 }
1541
1542 static PyGetSetDef py_lsa_LUID_getsetters[] = {
1543         { discard_const_p(char, "low"), py_lsa_LUID_get_low, py_lsa_LUID_set_low },
1544         { discard_const_p(char, "high"), py_lsa_LUID_get_high, py_lsa_LUID_set_high },
1545         { NULL }
1546 };
1547
1548 static PyObject *py_lsa_LUID_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1549 {
1550         return pytalloc_new(struct lsa_LUID, type);
1551 }
1552
1553
1554 static PyTypeObject lsa_LUID_Type = {
1555         PyObject_HEAD_INIT(NULL) 0,
1556         .tp_name = "lsa.LUID",
1557         .tp_getset = py_lsa_LUID_getsetters,
1558         .tp_methods = NULL,
1559         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1560         .tp_basicsize = sizeof(pytalloc_Object),
1561         .tp_new = py_lsa_LUID_new,
1562 };
1563
1564
1565 static PyObject *py_lsa_PrivEntry_get_name(PyObject *obj, void *closure)
1566 {
1567         struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(obj);
1568         PyObject *py_name;
1569         py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
1570         return py_name;
1571 }
1572
1573 static int py_lsa_PrivEntry_set_name(PyObject *py_obj, PyObject *value, void *closure)
1574 {
1575         struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(py_obj);
1576         PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
1577         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1578                 PyErr_NoMemory();
1579                 return -1;
1580         }
1581         object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
1582         return 0;
1583 }
1584
1585 static PyObject *py_lsa_PrivEntry_get_luid(PyObject *obj, void *closure)
1586 {
1587         struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(obj);
1588         PyObject *py_luid;
1589         py_luid = pytalloc_reference_ex(&lsa_LUID_Type, pytalloc_get_mem_ctx(obj), &object->luid);
1590         return py_luid;
1591 }
1592
1593 static int py_lsa_PrivEntry_set_luid(PyObject *py_obj, PyObject *value, void *closure)
1594 {
1595         struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(py_obj);
1596         PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
1597         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1598                 PyErr_NoMemory();
1599                 return -1;
1600         }
1601         object->luid = *(struct lsa_LUID *)pytalloc_get_ptr(value);
1602         return 0;
1603 }
1604
1605 static PyGetSetDef py_lsa_PrivEntry_getsetters[] = {
1606         { discard_const_p(char, "name"), py_lsa_PrivEntry_get_name, py_lsa_PrivEntry_set_name },
1607         { discard_const_p(char, "luid"), py_lsa_PrivEntry_get_luid, py_lsa_PrivEntry_set_luid },
1608         { NULL }
1609 };
1610
1611 static PyObject *py_lsa_PrivEntry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1612 {
1613         return pytalloc_new(struct lsa_PrivEntry, type);
1614 }
1615
1616
1617 static PyTypeObject lsa_PrivEntry_Type = {
1618         PyObject_HEAD_INIT(NULL) 0,
1619         .tp_name = "lsa.PrivEntry",
1620         .tp_getset = py_lsa_PrivEntry_getsetters,
1621         .tp_methods = NULL,
1622         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1623         .tp_basicsize = sizeof(pytalloc_Object),
1624         .tp_new = py_lsa_PrivEntry_new,
1625 };
1626
1627
1628 static PyObject *py_lsa_PrivArray_get_count(PyObject *obj, void *closure)
1629 {
1630         struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(obj);
1631         PyObject *py_count;
1632         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
1633         return py_count;
1634 }
1635
1636 static int py_lsa_PrivArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
1637 {
1638         struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(py_obj);
1639         {
1640                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
1641                 if (PyLong_Check(value)) {
1642                         unsigned long long test_var;
1643                         test_var = PyLong_AsUnsignedLongLong(value);
1644                         if (PyErr_Occurred() != NULL) {
1645                                 return -1;
1646                         }
1647                         if (test_var > uint_max) {
1648                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1649                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1650                                 return -1;
1651                         }
1652                         object->count = test_var;
1653                 } else if (PyInt_Check(value)) {
1654                         long test_var;
1655                         test_var = PyInt_AsLong(value);
1656                         if (test_var < 0 || test_var > uint_max) {
1657                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1658                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1659                                 return -1;
1660                         }
1661                         object->count = test_var;
1662                 } else {
1663                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1664                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1665                         return -1;
1666                 }
1667         }
1668         return 0;
1669 }
1670
1671 static PyObject *py_lsa_PrivArray_get_privs(PyObject *obj, void *closure)
1672 {
1673         struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(obj);
1674         PyObject *py_privs;
1675         if (object->privs == NULL) {
1676                 py_privs = Py_None;
1677                 Py_INCREF(py_privs);
1678         } else {
1679                 py_privs = PyList_New(object->count);
1680                 if (py_privs == NULL) {
1681                         return NULL;
1682                 }
1683                 {
1684                         int privs_cntr_1;
1685                         for (privs_cntr_1 = 0; privs_cntr_1 < (object->count); privs_cntr_1++) {
1686                                 PyObject *py_privs_1;
1687                                 py_privs_1 = pytalloc_reference_ex(&lsa_PrivEntry_Type, object->privs, &object->privs[privs_cntr_1]);
1688                                 PyList_SetItem(py_privs, privs_cntr_1, py_privs_1);
1689                         }
1690                 }
1691         }
1692         return py_privs;
1693 }
1694
1695 static int py_lsa_PrivArray_set_privs(PyObject *py_obj, PyObject *value, void *closure)
1696 {
1697         struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(py_obj);
1698         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->privs));
1699         if (value == Py_None) {
1700                 object->privs = NULL;
1701         } else {
1702                 object->privs = NULL;
1703                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1704                 {
1705                         int privs_cntr_1;
1706                         object->privs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->privs, PyList_GET_SIZE(value));
1707                         if (!object->privs) { return -1;; }
1708                         talloc_set_name_const(object->privs, "ARRAY: object->privs");
1709                         for (privs_cntr_1 = 0; privs_cntr_1 < PyList_GET_SIZE(value); privs_cntr_1++) {
1710                                 PY_CHECK_TYPE(&lsa_PrivEntry_Type, PyList_GET_ITEM(value, privs_cntr_1), return -1;);
1711                                 if (talloc_reference(object->privs, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, privs_cntr_1))) == NULL) {
1712                                         PyErr_NoMemory();
1713                                         return -1;
1714                                 }
1715                                 object->privs[privs_cntr_1] = *(struct lsa_PrivEntry *)pytalloc_get_ptr(PyList_GET_ITEM(value, privs_cntr_1));
1716                         }
1717                 }
1718         }
1719         return 0;
1720 }
1721
1722 static PyGetSetDef py_lsa_PrivArray_getsetters[] = {
1723         { discard_const_p(char, "count"), py_lsa_PrivArray_get_count, py_lsa_PrivArray_set_count },
1724         { discard_const_p(char, "privs"), py_lsa_PrivArray_get_privs, py_lsa_PrivArray_set_privs },
1725         { NULL }
1726 };
1727
1728 static PyObject *py_lsa_PrivArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1729 {
1730         return pytalloc_new(struct lsa_PrivArray, type);
1731 }
1732
1733
1734 static PyTypeObject lsa_PrivArray_Type = {
1735         PyObject_HEAD_INIT(NULL) 0,
1736         .tp_name = "lsa.PrivArray",
1737         .tp_getset = py_lsa_PrivArray_getsetters,
1738         .tp_methods = NULL,
1739         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1740         .tp_basicsize = sizeof(pytalloc_Object),
1741         .tp_new = py_lsa_PrivArray_new,
1742 };
1743
1744
1745 static PyObject *py_lsa_QosInfo_get_len(PyObject *obj, void *closure)
1746 {
1747         struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(obj);
1748         PyObject *py_len;
1749         py_len = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->len);
1750         return py_len;
1751 }
1752
1753 static int py_lsa_QosInfo_set_len(PyObject *py_obj, PyObject *value, void *closure)
1754 {
1755         struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
1756         {
1757                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->len));
1758                 if (PyLong_Check(value)) {
1759                         unsigned long long test_var;
1760                         test_var = PyLong_AsUnsignedLongLong(value);
1761                         if (PyErr_Occurred() != NULL) {
1762                                 return -1;
1763                         }
1764                         if (test_var > uint_max) {
1765                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1766                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1767                                 return -1;
1768                         }
1769                         object->len = test_var;
1770                 } else if (PyInt_Check(value)) {
1771                         long test_var;
1772                         test_var = PyInt_AsLong(value);
1773                         if (test_var < 0 || test_var > uint_max) {
1774                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1775                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1776                                 return -1;
1777                         }
1778                         object->len = test_var;
1779                 } else {
1780                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1781                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1782                         return -1;
1783                 }
1784         }
1785         return 0;
1786 }
1787
1788 static PyObject *py_lsa_QosInfo_get_impersonation_level(PyObject *obj, void *closure)
1789 {
1790         struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(obj);
1791         PyObject *py_impersonation_level;
1792         py_impersonation_level = PyInt_FromLong((uint16_t)object->impersonation_level);
1793         return py_impersonation_level;
1794 }
1795
1796 static int py_lsa_QosInfo_set_impersonation_level(PyObject *py_obj, PyObject *value, void *closure)
1797 {
1798         struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
1799         {
1800                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->impersonation_level));
1801                 if (PyLong_Check(value)) {
1802                         unsigned long long test_var;
1803                         test_var = PyLong_AsUnsignedLongLong(value);
1804                         if (PyErr_Occurred() != NULL) {
1805                                 return -1;
1806                         }
1807                         if (test_var > uint_max) {
1808                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1809                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1810                                 return -1;
1811                         }
1812                         object->impersonation_level = test_var;
1813                 } else if (PyInt_Check(value)) {
1814                         long test_var;
1815                         test_var = PyInt_AsLong(value);
1816                         if (test_var < 0 || test_var > uint_max) {
1817                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1818                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1819                                 return -1;
1820                         }
1821                         object->impersonation_level = test_var;
1822                 } else {
1823                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1824                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1825                         return -1;
1826                 }
1827         }
1828         return 0;
1829 }
1830
1831 static PyObject *py_lsa_QosInfo_get_context_mode(PyObject *obj, void *closure)
1832 {
1833         struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(obj);
1834         PyObject *py_context_mode;
1835         py_context_mode = PyInt_FromLong((uint16_t)object->context_mode);
1836         return py_context_mode;
1837 }
1838
1839 static int py_lsa_QosInfo_set_context_mode(PyObject *py_obj, PyObject *value, void *closure)
1840 {
1841         struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
1842         {
1843                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_mode));
1844                 if (PyLong_Check(value)) {
1845                         unsigned long long test_var;
1846                         test_var = PyLong_AsUnsignedLongLong(value);
1847                         if (PyErr_Occurred() != NULL) {
1848                                 return -1;
1849                         }
1850                         if (test_var > uint_max) {
1851                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1852                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1853                                 return -1;
1854                         }
1855                         object->context_mode = test_var;
1856                 } else if (PyInt_Check(value)) {
1857                         long test_var;
1858                         test_var = PyInt_AsLong(value);
1859                         if (test_var < 0 || test_var > uint_max) {
1860                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1861                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1862                                 return -1;
1863                         }
1864                         object->context_mode = test_var;
1865                 } else {
1866                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1867                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1868                         return -1;
1869                 }
1870         }
1871         return 0;
1872 }
1873
1874 static PyObject *py_lsa_QosInfo_get_effective_only(PyObject *obj, void *closure)
1875 {
1876         struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(obj);
1877         PyObject *py_effective_only;
1878         py_effective_only = PyInt_FromLong((uint16_t)object->effective_only);
1879         return py_effective_only;
1880 }
1881
1882 static int py_lsa_QosInfo_set_effective_only(PyObject *py_obj, PyObject *value, void *closure)
1883 {
1884         struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
1885         {
1886                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->effective_only));
1887                 if (PyLong_Check(value)) {
1888                         unsigned long long test_var;
1889                         test_var = PyLong_AsUnsignedLongLong(value);
1890                         if (PyErr_Occurred() != NULL) {
1891                                 return -1;
1892                         }
1893                         if (test_var > uint_max) {
1894                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1895                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1896                                 return -1;
1897                         }
1898                         object->effective_only = test_var;
1899                 } else if (PyInt_Check(value)) {
1900                         long test_var;
1901                         test_var = PyInt_AsLong(value);
1902                         if (test_var < 0 || test_var > uint_max) {
1903                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1904                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1905                                 return -1;
1906                         }
1907                         object->effective_only = test_var;
1908                 } else {
1909                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1910                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1911                         return -1;
1912                 }
1913         }
1914         return 0;
1915 }
1916
1917 static PyGetSetDef py_lsa_QosInfo_getsetters[] = {
1918         { discard_const_p(char, "len"), py_lsa_QosInfo_get_len, py_lsa_QosInfo_set_len },
1919         { discard_const_p(char, "impersonation_level"), py_lsa_QosInfo_get_impersonation_level, py_lsa_QosInfo_set_impersonation_level },
1920         { discard_const_p(char, "context_mode"), py_lsa_QosInfo_get_context_mode, py_lsa_QosInfo_set_context_mode },
1921         { discard_const_p(char, "effective_only"), py_lsa_QosInfo_get_effective_only, py_lsa_QosInfo_set_effective_only },
1922         { NULL }
1923 };
1924
1925 static PyObject *py_lsa_QosInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1926 {
1927         return pytalloc_new(struct lsa_QosInfo, type);
1928 }
1929
1930
1931 static PyTypeObject lsa_QosInfo_Type = {
1932         PyObject_HEAD_INIT(NULL) 0,
1933         .tp_name = "lsa.QosInfo",
1934         .tp_getset = py_lsa_QosInfo_getsetters,
1935         .tp_methods = NULL,
1936         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1937         .tp_basicsize = sizeof(pytalloc_Object),
1938         .tp_new = py_lsa_QosInfo_new,
1939 };
1940
1941
1942 static PyObject *py_lsa_ObjectAttribute_get_len(PyObject *obj, void *closure)
1943 {
1944         struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
1945         PyObject *py_len;
1946         py_len = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->len);
1947         return py_len;
1948 }
1949
1950 static int py_lsa_ObjectAttribute_set_len(PyObject *py_obj, PyObject *value, void *closure)
1951 {
1952         struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
1953         {
1954                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->len));
1955                 if (PyLong_Check(value)) {
1956                         unsigned long long test_var;
1957                         test_var = PyLong_AsUnsignedLongLong(value);
1958                         if (PyErr_Occurred() != NULL) {
1959                                 return -1;
1960                         }
1961                         if (test_var > uint_max) {
1962                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1963                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1964                                 return -1;
1965                         }
1966                         object->len = test_var;
1967                 } else if (PyInt_Check(value)) {
1968                         long test_var;
1969                         test_var = PyInt_AsLong(value);
1970                         if (test_var < 0 || test_var > uint_max) {
1971                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1972                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1973                                 return -1;
1974                         }
1975                         object->len = test_var;
1976                 } else {
1977                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1978                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1979                         return -1;
1980                 }
1981         }
1982         return 0;
1983 }
1984
1985 static PyObject *py_lsa_ObjectAttribute_get_root_dir(PyObject *obj, void *closure)
1986 {
1987         struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
1988         PyObject *py_root_dir;
1989         if (object->root_dir == NULL) {
1990                 py_root_dir = Py_None;
1991                 Py_INCREF(py_root_dir);
1992         } else {
1993                 py_root_dir = PyInt_FromLong((uint16_t)*object->root_dir);
1994         }
1995         return py_root_dir;
1996 }
1997
1998 static int py_lsa_ObjectAttribute_set_root_dir(PyObject *py_obj, PyObject *value, void *closure)
1999 {
2000         struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2001         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->root_dir));
2002         if (value == Py_None) {
2003                 object->root_dir = NULL;
2004         } else {
2005                 object->root_dir = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->root_dir);
2006                 {
2007                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->root_dir));
2008                         if (PyLong_Check(value)) {
2009                                 unsigned long long test_var;
2010                                 test_var = PyLong_AsUnsignedLongLong(value);
2011                                 if (PyErr_Occurred() != NULL) {
2012                                         return -1;
2013                                 }
2014                                 if (test_var > uint_max) {
2015                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2016                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2017                                         return -1;
2018                                 }
2019                                 *object->root_dir = test_var;
2020                         } else if (PyInt_Check(value)) {
2021                                 long test_var;
2022                                 test_var = PyInt_AsLong(value);
2023                                 if (test_var < 0 || test_var > uint_max) {
2024                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2025                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2026                                         return -1;
2027                                 }
2028                                 *object->root_dir = test_var;
2029                         } else {
2030                                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2031                                   PyInt_Type.tp_name, PyLong_Type.tp_name);
2032                                 return -1;
2033                         }
2034                 }
2035         }
2036         return 0;
2037 }
2038
2039 static PyObject *py_lsa_ObjectAttribute_get_object_name(PyObject *obj, void *closure)
2040 {
2041         struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2042         PyObject *py_object_name;
2043         if (object->object_name == NULL) {
2044                 py_object_name = Py_None;
2045                 Py_INCREF(py_object_name);
2046         } else {
2047                 if (object->object_name == NULL) {
2048                         py_object_name = Py_None;
2049                         Py_INCREF(py_object_name);
2050                 } else {
2051                         py_object_name = PyUnicode_Decode(object->object_name, strlen(object->object_name), "utf-8", "ignore");
2052                 }
2053         }
2054         return py_object_name;
2055 }
2056
2057 static int py_lsa_ObjectAttribute_set_object_name(PyObject *py_obj, PyObject *value, void *closure)
2058 {
2059         struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2060         if (value == Py_None) {
2061                 object->object_name = NULL;
2062         } else {
2063                 object->object_name = NULL;
2064                 if (PyUnicode_Check(value)) {
2065                         object->object_name = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
2066                 } else if (PyString_Check(value)) {
2067                         object->object_name = PyString_AS_STRING(value);
2068                 } else {
2069                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2070                         return -1;
2071                 }
2072         }
2073         return 0;
2074 }
2075
2076 static PyObject *py_lsa_ObjectAttribute_get_attributes(PyObject *obj, void *closure)
2077 {
2078         struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2079         PyObject *py_attributes;
2080         py_attributes = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->attributes);
2081         return py_attributes;
2082 }
2083
2084 static int py_lsa_ObjectAttribute_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
2085 {
2086         struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2087         {
2088                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
2089                 if (PyLong_Check(value)) {
2090                         unsigned long long test_var;
2091                         test_var = PyLong_AsUnsignedLongLong(value);
2092                         if (PyErr_Occurred() != NULL) {
2093                                 return -1;
2094                         }
2095                         if (test_var > uint_max) {
2096                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2097                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2098                                 return -1;
2099                         }
2100                         object->attributes = test_var;
2101                 } else if (PyInt_Check(value)) {
2102                         long test_var;
2103                         test_var = PyInt_AsLong(value);
2104                         if (test_var < 0 || test_var > uint_max) {
2105                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2106                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2107                                 return -1;
2108                         }
2109                         object->attributes = test_var;
2110                 } else {
2111                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2112                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2113                         return -1;
2114                 }
2115         }
2116         return 0;
2117 }
2118
2119 static PyObject *py_lsa_ObjectAttribute_get_sec_desc(PyObject *obj, void *closure)
2120 {
2121         struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2122         PyObject *py_sec_desc;
2123         if (object->sec_desc == NULL) {
2124                 py_sec_desc = Py_None;
2125                 Py_INCREF(py_sec_desc);
2126         } else {
2127                 py_sec_desc = pytalloc_reference_ex(security_descriptor_Type, object->sec_desc, object->sec_desc);
2128         }
2129         return py_sec_desc;
2130 }
2131
2132 static int py_lsa_ObjectAttribute_set_sec_desc(PyObject *py_obj, PyObject *value, void *closure)
2133 {
2134         struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2135         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sec_desc));
2136         if (value == Py_None) {
2137                 object->sec_desc = NULL;
2138         } else {
2139                 object->sec_desc = NULL;
2140                 PY_CHECK_TYPE(security_descriptor_Type, value, return -1;);
2141                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2142                         PyErr_NoMemory();
2143                         return -1;
2144                 }
2145                 object->sec_desc = (struct security_descriptor *)pytalloc_get_ptr(value);
2146         }
2147         return 0;
2148 }
2149
2150 static PyObject *py_lsa_ObjectAttribute_get_sec_qos(PyObject *obj, void *closure)
2151 {
2152         struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2153         PyObject *py_sec_qos;
2154         if (object->sec_qos == NULL) {
2155                 py_sec_qos = Py_None;
2156                 Py_INCREF(py_sec_qos);
2157         } else {
2158                 py_sec_qos = pytalloc_reference_ex(&lsa_QosInfo_Type, object->sec_qos, object->sec_qos);
2159         }
2160         return py_sec_qos;
2161 }
2162
2163 static int py_lsa_ObjectAttribute_set_sec_qos(PyObject *py_obj, PyObject *value, void *closure)
2164 {
2165         struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2166         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sec_qos));
2167         if (value == Py_None) {
2168                 object->sec_qos = NULL;
2169         } else {
2170                 object->sec_qos = NULL;
2171                 PY_CHECK_TYPE(&lsa_QosInfo_Type, value, return -1;);
2172                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2173                         PyErr_NoMemory();
2174                         return -1;
2175                 }
2176                 object->sec_qos = (struct lsa_QosInfo *)pytalloc_get_ptr(value);
2177         }
2178         return 0;
2179 }
2180
2181 static PyGetSetDef py_lsa_ObjectAttribute_getsetters[] = {
2182         { discard_const_p(char, "len"), py_lsa_ObjectAttribute_get_len, py_lsa_ObjectAttribute_set_len },
2183         { discard_const_p(char, "root_dir"), py_lsa_ObjectAttribute_get_root_dir, py_lsa_ObjectAttribute_set_root_dir },
2184         { discard_const_p(char, "object_name"), py_lsa_ObjectAttribute_get_object_name, py_lsa_ObjectAttribute_set_object_name },
2185         { discard_const_p(char, "attributes"), py_lsa_ObjectAttribute_get_attributes, py_lsa_ObjectAttribute_set_attributes },
2186         { discard_const_p(char, "sec_desc"), py_lsa_ObjectAttribute_get_sec_desc, py_lsa_ObjectAttribute_set_sec_desc },
2187         { discard_const_p(char, "sec_qos"), py_lsa_ObjectAttribute_get_sec_qos, py_lsa_ObjectAttribute_set_sec_qos },
2188         { NULL }
2189 };
2190
2191 static PyObject *py_lsa_ObjectAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2192 {
2193         return pytalloc_new(struct lsa_ObjectAttribute, type);
2194 }
2195
2196
2197 static PyTypeObject lsa_ObjectAttribute_Type = {
2198         PyObject_HEAD_INIT(NULL) 0,
2199         .tp_name = "lsa.ObjectAttribute",
2200         .tp_getset = py_lsa_ObjectAttribute_getsetters,
2201         .tp_methods = NULL,
2202         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2203         .tp_basicsize = sizeof(pytalloc_Object),
2204         .tp_new = py_lsa_ObjectAttribute_new,
2205 };
2206
2207
2208 static PyObject *py_lsa_AuditLogInfo_get_percent_full(PyObject *obj, void *closure)
2209 {
2210         struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2211         PyObject *py_percent_full;
2212         py_percent_full = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->percent_full);
2213         return py_percent_full;
2214 }
2215
2216 static int py_lsa_AuditLogInfo_set_percent_full(PyObject *py_obj, PyObject *value, void *closure)
2217 {
2218         struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2219         {
2220                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->percent_full));
2221                 if (PyLong_Check(value)) {
2222                         unsigned long long test_var;
2223                         test_var = PyLong_AsUnsignedLongLong(value);
2224                         if (PyErr_Occurred() != NULL) {
2225                                 return -1;
2226                         }
2227                         if (test_var > uint_max) {
2228                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2229                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2230                                 return -1;
2231                         }
2232                         object->percent_full = test_var;
2233                 } else if (PyInt_Check(value)) {
2234                         long test_var;
2235                         test_var = PyInt_AsLong(value);
2236                         if (test_var < 0 || test_var > uint_max) {
2237                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2238                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2239                                 return -1;
2240                         }
2241                         object->percent_full = test_var;
2242                 } else {
2243                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2244                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2245                         return -1;
2246                 }
2247         }
2248         return 0;
2249 }
2250
2251 static PyObject *py_lsa_AuditLogInfo_get_maximum_log_size(PyObject *obj, void *closure)
2252 {
2253         struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2254         PyObject *py_maximum_log_size;
2255         py_maximum_log_size = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->maximum_log_size);
2256         return py_maximum_log_size;
2257 }
2258
2259 static int py_lsa_AuditLogInfo_set_maximum_log_size(PyObject *py_obj, PyObject *value, void *closure)
2260 {
2261         struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2262         {
2263                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maximum_log_size));
2264                 if (PyLong_Check(value)) {
2265                         unsigned long long test_var;
2266                         test_var = PyLong_AsUnsignedLongLong(value);
2267                         if (PyErr_Occurred() != NULL) {
2268                                 return -1;
2269                         }
2270                         if (test_var > uint_max) {
2271                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2272                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2273                                 return -1;
2274                         }
2275                         object->maximum_log_size = test_var;
2276                 } else if (PyInt_Check(value)) {
2277                         long test_var;
2278                         test_var = PyInt_AsLong(value);
2279                         if (test_var < 0 || test_var > uint_max) {
2280                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2281                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2282                                 return -1;
2283                         }
2284                         object->maximum_log_size = test_var;
2285                 } else {
2286                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2287                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2288                         return -1;
2289                 }
2290         }
2291         return 0;
2292 }
2293
2294 static PyObject *py_lsa_AuditLogInfo_get_retention_time(PyObject *obj, void *closure)
2295 {
2296         struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2297         PyObject *py_retention_time;
2298         py_retention_time = ndr_PyLong_FromUnsignedLongLong(object->retention_time);
2299         return py_retention_time;
2300 }
2301
2302 static int py_lsa_AuditLogInfo_set_retention_time(PyObject *py_obj, PyObject *value, void *closure)
2303 {
2304         struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2305         {
2306                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->retention_time));
2307                 if (PyLong_Check(value)) {
2308                         unsigned long long test_var;
2309                         test_var = PyLong_AsUnsignedLongLong(value);
2310                         if (PyErr_Occurred() != NULL) {
2311                                 return -1;
2312                         }
2313                         if (test_var > uint_max) {
2314                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2315                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2316                                 return -1;
2317                         }
2318                         object->retention_time = test_var;
2319                 } else if (PyInt_Check(value)) {
2320                         long test_var;
2321                         test_var = PyInt_AsLong(value);
2322                         if (test_var < 0 || test_var > uint_max) {
2323                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2324                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2325                                 return -1;
2326                         }
2327                         object->retention_time = test_var;
2328                 } else {
2329                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2330                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2331                         return -1;
2332                 }
2333         }
2334         return 0;
2335 }
2336
2337 static PyObject *py_lsa_AuditLogInfo_get_shutdown_in_progress(PyObject *obj, void *closure)
2338 {
2339         struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2340         PyObject *py_shutdown_in_progress;
2341         py_shutdown_in_progress = PyInt_FromLong((uint16_t)object->shutdown_in_progress);
2342         return py_shutdown_in_progress;
2343 }
2344
2345 static int py_lsa_AuditLogInfo_set_shutdown_in_progress(PyObject *py_obj, PyObject *value, void *closure)
2346 {
2347         struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2348         {
2349                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shutdown_in_progress));
2350                 if (PyLong_Check(value)) {
2351                         unsigned long long test_var;
2352                         test_var = PyLong_AsUnsignedLongLong(value);
2353                         if (PyErr_Occurred() != NULL) {
2354                                 return -1;
2355                         }
2356                         if (test_var > uint_max) {
2357                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2358                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2359                                 return -1;
2360                         }
2361                         object->shutdown_in_progress = test_var;
2362                 } else if (PyInt_Check(value)) {
2363                         long test_var;
2364                         test_var = PyInt_AsLong(value);
2365                         if (test_var < 0 || test_var > uint_max) {
2366                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2367                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2368                                 return -1;
2369                         }
2370                         object->shutdown_in_progress = test_var;
2371                 } else {
2372                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2373                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2374                         return -1;
2375                 }
2376         }
2377         return 0;
2378 }
2379
2380 static PyObject *py_lsa_AuditLogInfo_get_time_to_shutdown(PyObject *obj, void *closure)
2381 {
2382         struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2383         PyObject *py_time_to_shutdown;
2384         py_time_to_shutdown = ndr_PyLong_FromUnsignedLongLong(object->time_to_shutdown);
2385         return py_time_to_shutdown;
2386 }
2387
2388 static int py_lsa_AuditLogInfo_set_time_to_shutdown(PyObject *py_obj, PyObject *value, void *closure)
2389 {
2390         struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2391         {
2392                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time_to_shutdown));
2393                 if (PyLong_Check(value)) {
2394                         unsigned long long test_var;
2395                         test_var = PyLong_AsUnsignedLongLong(value);
2396                         if (PyErr_Occurred() != NULL) {
2397                                 return -1;
2398                         }
2399                         if (test_var > uint_max) {
2400                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2401                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2402                                 return -1;
2403                         }
2404                         object->time_to_shutdown = test_var;
2405                 } else if (PyInt_Check(value)) {
2406                         long test_var;
2407                         test_var = PyInt_AsLong(value);
2408                         if (test_var < 0 || test_var > uint_max) {
2409                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2410                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2411                                 return -1;
2412                         }
2413                         object->time_to_shutdown = test_var;
2414                 } else {
2415                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2416                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2417                         return -1;
2418                 }
2419         }
2420         return 0;
2421 }
2422
2423 static PyObject *py_lsa_AuditLogInfo_get_next_audit_record(PyObject *obj, void *closure)
2424 {
2425         struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2426         PyObject *py_next_audit_record;
2427         py_next_audit_record = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->next_audit_record);
2428         return py_next_audit_record;
2429 }
2430
2431 static int py_lsa_AuditLogInfo_set_next_audit_record(PyObject *py_obj, PyObject *value, void *closure)
2432 {
2433         struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2434         {
2435                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->next_audit_record));
2436                 if (PyLong_Check(value)) {
2437                         unsigned long long test_var;
2438                         test_var = PyLong_AsUnsignedLongLong(value);
2439                         if (PyErr_Occurred() != NULL) {
2440                                 return -1;
2441                         }
2442                         if (test_var > uint_max) {
2443                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2444                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2445                                 return -1;
2446                         }
2447                         object->next_audit_record = test_var;
2448                 } else if (PyInt_Check(value)) {
2449                         long test_var;
2450                         test_var = PyInt_AsLong(value);
2451                         if (test_var < 0 || test_var > uint_max) {
2452                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2453                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2454                                 return -1;
2455                         }
2456                         object->next_audit_record = test_var;
2457                 } else {
2458                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2459                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2460                         return -1;
2461                 }
2462         }
2463         return 0;
2464 }
2465
2466 static PyGetSetDef py_lsa_AuditLogInfo_getsetters[] = {
2467         { discard_const_p(char, "percent_full"), py_lsa_AuditLogInfo_get_percent_full, py_lsa_AuditLogInfo_set_percent_full },
2468         { discard_const_p(char, "maximum_log_size"), py_lsa_AuditLogInfo_get_maximum_log_size, py_lsa_AuditLogInfo_set_maximum_log_size },
2469         { discard_const_p(char, "retention_time"), py_lsa_AuditLogInfo_get_retention_time, py_lsa_AuditLogInfo_set_retention_time },
2470         { discard_const_p(char, "shutdown_in_progress"), py_lsa_AuditLogInfo_get_shutdown_in_progress, py_lsa_AuditLogInfo_set_shutdown_in_progress },
2471         { discard_const_p(char, "time_to_shutdown"), py_lsa_AuditLogInfo_get_time_to_shutdown, py_lsa_AuditLogInfo_set_time_to_shutdown },
2472         { discard_const_p(char, "next_audit_record"), py_lsa_AuditLogInfo_get_next_audit_record, py_lsa_AuditLogInfo_set_next_audit_record },
2473         { NULL }
2474 };
2475
2476 static PyObject *py_lsa_AuditLogInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2477 {
2478         return pytalloc_new(struct lsa_AuditLogInfo, type);
2479 }
2480
2481
2482 static PyTypeObject lsa_AuditLogInfo_Type = {
2483         PyObject_HEAD_INIT(NULL) 0,
2484         .tp_name = "lsa.AuditLogInfo",
2485         .tp_getset = py_lsa_AuditLogInfo_getsetters,
2486         .tp_methods = NULL,
2487         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2488         .tp_basicsize = sizeof(pytalloc_Object),
2489         .tp_new = py_lsa_AuditLogInfo_new,
2490 };
2491
2492
2493 static PyObject *py_lsa_AuditEventsInfo_get_auditing_mode(PyObject *obj, void *closure)
2494 {
2495         struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(obj);
2496         PyObject *py_auditing_mode;
2497         py_auditing_mode = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->auditing_mode);
2498         return py_auditing_mode;
2499 }
2500
2501 static int py_lsa_AuditEventsInfo_set_auditing_mode(PyObject *py_obj, PyObject *value, void *closure)
2502 {
2503         struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(py_obj);
2504         {
2505                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auditing_mode));
2506                 if (PyLong_Check(value)) {
2507                         unsigned long long test_var;
2508                         test_var = PyLong_AsUnsignedLongLong(value);
2509                         if (PyErr_Occurred() != NULL) {
2510                                 return -1;
2511                         }
2512                         if (test_var > uint_max) {
2513                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2514                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2515                                 return -1;
2516                         }
2517                         object->auditing_mode = test_var;
2518                 } else if (PyInt_Check(value)) {
2519                         long test_var;
2520                         test_var = PyInt_AsLong(value);
2521                         if (test_var < 0 || test_var > uint_max) {
2522                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2523                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2524                                 return -1;
2525                         }
2526                         object->auditing_mode = test_var;
2527                 } else {
2528                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2529                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2530                         return -1;
2531                 }
2532         }
2533         return 0;
2534 }
2535
2536 static PyObject *py_lsa_AuditEventsInfo_get_settings(PyObject *obj, void *closure)
2537 {
2538         struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(obj);
2539         PyObject *py_settings;
2540         if (object->settings == NULL) {
2541                 py_settings = Py_None;
2542                 Py_INCREF(py_settings);
2543         } else {
2544                 py_settings = PyList_New(object->count);
2545                 if (py_settings == NULL) {
2546                         return NULL;
2547                 }
2548                 {
2549                         int settings_cntr_1;
2550                         for (settings_cntr_1 = 0; settings_cntr_1 < (object->count); settings_cntr_1++) {
2551                                 PyObject *py_settings_1;
2552                                 py_settings_1 = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->settings[settings_cntr_1]);
2553                                 PyList_SetItem(py_settings, settings_cntr_1, py_settings_1);
2554                         }
2555                 }
2556         }
2557         return py_settings;
2558 }
2559
2560 static int py_lsa_AuditEventsInfo_set_settings(PyObject *py_obj, PyObject *value, void *closure)
2561 {
2562         struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(py_obj);
2563         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->settings));
2564         if (value == Py_None) {
2565                 object->settings = NULL;
2566         } else {
2567                 object->settings = NULL;
2568                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2569                 {
2570                         int settings_cntr_1;
2571                         object->settings = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->settings, PyList_GET_SIZE(value));
2572                         if (!object->settings) { return -1;; }
2573                         talloc_set_name_const(object->settings, "ARRAY: object->settings");
2574                         for (settings_cntr_1 = 0; settings_cntr_1 < PyList_GET_SIZE(value); settings_cntr_1++) {
2575                                 {
2576                                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->settings[settings_cntr_1]));
2577                                         if (PyLong_Check(PyList_GET_ITEM(value, settings_cntr_1))) {
2578                                                 unsigned long long test_var;
2579                                                 test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, settings_cntr_1));
2580                                                 if (PyErr_Occurred() != NULL) {
2581                                                         return -1;
2582                                                 }
2583                                                 if (test_var > uint_max) {
2584                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2585                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2586                                                         return -1;
2587                                                 }
2588                                                 object->settings[settings_cntr_1] = test_var;
2589                                         } else if (PyInt_Check(PyList_GET_ITEM(value, settings_cntr_1))) {
2590                                                 long test_var;
2591                                                 test_var = PyInt_AsLong(PyList_GET_ITEM(value, settings_cntr_1));
2592                                                 if (test_var < 0 || test_var > uint_max) {
2593                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2594                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2595                                                         return -1;
2596                                                 }
2597                                                 object->settings[settings_cntr_1] = test_var;
2598                                         } else {
2599                                                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2600                                                   PyInt_Type.tp_name, PyLong_Type.tp_name);
2601                                                 return -1;
2602                                         }
2603                                 }
2604                         }
2605                 }
2606         }
2607         return 0;
2608 }
2609
2610 static PyObject *py_lsa_AuditEventsInfo_get_count(PyObject *obj, void *closure)
2611 {
2612         struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(obj);
2613         PyObject *py_count;
2614         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
2615         return py_count;
2616 }
2617
2618 static int py_lsa_AuditEventsInfo_set_count(PyObject *py_obj, PyObject *value, void *closure)
2619 {
2620         struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(py_obj);
2621         {
2622                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
2623                 if (PyLong_Check(value)) {
2624                         unsigned long long test_var;
2625                         test_var = PyLong_AsUnsignedLongLong(value);
2626                         if (PyErr_Occurred() != NULL) {
2627                                 return -1;
2628                         }
2629                         if (test_var > uint_max) {
2630                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2631                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2632                                 return -1;
2633                         }
2634                         object->count = test_var;
2635                 } else if (PyInt_Check(value)) {
2636                         long test_var;
2637                         test_var = PyInt_AsLong(value);
2638                         if (test_var < 0 || test_var > uint_max) {
2639                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2640                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2641                                 return -1;
2642                         }
2643                         object->count = test_var;
2644                 } else {
2645                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2646                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2647                         return -1;
2648                 }
2649         }
2650         return 0;
2651 }
2652
2653 static PyGetSetDef py_lsa_AuditEventsInfo_getsetters[] = {
2654         { discard_const_p(char, "auditing_mode"), py_lsa_AuditEventsInfo_get_auditing_mode, py_lsa_AuditEventsInfo_set_auditing_mode },
2655         { discard_const_p(char, "settings"), py_lsa_AuditEventsInfo_get_settings, py_lsa_AuditEventsInfo_set_settings },
2656         { discard_const_p(char, "count"), py_lsa_AuditEventsInfo_get_count, py_lsa_AuditEventsInfo_set_count },
2657         { NULL }
2658 };
2659
2660 static PyObject *py_lsa_AuditEventsInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2661 {
2662         return pytalloc_new(struct lsa_AuditEventsInfo, type);
2663 }
2664
2665
2666 static PyTypeObject lsa_AuditEventsInfo_Type = {
2667         PyObject_HEAD_INIT(NULL) 0,
2668         .tp_name = "lsa.AuditEventsInfo",
2669         .tp_getset = py_lsa_AuditEventsInfo_getsetters,
2670         .tp_methods = NULL,
2671         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2672         .tp_basicsize = sizeof(pytalloc_Object),
2673         .tp_new = py_lsa_AuditEventsInfo_new,
2674 };
2675
2676
2677 static PyObject *py_lsa_DomainInfo_get_name(PyObject *obj, void *closure)
2678 {
2679         struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(obj);
2680         PyObject *py_name;
2681         py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
2682         return py_name;
2683 }
2684
2685 static int py_lsa_DomainInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
2686 {
2687         struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(py_obj);
2688         PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
2689         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2690                 PyErr_NoMemory();
2691                 return -1;
2692         }
2693         object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
2694         return 0;
2695 }
2696
2697 static PyObject *py_lsa_DomainInfo_get_sid(PyObject *obj, void *closure)
2698 {
2699         struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(obj);
2700         PyObject *py_sid;
2701         if (object->sid == NULL) {
2702                 py_sid = Py_None;
2703                 Py_INCREF(py_sid);
2704         } else {
2705                 py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
2706         }
2707         return py_sid;
2708 }
2709
2710 static int py_lsa_DomainInfo_set_sid(PyObject *py_obj, PyObject *value, void *closure)
2711 {
2712         struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(py_obj);
2713         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
2714         if (value == Py_None) {
2715                 object->sid = NULL;
2716         } else {
2717                 object->sid = NULL;
2718                 PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
2719                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2720                         PyErr_NoMemory();
2721                         return -1;
2722                 }
2723                 object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
2724         }
2725         return 0;
2726 }
2727
2728 static PyGetSetDef py_lsa_DomainInfo_getsetters[] = {
2729         { discard_const_p(char, "name"), py_lsa_DomainInfo_get_name, py_lsa_DomainInfo_set_name },
2730         { discard_const_p(char, "sid"), py_lsa_DomainInfo_get_sid, py_lsa_DomainInfo_set_sid },
2731         { NULL }
2732 };
2733
2734 static PyObject *py_lsa_DomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2735 {
2736         return pytalloc_new(struct lsa_DomainInfo, type);
2737 }
2738
2739
2740 static PyTypeObject lsa_DomainInfo_Type = {
2741         PyObject_HEAD_INIT(NULL) 0,
2742         .tp_name = "lsa.DomainInfo",
2743         .tp_getset = py_lsa_DomainInfo_getsetters,
2744         .tp_methods = NULL,
2745         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2746         .tp_basicsize = sizeof(pytalloc_Object),
2747         .tp_new = py_lsa_DomainInfo_new,
2748 };
2749
2750
2751 static PyObject *py_lsa_PDAccountInfo_get_name(PyObject *obj, void *closure)
2752 {
2753         struct lsa_PDAccountInfo *object = (struct lsa_PDAccountInfo *)pytalloc_get_ptr(obj);
2754         PyObject *py_name;
2755         py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
2756         return py_name;
2757 }
2758
2759 static int py_lsa_PDAccountInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
2760 {
2761         struct lsa_PDAccountInfo *object = (struct lsa_PDAccountInfo *)pytalloc_get_ptr(py_obj);
2762         PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
2763         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2764                 PyErr_NoMemory();
2765                 return -1;
2766         }
2767         object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
2768         return 0;
2769 }
2770
2771 static PyGetSetDef py_lsa_PDAccountInfo_getsetters[] = {
2772         { discard_const_p(char, "name"), py_lsa_PDAccountInfo_get_name, py_lsa_PDAccountInfo_set_name },
2773         { NULL }
2774 };
2775
2776 static PyObject *py_lsa_PDAccountInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2777 {
2778         return pytalloc_new(struct lsa_PDAccountInfo, type);
2779 }
2780
2781
2782 static PyTypeObject lsa_PDAccountInfo_Type = {
2783         PyObject_HEAD_INIT(NULL) 0,
2784         .tp_name = "lsa.PDAccountInfo",
2785         .tp_getset = py_lsa_PDAccountInfo_getsetters,
2786         .tp_methods = NULL,
2787         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2788         .tp_basicsize = sizeof(pytalloc_Object),
2789         .tp_new = py_lsa_PDAccountInfo_new,
2790 };
2791
2792
2793 static PyObject *py_lsa_ServerRole_get_role(PyObject *obj, void *closure)
2794 {
2795         struct lsa_ServerRole *object = (struct lsa_ServerRole *)pytalloc_get_ptr(obj);
2796         PyObject *py_role;
2797         py_role = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->role);
2798         return py_role;
2799 }
2800
2801 static int py_lsa_ServerRole_set_role(PyObject *py_obj, PyObject *value, void *closure)
2802 {
2803         struct lsa_ServerRole *object = (struct lsa_ServerRole *)pytalloc_get_ptr(py_obj);
2804         {
2805                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->role));
2806                 if (PyLong_Check(value)) {
2807                         unsigned long long test_var;
2808                         test_var = PyLong_AsUnsignedLongLong(value);
2809                         if (PyErr_Occurred() != NULL) {
2810                                 return -1;
2811                         }
2812                         if (test_var > uint_max) {
2813                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2814                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2815                                 return -1;
2816                         }
2817                         object->role = test_var;
2818                 } else if (PyInt_Check(value)) {
2819                         long test_var;
2820                         test_var = PyInt_AsLong(value);
2821                         if (test_var < 0 || test_var > uint_max) {
2822                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2823                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2824                                 return -1;
2825                         }
2826                         object->role = test_var;
2827                 } else {
2828                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2829                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2830                         return -1;
2831                 }
2832         }
2833         return 0;
2834 }
2835
2836 static PyGetSetDef py_lsa_ServerRole_getsetters[] = {
2837         { discard_const_p(char, "role"), py_lsa_ServerRole_get_role, py_lsa_ServerRole_set_role },
2838         { NULL }
2839 };
2840
2841 static PyObject *py_lsa_ServerRole_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2842 {
2843         return pytalloc_new(struct lsa_ServerRole, type);
2844 }
2845
2846
2847 static PyTypeObject lsa_ServerRole_Type = {
2848         PyObject_HEAD_INIT(NULL) 0,
2849         .tp_name = "lsa.ServerRole",
2850         .tp_getset = py_lsa_ServerRole_getsetters,
2851         .tp_methods = NULL,
2852         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2853         .tp_basicsize = sizeof(pytalloc_Object),
2854         .tp_new = py_lsa_ServerRole_new,
2855 };
2856
2857
2858 static PyObject *py_lsa_ReplicaSourceInfo_get_source(PyObject *obj, void *closure)
2859 {
2860         struct lsa_ReplicaSourceInfo *object = (struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(obj);
2861         PyObject *py_source;
2862         py_source = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->source);
2863         return py_source;
2864 }
2865
2866 static int py_lsa_ReplicaSourceInfo_set_source(PyObject *py_obj, PyObject *value, void *closure)
2867 {
2868         struct lsa_ReplicaSourceInfo *object = (struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(py_obj);
2869         PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
2870         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2871                 PyErr_NoMemory();
2872                 return -1;
2873         }
2874         object->source = *(struct lsa_String *)pytalloc_get_ptr(value);
2875         return 0;
2876 }
2877
2878 static PyObject *py_lsa_ReplicaSourceInfo_get_account(PyObject *obj, void *closure)
2879 {
2880         struct lsa_ReplicaSourceInfo *object = (struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(obj);
2881         PyObject *py_account;
2882         py_account = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account);
2883         return py_account;
2884 }
2885
2886 static int py_lsa_ReplicaSourceInfo_set_account(PyObject *py_obj, PyObject *value, void *closure)
2887 {
2888         struct lsa_ReplicaSourceInfo *object = (struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(py_obj);
2889         PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
2890         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2891                 PyErr_NoMemory();
2892                 return -1;
2893         }
2894         object->account = *(struct lsa_String *)pytalloc_get_ptr(value);
2895         return 0;
2896 }
2897
2898 static PyGetSetDef py_lsa_ReplicaSourceInfo_getsetters[] = {
2899         { discard_const_p(char, "source"), py_lsa_ReplicaSourceInfo_get_source, py_lsa_ReplicaSourceInfo_set_source },
2900         { discard_const_p(char, "account"), py_lsa_ReplicaSourceInfo_get_account, py_lsa_ReplicaSourceInfo_set_account },
2901         { NULL }
2902 };
2903
2904 static PyObject *py_lsa_ReplicaSourceInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2905 {
2906         return pytalloc_new(struct lsa_ReplicaSourceInfo, type);
2907 }
2908
2909
2910 static PyTypeObject lsa_ReplicaSourceInfo_Type = {
2911         PyObject_HEAD_INIT(NULL) 0,
2912         .tp_name = "lsa.ReplicaSourceInfo",
2913         .tp_getset = py_lsa_ReplicaSourceInfo_getsetters,
2914         .tp_methods = NULL,
2915         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2916         .tp_basicsize = sizeof(pytalloc_Object),
2917         .tp_new = py_lsa_ReplicaSourceInfo_new,
2918 };
2919
2920
2921 static PyObject *py_lsa_DefaultQuotaInfo_get_paged_pool(PyObject *obj, void *closure)
2922 {
2923         struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
2924         PyObject *py_paged_pool;
2925         py_paged_pool = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->paged_pool);
2926         return py_paged_pool;
2927 }
2928
2929 static int py_lsa_DefaultQuotaInfo_set_paged_pool(PyObject *py_obj, PyObject *value, void *closure)
2930 {
2931         struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
2932         {
2933                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->paged_pool));
2934                 if (PyLong_Check(value)) {
2935                         unsigned long long test_var;
2936                         test_var = PyLong_AsUnsignedLongLong(value);
2937                         if (PyErr_Occurred() != NULL) {
2938                                 return -1;
2939                         }
2940                         if (test_var > uint_max) {
2941                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2942                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2943                                 return -1;
2944                         }
2945                         object->paged_pool = test_var;
2946                 } else if (PyInt_Check(value)) {
2947                         long test_var;
2948                         test_var = PyInt_AsLong(value);
2949                         if (test_var < 0 || test_var > uint_max) {
2950                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2951                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2952                                 return -1;
2953                         }
2954                         object->paged_pool = test_var;
2955                 } else {
2956                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2957                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2958                         return -1;
2959                 }
2960         }
2961         return 0;
2962 }
2963
2964 static PyObject *py_lsa_DefaultQuotaInfo_get_non_paged_pool(PyObject *obj, void *closure)
2965 {
2966         struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
2967         PyObject *py_non_paged_pool;
2968         py_non_paged_pool = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->non_paged_pool);
2969         return py_non_paged_pool;
2970 }
2971
2972 static int py_lsa_DefaultQuotaInfo_set_non_paged_pool(PyObject *py_obj, PyObject *value, void *closure)
2973 {
2974         struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
2975         {
2976                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->non_paged_pool));
2977                 if (PyLong_Check(value)) {
2978                         unsigned long long test_var;
2979                         test_var = PyLong_AsUnsignedLongLong(value);
2980                         if (PyErr_Occurred() != NULL) {
2981                                 return -1;
2982                         }
2983                         if (test_var > uint_max) {
2984                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2985                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2986                                 return -1;
2987                         }
2988                         object->non_paged_pool = test_var;
2989                 } else if (PyInt_Check(value)) {
2990                         long test_var;
2991                         test_var = PyInt_AsLong(value);
2992                         if (test_var < 0 || test_var > uint_max) {
2993                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2994                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2995                                 return -1;
2996                         }
2997                         object->non_paged_pool = test_var;
2998                 } else {
2999                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3000                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3001                         return -1;
3002                 }
3003         }
3004         return 0;
3005 }
3006
3007 static PyObject *py_lsa_DefaultQuotaInfo_get_min_wss(PyObject *obj, void *closure)
3008 {
3009         struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3010         PyObject *py_min_wss;
3011         py_min_wss = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->min_wss);
3012         return py_min_wss;
3013 }
3014
3015 static int py_lsa_DefaultQuotaInfo_set_min_wss(PyObject *py_obj, PyObject *value, void *closure)
3016 {
3017         struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3018         {
3019                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_wss));
3020                 if (PyLong_Check(value)) {
3021                         unsigned long long test_var;
3022                         test_var = PyLong_AsUnsignedLongLong(value);
3023                         if (PyErr_Occurred() != NULL) {
3024                                 return -1;
3025                         }
3026                         if (test_var > uint_max) {
3027                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3028                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3029                                 return -1;
3030                         }
3031                         object->min_wss = test_var;
3032                 } else if (PyInt_Check(value)) {
3033                         long test_var;
3034                         test_var = PyInt_AsLong(value);
3035                         if (test_var < 0 || test_var > uint_max) {
3036                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3037                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3038                                 return -1;
3039                         }
3040                         object->min_wss = test_var;
3041                 } else {
3042                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3043                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3044                         return -1;
3045                 }
3046         }
3047         return 0;
3048 }
3049
3050 static PyObject *py_lsa_DefaultQuotaInfo_get_max_wss(PyObject *obj, void *closure)
3051 {
3052         struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3053         PyObject *py_max_wss;
3054         py_max_wss = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->max_wss);
3055         return py_max_wss;
3056 }
3057
3058 static int py_lsa_DefaultQuotaInfo_set_max_wss(PyObject *py_obj, PyObject *value, void *closure)
3059 {
3060         struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3061         {
3062                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_wss));
3063                 if (PyLong_Check(value)) {
3064                         unsigned long long test_var;
3065                         test_var = PyLong_AsUnsignedLongLong(value);
3066                         if (PyErr_Occurred() != NULL) {
3067                                 return -1;
3068                         }
3069                         if (test_var > uint_max) {
3070                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3071                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3072                                 return -1;
3073                         }
3074                         object->max_wss = test_var;
3075                 } else if (PyInt_Check(value)) {
3076                         long test_var;
3077                         test_var = PyInt_AsLong(value);
3078                         if (test_var < 0 || test_var > uint_max) {
3079                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3080                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3081                                 return -1;
3082                         }
3083                         object->max_wss = test_var;
3084                 } else {
3085                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3086                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3087                         return -1;
3088                 }
3089         }
3090         return 0;
3091 }
3092
3093 static PyObject *py_lsa_DefaultQuotaInfo_get_pagefile(PyObject *obj, void *closure)
3094 {
3095         struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3096         PyObject *py_pagefile;
3097         py_pagefile = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->pagefile);
3098         return py_pagefile;
3099 }
3100
3101 static int py_lsa_DefaultQuotaInfo_set_pagefile(PyObject *py_obj, PyObject *value, void *closure)
3102 {
3103         struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3104         {
3105                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pagefile));
3106                 if (PyLong_Check(value)) {
3107                         unsigned long long test_var;
3108                         test_var = PyLong_AsUnsignedLongLong(value);
3109                         if (PyErr_Occurred() != NULL) {
3110                                 return -1;
3111                         }
3112                         if (test_var > uint_max) {
3113                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3114                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3115                                 return -1;
3116                         }
3117                         object->pagefile = test_var;
3118                 } else if (PyInt_Check(value)) {
3119                         long test_var;
3120                         test_var = PyInt_AsLong(value);
3121                         if (test_var < 0 || test_var > uint_max) {
3122                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3123                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3124                                 return -1;
3125                         }
3126                         object->pagefile = test_var;
3127                 } else {
3128                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3129                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3130                         return -1;
3131                 }
3132         }
3133         return 0;
3134 }
3135
3136 static PyObject *py_lsa_DefaultQuotaInfo_get_unknown(PyObject *obj, void *closure)
3137 {
3138         struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3139         PyObject *py_unknown;
3140         py_unknown = ndr_PyLong_FromUnsignedLongLong(object->unknown);
3141         return py_unknown;
3142 }
3143
3144 static int py_lsa_DefaultQuotaInfo_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
3145 {
3146         struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3147         {
3148                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
3149                 if (PyLong_Check(value)) {
3150                         unsigned long long test_var;
3151                         test_var = PyLong_AsUnsignedLongLong(value);
3152                         if (PyErr_Occurred() != NULL) {
3153                                 return -1;
3154                         }
3155                         if (test_var > uint_max) {
3156                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3157                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3158                                 return -1;
3159                         }
3160                         object->unknown = test_var;
3161                 } else if (PyInt_Check(value)) {
3162                         long test_var;
3163                         test_var = PyInt_AsLong(value);
3164                         if (test_var < 0 || test_var > uint_max) {
3165                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3166                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3167                                 return -1;
3168                         }
3169                         object->unknown = test_var;
3170                 } else {
3171                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3172                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3173                         return -1;
3174                 }
3175         }
3176         return 0;
3177 }
3178
3179 static PyGetSetDef py_lsa_DefaultQuotaInfo_getsetters[] = {
3180         { discard_const_p(char, "paged_pool"), py_lsa_DefaultQuotaInfo_get_paged_pool, py_lsa_DefaultQuotaInfo_set_paged_pool },
3181         { discard_const_p(char, "non_paged_pool"), py_lsa_DefaultQuotaInfo_get_non_paged_pool, py_lsa_DefaultQuotaInfo_set_non_paged_pool },
3182         { discard_const_p(char, "min_wss"), py_lsa_DefaultQuotaInfo_get_min_wss, py_lsa_DefaultQuotaInfo_set_min_wss },
3183         { discard_const_p(char, "max_wss"), py_lsa_DefaultQuotaInfo_get_max_wss, py_lsa_DefaultQuotaInfo_set_max_wss },
3184         { discard_const_p(char, "pagefile"), py_lsa_DefaultQuotaInfo_get_pagefile, py_lsa_DefaultQuotaInfo_set_pagefile },
3185         { discard_const_p(char, "unknown"), py_lsa_DefaultQuotaInfo_get_unknown, py_lsa_DefaultQuotaInfo_set_unknown },
3186         { NULL }
3187 };
3188
3189 static PyObject *py_lsa_DefaultQuotaInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3190 {
3191         return pytalloc_new(struct lsa_DefaultQuotaInfo, type);
3192 }
3193
3194
3195 static PyTypeObject lsa_DefaultQuotaInfo_Type = {
3196         PyObject_HEAD_INIT(NULL) 0,
3197         .tp_name = "lsa.DefaultQuotaInfo",
3198         .tp_getset = py_lsa_DefaultQuotaInfo_getsetters,
3199         .tp_methods = NULL,
3200         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3201         .tp_basicsize = sizeof(pytalloc_Object),
3202         .tp_new = py_lsa_DefaultQuotaInfo_new,
3203 };
3204
3205
3206 static PyObject *py_lsa_ModificationInfo_get_modified_id(PyObject *obj, void *closure)
3207 {
3208         struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(obj);
3209         PyObject *py_modified_id;
3210         py_modified_id = ndr_PyLong_FromUnsignedLongLong(object->modified_id);
3211         return py_modified_id;
3212 }
3213
3214 static int py_lsa_ModificationInfo_set_modified_id(PyObject *py_obj, PyObject *value, void *closure)
3215 {
3216         struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(py_obj);
3217         {
3218                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->modified_id));
3219                 if (PyLong_Check(value)) {
3220                         unsigned long long test_var;
3221                         test_var = PyLong_AsUnsignedLongLong(value);
3222                         if (PyErr_Occurred() != NULL) {
3223                                 return -1;
3224                         }
3225                         if (test_var > uint_max) {
3226                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3227                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3228                                 return -1;
3229                         }
3230                         object->modified_id = test_var;
3231                 } else if (PyInt_Check(value)) {
3232                         long test_var;
3233                         test_var = PyInt_AsLong(value);
3234                         if (test_var < 0 || test_var > uint_max) {
3235                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3236                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3237                                 return -1;
3238                         }
3239                         object->modified_id = test_var;
3240                 } else {
3241                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3242                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3243                         return -1;
3244                 }
3245         }
3246         return 0;
3247 }
3248
3249 static PyObject *py_lsa_ModificationInfo_get_db_create_time(PyObject *obj, void *closure)
3250 {
3251         struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(obj);
3252         PyObject *py_db_create_time;
3253         py_db_create_time = ndr_PyLong_FromUnsignedLongLong(object->db_create_time);
3254         return py_db_create_time;
3255 }
3256
3257 static int py_lsa_ModificationInfo_set_db_create_time(PyObject *py_obj, PyObject *value, void *closure)
3258 {
3259         struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(py_obj);
3260         {
3261                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_create_time));
3262                 if (PyLong_Check(value)) {
3263                         unsigned long long test_var;
3264                         test_var = PyLong_AsUnsignedLongLong(value);
3265                         if (PyErr_Occurred() != NULL) {
3266                                 return -1;
3267                         }
3268                         if (test_var > uint_max) {
3269                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3270                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3271                                 return -1;
3272                         }
3273                         object->db_create_time = test_var;
3274                 } else if (PyInt_Check(value)) {
3275                         long test_var;
3276                         test_var = PyInt_AsLong(value);
3277                         if (test_var < 0 || test_var > uint_max) {
3278                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3279                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3280                                 return -1;
3281                         }
3282                         object->db_create_time = test_var;
3283                 } else {
3284                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3285                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3286                         return -1;
3287                 }
3288         }
3289         return 0;
3290 }
3291
3292 static PyGetSetDef py_lsa_ModificationInfo_getsetters[] = {
3293         { discard_const_p(char, "modified_id"), py_lsa_ModificationInfo_get_modified_id, py_lsa_ModificationInfo_set_modified_id },
3294         { discard_const_p(char, "db_create_time"), py_lsa_ModificationInfo_get_db_create_time, py_lsa_ModificationInfo_set_db_create_time },
3295         { NULL }
3296 };
3297
3298 static PyObject *py_lsa_ModificationInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3299 {
3300         return pytalloc_new(struct lsa_ModificationInfo, type);
3301 }
3302
3303
3304 static PyTypeObject lsa_ModificationInfo_Type = {
3305         PyObject_HEAD_INIT(NULL) 0,
3306         .tp_name = "lsa.ModificationInfo",
3307         .tp_getset = py_lsa_ModificationInfo_getsetters,
3308         .tp_methods = NULL,
3309         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3310         .tp_basicsize = sizeof(pytalloc_Object),
3311         .tp_new = py_lsa_ModificationInfo_new,
3312 };
3313
3314
3315 static PyObject *py_lsa_AuditFullSetInfo_get_shutdown_on_full(PyObject *obj, void *closure)
3316 {
3317         struct lsa_AuditFullSetInfo *object = (struct lsa_AuditFullSetInfo *)pytalloc_get_ptr(obj);
3318         PyObject *py_shutdown_on_full;
3319         py_shutdown_on_full = PyInt_FromLong((uint16_t)object->shutdown_on_full);
3320         return py_shutdown_on_full;
3321 }
3322
3323 static int py_lsa_AuditFullSetInfo_set_shutdown_on_full(PyObject *py_obj, PyObject *value, void *closure)
3324 {
3325         struct lsa_AuditFullSetInfo *object = (struct lsa_AuditFullSetInfo *)pytalloc_get_ptr(py_obj);
3326         {
3327                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shutdown_on_full));
3328                 if (PyLong_Check(value)) {
3329                         unsigned long long test_var;
3330                         test_var = PyLong_AsUnsignedLongLong(value);
3331                         if (PyErr_Occurred() != NULL) {
3332                                 return -1;
3333                         }
3334                         if (test_var > uint_max) {
3335                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3336                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3337                                 return -1;
3338                         }
3339                         object->shutdown_on_full = test_var;
3340                 } else if (PyInt_Check(value)) {
3341                         long test_var;
3342                         test_var = PyInt_AsLong(value);
3343                         if (test_var < 0 || test_var > uint_max) {
3344                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3345                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3346                                 return -1;
3347                         }
3348                         object->shutdown_on_full = test_var;
3349                 } else {
3350                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3351                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3352                         return -1;
3353                 }
3354         }
3355         return 0;
3356 }
3357
3358 static PyGetSetDef py_lsa_AuditFullSetInfo_getsetters[] = {
3359         { discard_const_p(char, "shutdown_on_full"), py_lsa_AuditFullSetInfo_get_shutdown_on_full, py_lsa_AuditFullSetInfo_set_shutdown_on_full },
3360         { NULL }
3361 };
3362
3363 static PyObject *py_lsa_AuditFullSetInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3364 {
3365         return pytalloc_new(struct lsa_AuditFullSetInfo, type);
3366 }
3367
3368
3369 static PyTypeObject lsa_AuditFullSetInfo_Type = {
3370         PyObject_HEAD_INIT(NULL) 0,
3371         .tp_name = "lsa.AuditFullSetInfo",
3372         .tp_getset = py_lsa_AuditFullSetInfo_getsetters,
3373         .tp_methods = NULL,
3374         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3375         .tp_basicsize = sizeof(pytalloc_Object),
3376         .tp_new = py_lsa_AuditFullSetInfo_new,
3377 };
3378
3379
3380 static PyObject *py_lsa_AuditFullQueryInfo_get_shutdown_on_full(PyObject *obj, void *closure)
3381 {
3382         struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(obj);
3383         PyObject *py_shutdown_on_full;
3384         py_shutdown_on_full = PyInt_FromLong((uint16_t)object->shutdown_on_full);
3385         return py_shutdown_on_full;
3386 }
3387
3388 static int py_lsa_AuditFullQueryInfo_set_shutdown_on_full(PyObject *py_obj, PyObject *value, void *closure)
3389 {
3390         struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(py_obj);
3391         {
3392                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shutdown_on_full));
3393                 if (PyLong_Check(value)) {
3394                         unsigned long long test_var;
3395                         test_var = PyLong_AsUnsignedLongLong(value);
3396                         if (PyErr_Occurred() != NULL) {
3397                                 return -1;
3398                         }
3399                         if (test_var > uint_max) {
3400                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3401                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3402                                 return -1;
3403                         }
3404                         object->shutdown_on_full = test_var;
3405                 } else if (PyInt_Check(value)) {
3406                         long test_var;
3407                         test_var = PyInt_AsLong(value);
3408                         if (test_var < 0 || test_var > uint_max) {
3409                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3410                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3411                                 return -1;
3412                         }
3413                         object->shutdown_on_full = test_var;
3414                 } else {
3415                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3416                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3417                         return -1;
3418                 }
3419         }
3420         return 0;
3421 }
3422
3423 static PyObject *py_lsa_AuditFullQueryInfo_get_log_is_full(PyObject *obj, void *closure)
3424 {
3425         struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(obj);
3426         PyObject *py_log_is_full;
3427         py_log_is_full = PyInt_FromLong((uint16_t)object->log_is_full);
3428         return py_log_is_full;
3429 }
3430
3431 static int py_lsa_AuditFullQueryInfo_set_log_is_full(PyObject *py_obj, PyObject *value, void *closure)
3432 {
3433         struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(py_obj);
3434         {
3435                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->log_is_full));
3436                 if (PyLong_Check(value)) {
3437                         unsigned long long test_var;
3438                         test_var = PyLong_AsUnsignedLongLong(value);
3439                         if (PyErr_Occurred() != NULL) {
3440                                 return -1;
3441                         }
3442                         if (test_var > uint_max) {
3443                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3444                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3445                                 return -1;
3446                         }
3447                         object->log_is_full = test_var;
3448                 } else if (PyInt_Check(value)) {
3449                         long test_var;
3450                         test_var = PyInt_AsLong(value);
3451                         if (test_var < 0 || test_var > uint_max) {
3452                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3453                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3454                                 return -1;
3455                         }
3456                         object->log_is_full = test_var;
3457                 } else {
3458                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3459                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3460                         return -1;
3461                 }
3462         }
3463         return 0;
3464 }
3465
3466 static PyGetSetDef py_lsa_AuditFullQueryInfo_getsetters[] = {
3467         { discard_const_p(char, "shutdown_on_full"), py_lsa_AuditFullQueryInfo_get_shutdown_on_full, py_lsa_AuditFullQueryInfo_set_shutdown_on_full },
3468         { discard_const_p(char, "log_is_full"), py_lsa_AuditFullQueryInfo_get_log_is_full, py_lsa_AuditFullQueryInfo_set_log_is_full },
3469         { NULL }
3470 };
3471
3472 static PyObject *py_lsa_AuditFullQueryInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3473 {
3474         return pytalloc_new(struct lsa_AuditFullQueryInfo, type);
3475 }
3476
3477
3478 static PyTypeObject lsa_AuditFullQueryInfo_Type = {
3479         PyObject_HEAD_INIT(NULL) 0,
3480         .tp_name = "lsa.AuditFullQueryInfo",
3481         .tp_getset = py_lsa_AuditFullQueryInfo_getsetters,
3482         .tp_methods = NULL,
3483         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3484         .tp_basicsize = sizeof(pytalloc_Object),
3485         .tp_new = py_lsa_AuditFullQueryInfo_new,
3486 };
3487
3488
3489 static PyObject *py_lsa_DnsDomainInfo_get_name(PyObject *obj, void *closure)
3490 {
3491         struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3492         PyObject *py_name;
3493         py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
3494         return py_name;
3495 }
3496
3497 static int py_lsa_DnsDomainInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
3498 {
3499         struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3500         PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3501         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3502                 PyErr_NoMemory();
3503                 return -1;
3504         }
3505         object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3506         return 0;
3507 }
3508
3509 static PyObject *py_lsa_DnsDomainInfo_get_dns_domain(PyObject *obj, void *closure)
3510 {
3511         struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3512         PyObject *py_dns_domain;
3513         py_dns_domain = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_domain);
3514         return py_dns_domain;
3515 }
3516
3517 static int py_lsa_DnsDomainInfo_set_dns_domain(PyObject *py_obj, PyObject *value, void *closure)
3518 {
3519         struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3520         PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3521         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3522                 PyErr_NoMemory();
3523                 return -1;
3524         }
3525         object->dns_domain = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3526         return 0;
3527 }
3528
3529 static PyObject *py_lsa_DnsDomainInfo_get_dns_forest(PyObject *obj, void *closure)
3530 {
3531         struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3532         PyObject *py_dns_forest;
3533         py_dns_forest = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_forest);
3534         return py_dns_forest;
3535 }
3536
3537 static int py_lsa_DnsDomainInfo_set_dns_forest(PyObject *py_obj, PyObject *value, void *closure)
3538 {
3539         struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3540         PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3541         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3542                 PyErr_NoMemory();
3543                 return -1;
3544         }
3545         object->dns_forest = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3546         return 0;
3547 }
3548
3549 static PyObject *py_lsa_DnsDomainInfo_get_domain_guid(PyObject *obj, void *closure)
3550 {
3551         struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3552         PyObject *py_domain_guid;
3553         py_domain_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_guid);
3554         return py_domain_guid;
3555 }
3556
3557 static int py_lsa_DnsDomainInfo_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
3558 {
3559         struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3560         PY_CHECK_TYPE(GUID_Type, value, return -1;);
3561         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3562                 PyErr_NoMemory();
3563                 return -1;
3564         }
3565         object->domain_guid = *(struct GUID *)pytalloc_get_ptr(value);
3566         return 0;
3567 }
3568
3569 static PyObject *py_lsa_DnsDomainInfo_get_sid(PyObject *obj, void *closure)
3570 {
3571         struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3572         PyObject *py_sid;
3573         if (object->sid == NULL) {
3574                 py_sid = Py_None;
3575                 Py_INCREF(py_sid);
3576         } else {
3577                 py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
3578         }
3579         return py_sid;
3580 }
3581
3582 static int py_lsa_DnsDomainInfo_set_sid(PyObject *py_obj, PyObject *value, void *closure)
3583 {
3584         struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3585         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
3586         if (value == Py_None) {
3587                 object->sid = NULL;
3588         } else {
3589                 object->sid = NULL;
3590                 PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
3591                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3592                         PyErr_NoMemory();
3593                         return -1;
3594                 }
3595                 object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
3596         }
3597         return 0;
3598 }
3599
3600 static PyGetSetDef py_lsa_DnsDomainInfo_getsetters[] = {
3601         { discard_const_p(char, "name"), py_lsa_DnsDomainInfo_get_name, py_lsa_DnsDomainInfo_set_name },
3602         { discard_const_p(char, "dns_domain"), py_lsa_DnsDomainInfo_get_dns_domain, py_lsa_DnsDomainInfo_set_dns_domain },
3603         { discard_const_p(char, "dns_forest"), py_lsa_DnsDomainInfo_get_dns_forest, py_lsa_DnsDomainInfo_set_dns_forest },
3604         { discard_const_p(char, "domain_guid"), py_lsa_DnsDomainInfo_get_domain_guid, py_lsa_DnsDomainInfo_set_domain_guid },
3605         { discard_const_p(char, "sid"), py_lsa_DnsDomainInfo_get_sid, py_lsa_DnsDomainInfo_set_sid },
3606         { NULL }
3607 };
3608
3609 static PyObject *py_lsa_DnsDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3610 {
3611         return pytalloc_new(struct lsa_DnsDomainInfo, type);
3612 }
3613
3614
3615 static PyTypeObject lsa_DnsDomainInfo_Type = {
3616         PyObject_HEAD_INIT(NULL) 0,
3617         .tp_name = "lsa.DnsDomainInfo",
3618         .tp_getset = py_lsa_DnsDomainInfo_getsetters,
3619         .tp_methods = NULL,
3620         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3621         .tp_basicsize = sizeof(pytalloc_Object),
3622         .tp_new = py_lsa_DnsDomainInfo_new,
3623 };
3624
3625 PyObject *py_import_lsa_PolicyInformation(TALLOC_CTX *mem_ctx, int level, union lsa_PolicyInformation *in)
3626 {
3627         PyObject *ret;
3628
3629         switch (level) {
3630                 case LSA_POLICY_INFO_AUDIT_LOG:
3631                         ret = pytalloc_reference_ex(&lsa_AuditLogInfo_Type, mem_ctx, &in->audit_log);
3632                         return ret;
3633
3634                 case LSA_POLICY_INFO_AUDIT_EVENTS:
3635                         ret = pytalloc_reference_ex(&lsa_AuditEventsInfo_Type, mem_ctx, &in->audit_events);
3636                         return ret;
3637
3638                 case LSA_POLICY_INFO_DOMAIN:
3639                         ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->domain);
3640                         return ret;
3641
3642                 case LSA_POLICY_INFO_PD:
3643                         ret = pytalloc_reference_ex(&lsa_PDAccountInfo_Type, mem_ctx, &in->pd);
3644                         return ret;
3645
3646                 case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
3647                         ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->account_domain);
3648                         return ret;
3649
3650                 case LSA_POLICY_INFO_ROLE:
3651                         ret = pytalloc_reference_ex(&lsa_ServerRole_Type, mem_ctx, &in->role);
3652                         return ret;
3653
3654                 case LSA_POLICY_INFO_REPLICA:
3655                         ret = pytalloc_reference_ex(&lsa_ReplicaSourceInfo_Type, mem_ctx, &in->replica);
3656                         return ret;
3657
3658                 case LSA_POLICY_INFO_QUOTA:
3659                         ret = pytalloc_reference_ex(&lsa_DefaultQuotaInfo_Type, mem_ctx, &in->quota);
3660                         return ret;
3661
3662                 case LSA_POLICY_INFO_MOD:
3663                         ret = pytalloc_reference_ex(&lsa_ModificationInfo_Type, mem_ctx, &in->mod);
3664                         return ret;
3665
3666                 case LSA_POLICY_INFO_AUDIT_FULL_SET:
3667                         ret = pytalloc_reference_ex(&lsa_AuditFullSetInfo_Type, mem_ctx, &in->auditfullset);
3668                         return ret;
3669
3670                 case LSA_POLICY_INFO_AUDIT_FULL_QUERY:
3671                         ret = pytalloc_reference_ex(&lsa_AuditFullQueryInfo_Type, mem_ctx, &in->auditfullquery);
3672                         return ret;
3673
3674                 case LSA_POLICY_INFO_DNS:
3675                         ret = pytalloc_reference_ex(&lsa_DnsDomainInfo_Type, mem_ctx, &in->dns);
3676                         return ret;
3677
3678                 case LSA_POLICY_INFO_DNS_INT:
3679                         ret = pytalloc_reference_ex(&lsa_DnsDomainInfo_Type, mem_ctx, &in->dns);
3680                         return ret;
3681
3682                 case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN:
3683                         ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->l_account_domain);
3684                         return ret;
3685
3686         }
3687         PyErr_SetString(PyExc_TypeError, "unknown union level");
3688         return NULL;
3689 }
3690
3691 union lsa_PolicyInformation *py_export_lsa_PolicyInformation(TALLOC_CTX *mem_ctx, int level, PyObject *in)
3692 {
3693         union lsa_PolicyInformation *ret = talloc_zero(mem_ctx, union lsa_PolicyInformation);
3694         switch (level) {
3695                 case LSA_POLICY_INFO_AUDIT_LOG:
3696                         PY_CHECK_TYPE(&lsa_AuditLogInfo_Type, in, talloc_free(ret); return NULL;);
3697                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3698                                 PyErr_NoMemory();
3699                                 talloc_free(ret); return NULL;
3700                         }
3701                         ret->audit_log = *(struct lsa_AuditLogInfo *)pytalloc_get_ptr(in);
3702                         break;
3703
3704                 case LSA_POLICY_INFO_AUDIT_EVENTS:
3705                         PY_CHECK_TYPE(&lsa_AuditEventsInfo_Type, in, talloc_free(ret); return NULL;);
3706                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3707                                 PyErr_NoMemory();
3708                                 talloc_free(ret); return NULL;
3709                         }
3710                         ret->audit_events = *(struct lsa_AuditEventsInfo *)pytalloc_get_ptr(in);
3711                         break;
3712
3713                 case LSA_POLICY_INFO_DOMAIN:
3714                         PY_CHECK_TYPE(&lsa_DomainInfo_Type, in, talloc_free(ret); return NULL;);
3715                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3716                                 PyErr_NoMemory();
3717                                 talloc_free(ret); return NULL;
3718                         }
3719                         ret->domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
3720                         break;
3721
3722                 case LSA_POLICY_INFO_PD:
3723                         PY_CHECK_TYPE(&lsa_PDAccountInfo_Type, in, talloc_free(ret); return NULL;);
3724                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3725                                 PyErr_NoMemory();
3726                                 talloc_free(ret); return NULL;
3727                         }
3728                         ret->pd = *(struct lsa_PDAccountInfo *)pytalloc_get_ptr(in);
3729                         break;
3730
3731                 case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
3732                         PY_CHECK_TYPE(&lsa_DomainInfo_Type, in, talloc_free(ret); return NULL;);
3733                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3734                                 PyErr_NoMemory();
3735                                 talloc_free(ret); return NULL;
3736                         }
3737                         ret->account_domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
3738                         break;
3739
3740                 case LSA_POLICY_INFO_ROLE:
3741                         PY_CHECK_TYPE(&lsa_ServerRole_Type, in, talloc_free(ret); return NULL;);
3742                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3743                                 PyErr_NoMemory();
3744                                 talloc_free(ret); return NULL;
3745                         }
3746                         ret->role = *(struct lsa_ServerRole *)pytalloc_get_ptr(in);
3747                         break;
3748
3749                 case LSA_POLICY_INFO_REPLICA:
3750                         PY_CHECK_TYPE(&lsa_ReplicaSourceInfo_Type, in, talloc_free(ret); return NULL;);
3751                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3752                                 PyErr_NoMemory();
3753                                 talloc_free(ret); return NULL;
3754                         }
3755                         ret->replica = *(struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(in);
3756                         break;
3757
3758                 case LSA_POLICY_INFO_QUOTA:
3759                         PY_CHECK_TYPE(&lsa_DefaultQuotaInfo_Type, in, talloc_free(ret); return NULL;);
3760                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3761                                 PyErr_NoMemory();
3762                                 talloc_free(ret); return NULL;
3763                         }
3764                         ret->quota = *(struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(in);
3765                         break;
3766
3767                 case LSA_POLICY_INFO_MOD:
3768                         PY_CHECK_TYPE(&lsa_ModificationInfo_Type, in, talloc_free(ret); return NULL;);
3769                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3770                                 PyErr_NoMemory();
3771                                 talloc_free(ret); return NULL;
3772                         }
3773                         ret->mod = *(struct lsa_ModificationInfo *)pytalloc_get_ptr(in);
3774                         break;
3775
3776                 case LSA_POLICY_INFO_AUDIT_FULL_SET:
3777                         PY_CHECK_TYPE(&lsa_AuditFullSetInfo_Type, in, talloc_free(ret); return NULL;);
3778                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3779                                 PyErr_NoMemory();
3780                                 talloc_free(ret); return NULL;
3781                         }
3782                         ret->auditfullset = *(struct lsa_AuditFullSetInfo *)pytalloc_get_ptr(in);
3783                         break;
3784
3785                 case LSA_POLICY_INFO_AUDIT_FULL_QUERY:
3786                         PY_CHECK_TYPE(&lsa_AuditFullQueryInfo_Type, in, talloc_free(ret); return NULL;);
3787                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3788                                 PyErr_NoMemory();
3789                                 talloc_free(ret); return NULL;
3790                         }
3791                         ret->auditfullquery = *(struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(in);
3792                         break;
3793
3794                 case LSA_POLICY_INFO_DNS:
3795                         PY_CHECK_TYPE(&lsa_DnsDomainInfo_Type, in, talloc_free(ret); return NULL;);
3796                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3797                                 PyErr_NoMemory();
3798                                 talloc_free(ret); return NULL;
3799                         }
3800                         ret->dns = *(struct lsa_DnsDomainInfo *)pytalloc_get_ptr(in);
3801                         break;
3802
3803                 case LSA_POLICY_INFO_DNS_INT:
3804                         PY_CHECK_TYPE(&lsa_DnsDomainInfo_Type, in, talloc_free(ret); return NULL;);
3805                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3806                                 PyErr_NoMemory();
3807                                 talloc_free(ret); return NULL;
3808                         }
3809                         ret->dns = *(struct lsa_DnsDomainInfo *)pytalloc_get_ptr(in);
3810                         break;
3811
3812                 case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN:
3813                         PY_CHECK_TYPE(&lsa_DomainInfo_Type, in, talloc_free(ret); return NULL;);
3814                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3815                                 PyErr_NoMemory();
3816                                 talloc_free(ret); return NULL;
3817                         }
3818                         ret->l_account_domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
3819                         break;
3820
3821                 default:
3822                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
3823                         talloc_free(ret);
3824                         ret = NULL;
3825         }
3826
3827         return ret;
3828 }
3829
3830
3831 static PyObject *py_lsa_SidPtr_get_sid(PyObject *obj, void *closure)
3832 {
3833         struct lsa_SidPtr *object = (struct lsa_SidPtr *)pytalloc_get_ptr(obj);
3834         PyObject *py_sid;
3835         if (object->sid == NULL) {
3836                 py_sid = Py_None;
3837                 Py_INCREF(py_sid);
3838         } else {
3839                 py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
3840         }
3841         return py_sid;
3842 }
3843
3844 static int py_lsa_SidPtr_set_sid(PyObject *py_obj, PyObject *value, void *closure)
3845 {
3846         struct lsa_SidPtr *object = (struct lsa_SidPtr *)pytalloc_get_ptr(py_obj);
3847         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
3848         if (value == Py_None) {
3849                 object->sid = NULL;
3850         } else {
3851                 object->sid = NULL;
3852                 PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
3853                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3854                         PyErr_NoMemory();
3855                         return -1;
3856                 }
3857                 object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
3858         }
3859         return 0;
3860 }
3861
3862 static PyGetSetDef py_lsa_SidPtr_getsetters[] = {
3863         { discard_const_p(char, "sid"), py_lsa_SidPtr_get_sid, py_lsa_SidPtr_set_sid },
3864         { NULL }
3865 };
3866
3867 static PyObject *py_lsa_SidPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3868 {
3869         return pytalloc_new(struct lsa_SidPtr, type);
3870 }
3871
3872
3873 static PyTypeObject lsa_SidPtr_Type = {
3874         PyObject_HEAD_INIT(NULL) 0,
3875         .tp_name = "lsa.SidPtr",
3876         .tp_getset = py_lsa_SidPtr_getsetters,
3877         .tp_methods = NULL,
3878         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3879         .tp_basicsize = sizeof(pytalloc_Object),
3880         .tp_new = py_lsa_SidPtr_new,
3881 };
3882
3883
3884 static PyObject *py_lsa_SidArray_get_num_sids(PyObject *obj, void *closure)
3885 {
3886         struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(obj);
3887         PyObject *py_num_sids;
3888         py_num_sids = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_sids);
3889         return py_num_sids;
3890 }
3891
3892 static int py_lsa_SidArray_set_num_sids(PyObject *py_obj, PyObject *value, void *closure)
3893 {
3894         struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
3895         {
3896                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sids));
3897                 if (PyLong_Check(value)) {
3898                         unsigned long long test_var;
3899                         test_var = PyLong_AsUnsignedLongLong(value);
3900                         if (PyErr_Occurred() != NULL) {
3901                                 return -1;
3902                         }
3903                         if (test_var > uint_max) {
3904                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3905                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3906                                 return -1;
3907                         }
3908                         object->num_sids = test_var;
3909                 } else if (PyInt_Check(value)) {
3910                         long test_var;
3911                         test_var = PyInt_AsLong(value);
3912                         if (test_var < 0 || test_var > uint_max) {
3913                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3914                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3915                                 return -1;
3916                         }
3917                         object->num_sids = test_var;
3918                 } else {
3919                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3920                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3921                         return -1;
3922                 }
3923         }
3924         return 0;
3925 }
3926
3927 static PyObject *py_lsa_SidArray_get_sids(PyObject *obj, void *closure)
3928 {
3929         struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(obj);
3930         PyObject *py_sids;
3931         if (object->sids == NULL) {
3932                 py_sids = Py_None;
3933                 Py_INCREF(py_sids);
3934         } else {
3935                 py_sids = PyList_New(object->num_sids);
3936                 if (py_sids == NULL) {
3937                         return NULL;
3938                 }
3939                 {
3940                         int sids_cntr_1;
3941                         for (sids_cntr_1 = 0; sids_cntr_1 < (object->num_sids); sids_cntr_1++) {
3942                                 PyObject *py_sids_1;
3943                                 py_sids_1 = pytalloc_reference_ex(&lsa_SidPtr_Type, object->sids, &object->sids[sids_cntr_1]);
3944                                 PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
3945                         }
3946                 }
3947         }
3948         return py_sids;
3949 }
3950
3951 static int py_lsa_SidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure)
3952 {
3953         struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
3954         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
3955         if (value == Py_None) {
3956                 object->sids = NULL;
3957         } else {
3958                 object->sids = NULL;
3959                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3960                 {
3961                         int sids_cntr_1;
3962                         object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
3963                         if (!object->sids) { return -1;; }
3964                         talloc_set_name_const(object->sids, "ARRAY: object->sids");
3965                         for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
3966                                 PY_CHECK_TYPE(&lsa_SidPtr_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
3967                                 if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
3968                                         PyErr_NoMemory();
3969                                         return -1;
3970                                 }
3971                                 object->sids[sids_cntr_1] = *(struct lsa_SidPtr *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
3972                         }
3973                 }
3974         }
3975         return 0;
3976 }
3977
3978 static PyGetSetDef py_lsa_SidArray_getsetters[] = {
3979         { discard_const_p(char, "num_sids"), py_lsa_SidArray_get_num_sids, py_lsa_SidArray_set_num_sids },
3980         { discard_const_p(char, "sids"), py_lsa_SidArray_get_sids, py_lsa_SidArray_set_sids },
3981         { NULL }
3982 };
3983
3984 static PyObject *py_lsa_SidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3985 {
3986         return pytalloc_new(struct lsa_SidArray, type);
3987 }
3988
3989 static PyObject *py_lsa_SidArray_ndr_pack(PyObject *py_obj)
3990 {
3991         struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
3992         DATA_BLOB blob;
3993         enum ndr_err_code err;
3994         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_SidArray);
3995         if (err != NDR_ERR_SUCCESS) {
3996                 PyErr_SetNdrError(err);
3997                 return NULL;
3998         }
3999
4000         return PyString_FromStringAndSize((char *)blob.data, blob.length);
4001 }
4002
4003 static PyObject *py_lsa_SidArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4004 {
4005         struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
4006         DATA_BLOB blob;
4007         int blob_length = 0;
4008         enum ndr_err_code err;
4009         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4010         PyObject *allow_remaining_obj = NULL;
4011         bool allow_remaining = false;
4012
4013         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
4014                 discard_const_p(char *, kwnames),
4015                 &blob.data, &blob_length,
4016                 &allow_remaining_obj)) {
4017                 return NULL;
4018         }
4019         blob.length = blob_length;
4020
4021         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4022                 allow_remaining = true;
4023         }
4024
4025         if (allow_remaining) {
4026                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_SidArray);
4027         } else {
4028                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_SidArray);
4029         }
4030         if (err != NDR_ERR_SUCCESS) {
4031                 PyErr_SetNdrError(err);
4032                 return NULL;
4033         }
4034
4035         Py_RETURN_NONE;
4036 }
4037
4038 static PyObject *py_lsa_SidArray_ndr_print(PyObject *py_obj)
4039 {
4040         struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
4041         PyObject *ret;
4042         char *retstr;
4043
4044         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_SidArray, "lsa_SidArray", object);
4045         ret = PyString_FromString(retstr);
4046         talloc_free(retstr);
4047
4048         return ret;
4049 }
4050
4051 static PyMethodDef py_lsa_SidArray_methods[] = {
4052         { "__ndr_pack__", (PyCFunction)py_lsa_SidArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4053         { "__ndr_unpack__", (PyCFunction)py_lsa_SidArray_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4054         { "__ndr_print__", (PyCFunction)py_lsa_SidArray_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
4055         { NULL, NULL, 0, NULL }
4056 };
4057
4058
4059 static PyTypeObject lsa_SidArray_Type = {
4060         PyObject_HEAD_INIT(NULL) 0,
4061         .tp_name = "lsa.SidArray",
4062         .tp_getset = py_lsa_SidArray_getsetters,
4063         .tp_methods = py_lsa_SidArray_methods,
4064         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4065         .tp_basicsize = sizeof(pytalloc_Object),
4066         .tp_new = py_lsa_SidArray_new,
4067 };
4068
4069
4070 static PyObject *py_lsa_DomainList_get_count(PyObject *obj, void *closure)
4071 {
4072         struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(obj);
4073         PyObject *py_count;
4074         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
4075         return py_count;
4076 }
4077
4078 static int py_lsa_DomainList_set_count(PyObject *py_obj, PyObject *value, void *closure)
4079 {
4080         struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(py_obj);
4081         {
4082                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
4083                 if (PyLong_Check(value)) {
4084                         unsigned long long test_var;
4085                         test_var = PyLong_AsUnsignedLongLong(value);
4086                         if (PyErr_Occurred() != NULL) {
4087                                 return -1;
4088                         }
4089                         if (test_var > uint_max) {
4090                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4091                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4092                                 return -1;
4093                         }
4094                         object->count = test_var;
4095                 } else if (PyInt_Check(value)) {
4096                         long test_var;
4097                         test_var = PyInt_AsLong(value);
4098                         if (test_var < 0 || test_var > uint_max) {
4099                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4100                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4101                                 return -1;
4102                         }
4103                         object->count = test_var;
4104                 } else {
4105                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4106                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4107                         return -1;
4108                 }
4109         }
4110         return 0;
4111 }
4112
4113 static PyObject *py_lsa_DomainList_get_domains(PyObject *obj, void *closure)
4114 {
4115         struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(obj);
4116         PyObject *py_domains;
4117         if (object->domains == NULL) {
4118                 py_domains = Py_None;
4119                 Py_INCREF(py_domains);
4120         } else {
4121                 py_domains = PyList_New(object->count);
4122                 if (py_domains == NULL) {
4123                         return NULL;
4124                 }
4125                 {
4126                         int domains_cntr_1;
4127                         for (domains_cntr_1 = 0; domains_cntr_1 < (object->count); domains_cntr_1++) {
4128                                 PyObject *py_domains_1;
4129                                 py_domains_1 = pytalloc_reference_ex(&lsa_DomainInfo_Type, object->domains, &object->domains[domains_cntr_1]);
4130                                 PyList_SetItem(py_domains, domains_cntr_1, py_domains_1);
4131                         }
4132                 }
4133         }
4134         return py_domains;
4135 }
4136
4137 static int py_lsa_DomainList_set_domains(PyObject *py_obj, PyObject *value, void *closure)
4138 {
4139         struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(py_obj);
4140         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domains));
4141         if (value == Py_None) {
4142                 object->domains = NULL;
4143         } else {
4144                 object->domains = NULL;
4145                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4146                 {
4147                         int domains_cntr_1;
4148                         object->domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->domains, PyList_GET_SIZE(value));
4149                         if (!object->domains) { return -1;; }
4150                         talloc_set_name_const(object->domains, "ARRAY: object->domains");
4151                         for (domains_cntr_1 = 0; domains_cntr_1 < PyList_GET_SIZE(value); domains_cntr_1++) {
4152                                 PY_CHECK_TYPE(&lsa_DomainInfo_Type, PyList_GET_ITEM(value, domains_cntr_1), return -1;);
4153                                 if (talloc_reference(object->domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, domains_cntr_1))) == NULL) {
4154                                         PyErr_NoMemory();
4155                                         return -1;
4156                                 }
4157                                 object->domains[domains_cntr_1] = *(struct lsa_DomainInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
4158                         }
4159                 }
4160         }
4161         return 0;
4162 }
4163
4164 static PyGetSetDef py_lsa_DomainList_getsetters[] = {
4165         { discard_const_p(char, "count"), py_lsa_DomainList_get_count, py_lsa_DomainList_set_count },
4166         { discard_const_p(char, "domains"), py_lsa_DomainList_get_domains, py_lsa_DomainList_set_domains },
4167         { NULL }
4168 };
4169
4170 static PyObject *py_lsa_DomainList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4171 {
4172         return pytalloc_new(struct lsa_DomainList, type);
4173 }
4174
4175
4176 static PyTypeObject lsa_DomainList_Type = {
4177         PyObject_HEAD_INIT(NULL) 0,
4178         .tp_name = "lsa.DomainList",
4179         .tp_getset = py_lsa_DomainList_getsetters,
4180         .tp_methods = NULL,
4181         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4182         .tp_basicsize = sizeof(pytalloc_Object),
4183         .tp_new = py_lsa_DomainList_new,
4184 };
4185
4186
4187 static PyObject *py_lsa_TranslatedSid_get_sid_type(PyObject *obj, void *closure)
4188 {
4189         struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(obj);
4190         PyObject *py_sid_type;
4191         py_sid_type = PyInt_FromLong((uint16_t)object->sid_type);
4192         return py_sid_type;
4193 }
4194
4195 static int py_lsa_TranslatedSid_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
4196 {
4197         struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(py_obj);
4198         {
4199                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
4200                 if (PyLong_Check(value)) {
4201                         unsigned long long test_var;
4202                         test_var = PyLong_AsUnsignedLongLong(value);
4203                         if (PyErr_Occurred() != NULL) {
4204                                 return -1;
4205                         }
4206                         if (test_var > uint_max) {
4207                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4208                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4209                                 return -1;
4210                         }
4211                         object->sid_type = test_var;
4212                 } else if (PyInt_Check(value)) {
4213                         long test_var;
4214                         test_var = PyInt_AsLong(value);
4215                         if (test_var < 0 || test_var > uint_max) {
4216                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4217                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4218                                 return -1;
4219                         }
4220                         object->sid_type = test_var;
4221                 } else {
4222                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4223                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4224                         return -1;
4225                 }
4226         }
4227         return 0;
4228 }
4229
4230 static PyObject *py_lsa_TranslatedSid_get_rid(PyObject *obj, void *closure)
4231 {
4232         struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(obj);
4233         PyObject *py_rid;
4234         py_rid = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->rid);
4235         return py_rid;
4236 }
4237
4238 static int py_lsa_TranslatedSid_set_rid(PyObject *py_obj, PyObject *value, void *closure)
4239 {
4240         struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(py_obj);
4241         {
4242                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
4243                 if (PyLong_Check(value)) {
4244                         unsigned long long test_var;
4245                         test_var = PyLong_AsUnsignedLongLong(value);
4246                         if (PyErr_Occurred() != NULL) {
4247                                 return -1;
4248                         }
4249                         if (test_var > uint_max) {
4250                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4251                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4252                                 return -1;
4253                         }
4254                         object->rid = test_var;
4255                 } else if (PyInt_Check(value)) {
4256                         long test_var;
4257                         test_var = PyInt_AsLong(value);
4258                         if (test_var < 0 || test_var > uint_max) {
4259                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4260                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4261                                 return -1;
4262                         }
4263                         object->rid = test_var;
4264                 } else {
4265                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4266                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4267                         return -1;
4268                 }
4269         }
4270         return 0;
4271 }
4272
4273 static PyObject *py_lsa_TranslatedSid_get_sid_index(PyObject *obj, void *closure)
4274 {
4275         struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(obj);
4276         PyObject *py_sid_index;
4277         py_sid_index = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
4278         return py_sid_index;
4279 }
4280
4281 static int py_lsa_TranslatedSid_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
4282 {
4283         struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(py_obj);
4284         {
4285                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
4286                 if (PyLong_Check(value)) {
4287                         unsigned long long test_var;
4288                         test_var = PyLong_AsUnsignedLongLong(value);
4289                         if (PyErr_Occurred() != NULL) {
4290                                 return -1;
4291                         }
4292                         if (test_var > uint_max) {
4293                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4294                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4295                                 return -1;
4296                         }
4297                         object->sid_index = test_var;
4298                 } else if (PyInt_Check(value)) {
4299                         long test_var;
4300                         test_var = PyInt_AsLong(value);
4301                         if (test_var < 0 || test_var > uint_max) {
4302                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4303                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4304                                 return -1;
4305                         }
4306                         object->sid_index = test_var;
4307                 } else {
4308                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4309                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4310                         return -1;
4311                 }
4312         }
4313         return 0;
4314 }
4315
4316 static PyGetSetDef py_lsa_TranslatedSid_getsetters[] = {
4317         { discard_const_p(char, "sid_type"), py_lsa_TranslatedSid_get_sid_type, py_lsa_TranslatedSid_set_sid_type },
4318         { discard_const_p(char, "rid"), py_lsa_TranslatedSid_get_rid, py_lsa_TranslatedSid_set_rid },
4319         { discard_const_p(char, "sid_index"), py_lsa_TranslatedSid_get_sid_index, py_lsa_TranslatedSid_set_sid_index },
4320         { NULL }
4321 };
4322
4323 static PyObject *py_lsa_TranslatedSid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4324 {
4325         return pytalloc_new(struct lsa_TranslatedSid, type);
4326 }
4327
4328
4329 static PyTypeObject lsa_TranslatedSid_Type = {
4330         PyObject_HEAD_INIT(NULL) 0,
4331         .tp_name = "lsa.TranslatedSid",
4332         .tp_getset = py_lsa_TranslatedSid_getsetters,
4333         .tp_methods = NULL,
4334         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4335         .tp_basicsize = sizeof(pytalloc_Object),
4336         .tp_new = py_lsa_TranslatedSid_new,
4337 };
4338
4339
4340 static PyObject *py_lsa_TransSidArray_get_count(PyObject *obj, void *closure)
4341 {
4342         struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(obj);
4343         PyObject *py_count;
4344         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
4345         return py_count;
4346 }
4347
4348 static int py_lsa_TransSidArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
4349 {
4350         struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(py_obj);
4351         {
4352                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
4353                 if (PyLong_Check(value)) {
4354                         unsigned long long test_var;
4355                         test_var = PyLong_AsUnsignedLongLong(value);
4356                         if (PyErr_Occurred() != NULL) {
4357                                 return -1;
4358                         }
4359                         if (test_var > uint_max) {
4360                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4361                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4362                                 return -1;
4363                         }
4364                         object->count = test_var;
4365                 } else if (PyInt_Check(value)) {
4366                         long test_var;
4367                         test_var = PyInt_AsLong(value);
4368                         if (test_var < 0 || test_var > uint_max) {
4369                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4370                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4371                                 return -1;
4372                         }
4373                         object->count = test_var;
4374                 } else {
4375                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4376                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4377                         return -1;
4378                 }
4379         }
4380         return 0;
4381 }
4382
4383 static PyObject *py_lsa_TransSidArray_get_sids(PyObject *obj, void *closure)
4384 {
4385         struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(obj);
4386         PyObject *py_sids;
4387         if (object->sids == NULL) {
4388                 py_sids = Py_None;
4389                 Py_INCREF(py_sids);
4390         } else {
4391                 py_sids = PyList_New(object->count);
4392                 if (py_sids == NULL) {
4393                         return NULL;
4394                 }
4395                 {
4396                         int sids_cntr_1;
4397                         for (sids_cntr_1 = 0; sids_cntr_1 < (object->count); sids_cntr_1++) {
4398                                 PyObject *py_sids_1;
4399                                 py_sids_1 = pytalloc_reference_ex(&lsa_TranslatedSid_Type, object->sids, &object->sids[sids_cntr_1]);
4400                                 PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
4401                         }
4402                 }
4403         }
4404         return py_sids;
4405 }
4406
4407 static int py_lsa_TransSidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure)
4408 {
4409         struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(py_obj);
4410         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
4411         if (value == Py_None) {
4412                 object->sids = NULL;
4413         } else {
4414                 object->sids = NULL;
4415                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4416                 {
4417                         int sids_cntr_1;
4418                         object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
4419                         if (!object->sids) { return -1;; }
4420                         talloc_set_name_const(object->sids, "ARRAY: object->sids");
4421                         for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
4422                                 PY_CHECK_TYPE(&lsa_TranslatedSid_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
4423                                 if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
4424                                         PyErr_NoMemory();
4425                                         return -1;
4426                                 }
4427                                 object->sids[sids_cntr_1] = *(struct lsa_TranslatedSid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
4428                         }
4429                 }
4430         }
4431         return 0;
4432 }
4433
4434 static PyGetSetDef py_lsa_TransSidArray_getsetters[] = {
4435         { discard_const_p(char, "count"), py_lsa_TransSidArray_get_count, py_lsa_TransSidArray_set_count },
4436         { discard_const_p(char, "sids"), py_lsa_TransSidArray_get_sids, py_lsa_TransSidArray_set_sids },
4437         { NULL }
4438 };
4439
4440 static PyObject *py_lsa_TransSidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4441 {
4442         return pytalloc_new(struct lsa_TransSidArray, type);
4443 }
4444
4445
4446 static PyTypeObject lsa_TransSidArray_Type = {
4447         PyObject_HEAD_INIT(NULL) 0,
4448         .tp_name = "lsa.TransSidArray",
4449         .tp_getset = py_lsa_TransSidArray_getsetters,
4450         .tp_methods = NULL,
4451         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4452         .tp_basicsize = sizeof(pytalloc_Object),
4453         .tp_new = py_lsa_TransSidArray_new,
4454 };
4455
4456
4457 static PyObject *py_lsa_RefDomainList_get_count(PyObject *obj, void *closure)
4458 {
4459         struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(obj);
4460         PyObject *py_count;
4461         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
4462         return py_count;
4463 }
4464
4465 static int py_lsa_RefDomainList_set_count(PyObject *py_obj, PyObject *value, void *closure)
4466 {
4467         struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
4468         {
4469                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
4470                 if (PyLong_Check(value)) {
4471                         unsigned long long test_var;
4472                         test_var = PyLong_AsUnsignedLongLong(value);
4473                         if (PyErr_Occurred() != NULL) {
4474                                 return -1;
4475                         }
4476                         if (test_var > uint_max) {
4477                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4478                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4479                                 return -1;
4480                         }
4481                         object->count = test_var;
4482                 } else if (PyInt_Check(value)) {
4483                         long test_var;
4484                         test_var = PyInt_AsLong(value);
4485                         if (test_var < 0 || test_var > uint_max) {
4486                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4487                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4488                                 return -1;
4489                         }
4490                         object->count = test_var;
4491                 } else {
4492                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4493                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4494                         return -1;
4495                 }
4496         }
4497         return 0;
4498 }
4499
4500 static PyObject *py_lsa_RefDomainList_get_domains(PyObject *obj, void *closure)
4501 {
4502         struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(obj);
4503         PyObject *py_domains;
4504         if (object->domains == NULL) {
4505                 py_domains = Py_None;
4506                 Py_INCREF(py_domains);
4507         } else {
4508                 py_domains = PyList_New(object->count);
4509                 if (py_domains == NULL) {
4510                         return NULL;
4511                 }
4512                 {
4513                         int domains_cntr_1;
4514                         for (domains_cntr_1 = 0; domains_cntr_1 < (object->count); domains_cntr_1++) {
4515                                 PyObject *py_domains_1;
4516                                 py_domains_1 = pytalloc_reference_ex(&lsa_DomainInfo_Type, object->domains, &object->domains[domains_cntr_1]);
4517                                 PyList_SetItem(py_domains, domains_cntr_1, py_domains_1);
4518                         }
4519                 }
4520         }
4521         return py_domains;
4522 }
4523
4524 static int py_lsa_RefDomainList_set_domains(PyObject *py_obj, PyObject *value, void *closure)
4525 {
4526         struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
4527         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domains));
4528         if (value == Py_None) {
4529                 object->domains = NULL;
4530         } else {
4531                 object->domains = NULL;
4532                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4533                 {
4534                         int domains_cntr_1;
4535                         object->domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->domains, PyList_GET_SIZE(value));
4536                         if (!object->domains) { return -1;; }
4537                         talloc_set_name_const(object->domains, "ARRAY: object->domains");
4538                         for (domains_cntr_1 = 0; domains_cntr_1 < PyList_GET_SIZE(value); domains_cntr_1++) {
4539                                 PY_CHECK_TYPE(&lsa_DomainInfo_Type, PyList_GET_ITEM(value, domains_cntr_1), return -1;);
4540                                 if (talloc_reference(object->domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, domains_cntr_1))) == NULL) {
4541                                         PyErr_NoMemory();
4542                                         return -1;
4543                                 }
4544                                 object->domains[domains_cntr_1] = *(struct lsa_DomainInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
4545                         }
4546                 }
4547         }
4548         return 0;
4549 }
4550
4551 static PyObject *py_lsa_RefDomainList_get_max_size(PyObject *obj, void *closure)
4552 {
4553         struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(obj);
4554         PyObject *py_max_size;
4555         py_max_size = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->max_size);
4556         return py_max_size;
4557 }
4558
4559 static int py_lsa_RefDomainList_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
4560 {
4561         struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
4562         {
4563                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_size));
4564                 if (PyLong_Check(value)) {
4565                         unsigned long long test_var;
4566                         test_var = PyLong_AsUnsignedLongLong(value);
4567                         if (PyErr_Occurred() != NULL) {
4568                                 return -1;
4569                         }
4570                         if (test_var > uint_max) {
4571                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4572                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4573                                 return -1;
4574                         }
4575                         object->max_size = test_var;
4576                 } else if (PyInt_Check(value)) {
4577                         long test_var;
4578                         test_var = PyInt_AsLong(value);
4579                         if (test_var < 0 || test_var > uint_max) {
4580                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4581                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4582                                 return -1;
4583                         }
4584                         object->max_size = test_var;
4585                 } else {
4586                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4587                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4588                         return -1;
4589                 }
4590         }
4591         return 0;
4592 }
4593
4594 static PyGetSetDef py_lsa_RefDomainList_getsetters[] = {
4595         { discard_const_p(char, "count"), py_lsa_RefDomainList_get_count, py_lsa_RefDomainList_set_count },
4596         { discard_const_p(char, "domains"), py_lsa_RefDomainList_get_domains, py_lsa_RefDomainList_set_domains },
4597         { discard_const_p(char, "max_size"), py_lsa_RefDomainList_get_max_size, py_lsa_RefDomainList_set_max_size },
4598         { NULL }
4599 };
4600
4601 static PyObject *py_lsa_RefDomainList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4602 {
4603         return pytalloc_new(struct lsa_RefDomainList, type);
4604 }
4605
4606 static PyObject *py_lsa_RefDomainList_ndr_pack(PyObject *py_obj)
4607 {
4608         struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
4609         DATA_BLOB blob;
4610         enum ndr_err_code err;
4611         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_RefDomainList);
4612         if (err != NDR_ERR_SUCCESS) {
4613                 PyErr_SetNdrError(err);
4614                 return NULL;
4615         }
4616
4617         return PyString_FromStringAndSize((char *)blob.data, blob.length);
4618 }
4619
4620 static PyObject *py_lsa_RefDomainList_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4621 {
4622         struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
4623         DATA_BLOB blob;
4624         int blob_length = 0;
4625         enum ndr_err_code err;
4626         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4627         PyObject *allow_remaining_obj = NULL;
4628         bool allow_remaining = false;
4629
4630         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
4631                 discard_const_p(char *, kwnames),
4632                 &blob.data, &blob_length,
4633                 &allow_remaining_obj)) {
4634                 return NULL;
4635         }
4636         blob.length = blob_length;
4637
4638         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4639                 allow_remaining = true;
4640         }
4641
4642         if (allow_remaining) {
4643                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_RefDomainList);
4644         } else {
4645                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_RefDomainList);
4646         }
4647         if (err != NDR_ERR_SUCCESS) {
4648                 PyErr_SetNdrError(err);
4649                 return NULL;
4650         }
4651
4652         Py_RETURN_NONE;
4653 }
4654
4655 static PyObject *py_lsa_RefDomainList_ndr_print(PyObject *py_obj)
4656 {
4657         struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
4658         PyObject *ret;
4659         char *retstr;
4660
4661         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_RefDomainList, "lsa_RefDomainList", object);
4662         ret = PyString_FromString(retstr);
4663         talloc_free(retstr);
4664
4665         return ret;
4666 }
4667
4668 static PyMethodDef py_lsa_RefDomainList_methods[] = {
4669         { "__ndr_pack__", (PyCFunction)py_lsa_RefDomainList_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4670         { "__ndr_unpack__", (PyCFunction)py_lsa_RefDomainList_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4671         { "__ndr_print__", (PyCFunction)py_lsa_RefDomainList_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
4672         { NULL, NULL, 0, NULL }
4673 };
4674
4675
4676 static PyTypeObject lsa_RefDomainList_Type = {
4677         PyObject_HEAD_INIT(NULL) 0,
4678         .tp_name = "lsa.RefDomainList",
4679         .tp_getset = py_lsa_RefDomainList_getsetters,
4680         .tp_methods = py_lsa_RefDomainList_methods,
4681         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4682         .tp_basicsize = sizeof(pytalloc_Object),
4683         .tp_new = py_lsa_RefDomainList_new,
4684 };
4685
4686
4687 static PyObject *py_lsa_TranslatedName_get_sid_type(PyObject *obj, void *closure)
4688 {
4689         struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(obj);
4690         PyObject *py_sid_type;
4691         py_sid_type = PyInt_FromLong((uint16_t)object->sid_type);
4692         return py_sid_type;
4693 }
4694
4695 static int py_lsa_TranslatedName_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
4696 {
4697         struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(py_obj);
4698         {
4699                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
4700                 if (PyLong_Check(value)) {
4701                         unsigned long long test_var;
4702                         test_var = PyLong_AsUnsignedLongLong(value);
4703                         if (PyErr_Occurred() != NULL) {
4704                                 return -1;
4705                         }
4706                         if (test_var > uint_max) {
4707                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4708                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4709                                 return -1;
4710                         }
4711                         object->sid_type = test_var;
4712                 } else if (PyInt_Check(value)) {
4713                         long test_var;
4714                         test_var = PyInt_AsLong(value);
4715                         if (test_var < 0 || test_var > uint_max) {
4716                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4717                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4718                                 return -1;
4719                         }
4720                         object->sid_type = test_var;
4721                 } else {
4722                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4723                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4724                         return -1;
4725                 }
4726         }
4727         return 0;
4728 }
4729
4730 static PyObject *py_lsa_TranslatedName_get_name(PyObject *obj, void *closure)
4731 {
4732         struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(obj);
4733         PyObject *py_name;
4734         py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
4735         return py_name;
4736 }
4737
4738 static int py_lsa_TranslatedName_set_name(PyObject *py_obj, PyObject *value, void *closure)
4739 {
4740         struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(py_obj);
4741         PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
4742         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4743                 PyErr_NoMemory();
4744                 return -1;
4745         }
4746         object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
4747         return 0;
4748 }
4749
4750 static PyObject *py_lsa_TranslatedName_get_sid_index(PyObject *obj, void *closure)
4751 {
4752         struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(obj);
4753         PyObject *py_sid_index;
4754         py_sid_index = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
4755         return py_sid_index;
4756 }
4757
4758 static int py_lsa_TranslatedName_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
4759 {
4760         struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(py_obj);
4761         {
4762                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
4763                 if (PyLong_Check(value)) {
4764                         unsigned long long test_var;
4765                         test_var = PyLong_AsUnsignedLongLong(value);
4766                         if (PyErr_Occurred() != NULL) {
4767                                 return -1;
4768                         }
4769                         if (test_var > uint_max) {
4770                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4771                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4772                                 return -1;
4773                         }
4774                         object->sid_index = test_var;
4775                 } else if (PyInt_Check(value)) {
4776                         long test_var;
4777                         test_var = PyInt_AsLong(value);
4778                         if (test_var < 0 || test_var > uint_max) {
4779                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4780                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4781                                 return -1;
4782                         }
4783                         object->sid_index = test_var;
4784                 } else {
4785                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4786                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4787                         return -1;
4788                 }
4789         }
4790         return 0;
4791 }
4792
4793 static PyGetSetDef py_lsa_TranslatedName_getsetters[] = {
4794         { discard_const_p(char, "sid_type"), py_lsa_TranslatedName_get_sid_type, py_lsa_TranslatedName_set_sid_type },
4795         { discard_const_p(char, "name"), py_lsa_TranslatedName_get_name, py_lsa_TranslatedName_set_name },
4796         { discard_const_p(char, "sid_index"), py_lsa_TranslatedName_get_sid_index, py_lsa_TranslatedName_set_sid_index },
4797         { NULL }
4798 };
4799
4800 static PyObject *py_lsa_TranslatedName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4801 {
4802         return pytalloc_new(struct lsa_TranslatedName, type);
4803 }
4804
4805
4806 static PyTypeObject lsa_TranslatedName_Type = {
4807         PyObject_HEAD_INIT(NULL) 0,
4808         .tp_name = "lsa.TranslatedName",
4809         .tp_getset = py_lsa_TranslatedName_getsetters,
4810         .tp_methods = NULL,
4811         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4812         .tp_basicsize = sizeof(pytalloc_Object),
4813         .tp_new = py_lsa_TranslatedName_new,
4814 };
4815
4816
4817 static PyObject *py_lsa_TransNameArray_get_count(PyObject *obj, void *closure)
4818 {
4819         struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(obj);
4820         PyObject *py_count;
4821         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
4822         return py_count;
4823 }
4824
4825 static int py_lsa_TransNameArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
4826 {
4827         struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
4828         {
4829                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
4830                 if (PyLong_Check(value)) {
4831                         unsigned long long test_var;
4832                         test_var = PyLong_AsUnsignedLongLong(value);
4833                         if (PyErr_Occurred() != NULL) {
4834                                 return -1;
4835                         }
4836                         if (test_var > uint_max) {
4837                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4838                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4839                                 return -1;
4840                         }
4841                         object->count = test_var;
4842                 } else if (PyInt_Check(value)) {
4843                         long test_var;
4844                         test_var = PyInt_AsLong(value);
4845                         if (test_var < 0 || test_var > uint_max) {
4846                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4847                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4848                                 return -1;
4849                         }
4850                         object->count = test_var;
4851                 } else {
4852                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4853                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4854                         return -1;
4855                 }
4856         }
4857         return 0;
4858 }
4859
4860 static PyObject *py_lsa_TransNameArray_get_names(PyObject *obj, void *closure)
4861 {
4862         struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(obj);
4863         PyObject *py_names;
4864         if (object->names == NULL) {
4865                 py_names = Py_None;
4866                 Py_INCREF(py_names);
4867         } else {
4868                 py_names = PyList_New(object->count);
4869                 if (py_names == NULL) {
4870                         return NULL;
4871                 }
4872                 {
4873                         int names_cntr_1;
4874                         for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
4875                                 PyObject *py_names_1;
4876                                 py_names_1 = pytalloc_reference_ex(&lsa_TranslatedName_Type, object->names, &object->names[names_cntr_1]);
4877                                 PyList_SetItem(py_names, names_cntr_1, py_names_1);
4878                         }
4879                 }
4880         }
4881         return py_names;
4882 }
4883
4884 static int py_lsa_TransNameArray_set_names(PyObject *py_obj, PyObject *value, void *closure)
4885 {
4886         struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
4887         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
4888         if (value == Py_None) {
4889                 object->names = NULL;
4890         } else {
4891                 object->names = NULL;
4892                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4893                 {
4894                         int names_cntr_1;
4895                         object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
4896                         if (!object->names) { return -1;; }
4897                         talloc_set_name_const(object->names, "ARRAY: object->names");
4898                         for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
4899                                 PY_CHECK_TYPE(&lsa_TranslatedName_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
4900                                 if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
4901                                         PyErr_NoMemory();
4902                                         return -1;
4903                                 }
4904                                 object->names[names_cntr_1] = *(struct lsa_TranslatedName *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
4905                         }
4906                 }
4907         }
4908         return 0;
4909 }
4910
4911 static PyGetSetDef py_lsa_TransNameArray_getsetters[] = {
4912         { discard_const_p(char, "count"), py_lsa_TransNameArray_get_count, py_lsa_TransNameArray_set_count },
4913         { discard_const_p(char, "names"), py_lsa_TransNameArray_get_names, py_lsa_TransNameArray_set_names },
4914         { NULL }
4915 };
4916
4917 static PyObject *py_lsa_TransNameArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4918 {
4919         return pytalloc_new(struct lsa_TransNameArray, type);
4920 }
4921
4922 static PyObject *py_lsa_TransNameArray_ndr_pack(PyObject *py_obj)
4923 {
4924         struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
4925         DATA_BLOB blob;
4926         enum ndr_err_code err;
4927         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_TransNameArray);
4928         if (err != NDR_ERR_SUCCESS) {
4929                 PyErr_SetNdrError(err);
4930                 return NULL;
4931         }
4932
4933         return PyString_FromStringAndSize((char *)blob.data, blob.length);
4934 }
4935
4936 static PyObject *py_lsa_TransNameArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4937 {
4938         struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
4939         DATA_BLOB blob;
4940         int blob_length = 0;
4941         enum ndr_err_code err;
4942         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4943         PyObject *allow_remaining_obj = NULL;
4944         bool allow_remaining = false;
4945
4946         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
4947                 discard_const_p(char *, kwnames),
4948                 &blob.data, &blob_length,
4949                 &allow_remaining_obj)) {
4950                 return NULL;
4951         }
4952         blob.length = blob_length;
4953
4954         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4955                 allow_remaining = true;
4956         }
4957
4958         if (allow_remaining) {
4959                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TransNameArray);
4960         } else {
4961                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TransNameArray);
4962         }
4963         if (err != NDR_ERR_SUCCESS) {
4964                 PyErr_SetNdrError(err);
4965                 return NULL;
4966         }
4967
4968         Py_RETURN_NONE;
4969 }
4970
4971 static PyObject *py_lsa_TransNameArray_ndr_print(PyObject *py_obj)
4972 {
4973         struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
4974         PyObject *ret;
4975         char *retstr;
4976
4977         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_TransNameArray, "lsa_TransNameArray", object);
4978         ret = PyString_FromString(retstr);
4979         talloc_free(retstr);
4980
4981         return ret;
4982 }
4983
4984 static PyMethodDef py_lsa_TransNameArray_methods[] = {
4985         { "__ndr_pack__", (PyCFunction)py_lsa_TransNameArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4986         { "__ndr_unpack__", (PyCFunction)py_lsa_TransNameArray_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4987         { "__ndr_print__", (PyCFunction)py_lsa_TransNameArray_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
4988         { NULL, NULL, 0, NULL }
4989 };
4990
4991
4992 static PyTypeObject lsa_TransNameArray_Type = {
4993         PyObject_HEAD_INIT(NULL) 0,
4994         .tp_name = "lsa.TransNameArray",
4995         .tp_getset = py_lsa_TransNameArray_getsetters,
4996         .tp_methods = py_lsa_TransNameArray_methods,
4997         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4998         .tp_basicsize = sizeof(pytalloc_Object),
4999         .tp_new = py_lsa_TransNameArray_new,
5000 };
5001
5002
5003 static PyObject *py_lsa_LUIDAttribute_get_luid(PyObject *obj, void *closure)
5004 {
5005         struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(obj);
5006         PyObject *py_luid;
5007         py_luid = pytalloc_reference_ex(&lsa_LUID_Type, pytalloc_get_mem_ctx(obj), &object->luid);
5008         return py_luid;
5009 }
5010
5011 static int py_lsa_LUIDAttribute_set_luid(PyObject *py_obj, PyObject *value, void *closure)
5012 {
5013         struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(py_obj);
5014         PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
5015         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5016                 PyErr_NoMemory();
5017                 return -1;
5018         }
5019         object->luid = *(struct lsa_LUID *)pytalloc_get_ptr(value);
5020         return 0;
5021 }
5022
5023 static PyObject *py_lsa_LUIDAttribute_get_attribute(PyObject *obj, void *closure)
5024 {
5025         struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(obj);
5026         PyObject *py_attribute;
5027         py_attribute = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->attribute);
5028         return py_attribute;
5029 }
5030
5031 static int py_lsa_LUIDAttribute_set_attribute(PyObject *py_obj, PyObject *value, void *closure)
5032 {
5033         struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(py_obj);
5034         {
5035                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attribute));
5036                 if (PyLong_Check(value)) {
5037                         unsigned long long test_var;
5038                         test_var = PyLong_AsUnsignedLongLong(value);
5039                         if (PyErr_Occurred() != NULL) {
5040                                 return -1;
5041                         }
5042                         if (test_var > uint_max) {
5043                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5044                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5045                                 return -1;
5046                         }
5047                         object->attribute = test_var;
5048                 } else if (PyInt_Check(value)) {
5049                         long test_var;
5050                         test_var = PyInt_AsLong(value);
5051                         if (test_var < 0 || test_var > uint_max) {
5052                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5053                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5054                                 return -1;
5055                         }
5056                         object->attribute = test_var;
5057                 } else {
5058                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5059                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5060                         return -1;
5061                 }
5062         }
5063         return 0;
5064 }
5065
5066 static PyGetSetDef py_lsa_LUIDAttribute_getsetters[] = {
5067         { discard_const_p(char, "luid"), py_lsa_LUIDAttribute_get_luid, py_lsa_LUIDAttribute_set_luid },
5068         { discard_const_p(char, "attribute"), py_lsa_LUIDAttribute_get_attribute, py_lsa_LUIDAttribute_set_attribute },
5069         { NULL }
5070 };
5071
5072 static PyObject *py_lsa_LUIDAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5073 {
5074         return pytalloc_new(struct lsa_LUIDAttribute, type);
5075 }
5076
5077
5078 static PyTypeObject lsa_LUIDAttribute_Type = {
5079         PyObject_HEAD_INIT(NULL) 0,
5080         .tp_name = "lsa.LUIDAttribute",
5081         .tp_getset = py_lsa_LUIDAttribute_getsetters,
5082         .tp_methods = NULL,
5083         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5084         .tp_basicsize = sizeof(pytalloc_Object),
5085         .tp_new = py_lsa_LUIDAttribute_new,
5086 };
5087
5088
5089 static PyObject *py_lsa_PrivilegeSet_get_count(PyObject *obj, void *closure)
5090 {
5091         struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(obj);
5092         PyObject *py_count;
5093         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
5094         return py_count;
5095 }
5096
5097 static int py_lsa_PrivilegeSet_set_count(PyObject *py_obj, PyObject *value, void *closure)
5098 {
5099         struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_obj);
5100         {
5101                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
5102                 if (PyLong_Check(value)) {
5103                         unsigned long long test_var;
5104                         test_var = PyLong_AsUnsignedLongLong(value);
5105                         if (PyErr_Occurred() != NULL) {
5106                                 return -1;
5107                         }
5108                         if (test_var > uint_max) {
5109                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5110                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5111                                 return -1;
5112                         }
5113                         object->count = test_var;
5114                 } else if (PyInt_Check(value)) {
5115                         long test_var;
5116                         test_var = PyInt_AsLong(value);
5117                         if (test_var < 0 || test_var > uint_max) {
5118                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5119                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5120                                 return -1;
5121                         }
5122                         object->count = test_var;
5123                 } else {
5124                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5125                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5126                         return -1;
5127                 }
5128         }
5129         return 0;
5130 }
5131
5132 static PyObject *py_lsa_PrivilegeSet_get_unknown(PyObject *obj, void *closure)
5133 {
5134         struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(obj);
5135         PyObject *py_unknown;
5136         py_unknown = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->unknown);
5137         return py_unknown;
5138 }
5139
5140 static int py_lsa_PrivilegeSet_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
5141 {
5142         struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_obj);
5143         {
5144                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
5145                 if (PyLong_Check(value)) {
5146                         unsigned long long test_var;
5147                         test_var = PyLong_AsUnsignedLongLong(value);
5148                         if (PyErr_Occurred() != NULL) {
5149                                 return -1;
5150                         }
5151                         if (test_var > uint_max) {
5152                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5153                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5154                                 return -1;
5155                         }
5156                         object->unknown = test_var;
5157                 } else if (PyInt_Check(value)) {
5158                         long test_var;
5159                         test_var = PyInt_AsLong(value);
5160                         if (test_var < 0 || test_var > uint_max) {
5161                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5162                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5163                                 return -1;
5164                         }
5165                         object->unknown = test_var;
5166                 } else {
5167                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5168                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5169                         return -1;
5170                 }
5171         }
5172         return 0;
5173 }
5174
5175 static PyObject *py_lsa_PrivilegeSet_get_set(PyObject *obj, void *closure)
5176 {
5177         struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(obj);
5178         PyObject *py_set;
5179         py_set = PyList_New(object->count);
5180         if (py_set == NULL) {
5181                 return NULL;
5182         }
5183         {
5184                 int set_cntr_0;
5185                 for (set_cntr_0 = 0; set_cntr_0 < (object->count); set_cntr_0++) {
5186                         PyObject *py_set_0;
5187                         py_set_0 = pytalloc_reference_ex(&lsa_LUIDAttribute_Type, object->set, &object->set[set_cntr_0]);
5188                         PyList_SetItem(py_set, set_cntr_0, py_set_0);
5189                 }
5190         }
5191         return py_set;
5192 }
5193
5194 static int py_lsa_PrivilegeSet_set_set(PyObject *py_obj, PyObject *value, void *closure)
5195 {
5196         struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_obj);
5197         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5198         {
5199                 int set_cntr_0;
5200                 object->set = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->set, PyList_GET_SIZE(value));
5201                 if (!object->set) { return -1;; }
5202                 talloc_set_name_const(object->set, "ARRAY: object->set");
5203                 for (set_cntr_0 = 0; set_cntr_0 < PyList_GET_SIZE(value); set_cntr_0++) {
5204                         PY_CHECK_TYPE(&lsa_LUIDAttribute_Type, PyList_GET_ITEM(value, set_cntr_0), return -1;);
5205                         if (talloc_reference(object->set, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, set_cntr_0))) == NULL) {
5206                                 PyErr_NoMemory();
5207                                 return -1;
5208                         }
5209                         object->set[set_cntr_0] = *(struct lsa_LUIDAttribute *)pytalloc_get_ptr(PyList_GET_ITEM(value, set_cntr_0));
5210                 }
5211         }
5212         return 0;
5213 }
5214
5215 static PyGetSetDef py_lsa_PrivilegeSet_getsetters[] = {
5216         { discard_const_p(char, "count"), py_lsa_PrivilegeSet_get_count, py_lsa_PrivilegeSet_set_count },
5217         { discard_const_p(char, "unknown"), py_lsa_PrivilegeSet_get_unknown, py_lsa_PrivilegeSet_set_unknown },
5218         { discard_const_p(char, "set"), py_lsa_PrivilegeSet_get_set, py_lsa_PrivilegeSet_set_set },
5219         { NULL }
5220 };
5221
5222 static PyObject *py_lsa_PrivilegeSet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5223 {
5224         return pytalloc_new(struct lsa_PrivilegeSet, type);
5225 }
5226
5227
5228 static PyTypeObject lsa_PrivilegeSet_Type = {
5229         PyObject_HEAD_INIT(NULL) 0,
5230         .tp_name = "lsa.PrivilegeSet",
5231         .tp_getset = py_lsa_PrivilegeSet_getsetters,
5232         .tp_methods = NULL,
5233         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5234         .tp_basicsize = sizeof(pytalloc_Object),
5235         .tp_new = py_lsa_PrivilegeSet_new,
5236 };
5237
5238
5239 static PyObject *py_lsa_DATA_BUF_get_length(PyObject *obj, void *closure)
5240 {
5241         struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(obj);
5242         PyObject *py_length;
5243         py_length = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->length);
5244         return py_length;
5245 }
5246
5247 static int py_lsa_DATA_BUF_set_length(PyObject *py_obj, PyObject *value, void *closure)
5248 {
5249         struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_obj);
5250         {
5251                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
5252                 if (PyLong_Check(value)) {
5253                         unsigned long long test_var;
5254                         test_var = PyLong_AsUnsignedLongLong(value);
5255                         if (PyErr_Occurred() != NULL) {
5256                                 return -1;
5257                         }
5258                         if (test_var > uint_max) {
5259                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5260                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5261                                 return -1;
5262                         }
5263                         object->length = test_var;
5264                 } else if (PyInt_Check(value)) {
5265                         long test_var;
5266                         test_var = PyInt_AsLong(value);
5267                         if (test_var < 0 || test_var > uint_max) {
5268                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5269                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5270                                 return -1;
5271                         }
5272                         object->length = test_var;
5273                 } else {
5274                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5275                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5276                         return -1;
5277                 }
5278         }
5279         return 0;
5280 }
5281
5282 static PyObject *py_lsa_DATA_BUF_get_size(PyObject *obj, void *closure)
5283 {
5284         struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(obj);
5285         PyObject *py_size;
5286         py_size = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->size);
5287         return py_size;
5288 }
5289
5290 static int py_lsa_DATA_BUF_set_size(PyObject *py_obj, PyObject *value, void *closure)
5291 {
5292         struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_obj);
5293         {
5294                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
5295                 if (PyLong_Check(value)) {
5296                         unsigned long long test_var;
5297                         test_var = PyLong_AsUnsignedLongLong(value);
5298                         if (PyErr_Occurred() != NULL) {
5299                                 return -1;
5300                         }
5301                         if (test_var > uint_max) {
5302                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5303                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5304                                 return -1;
5305                         }
5306                         object->size = test_var;
5307                 } else if (PyInt_Check(value)) {
5308                         long test_var;
5309                         test_var = PyInt_AsLong(value);
5310                         if (test_var < 0 || test_var > uint_max) {
5311                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5312                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5313                                 return -1;
5314                         }
5315                         object->size = test_var;
5316                 } else {
5317                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5318                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5319                         return -1;
5320                 }
5321         }
5322         return 0;
5323 }
5324
5325 static PyObject *py_lsa_DATA_BUF_get_data(PyObject *obj, void *closure)
5326 {
5327         struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(obj);
5328         PyObject *py_data;
5329         if (object->data == NULL) {
5330                 py_data = Py_None;
5331                 Py_INCREF(py_data);
5332         } else {
5333                 py_data = PyList_New(object->length);
5334                 if (py_data == NULL) {
5335                         return NULL;
5336                 }
5337                 {
5338                         int data_cntr_1;
5339                         for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
5340                                 PyObject *py_data_1;
5341                                 py_data_1 = PyInt_FromLong((uint16_t)object->data[data_cntr_1]);
5342                                 PyList_SetItem(py_data, data_cntr_1, py_data_1);
5343                         }
5344                 }
5345         }
5346         return py_data;
5347 }
5348
5349 static int py_lsa_DATA_BUF_set_data(PyObject *py_obj, PyObject *value, void *closure)
5350 {
5351         struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_obj);
5352         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
5353         if (value == Py_None) {
5354                 object->data = NULL;
5355         } else {
5356                 object->data = NULL;
5357                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5358                 {
5359                         int data_cntr_1;
5360                         object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
5361                         if (!object->data) { return -1;; }
5362                         talloc_set_name_const(object->data, "ARRAY: object->data");
5363                         for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
5364                                 {
5365                                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
5366                                         if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
5367                                                 unsigned long long test_var;
5368                                                 test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
5369                                                 if (PyErr_Occurred() != NULL) {
5370                                                         return -1;
5371                                                 }
5372                                                 if (test_var > uint_max) {
5373                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5374                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5375                                                         return -1;
5376                                                 }
5377                                                 object->data[data_cntr_1] = test_var;
5378                                         } else if (PyInt_Check(PyList_GET_ITEM(value, data_cntr_1))) {
5379                                                 long test_var;
5380                                                 test_var = PyInt_AsLong(PyList_GET_ITEM(value, data_cntr_1));
5381                                                 if (test_var < 0 || test_var > uint_max) {
5382                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5383                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5384                                                         return -1;
5385                                                 }
5386                                                 object->data[data_cntr_1] = test_var;
5387                                         } else {
5388                                                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5389                                                   PyInt_Type.tp_name, PyLong_Type.tp_name);
5390                                                 return -1;
5391                                         }
5392                                 }
5393                         }
5394                 }
5395         }
5396         return 0;
5397 }
5398
5399 static PyGetSetDef py_lsa_DATA_BUF_getsetters[] = {
5400         { discard_const_p(char, "length"), py_lsa_DATA_BUF_get_length, py_lsa_DATA_BUF_set_length },
5401         { discard_const_p(char, "size"), py_lsa_DATA_BUF_get_size, py_lsa_DATA_BUF_set_size },
5402         { discard_const_p(char, "data"), py_lsa_DATA_BUF_get_data, py_lsa_DATA_BUF_set_data },
5403         { NULL }
5404 };
5405
5406 static PyObject *py_lsa_DATA_BUF_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5407 {
5408         return pytalloc_new(struct lsa_DATA_BUF, type);
5409 }
5410
5411
5412 static PyTypeObject lsa_DATA_BUF_Type = {
5413         PyObject_HEAD_INIT(NULL) 0,
5414         .tp_name = "lsa.DATA_BUF",
5415         .tp_getset = py_lsa_DATA_BUF_getsetters,
5416         .tp_methods = NULL,
5417         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5418         .tp_basicsize = sizeof(pytalloc_Object),
5419         .tp_new = py_lsa_DATA_BUF_new,
5420 };
5421
5422
5423 static PyObject *py_lsa_DATA_BUF2_get_size(PyObject *obj, void *closure)
5424 {
5425         struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(obj);
5426         PyObject *py_size;
5427         py_size = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->size);
5428         return py_size;
5429 }
5430
5431 static int py_lsa_DATA_BUF2_set_size(PyObject *py_obj, PyObject *value, void *closure)
5432 {
5433         struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(py_obj);
5434         {
5435                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
5436                 if (PyLong_Check(value)) {
5437                         unsigned long long test_var;
5438                         test_var = PyLong_AsUnsignedLongLong(value);
5439                         if (PyErr_Occurred() != NULL) {
5440                                 return -1;
5441                         }
5442                         if (test_var > uint_max) {
5443                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5444                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5445                                 return -1;
5446                         }
5447                         object->size = test_var;
5448                 } else if (PyInt_Check(value)) {
5449                         long test_var;
5450                         test_var = PyInt_AsLong(value);
5451                         if (test_var < 0 || test_var > uint_max) {
5452                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5453                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5454                                 return -1;
5455                         }
5456                         object->size = test_var;
5457                 } else {
5458                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5459                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5460                         return -1;
5461                 }
5462         }
5463         return 0;
5464 }
5465
5466 static PyObject *py_lsa_DATA_BUF2_get_data(PyObject *obj, void *closure)
5467 {
5468         struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(obj);
5469         PyObject *py_data;
5470         if (object->data == NULL) {
5471                 py_data = Py_None;
5472                 Py_INCREF(py_data);
5473         } else {
5474                 py_data = PyList_New(object->size);
5475                 if (py_data == NULL) {
5476                         return NULL;
5477                 }
5478                 {
5479                         int data_cntr_1;
5480                         for (data_cntr_1 = 0; data_cntr_1 < (object->size); data_cntr_1++) {
5481                                 PyObject *py_data_1;
5482                                 py_data_1 = PyInt_FromLong((uint16_t)object->data[data_cntr_1]);
5483                                 PyList_SetItem(py_data, data_cntr_1, py_data_1);
5484                         }
5485                 }
5486         }
5487         return py_data;
5488 }
5489
5490 static int py_lsa_DATA_BUF2_set_data(PyObject *py_obj, PyObject *value, void *closure)
5491 {
5492         struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(py_obj);
5493         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
5494         if (value == Py_None) {
5495                 object->data = NULL;
5496         } else {
5497                 object->data = NULL;
5498                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5499                 {
5500                         int data_cntr_1;
5501                         object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
5502                         if (!object->data) { return -1;; }
5503                         talloc_set_name_const(object->data, "ARRAY: object->data");
5504                         for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
5505                                 {
5506                                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
5507                                         if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
5508                                                 unsigned long long test_var;
5509                                                 test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
5510                                                 if (PyErr_Occurred() != NULL) {
5511                                                         return -1;
5512                                                 }
5513                                                 if (test_var > uint_max) {
5514                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5515                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5516                                                         return -1;
5517                                                 }
5518                                                 object->data[data_cntr_1] = test_var;
5519                                         } else if (PyInt_Check(PyList_GET_ITEM(value, data_cntr_1))) {
5520                                                 long test_var;
5521                                                 test_var = PyInt_AsLong(PyList_GET_ITEM(value, data_cntr_1));
5522                                                 if (test_var < 0 || test_var > uint_max) {
5523                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5524                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5525                                                         return -1;
5526                                                 }
5527                                                 object->data[data_cntr_1] = test_var;
5528                                         } else {
5529                                                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5530                                                   PyInt_Type.tp_name, PyLong_Type.tp_name);
5531                                                 return -1;
5532                                         }
5533                                 }
5534                         }
5535                 }
5536         }
5537         return 0;
5538 }
5539
5540 static PyGetSetDef py_lsa_DATA_BUF2_getsetters[] = {
5541         { discard_const_p(char, "size"), py_lsa_DATA_BUF2_get_size, py_lsa_DATA_BUF2_set_size },
5542         { discard_const_p(char, "data"), py_lsa_DATA_BUF2_get_data, py_lsa_DATA_BUF2_set_data },
5543         { NULL }
5544 };
5545
5546 static PyObject *py_lsa_DATA_BUF2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5547 {
5548         return pytalloc_new(struct lsa_DATA_BUF2, type);
5549 }
5550
5551
5552 static PyTypeObject lsa_DATA_BUF2_Type = {
5553         PyObject_HEAD_INIT(NULL) 0,
5554         .tp_name = "lsa.DATA_BUF2",
5555         .tp_getset = py_lsa_DATA_BUF2_getsetters,
5556         .tp_methods = NULL,
5557         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5558         .tp_basicsize = sizeof(pytalloc_Object),
5559         .tp_new = py_lsa_DATA_BUF2_new,
5560 };
5561
5562
5563 static PyObject *py_lsa_TrustDomainInfoName_get_netbios_name(PyObject *obj, void *closure)
5564 {
5565         struct lsa_TrustDomainInfoName *object = (struct lsa_TrustDomainInfoName *)pytalloc_get_ptr(obj);
5566         PyObject *py_netbios_name;
5567         py_netbios_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->netbios_name);
5568         return py_netbios_name;
5569 }
5570
5571 static int py_lsa_TrustDomainInfoName_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
5572 {
5573         struct lsa_TrustDomainInfoName *object = (struct lsa_TrustDomainInfoName *)pytalloc_get_ptr(py_obj);
5574         PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
5575         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5576                 PyErr_NoMemory();
5577                 return -1;
5578         }
5579         object->netbios_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
5580         return 0;
5581 }
5582
5583 static PyGetSetDef py_lsa_TrustDomainInfoName_getsetters[] = {
5584         { discard_const_p(char, "netbios_name"), py_lsa_TrustDomainInfoName_get_netbios_name, py_lsa_TrustDomainInfoName_set_netbios_name },
5585         { NULL }
5586 };
5587
5588 static PyObject *py_lsa_TrustDomainInfoName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5589 {
5590         return pytalloc_new(struct lsa_TrustDomainInfoName, type);
5591 }
5592
5593
5594 static PyTypeObject lsa_TrustDomainInfoName_Type = {
5595         PyObject_HEAD_INIT(NULL) 0,
5596         .tp_name = "lsa.TrustDomainInfoName",
5597         .tp_getset = py_lsa_TrustDomainInfoName_getsetters,
5598         .tp_methods = NULL,
5599         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5600         .tp_basicsize = sizeof(pytalloc_Object),
5601         .tp_new = py_lsa_TrustDomainInfoName_new,
5602 };
5603
5604
5605 static PyObject *py_lsa_TrustDomainInfoControllers_get_entries(PyObject *obj, void *closure)
5606 {
5607         struct lsa_TrustDomainInfoControllers *object = (struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(obj);
5608         PyObject *py_entries;
5609         py_entries = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->entries);
5610         return py_entries;
5611 }
5612
5613 static int py_lsa_TrustDomainInfoControllers_set_entries(PyObject *py_obj, PyObject *value, void *closure)
5614 {
5615         struct lsa_TrustDomainInfoControllers *object = (struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(py_obj);
5616         {
5617                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->entries));
5618                 if (PyLong_Check(value)) {
5619                         unsigned long long test_var;
5620                         test_var = PyLong_AsUnsignedLongLong(value);
5621                         if (PyErr_Occurred() != NULL) {
5622                                 return -1;
5623                         }
5624                         if (test_var > uint_max) {
5625                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5626                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5627                                 return -1;
5628                         }
5629                         object->entries = test_var;
5630                 } else if (PyInt_Check(value)) {
5631                         long test_var;
5632                         test_var = PyInt_AsLong(value);
5633                         if (test_var < 0 || test_var > uint_max) {
5634                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5635                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5636                                 return -1;
5637                         }
5638                         object->entries = test_var;
5639                 } else {
5640                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5641                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5642                         return -1;
5643                 }
5644         }
5645         return 0;
5646 }
5647
5648 static PyObject *py_lsa_TrustDomainInfoControllers_get_netbios_names(PyObject *obj, void *closure)
5649 {
5650         struct lsa_TrustDomainInfoControllers *object = (struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(obj);
5651         PyObject *py_netbios_names;
5652         if (object->netbios_names == NULL) {
5653                 py_netbios_names = Py_None;
5654                 Py_INCREF(py_netbios_names);
5655         } else {
5656                 py_netbios_names = PyList_New(object->entries);
5657                 if (py_netbios_names == NULL) {
5658                         return NULL;
5659                 }
5660                 {
5661                         int netbios_names_cntr_1;
5662                         for (netbios_names_cntr_1 = 0; netbios_names_cntr_1 < (object->entries); netbios_names_cntr_1++) {
5663                                 PyObject *py_netbios_names_1;
5664                                 py_netbios_names_1 = pytalloc_reference_ex(&lsa_StringLarge_Type, object->netbios_names, &object->netbios_names[netbios_names_cntr_1]);
5665                                 PyList_SetItem(py_netbios_names, netbios_names_cntr_1, py_netbios_names_1);
5666                         }
5667                 }
5668         }
5669         return py_netbios_names;
5670 }
5671
5672 static int py_lsa_TrustDomainInfoControllers_set_netbios_names(PyObject *py_obj, PyObject *value, void *closure)
5673 {
5674         struct lsa_TrustDomainInfoControllers *object = (struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(py_obj);
5675         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->netbios_names));
5676         if (value == Py_None) {
5677                 object->netbios_names = NULL;
5678         } else {
5679                 object->netbios_names = NULL;
5680                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5681                 {
5682                         int netbios_names_cntr_1;
5683                         object->netbios_names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->netbios_names, PyList_GET_SIZE(value));
5684                         if (!object->netbios_names) { return -1;; }
5685                         talloc_set_name_const(object->netbios_names, "ARRAY: object->netbios_names");
5686                         for (netbios_names_cntr_1 = 0; netbios_names_cntr_1 < PyList_GET_SIZE(value); netbios_names_cntr_1++) {
5687                                 PY_CHECK_TYPE(&lsa_StringLarge_Type, PyList_GET_ITEM(value, netbios_names_cntr_1), return -1;);
5688                                 if (talloc_reference(object->netbios_names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, netbios_names_cntr_1))) == NULL) {
5689                                         PyErr_NoMemory();
5690                                         return -1;
5691                                 }
5692                                 object->netbios_names[netbios_names_cntr_1] = *(struct lsa_StringLarge *)pytalloc_get_ptr(PyList_GET_ITEM(value, netbios_names_cntr_1));
5693                         }
5694                 }
5695         }
5696         return 0;
5697 }
5698
5699 static PyGetSetDef py_lsa_TrustDomainInfoControllers_getsetters[] = {
5700         { discard_const_p(char, "entries"), py_lsa_TrustDomainInfoControllers_get_entries, py_lsa_TrustDomainInfoControllers_set_entries },
5701         { discard_const_p(char, "netbios_names"), py_lsa_TrustDomainInfoControllers_get_netbios_names, py_lsa_TrustDomainInfoControllers_set_netbios_names },
5702         { NULL }
5703 };
5704
5705 static PyObject *py_lsa_TrustDomainInfoControllers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5706 {
5707         return pytalloc_new(struct lsa_TrustDomainInfoControllers, type);
5708 }
5709
5710
5711 static PyTypeObject lsa_TrustDomainInfoControllers_Type = {
5712         PyObject_HEAD_INIT(NULL) 0,
5713         .tp_name = "lsa.TrustDomainInfoControllers",
5714         .tp_getset = py_lsa_TrustDomainInfoControllers_getsetters,
5715         .tp_methods = NULL,
5716         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5717         .tp_basicsize = sizeof(pytalloc_Object),
5718         .tp_new = py_lsa_TrustDomainInfoControllers_new,
5719 };
5720
5721
5722 static PyObject *py_lsa_TrustDomainInfoPosixOffset_get_posix_offset(PyObject *obj, void *closure)
5723 {
5724         struct lsa_TrustDomainInfoPosixOffset *object = (struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(obj);
5725         PyObject *py_posix_offset;
5726         py_posix_offset = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->posix_offset);
5727         return py_posix_offset;
5728 }
5729
5730 static int py_lsa_TrustDomainInfoPosixOffset_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
5731 {
5732         struct lsa_TrustDomainInfoPosixOffset *object = (struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(py_obj);
5733         {
5734                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->posix_offset));
5735                 if (PyLong_Check(value)) {
5736                         unsigned long long test_var;
5737                         test_var = PyLong_AsUnsignedLongLong(value);
5738                         if (PyErr_Occurred() != NULL) {
5739                                 return -1;
5740                         }
5741                         if (test_var > uint_max) {
5742                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5743                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5744                                 return -1;
5745                         }
5746                         object->posix_offset = test_var;
5747                 } else if (PyInt_Check(value)) {
5748                         long test_var;
5749                         test_var = PyInt_AsLong(value);
5750                         if (test_var < 0 || test_var > uint_max) {
5751                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5752                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5753                                 return -1;
5754                         }
5755                         object->posix_offset = test_var;
5756                 } else {
5757                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5758                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5759                         return -1;
5760                 }
5761         }
5762         return 0;
5763 }
5764
5765 static PyGetSetDef py_lsa_TrustDomainInfoPosixOffset_getsetters[] = {
5766         { discard_const_p(char, "posix_offset"), py_lsa_TrustDomainInfoPosixOffset_get_posix_offset, py_lsa_TrustDomainInfoPosixOffset_set_posix_offset },
5767         { NULL }
5768 };
5769
5770 static PyObject *py_lsa_TrustDomainInfoPosixOffset_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5771 {
5772         return pytalloc_new(struct lsa_TrustDomainInfoPosixOffset, type);
5773 }
5774
5775
5776 static PyTypeObject lsa_TrustDomainInfoPosixOffset_Type = {
5777         PyObject_HEAD_INIT(NULL) 0,
5778         .tp_name = "lsa.TrustDomainInfoPosixOffset",
5779         .tp_getset = py_lsa_TrustDomainInfoPosixOffset_getsetters,
5780         .tp_methods = NULL,
5781         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5782         .tp_basicsize = sizeof(pytalloc_Object),
5783         .tp_new = py_lsa_TrustDomainInfoPosixOffset_new,
5784 };
5785
5786
5787 static PyObject *py_lsa_TrustDomainInfoPassword_get_password(PyObject *obj, void *closure)
5788 {
5789         struct lsa_TrustDomainInfoPassword *object = (struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(obj);
5790         PyObject *py_password;
5791         if (object->password == NULL) {
5792                 py_password = Py_None;
5793                 Py_INCREF(py_password);
5794         } else {
5795                 py_password = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->password, object->password);
5796         }
5797         return py_password;
5798 }
5799
5800 static int py_lsa_TrustDomainInfoPassword_set_password(PyObject *py_obj, PyObject *value, void *closure)
5801 {
5802         struct lsa_TrustDomainInfoPassword *object = (struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(py_obj);
5803         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->password));
5804         if (value == Py_None) {
5805                 object->password = NULL;
5806         } else {
5807                 object->password = NULL;
5808                 PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
5809                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5810                         PyErr_NoMemory();
5811                         return -1;
5812                 }
5813                 object->password = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
5814         }
5815         return 0;
5816 }
5817
5818 static PyObject *py_lsa_TrustDomainInfoPassword_get_old_password(PyObject *obj, void *closure)
5819 {
5820         struct lsa_TrustDomainInfoPassword *object = (struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(obj);
5821         PyObject *py_old_password;
5822         if (object->old_password == NULL) {
5823                 py_old_password = Py_None;
5824                 Py_INCREF(py_old_password);
5825         } else {
5826                 py_old_password = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->old_password, object->old_password);
5827         }
5828         return py_old_password;
5829 }
5830
5831 static int py_lsa_TrustDomainInfoPassword_set_old_password(PyObject *py_obj, PyObject *value, void *closure)
5832 {
5833         struct lsa_TrustDomainInfoPassword *object = (struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(py_obj);
5834         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->old_password));
5835         if (value == Py_None) {
5836                 object->old_password = NULL;
5837         } else {
5838                 object->old_password = NULL;
5839                 PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
5840                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5841                         PyErr_NoMemory();
5842                         return -1;
5843                 }
5844                 object->old_password = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
5845         }
5846         return 0;
5847 }
5848
5849 static PyGetSetDef py_lsa_TrustDomainInfoPassword_getsetters[] = {
5850         { discard_const_p(char, "password"), py_lsa_TrustDomainInfoPassword_get_password, py_lsa_TrustDomainInfoPassword_set_password },
5851         { discard_const_p(char, "old_password"), py_lsa_TrustDomainInfoPassword_get_old_password, py_lsa_TrustDomainInfoPassword_set_old_password },
5852         { NULL }
5853 };
5854
5855 static PyObject *py_lsa_TrustDomainInfoPassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5856 {
5857         return pytalloc_new(struct lsa_TrustDomainInfoPassword, type);
5858 }
5859
5860
5861 static PyTypeObject lsa_TrustDomainInfoPassword_Type = {
5862         PyObject_HEAD_INIT(NULL) 0,
5863         .tp_name = "lsa.TrustDomainInfoPassword",
5864         .tp_getset = py_lsa_TrustDomainInfoPassword_getsetters,
5865         .tp_methods = NULL,
5866         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5867         .tp_basicsize = sizeof(pytalloc_Object),
5868         .tp_new = py_lsa_TrustDomainInfoPassword_new,
5869 };
5870
5871
5872 static PyObject *py_lsa_TrustDomainInfoBasic_get_netbios_name(PyObject *obj, void *closure)
5873 {
5874         struct lsa_TrustDomainInfoBasic *object = (struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(obj);
5875         PyObject *py_netbios_name;
5876         py_netbios_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->netbios_name);
5877         return py_netbios_name;
5878 }
5879
5880 static int py_lsa_TrustDomainInfoBasic_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
5881 {
5882         struct lsa_TrustDomainInfoBasic *object = (struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(py_obj);
5883         PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
5884         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5885                 PyErr_NoMemory();
5886                 return -1;
5887         }
5888         object->netbios_name = *(struct lsa_String *)pytalloc_get_ptr(value);
5889         return 0;
5890 }
5891
5892 static PyObject *py_lsa_TrustDomainInfoBasic_get_sid(PyObject *obj, void *closure)
5893 {
5894         struct lsa_TrustDomainInfoBasic *object = (struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(obj);
5895         PyObject *py_sid;
5896         if (object->sid == NULL) {
5897                 py_sid = Py_None;
5898                 Py_INCREF(py_sid);
5899         } else {
5900                 py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
5901         }
5902         return py_sid;
5903 }
5904
5905 static int py_lsa_TrustDomainInfoBasic_set_sid(PyObject *py_obj, PyObject *value, void *closure)
5906 {
5907         struct lsa_TrustDomainInfoBasic *object = (struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(py_obj);
5908         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
5909         if (value == Py_None) {
5910                 object->sid = NULL;
5911         } else {
5912                 object->sid = NULL;
5913                 PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
5914                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5915                         PyErr_NoMemory();
5916                         return -1;
5917                 }
5918                 object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
5919         }
5920         return 0;
5921 }
5922
5923 static PyGetSetDef py_lsa_TrustDomainInfoBasic_getsetters[] = {
5924         { discard_const_p(char, "netbios_name"), py_lsa_TrustDomainInfoBasic_get_netbios_name, py_lsa_TrustDomainInfoBasic_set_netbios_name },
5925         { discard_const_p(char, "sid"), py_lsa_TrustDomainInfoBasic_get_sid, py_lsa_TrustDomainInfoBasic_set_sid },
5926         { NULL }
5927 };
5928
5929 static PyObject *py_lsa_TrustDomainInfoBasic_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5930 {
5931         return pytalloc_new(struct lsa_TrustDomainInfoBasic, type);
5932 }
5933
5934
5935 static PyTypeObject lsa_TrustDomainInfoBasic_Type = {
5936         PyObject_HEAD_INIT(NULL) 0,
5937         .tp_name = "lsa.TrustDomainInfoBasic",
5938         .tp_getset = py_lsa_TrustDomainInfoBasic_getsetters,
5939         .tp_methods = NULL,
5940         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5941         .tp_basicsize = sizeof(pytalloc_Object),
5942         .tp_new = py_lsa_TrustDomainInfoBasic_new,
5943 };
5944
5945
5946 static PyObject *py_lsa_TrustDomainInfoInfoEx_get_domain_name(PyObject *obj, void *closure)
5947 {
5948         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
5949         PyObject *py_domain_name;
5950         py_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->domain_name);
5951         return py_domain_name;
5952 }
5953
5954 static int py_lsa_TrustDomainInfoInfoEx_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
5955 {
5956         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
5957         PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
5958         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5959                 PyErr_NoMemory();
5960                 return -1;
5961         }
5962         object->domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
5963         return 0;
5964 }
5965
5966 static PyObject *py_lsa_TrustDomainInfoInfoEx_get_netbios_name(PyObject *obj, void *closure)
5967 {
5968         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
5969         PyObject *py_netbios_name;
5970         py_netbios_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->netbios_name);
5971         return py_netbios_name;
5972 }
5973
5974 static int py_lsa_TrustDomainInfoInfoEx_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
5975 {
5976         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
5977         PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
5978         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5979                 PyErr_NoMemory();
5980                 return -1;
5981         }
5982         object->netbios_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
5983         return 0;
5984 }
5985
5986 static PyObject *py_lsa_TrustDomainInfoInfoEx_get_sid(PyObject *obj, void *closure)
5987 {
5988         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
5989         PyObject *py_sid;
5990         if (object->sid == NULL) {
5991                 py_sid = Py_None;
5992                 Py_INCREF(py_sid);
5993         } else {
5994                 py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
5995         }
5996         return py_sid;
5997 }
5998
5999 static int py_lsa_TrustDomainInfoInfoEx_set_sid(PyObject *py_obj, PyObject *value, void *closure)
6000 {
6001         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6002         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
6003         if (value == Py_None) {
6004                 object->sid = NULL;
6005         } else {
6006                 object->sid = NULL;
6007                 PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
6008                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6009                         PyErr_NoMemory();
6010                         return -1;
6011                 }
6012                 object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
6013         }
6014         return 0;
6015 }
6016
6017 static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_direction(PyObject *obj, void *closure)
6018 {
6019         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6020         PyObject *py_trust_direction;
6021         py_trust_direction = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->trust_direction);
6022         return py_trust_direction;
6023 }
6024
6025 static int py_lsa_TrustDomainInfoInfoEx_set_trust_direction(PyObject *py_obj, PyObject *value, void *closure)
6026 {
6027         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6028         {
6029                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_direction));
6030                 if (PyLong_Check(value)) {
6031                         unsigned long long test_var;
6032                         test_var = PyLong_AsUnsignedLongLong(value);
6033                         if (PyErr_Occurred() != NULL) {
6034                                 return -1;
6035                         }
6036                         if (test_var > uint_max) {
6037                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
6038                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6039                                 return -1;
6040                         }
6041                         object->trust_direction = test_var;
6042                 } else if (PyInt_Check(value)) {
6043                         long test_var;
6044                         test_var = PyInt_AsLong(value);
6045                         if (test_var < 0 || test_var > uint_max) {
6046                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
6047                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6048                                 return -1;
6049                         }
6050                         object->trust_direction = test_var;
6051                 } else {
6052                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6053                           PyInt_Type.tp_name, PyLong_Type.tp_name);
6054                         return -1;
6055                 }
6056         }
6057         return 0;
6058 }
6059
6060 static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_type(PyObject *obj, void *closure)
6061 {
6062         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6063         PyObject *py_trust_type;
6064         py_trust_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->trust_type);
6065         return py_trust_type;
6066 }
6067
6068 static int py_lsa_TrustDomainInfoInfoEx_set_trust_type(PyObject *py_obj, PyObject *value, void *closure)
6069 {
6070         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6071         {
6072                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_type));
6073                 if (PyLong_Check(value)) {
6074                         unsigned long long test_var;
6075                         test_var = PyLong_AsUnsignedLongLong(value);
6076                         if (PyErr_Occurred() != NULL) {
6077                                 return -1;
6078                         }
6079                         if (test_var > uint_max) {
6080                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
6081                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6082                                 return -1;
6083                         }
6084                         object->trust_type = test_var;
6085                 } else if (PyInt_Check(value)) {
6086                         long test_var;
6087                         test_var = PyInt_AsLong(value);
6088                         if (test_var < 0 || test_var > uint_max) {
6089                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
6090                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6091                                 return -1;
6092                         }
6093                         object->trust_type = test_var;
6094                 } else {
6095                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6096                           PyInt_Type.tp_name, PyLong_Type.tp_name);
6097                         return -1;
6098                 }
6099         }
6100         return 0;
6101 }
6102
6103 static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_attributes(PyObject *obj, void *closure)
6104 {
6105         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6106         PyObject *py_trust_attributes;
6107         py_trust_attributes = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->trust_attributes);
6108         return py_trust_attributes;
6109 }
6110
6111 static int py_lsa_TrustDomainInfoInfoEx_set_trust_attributes(PyObject *py_obj, PyObject *value, void *closure)
6112 {
6113         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6114         {
6115                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_attributes));
6116                 if (PyLong_Check(value)) {
6117                         unsigned long long test_var;
6118                         test_var = PyLong_AsUnsignedLongLong(value);
6119                         if (PyErr_Occurred() != NULL) {
6120                                 return -1;
6121                         }
6122                         if (test_var > uint_max) {
6123                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
6124                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6125                                 return -1;
6126                         }
6127                         object->trust_attributes = test_var;
6128                 } else if (PyInt_Check(value)) {
6129                         long test_var;
6130                         test_var = PyInt_AsLong(value);
6131                         if (test_var < 0 || test_var > uint_max) {
6132                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
6133                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6134                                 return -1;
6135                         }
6136                         object->trust_attributes = test_var;
6137                 } else {
6138                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6139                           PyInt_Type.tp_name, PyLong_Type.tp_name);
6140                         return -1;
6141                 }
6142         }
6143         return 0;
6144 }
6145
6146 static PyGetSetDef py_lsa_TrustDomainInfoInfoEx_getsetters[] = {
6147         { discard_const_p(char, "domain_name"), py_lsa_TrustDomainInfoInfoEx_get_domain_name, py_lsa_TrustDomainInfoInfoEx_set_domain_name },
6148         { discard_const_p(char, "netbios_name"), py_lsa_TrustDomainInfoInfoEx_get_netbios_name, py_lsa_TrustDomainInfoInfoEx_set_netbios_name },
6149         { discard_const_p(char, "sid"), py_lsa_TrustDomainInfoInfoEx_get_sid, py_lsa_TrustDomainInfoInfoEx_set_sid },
6150         { discard_const_p(char, "trust_direction"), py_lsa_TrustDomainInfoInfoEx_get_trust_direction, py_lsa_TrustDomainInfoInfoEx_set_trust_direction },
6151         { discard_const_p(char, "trust_type"), py_lsa_TrustDomainInfoInfoEx_get_trust_type, py_lsa_TrustDomainInfoInfoEx_set_trust_type },
6152         { discard_const_p(char, "trust_attributes"), py_lsa_TrustDomainInfoInfoEx_get_trust_attributes, py_lsa_TrustDomainInfoInfoEx_set_trust_attributes },
6153         { NULL }
6154 };
6155
6156 static PyObject *py_lsa_TrustDomainInfoInfoEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6157 {
6158         return pytalloc_new(struct lsa_TrustDomainInfoInfoEx, type);
6159 }
6160
6161 static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_pack(PyObject *py_obj)
6162 {
6163         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6164         DATA_BLOB blob;
6165         enum ndr_err_code err;
6166         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_TrustDomainInfoInfoEx);
6167         if (err != NDR_ERR_SUCCESS) {
6168                 PyErr_SetNdrError(err);
6169                 return NULL;
6170         }
6171
6172         return PyString_FromStringAndSize((char *)blob.data, blob.length);
6173 }
6174
6175 static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6176 {
6177         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6178         DATA_BLOB blob;
6179         int blob_length = 0;
6180         enum ndr_err_code err;
6181         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6182         PyObject *allow_remaining_obj = NULL;
6183         bool allow_remaining = false;
6184
6185         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
6186                 discard_const_p(char *, kwnames),
6187                 &blob.data, &blob_length,
6188                 &allow_remaining_obj)) {
6189                 return NULL;
6190         }
6191         blob.length = blob_length;
6192
6193         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6194                 allow_remaining = true;
6195         }
6196
6197         if (allow_remaining) {
6198                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoInfoEx);
6199         } else {
6200                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoInfoEx);
6201         }
6202         if (err != NDR_ERR_SUCCESS) {
6203                 PyErr_SetNdrError(err);
6204                 return NULL;
6205         }
6206
6207         Py_RETURN_NONE;
6208 }
6209
6210 static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_print(PyObject *py_obj)
6211 {
6212         struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6213         PyObject *ret;
6214         char *retstr;
6215
6216         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_TrustDomainInfoInfoEx, "lsa_TrustDomainInfoInfoEx", object);
6217         ret = PyString_FromString(retstr);
6218         talloc_free(retstr);
6219
6220         return ret;
6221 }
6222
6223 static PyMethodDef py_lsa_TrustDomainInfoInfoEx_methods[] = {
6224         { "__ndr_pack__", (PyCFunction)py_lsa_TrustDomainInfoInfoEx_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6225         { "__ndr_unpack__", (PyCFunction)py_lsa_TrustDomainInfoInfoEx_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6226         { "__ndr_print__", (PyCFunction)py_lsa_TrustDomainInfoInfoEx_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
6227         { NULL, NULL, 0, NULL }
6228 };
6229
6230
6231 static PyTypeObject lsa_TrustDomainInfoInfoEx_Type = {
6232         PyObject_HEAD_INIT(NULL) 0,
6233         .tp_name = "lsa.TrustDomainInfoInfoEx",
6234         .tp_getset = py_lsa_TrustDomainInfoInfoEx_getsetters,
6235         .tp_methods = py_lsa_TrustDomainInfoInfoEx_methods,
6236         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6237         .tp_basicsize = sizeof(pytalloc_Object),
6238         .tp_new = py_lsa_TrustDomainInfoInfoEx_new,
6239 };
6240
6241
6242 static PyObject *py_lsa_TrustDomainInfoBuffer_get_last_update_time(PyObject *obj, void *closure)
6243 {
6244         struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(obj);
6245         PyObject *py_last_update_time;
6246         py_last_update_time = ndr_PyLong_FromUnsignedLongLong(object->last_update_time);
6247         return py_last_update_time;
6248 }
6249
6250 static int py_lsa_TrustDomainInfoBuffer_set_last_update_time(PyObject *py_obj, PyObject *value, void *closure)
6251 {
6252         struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(py_obj);
6253         {
6254                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_update_time));
6255                 if (PyLong_Check(value)) {
6256                         unsigned long long test_var;
6257                         test_var = PyLong_AsUnsignedLongLong(value);
6258                         if (PyErr_Occurred() != NULL) {
6259                                 return -1;
6260                         }
6261                         if (test_var > uint_max) {
6262                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
6263                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6264                                 return -1;
6265                         }
6266                         object->last_update_time = test_var;
6267                 } else if (PyInt_Check(value)) {
6268                         long test_var;
6269                         test_var = PyInt_AsLong(value);
6270                         if (test_var < 0 || test_var > uint_max) {
6271                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
6272                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6273                                 return -1;
6274                         }
6275                         object->last_update_time = test_var;
6276                 } else {
6277                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6278                           PyInt_Type.tp_name, PyLong_Type.tp_name);
6279                         return -1;
6280                 }
6281         }
6282         return 0;
6283 }
6284
6285 static PyObject *py_lsa_TrustDomainInfoBuffer_get_AuthType(PyObject *obj, void *closure)
6286 {
6287         struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(obj);
6288         PyObject *py_AuthType;
6289         py_AuthType = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->AuthType);
6290         return py_AuthType;
6291 }
6292
6293 static int py_lsa_TrustDomainInfoBuffer_set_AuthType(PyObject *py_obj, PyObject *value, void *closure)
6294 {
6295         struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(py_obj);
6296         {
6297                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->AuthType));
6298                 if (PyLong_Check(value)) {
6299                         unsigned long long test_var;
6300                         test_var = PyLong_AsUnsignedLongLong(value);
6301                         if (PyErr_Occurred() != NULL) {
6302                                 return -1;
6303                         }
6304                         if (test_var > uint_max) {
6305                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
6306                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6307                                 return -1;
6308                         }
6309                         object->AuthType = test_var;
6310                 } else if (PyInt_Check(value)) {
6311                         long test_var;
6312                         test_var = PyInt_AsLong(value);
6313                         if (test_var < 0 || test_var > uint_max) {
6314                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
6315                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6316                                 return -1;
6317                         }
6318                         object->AuthType = test_var;
6319                 } else {
6320                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6321                           PyInt_Type.tp_name, PyLong_Type.tp_name);
6322                         return -1;
6323                 }
6324         }
6325         return 0;
6326 }
6327
6328 static PyObject *py_lsa_TrustDomainInfoBuffer_get_data(PyObject *obj, void *closure)
6329 {
6330         struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(obj);
6331         PyObject *py_data;
6332         py_data = pytalloc_reference_ex(&lsa_DATA_BUF2_Type, pytalloc_get_mem_ctx(obj), &object->data);
6333         return py_data;
6334 }
6335
6336 static int py_lsa_TrustDomainInfoBuffer_set_data(PyObject *py_obj, PyObject *value, void *closure)
6337 {
6338         struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(py_obj);
6339         PY_CHECK_TYPE(&lsa_DATA_BUF2_Type, value, return -1;);
6340         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6341                 PyErr_NoMemory();
6342                 return -1;
6343         }
6344         object->data = *(struct lsa_DATA_BUF2 *)pytalloc_get_ptr(value);
6345         return 0;
6346 }
6347
6348 static PyGetSetDef py_lsa_TrustDomainInfoBuffer_getsetters[] = {
6349         { discard_const_p(char, "last_update_time"), py_lsa_TrustDomainInfoBuffer_get_last_update_time, py_lsa_TrustDomainInfoBuffer_set_last_update_time },
6350         { discard_const_p(char, "AuthType"), py_lsa_TrustDomainInfoBuffer_get_AuthType, py_lsa_TrustDomainInfoBuffer_set_AuthType },
6351         { discard_const_p(char, "data"), py_lsa_TrustDomainInfoBuffer_get_data, py_lsa_TrustDomainInfoBuffer_set_data },
6352         { NULL }
6353 };
6354
6355 static PyObject *py_lsa_TrustDomainInfoBuffer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6356 {
6357         return pytalloc_new(struct lsa_TrustDomainInfoBuffer, type);
6358 }
6359
6360
6361 static PyTypeObject lsa_TrustDomainInfoBuffer_Type = {
6362         PyObject_HEAD_INIT(NULL) 0,
6363         .tp_name = "lsa.TrustDomainInfoBuffer",
6364         .tp_getset = py_lsa_TrustDomainInfoBuffer_getsetters,
6365         .tp_methods = NULL,
6366         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6367         .tp_basicsize = sizeof(pytalloc_Object),
6368         .tp_new = py_lsa_TrustDomainInfoBuffer_new,
6369 };
6370
6371
6372 static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_count(PyObject *obj, void *closure)
6373 {
6374         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
6375         PyObject *py_incoming_count;
6376         py_incoming_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->incoming_count);
6377         return py_incoming_count;
6378 }
6379
6380 static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_count(PyObject *py_obj, PyObject *value, void *closure)
6381 {
6382         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
6383         {
6384                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->incoming_count));
6385                 if (PyLong_Check(value)) {
6386                         unsigned long long test_var;
6387                         test_var = PyLong_AsUnsignedLongLong(value);
6388                         if (PyErr_Occurred() != NULL) {
6389                                 return -1;
6390                         }
6391                         if (test_var > uint_max) {
6392                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
6393                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6394                                 return -1;
6395                         }
6396                         object->incoming_count = test_var;
6397                 } else if (PyInt_Check(value)) {
6398                         long test_var;
6399                         test_var = PyInt_AsLong(value);
6400                         if (test_var < 0 || test_var > uint_max) {
6401                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
6402                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6403                                 return -1;
6404                         }
6405                         object->incoming_count = test_var;
6406                 } else {
6407                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6408                           PyInt_Type.tp_name, PyLong_Type.tp_name);
6409                         return -1;
6410                 }
6411         }
6412         return 0;
6413 }
6414
6415 static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_current_auth_info(PyObject *obj, void *closure)
6416 {
6417         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
6418         PyObject *py_incoming_current_auth_info;
6419         if (object->incoming_current_auth_info == NULL) {
6420                 py_incoming_current_auth_info = Py_None;
6421                 Py_INCREF(py_incoming_current_auth_info);
6422         } else {
6423                 py_incoming_current_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->incoming_current_auth_info, object->incoming_current_auth_info);
6424         }
6425         return py_incoming_current_auth_info;
6426 }
6427
6428 static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_current_auth_info(PyObject *py_obj, PyObject *value, void *closure)
6429 {
6430         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
6431         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->incoming_current_auth_info));
6432         if (value == Py_None) {
6433                 object->incoming_current_auth_info = NULL;
6434         } else {
6435                 object->incoming_current_auth_info = NULL;
6436                 PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
6437                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6438                         PyErr_NoMemory();
6439                         return -1;
6440                 }
6441                 object->incoming_current_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
6442         }
6443         return 0;
6444 }
6445
6446 static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_previous_auth_info(PyObject *obj, void *closure)
6447 {
6448         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
6449         PyObject *py_incoming_previous_auth_info;
6450         if (object->incoming_previous_auth_info == NULL) {
6451                 py_incoming_previous_auth_info = Py_None;
6452                 Py_INCREF(py_incoming_previous_auth_info);
6453         } else {
6454                 py_incoming_previous_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->incoming_previous_auth_info, object->incoming_previous_auth_info);
6455         }
6456         return py_incoming_previous_auth_info;
6457 }
6458
6459 static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_previous_auth_info(PyObject *py_obj, PyObject *value, void *closure)
6460 {
6461         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
6462         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->incoming_previous_auth_info));
6463         if (value == Py_None) {
6464                 object->incoming_previous_auth_info = NULL;
6465         } else {
6466                 object->incoming_previous_auth_info = NULL;
6467                 PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
6468                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6469                         PyErr_NoMemory();
6470                         return -1;
6471                 }
6472                 object->incoming_previous_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
6473         }
6474         return 0;
6475 }
6476
6477 static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_count(PyObject *obj, void *closure)
6478 {
6479         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
6480         PyObject *py_outgoing_count;
6481         py_outgoing_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->outgoing_count);
6482         return py_outgoing_count;
6483 }
6484
6485 static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_count(PyObject *py_obj, PyObject *value, void *closure)
6486 {
6487         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
6488         {
6489                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->outgoing_count));
6490                 if (PyLong_Check(value)) {
6491                         unsigned long long test_var;
6492                         test_var = PyLong_AsUnsignedLongLong(value);
6493                         if (PyErr_Occurred() != NULL) {
6494                                 return -1;
6495                         }
6496                         if (test_var > uint_max) {
6497                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
6498                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6499                                 return -1;
6500                         }
6501                         object->outgoing_count = test_var;
6502                 } else if (PyInt_Check(value)) {
6503                         long test_var;
6504                         test_var = PyInt_AsLong(value);
6505                         if (test_var < 0 || test_var > uint_max) {
6506                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
6507                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6508                                 return -1;
6509                         }
6510                         object->outgoing_count = test_var;
6511                 } else {
6512                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6513                           PyInt_Type.tp_name, PyLong_Type.tp_name);
6514                         return -1;
6515                 }
6516         }
6517         return 0;
6518 }
6519
6520 static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_current_auth_info(PyObject *obj, void *closure)
6521 {
6522         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
6523         PyObject *py_outgoing_current_auth_info;
6524         if (object->outgoing_current_auth_info == NULL) {
6525                 py_outgoing_current_auth_info = Py_None;
6526                 Py_INCREF(py_outgoing_current_auth_info);
6527         } else {
6528                 py_outgoing_current_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->outgoing_current_auth_info, object->outgoing_current_auth_info);
6529         }
6530         return py_outgoing_current_auth_info;
6531 }
6532
6533 static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_current_auth_info(PyObject *py_obj, PyObject *value, void *closure)
6534 {
6535         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
6536         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->outgoing_current_auth_info));
6537         if (value == Py_None) {
6538                 object->outgoing_current_auth_info = NULL;
6539         } else {
6540                 object->outgoing_current_auth_info = NULL;
6541                 PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
6542                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6543                         PyErr_NoMemory();
6544                         return -1;
6545                 }
6546                 object->outgoing_current_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
6547         }
6548         return 0;
6549 }
6550
6551 static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_previous_auth_info(PyObject *obj, void *closure)
6552 {
6553         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
6554         PyObject *py_outgoing_previous_auth_info;
6555         if (object->outgoing_previous_auth_info == NULL) {
6556                 py_outgoing_previous_auth_info = Py_None;
6557                 Py_INCREF(py_outgoing_previous_auth_info);
6558         } else {
6559                 py_outgoing_previous_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->outgoing_previous_auth_info, object->outgoing_previous_auth_info);
6560         }
6561         return py_outgoing_previous_auth_info;
6562 }
6563
6564 static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_previous_auth_info(PyObject *py_obj, PyObject *value, void *closure)
6565 {
6566         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
6567         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->outgoing_previous_auth_info));
6568         if (value == Py_None) {
6569                 object->outgoing_previous_auth_info = NULL;
6570         } else {
6571                 object->outgoing_previous_auth_info = NULL;
6572                 PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
6573                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6574                         PyErr_NoMemory();
6575                         return -1;
6576                 }
6577                 object->outgoing_previous_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
6578         }
6579         return 0;
6580 }
6581
6582 static PyGetSetDef py_lsa_TrustDomainInfoAuthInfo_getsetters[] = {
6583         { discard_const_p(char, "incoming_count"), py_lsa_TrustDomainInfoAuthInfo_get_incoming_count, py_lsa_TrustDomainInfoAuthInfo_set_incoming_count },
6584         { discard_const_p(char, "incoming_current_auth_info"), py_lsa_TrustDomainInfoAuthInfo_get_incoming_current_auth_info, py_lsa_TrustDomainInfoAuthInfo_set_incoming_current_auth_info },
6585         { discard_const_p(char, "incoming_previous_auth_info"), py_lsa_TrustDomainInfoAuthInfo_get_incoming_previous_auth_info, py_lsa_TrustDomainInfoAuthInfo_set_incoming_previous_auth_info },
6586         { discard_const_p(char, "outgoing_count"), py_lsa_TrustDomainInfoAuthInfo_get_outgoing_count, py_lsa_TrustDomainInfoAuthInfo_set_outgoing_count },
6587         { discard_const_p(char, "outgoing_current_auth_info"), py_lsa_TrustDomainInfoAuthInfo_get_outgoing_current_auth_info, py_lsa_TrustDomainInfoAuthInfo_set_outgoing_current_auth_info },
6588         { discard_const_p(char, "outgoing_previous_auth_info"), py_lsa_TrustDomainInfoAuthInfo_get_outgoing_previous_auth_info, py_lsa_TrustDomainInfoAuthInfo_set_outgoing_previous_auth_info },
6589         { NULL }
6590 };
6591
6592 static PyObject *py_lsa_TrustDomainInfoAuthInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6593 {
6594         return pytalloc_new(struct lsa_TrustDomainInfoAuthInfo, type);
6595 }
6596
6597 static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_pack(PyObject *py_obj)
6598 {
6599         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
6600         DATA_BLOB blob;
6601         enum ndr_err_code err;
6602         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_TrustDomainInfoAuthInfo);
6603         if (err != NDR_ERR_SUCCESS) {
6604                 PyErr_SetNdrError(err);
6605                 return NULL;
6606         }
6607
6608         return PyString_FromStringAndSize((char *)blob.data, blob.length);
6609 }
6610
6611 static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6612 {
6613         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
6614         DATA_BLOB blob;
6615         int blob_length = 0;
6616         enum ndr_err_code err;
6617         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6618         PyObject *allow_remaining_obj = NULL;
6619         bool allow_remaining = false;
6620
6621         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
6622                 discard_const_p(char *, kwnames),
6623                 &blob.data, &blob_length,
6624                 &allow_remaining_obj)) {
6625                 return NULL;
6626         }
6627         blob.length = blob_length;
6628
6629         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6630                 allow_remaining = true;
6631         }
6632
6633         if (allow_remaining) {
6634                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoAuthInfo);
6635         } else {
6636                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoAuthInfo);
6637         }
6638         if (err != NDR_ERR_SUCCESS) {
6639                 PyErr_SetNdrError(err);
6640                 return NULL;
6641         }
6642
6643         Py_RETURN_NONE;
6644 }
6645
6646 static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_print(PyObject *py_obj)
6647 {
6648         struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
6649         PyObject *ret;
6650         char *retstr;
6651
6652         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_TrustDomainInfoAuthInfo, "lsa_TrustDomainInfoAuthInfo", object);
6653         ret = PyString_FromString(retstr);
6654         talloc_free(retstr);
6655
6656         return ret;
6657 }
6658
6659 static PyMethodDef py_lsa_TrustDomainInfoAuthInfo_methods[] = {
6660         { "__ndr_pack__", (PyCFunction)py_lsa_TrustDomainInfoAuthInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6661         { "__ndr_unpack__", (PyCFunction)py_lsa_TrustDomainInfoAuthInfo_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6662         { "__ndr_print__", (PyCFunction)py_lsa_TrustDomainInfoAuthInfo_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
6663         { NULL, NULL, 0, NULL }
6664 };
6665
6666
6667 static PyTypeObject lsa_TrustDomainInfoAuthInfo_Type = {
6668         PyObject_HEAD_INIT(NULL) 0,
6669         .tp_name = "lsa.TrustDomainInfoAuthInfo",
6670         .tp_getset = py_lsa_TrustDomainInfoAuthInfo_getsetters,
6671         .tp_methods = py_lsa_TrustDomainInfoAuthInfo_methods,
6672         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6673         .tp_basicsize = sizeof(pytalloc_Object),
6674         .tp_new = py_lsa_TrustDomainInfoAuthInfo_new,
6675 };
6676
6677
6678 static PyObject *py_lsa_TrustDomainInfoFullInfo_get_info_ex(PyObject *obj, void *closure)
6679 {
6680         struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(obj);
6681         PyObject *py_info_ex;
6682         py_info_ex = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->info_ex);
6683         return py_info_ex;
6684 }
6685
6686 static int py_lsa_TrustDomainInfoFullInfo_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
6687 {
6688         struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(py_obj);
6689         PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
6690         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6691                 PyErr_NoMemory();
6692                 return -1;
6693         }
6694         object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
6695         return 0;
6696 }
6697
6698 static PyObject *py_lsa_TrustDomainInfoFullInfo_get_posix_offset(PyObject *obj, void *closure)
6699 {
6700         struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(obj);
6701         PyObject *py_posix_offset;
6702         py_posix_offset = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, pytalloc_get_mem_ctx(obj), &object->posix_offset);
6703         return py_posix_offset;
6704 }
6705
6706 static int py_lsa_TrustDomainInfoFullInfo_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
6707 {
6708         struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(py_obj);
6709         PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, value, return -1;);
6710         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6711                 PyErr_NoMemory();
6712                 return -1;
6713         }
6714         object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
6715         return 0;
6716 }
6717
6718 static PyObject *py_lsa_TrustDomainInfoFullInfo_get_auth_info(PyObject *obj, void *closure)
6719 {
6720         struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(obj);
6721         PyObject *py_auth_info;
6722         py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, pytalloc_get_mem_ctx(obj), &object->auth_info);
6723         return py_auth_info;
6724 }
6725
6726 static int py_lsa_TrustDomainInfoFullInfo_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
6727 {
6728         struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(py_obj);
6729         PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, value, return -1;);
6730         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6731                 PyErr_NoMemory();
6732                 return -1;
6733         }
6734         object->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(value);
6735         return 0;
6736 }
6737
6738 static PyGetSetDef py_lsa_TrustDomainInfoFullInfo_getsetters[] = {
6739         { discard_const_p(char, "info_ex"), py_lsa_TrustDomainInfoFullInfo_get_info_ex, py_lsa_TrustDomainInfoFullInfo_set_info_ex },
6740         { discard_const_p(char, "posix_offset"), py_lsa_TrustDomainInfoFullInfo_get_posix_offset, py_lsa_TrustDomainInfoFullInfo_set_posix_offset },
6741         { discard_const_p(char, "auth_info"), py_lsa_TrustDomainInfoFullInfo_get_auth_info, py_lsa_TrustDomainInfoFullInfo_set_auth_info },
6742         { NULL }
6743 };
6744
6745 static PyObject *py_lsa_TrustDomainInfoFullInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6746 {
6747         return pytalloc_new(struct lsa_TrustDomainInfoFullInfo, type);
6748 }
6749
6750
6751 static PyTypeObject lsa_TrustDomainInfoFullInfo_Type = {
6752         PyObject_HEAD_INIT(NULL) 0,
6753         .tp_name = "lsa.TrustDomainInfoFullInfo",
6754         .tp_getset = py_lsa_TrustDomainInfoFullInfo_getsetters,
6755         .tp_methods = NULL,
6756         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6757         .tp_basicsize = sizeof(pytalloc_Object),
6758         .tp_new = py_lsa_TrustDomainInfoFullInfo_new,
6759 };
6760
6761
6762 static PyObject *py_lsa_TrustDomainInfoAuthInfoInternal_get_auth_blob(PyObject *obj, void *closure)
6763 {
6764         struct lsa_TrustDomainInfoAuthInfoInternal *object = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(obj);
6765         PyObject *py_auth_blob;
6766         py_auth_blob = pytalloc_reference_ex(&lsa_DATA_BUF2_Type, pytalloc_get_mem_ctx(obj), &object->auth_blob);
6767         return py_auth_blob;
6768 }
6769
6770 static int py_lsa_TrustDomainInfoAuthInfoInternal_set_auth_blob(PyObject *py_obj, PyObject *value, void *closure)
6771 {
6772         struct lsa_TrustDomainInfoAuthInfoInternal *object = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(py_obj);
6773         PY_CHECK_TYPE(&lsa_DATA_BUF2_Type, value, return -1;);
6774         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6775                 PyErr_NoMemory();
6776                 return -1;
6777         }
6778         object->auth_blob = *(struct lsa_DATA_BUF2 *)pytalloc_get_ptr(value);
6779         return 0;
6780 }
6781
6782 static PyGetSetDef py_lsa_TrustDomainInfoAuthInfoInternal_getsetters[] = {
6783         { discard_const_p(char, "auth_blob"), py_lsa_TrustDomainInfoAuthInfoInternal_get_auth_blob, py_lsa_TrustDomainInfoAuthInfoInternal_set_auth_blob },
6784         { NULL }
6785 };
6786
6787 static PyObject *py_lsa_TrustDomainInfoAuthInfoInternal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6788 {
6789         return pytalloc_new(struct lsa_TrustDomainInfoAuthInfoInternal, type);
6790 }
6791
6792
6793 static PyTypeObject lsa_TrustDomainInfoAuthInfoInternal_Type = {
6794         PyObject_HEAD_INIT(NULL) 0,
6795         .tp_name = "lsa.TrustDomainInfoAuthInfoInternal",
6796         .tp_getset = py_lsa_TrustDomainInfoAuthInfoInternal_getsetters,
6797         .tp_methods = NULL,
6798         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6799         .tp_basicsize = sizeof(pytalloc_Object),
6800         .tp_new = py_lsa_TrustDomainInfoAuthInfoInternal_new,
6801 };
6802
6803
6804 static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_info_ex(PyObject *obj, void *closure)
6805 {
6806         struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(obj);
6807         PyObject *py_info_ex;
6808         py_info_ex = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->info_ex);
6809         return py_info_ex;
6810 }
6811
6812 static int py_lsa_TrustDomainInfoFullInfoInternal_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
6813 {
6814         struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(py_obj);
6815         PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
6816         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6817                 PyErr_NoMemory();
6818                 return -1;
6819         }
6820         object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
6821         return 0;
6822 }
6823
6824 static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_posix_offset(PyObject *obj, void *closure)
6825 {
6826         struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(obj);
6827         PyObject *py_posix_offset;
6828         py_posix_offset = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, pytalloc_get_mem_ctx(obj), &object->posix_offset);
6829         return py_posix_offset;
6830 }
6831
6832 static int py_lsa_TrustDomainInfoFullInfoInternal_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
6833 {
6834         struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(py_obj);
6835         PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, value, return -1;);
6836         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6837                 PyErr_NoMemory();
6838                 return -1;
6839         }
6840         object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
6841         return 0;
6842 }
6843
6844 static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_auth_info(PyObject *obj, void *closure)
6845 {
6846         struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(obj);
6847         PyObject *py_auth_info;
6848         py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternal_Type, pytalloc_get_mem_ctx(obj), &object->auth_info);
6849         return py_auth_info;
6850 }
6851
6852 static int py_lsa_TrustDomainInfoFullInfoInternal_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
6853 {
6854         struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(py_obj);
6855         PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, value, return -1;);
6856         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6857                 PyErr_NoMemory();
6858                 return -1;
6859         }
6860         object->auth_info = *(struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(value);
6861         return 0;
6862 }
6863
6864 static PyGetSetDef py_lsa_TrustDomainInfoFullInfoInternal_getsetters[] = {
6865         { discard_const_p(char, "info_ex"), py_lsa_TrustDomainInfoFullInfoInternal_get_info_ex, py_lsa_TrustDomainInfoFullInfoInternal_set_info_ex },
6866         { discard_const_p(char, "posix_offset"), py_lsa_TrustDomainInfoFullInfoInternal_get_posix_offset, py_lsa_TrustDomainInfoFullInfoInternal_set_posix_offset },
6867         { discard_const_p(char, "auth_info"), py_lsa_TrustDomainInfoFullInfoInternal_get_auth_info, py_lsa_TrustDomainInfoFullInfoInternal_set_auth_info },
6868         { NULL }
6869 };
6870
6871 static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6872 {
6873         return pytalloc_new(struct lsa_TrustDomainInfoFullInfoInternal, type);
6874 }
6875
6876
6877 static PyTypeObject lsa_TrustDomainInfoFullInfoInternal_Type = {
6878         PyObject_HEAD_INIT(NULL) 0,
6879         .tp_name = "lsa.TrustDomainInfoFullInfoInternal",
6880         .tp_getset = py_lsa_TrustDomainInfoFullInfoInternal_getsetters,
6881         .tp_methods = NULL,
6882         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6883         .tp_basicsize = sizeof(pytalloc_Object),
6884         .tp_new = py_lsa_TrustDomainInfoFullInfoInternal_new,
6885 };
6886
6887
6888 static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_info_ex(PyObject *obj, void *closure)
6889 {
6890         struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(obj);
6891         PyObject *py_info_ex;
6892         py_info_ex = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->info_ex);
6893         return py_info_ex;
6894 }
6895
6896 static int py_lsa_TrustDomainInfoInfoEx2Internal_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
6897 {
6898         struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(py_obj);
6899         PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
6900         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6901                 PyErr_NoMemory();
6902                 return -1;
6903         }
6904         object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
6905         return 0;
6906 }
6907
6908 static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_length(PyObject *obj, void *closure)
6909 {
6910         struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(obj);
6911         PyObject *py_forest_trust_length;
6912         py_forest_trust_length = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->forest_trust_length);
6913         return py_forest_trust_length;
6914 }
6915
6916 static int py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_length(PyObject *py_obj, PyObject *value, void *closure)
6917 {
6918         struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(py_obj);
6919         {
6920                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->forest_trust_length));
6921                 if (PyLong_Check(value)) {
6922                         unsigned long long test_var;
6923                         test_var = PyLong_AsUnsignedLongLong(value);
6924                         if (PyErr_Occurred() != NULL) {
6925                                 return -1;
6926                         }
6927                         if (test_var > uint_max) {
6928                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
6929                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6930                                 return -1;
6931                         }
6932                         object->forest_trust_length = test_var;
6933                 } else if (PyInt_Check(value)) {
6934                         long test_var;
6935                         test_var = PyInt_AsLong(value);
6936                         if (test_var < 0 || test_var > uint_max) {
6937                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
6938                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6939                                 return -1;
6940                         }
6941                         object->forest_trust_length = test_var;
6942                 } else {
6943                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6944                           PyInt_Type.tp_name, PyLong_Type.tp_name);
6945                         return -1;
6946                 }
6947         }
6948         return 0;
6949 }
6950
6951 static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_data(PyObject *obj, void *closure)
6952 {
6953         struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(obj);
6954         PyObject *py_forest_trust_data;
6955         if (object->forest_trust_data == NULL) {
6956                 py_forest_trust_data = Py_None;
6957                 Py_INCREF(py_forest_trust_data);
6958         } else {
6959                 py_forest_trust_data = PyList_New(object->forest_trust_length);
6960                 if (py_forest_trust_data == NULL) {
6961                         return NULL;
6962                 }
6963                 {
6964                         int forest_trust_data_cntr_1;
6965                         for (forest_trust_data_cntr_1 = 0; forest_trust_data_cntr_1 < (object->forest_trust_length); forest_trust_data_cntr_1++) {
6966                                 PyObject *py_forest_trust_data_1;
6967                                 py_forest_trust_data_1 = PyInt_FromLong((uint16_t)object->forest_trust_data[forest_trust_data_cntr_1]);
6968                                 PyList_SetItem(py_forest_trust_data, forest_trust_data_cntr_1, py_forest_trust_data_1);
6969                         }
6970                 }
6971         }
6972         return py_forest_trust_data;
6973 }
6974
6975 static int py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_data(PyObject *py_obj, PyObject *value, void *closure)
6976 {
6977         struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(py_obj);
6978         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->forest_trust_data));
6979         if (value == Py_None) {
6980                 object->forest_trust_data = NULL;
6981         } else {
6982                 object->forest_trust_data = NULL;
6983                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6984                 {
6985                         int forest_trust_data_cntr_1;
6986                         object->forest_trust_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->forest_trust_data, PyList_GET_SIZE(value));
6987                         if (!object->forest_trust_data) { return -1;; }
6988                         talloc_set_name_const(object->forest_trust_data, "ARRAY: object->forest_trust_data");
6989                         for (forest_trust_data_cntr_1 = 0; forest_trust_data_cntr_1 < PyList_GET_SIZE(value); forest_trust_data_cntr_1++) {
6990                                 {
6991                                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->forest_trust_data[forest_trust_data_cntr_1]));
6992                                         if (PyLong_Check(PyList_GET_ITEM(value, forest_trust_data_cntr_1))) {
6993                                                 unsigned long long test_var;
6994                                                 test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, forest_trust_data_cntr_1));
6995                                                 if (PyErr_Occurred() != NULL) {
6996                                                         return -1;
6997                                                 }
6998                                                 if (test_var > uint_max) {
6999                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7000                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7001                                                         return -1;
7002                                                 }
7003                                                 object->forest_trust_data[forest_trust_data_cntr_1] = test_var;
7004                                         } else if (PyInt_Check(PyList_GET_ITEM(value, forest_trust_data_cntr_1))) {
7005                                                 long test_var;
7006                                                 test_var = PyInt_AsLong(PyList_GET_ITEM(value, forest_trust_data_cntr_1));
7007                                                 if (test_var < 0 || test_var > uint_max) {
7008                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7009                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7010                                                         return -1;
7011                                                 }
7012                                                 object->forest_trust_data[forest_trust_data_cntr_1] = test_var;
7013                                         } else {
7014                                                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7015                                                   PyInt_Type.tp_name, PyLong_Type.tp_name);
7016                                                 return -1;
7017                                         }
7018                                 }
7019                         }
7020                 }
7021         }
7022         return 0;
7023 }
7024
7025 static PyGetSetDef py_lsa_TrustDomainInfoInfoEx2Internal_getsetters[] = {
7026         { discard_const_p(char, "info_ex"), py_lsa_TrustDomainInfoInfoEx2Internal_get_info_ex, py_lsa_TrustDomainInfoInfoEx2Internal_set_info_ex },
7027         { discard_const_p(char, "forest_trust_length"), py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_length, py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_length },
7028         { discard_const_p(char, "forest_trust_data"), py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_data, py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_data },
7029         { NULL }
7030 };
7031
7032 static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7033 {
7034         return pytalloc_new(struct lsa_TrustDomainInfoInfoEx2Internal, type);
7035 }
7036
7037
7038 static PyTypeObject lsa_TrustDomainInfoInfoEx2Internal_Type = {
7039         PyObject_HEAD_INIT(NULL) 0,
7040         .tp_name = "lsa.TrustDomainInfoInfoEx2Internal",
7041         .tp_getset = py_lsa_TrustDomainInfoInfoEx2Internal_getsetters,
7042         .tp_methods = NULL,
7043         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7044         .tp_basicsize = sizeof(pytalloc_Object),
7045         .tp_new = py_lsa_TrustDomainInfoInfoEx2Internal_new,
7046 };
7047
7048
7049 static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_info(PyObject *obj, void *closure)
7050 {
7051         struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(obj);
7052         PyObject *py_info;
7053         py_info = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx2Internal_Type, pytalloc_get_mem_ctx(obj), &object->info);
7054         return py_info;
7055 }
7056
7057 static int py_lsa_TrustDomainInfoFullInfo2Internal_set_info(PyObject *py_obj, PyObject *value, void *closure)
7058 {
7059         struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(py_obj);
7060         PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx2Internal_Type, value, return -1;);
7061         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7062                 PyErr_NoMemory();
7063                 return -1;
7064         }
7065         object->info = *(struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(value);
7066         return 0;
7067 }
7068
7069 static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_posix_offset(PyObject *obj, void *closure)
7070 {
7071         struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(obj);
7072         PyObject *py_posix_offset;
7073         py_posix_offset = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, pytalloc_get_mem_ctx(obj), &object->posix_offset);
7074         return py_posix_offset;
7075 }
7076
7077 static int py_lsa_TrustDomainInfoFullInfo2Internal_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
7078 {
7079         struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(py_obj);
7080         PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, value, return -1;);
7081         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7082                 PyErr_NoMemory();
7083                 return -1;
7084         }
7085         object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
7086         return 0;
7087 }
7088
7089 static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_auth_info(PyObject *obj, void *closure)
7090 {
7091         struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(obj);
7092         PyObject *py_auth_info;
7093         py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, pytalloc_get_mem_ctx(obj), &object->auth_info);
7094         return py_auth_info;
7095 }
7096
7097 static int py_lsa_TrustDomainInfoFullInfo2Internal_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7098 {
7099         struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(py_obj);
7100         PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, value, return -1;);
7101         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7102                 PyErr_NoMemory();
7103                 return -1;
7104         }
7105         object->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(value);
7106         return 0;
7107 }
7108
7109 static PyGetSetDef py_lsa_TrustDomainInfoFullInfo2Internal_getsetters[] = {
7110         { discard_const_p(char, "info"), py_lsa_TrustDomainInfoFullInfo2Internal_get_info, py_lsa_TrustDomainInfoFullInfo2Internal_set_info },
7111         { discard_const_p(char, "posix_offset"), py_lsa_TrustDomainInfoFullInfo2Internal_get_posix_offset, py_lsa_TrustDomainInfoFullInfo2Internal_set_posix_offset },
7112         { discard_const_p(char, "auth_info"), py_lsa_TrustDomainInfoFullInfo2Internal_get_auth_info, py_lsa_TrustDomainInfoFullInfo2Internal_set_auth_info },
7113         { NULL }
7114 };
7115
7116 static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7117 {
7118         return pytalloc_new(struct lsa_TrustDomainInfoFullInfo2Internal, type);
7119 }
7120
7121
7122 static PyTypeObject lsa_TrustDomainInfoFullInfo2Internal_Type = {
7123         PyObject_HEAD_INIT(NULL) 0,
7124         .tp_name = "lsa.TrustDomainInfoFullInfo2Internal",
7125         .tp_getset = py_lsa_TrustDomainInfoFullInfo2Internal_getsetters,
7126         .tp_methods = NULL,
7127         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7128         .tp_basicsize = sizeof(pytalloc_Object),
7129         .tp_new = py_lsa_TrustDomainInfoFullInfo2Internal_new,
7130 };
7131
7132
7133 static PyObject *py_lsa_TrustDomainInfoSupportedEncTypes_get_enc_types(PyObject *obj, void *closure)
7134 {
7135         struct lsa_TrustDomainInfoSupportedEncTypes *object = (struct lsa_TrustDomainInfoSupportedEncTypes *)pytalloc_get_ptr(obj);
7136         PyObject *py_enc_types;
7137         py_enc_types = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->enc_types);
7138         return py_enc_types;
7139 }
7140
7141 static int py_lsa_TrustDomainInfoSupportedEncTypes_set_enc_types(PyObject *py_obj, PyObject *value, void *closure)
7142 {
7143         struct lsa_TrustDomainInfoSupportedEncTypes *object = (struct lsa_TrustDomainInfoSupportedEncTypes *)pytalloc_get_ptr(py_obj);
7144         {
7145                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enc_types));
7146                 if (PyLong_Check(value)) {
7147                         unsigned long long test_var;
7148                         test_var = PyLong_AsUnsignedLongLong(value);
7149                         if (PyErr_Occurred() != NULL) {
7150                                 return -1;
7151                         }
7152                         if (test_var > uint_max) {
7153                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7154                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7155                                 return -1;
7156                         }
7157                         object->enc_types = test_var;
7158                 } else if (PyInt_Check(value)) {
7159                         long test_var;
7160                         test_var = PyInt_AsLong(value);
7161                         if (test_var < 0 || test_var > uint_max) {
7162                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7163                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7164                                 return -1;
7165                         }
7166                         object->enc_types = test_var;
7167                 } else {
7168                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7169                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7170                         return -1;
7171                 }
7172         }
7173         return 0;
7174 }
7175
7176 static PyGetSetDef py_lsa_TrustDomainInfoSupportedEncTypes_getsetters[] = {
7177         { discard_const_p(char, "enc_types"), py_lsa_TrustDomainInfoSupportedEncTypes_get_enc_types, py_lsa_TrustDomainInfoSupportedEncTypes_set_enc_types },
7178         { NULL }
7179 };
7180
7181 static PyObject *py_lsa_TrustDomainInfoSupportedEncTypes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7182 {
7183         return pytalloc_new(struct lsa_TrustDomainInfoSupportedEncTypes, type);
7184 }
7185
7186
7187 static PyTypeObject lsa_TrustDomainInfoSupportedEncTypes_Type = {
7188         PyObject_HEAD_INIT(NULL) 0,
7189         .tp_name = "lsa.TrustDomainInfoSupportedEncTypes",
7190         .tp_getset = py_lsa_TrustDomainInfoSupportedEncTypes_getsetters,
7191         .tp_methods = NULL,
7192         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7193         .tp_basicsize = sizeof(pytalloc_Object),
7194         .tp_new = py_lsa_TrustDomainInfoSupportedEncTypes_new,
7195 };
7196
7197 PyObject *py_import_lsa_TrustedDomainInfo(TALLOC_CTX *mem_ctx, int level, union lsa_TrustedDomainInfo *in)
7198 {
7199         PyObject *ret;
7200
7201         switch (level) {
7202                 case LSA_TRUSTED_DOMAIN_INFO_NAME:
7203                         ret = pytalloc_reference_ex(&lsa_TrustDomainInfoName_Type, mem_ctx, &in->name);
7204                         return ret;
7205
7206                 case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS:
7207                         ret = pytalloc_reference_ex(&lsa_TrustDomainInfoControllers_Type, mem_ctx, &in->controllers);
7208                         return ret;
7209
7210                 case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET:
7211                         ret = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, mem_ctx, &in->posix_offset);
7212                         return ret;
7213
7214                 case LSA_TRUSTED_DOMAIN_INFO_PASSWORD:
7215                         ret = pytalloc_reference_ex(&lsa_TrustDomainInfoPassword_Type, mem_ctx, &in->password);
7216                         return ret;
7217
7218                 case LSA_TRUSTED_DOMAIN_INFO_BASIC:
7219                         ret = pytalloc_reference_ex(&lsa_TrustDomainInfoBasic_Type, mem_ctx, &in->info_basic);
7220                         return ret;
7221
7222                 case LSA_TRUSTED_DOMAIN_INFO_INFO_EX:
7223                         ret = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, mem_ctx, &in->info_ex);
7224                         return ret;
7225
7226                 case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO:
7227                         ret = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, mem_ctx, &in->auth_info);
7228                         return ret;
7229
7230                 case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO:
7231                         ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfo_Type, mem_ctx, &in->full_info);
7232                         return ret;
7233
7234                 case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL:
7235                         ret = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternal_Type, mem_ctx, &in->auth_info_internal);
7236                         return ret;
7237
7238                 case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL:
7239                         ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfoInternal_Type, mem_ctx, &in->full_info_internal);
7240                         return ret;
7241
7242                 case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL:
7243                         ret = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx2Internal_Type, mem_ctx, &in->info_ex2_internal);
7244                         return ret;
7245
7246                 case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL:
7247                         ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfo2Internal_Type, mem_ctx, &in->full_info2_internal);
7248                         return ret;
7249
7250                 case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES:
7251                         ret = pytalloc_reference_ex(&lsa_TrustDomainInfoSupportedEncTypes_Type, mem_ctx, &in->enc_types);
7252                         return ret;
7253
7254         }
7255         PyErr_SetString(PyExc_TypeError, "unknown union level");
7256         return NULL;
7257 }
7258
7259 union lsa_TrustedDomainInfo *py_export_lsa_TrustedDomainInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
7260 {
7261         union lsa_TrustedDomainInfo *ret = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
7262         switch (level) {
7263                 case LSA_TRUSTED_DOMAIN_INFO_NAME:
7264                         PY_CHECK_TYPE(&lsa_TrustDomainInfoName_Type, in, talloc_free(ret); return NULL;);
7265                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7266                                 PyErr_NoMemory();
7267                                 talloc_free(ret); return NULL;
7268                         }
7269                         ret->name = *(struct lsa_TrustDomainInfoName *)pytalloc_get_ptr(in);
7270                         break;
7271
7272                 case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS:
7273                         PY_CHECK_TYPE(&lsa_TrustDomainInfoControllers_Type, in, talloc_free(ret); return NULL;);
7274                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7275                                 PyErr_NoMemory();
7276                                 talloc_free(ret); return NULL;
7277                         }
7278                         ret->controllers = *(struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(in);
7279                         break;
7280
7281                 case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET:
7282                         PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, in, talloc_free(ret); return NULL;);
7283                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7284                                 PyErr_NoMemory();
7285                                 talloc_free(ret); return NULL;
7286                         }
7287                         ret->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(in);
7288                         break;
7289
7290                 case LSA_TRUSTED_DOMAIN_INFO_PASSWORD:
7291                         PY_CHECK_TYPE(&lsa_TrustDomainInfoPassword_Type, in, talloc_free(ret); return NULL;);
7292                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7293                                 PyErr_NoMemory();
7294                                 talloc_free(ret); return NULL;
7295                         }
7296                         ret->password = *(struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(in);
7297                         break;
7298
7299                 case LSA_TRUSTED_DOMAIN_INFO_BASIC:
7300                         PY_CHECK_TYPE(&lsa_TrustDomainInfoBasic_Type, in, talloc_free(ret); return NULL;);
7301                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7302                                 PyErr_NoMemory();
7303                                 talloc_free(ret); return NULL;
7304                         }
7305                         ret->info_basic = *(struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(in);
7306                         break;
7307
7308                 case LSA_TRUSTED_DOMAIN_INFO_INFO_EX:
7309                         PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, in, talloc_free(ret); return NULL;);
7310                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7311                                 PyErr_NoMemory();
7312                                 talloc_free(ret); return NULL;
7313                         }
7314                         ret->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(in);
7315                         break;
7316
7317                 case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO:
7318                         PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, in, talloc_free(ret); return NULL;);
7319                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7320                                 PyErr_NoMemory();
7321                                 talloc_free(ret); return NULL;
7322                         }
7323                         ret->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(in);
7324                         break;
7325
7326                 case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO:
7327                         PY_CHECK_TYPE(&lsa_TrustDomainInfoFullInfo_Type, in, talloc_free(ret); return NULL;);
7328                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7329                                 PyErr_NoMemory();
7330                                 talloc_free(ret); return NULL;
7331                         }
7332                         ret->full_info = *(struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(in);
7333                         break;
7334
7335                 case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL:
7336                         PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, in, talloc_free(ret); return NULL;);
7337                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7338                                 PyErr_NoMemory();
7339                                 talloc_free(ret); return NULL;
7340                         }
7341                         ret->auth_info_internal = *(struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(in);
7342                         break;
7343
7344                 case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL:
7345                         PY_CHECK_TYPE(&lsa_TrustDomainInfoFullInfoInternal_Type, in, talloc_free(ret); return NULL;);
7346                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7347                                 PyErr_NoMemory();
7348                                 talloc_free(ret); return NULL;
7349                         }
7350                         ret->full_info_internal = *(struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(in);
7351                         break;
7352
7353                 case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL:
7354                         PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx2Internal_Type, in, talloc_free(ret); return NULL;);
7355                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7356                                 PyErr_NoMemory();
7357                                 talloc_free(ret); return NULL;
7358                         }
7359                         ret->info_ex2_internal = *(struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(in);
7360                         break;
7361
7362                 case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL:
7363                         PY_CHECK_TYPE(&lsa_TrustDomainInfoFullInfo2Internal_Type, in, talloc_free(ret); return NULL;);
7364                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7365                                 PyErr_NoMemory();
7366                                 talloc_free(ret); return NULL;
7367                         }
7368                         ret->full_info2_internal = *(struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(in);
7369                         break;
7370
7371                 case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES:
7372                         PY_CHECK_TYPE(&lsa_TrustDomainInfoSupportedEncTypes_Type, in, talloc_free(ret); return NULL;);
7373                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7374                                 PyErr_NoMemory();
7375                                 talloc_free(ret); return NULL;
7376                         }
7377                         ret->enc_types = *(struct lsa_TrustDomainInfoSupportedEncTypes *)pytalloc_get_ptr(in);
7378                         break;
7379
7380                 default:
7381                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
7382                         talloc_free(ret);
7383                         ret = NULL;
7384         }
7385
7386         return ret;
7387 }
7388
7389
7390 static PyObject *py_lsa_DATA_BUF_PTR_get_buf(PyObject *obj, void *closure)
7391 {
7392         struct lsa_DATA_BUF_PTR *object = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(obj);
7393         PyObject *py_buf;
7394         if (object->buf == NULL) {
7395                 py_buf = Py_None;
7396                 Py_INCREF(py_buf);
7397         } else {
7398                 py_buf = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->buf, object->buf);
7399         }
7400         return py_buf;
7401 }
7402
7403 static int py_lsa_DATA_BUF_PTR_set_buf(PyObject *py_obj, PyObject *value, void *closure)
7404 {
7405         struct lsa_DATA_BUF_PTR *object = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(py_obj);
7406         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->buf));
7407         if (value == Py_None) {
7408                 object->buf = NULL;
7409         } else {
7410                 object->buf = NULL;
7411                 PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
7412                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7413                         PyErr_NoMemory();
7414                         return -1;
7415                 }
7416                 object->buf = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
7417         }
7418         return 0;
7419 }
7420
7421 static PyGetSetDef py_lsa_DATA_BUF_PTR_getsetters[] = {
7422         { discard_const_p(char, "buf"), py_lsa_DATA_BUF_PTR_get_buf, py_lsa_DATA_BUF_PTR_set_buf },
7423         { NULL }
7424 };
7425
7426 static PyObject *py_lsa_DATA_BUF_PTR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7427 {
7428         return pytalloc_new(struct lsa_DATA_BUF_PTR, type);
7429 }
7430
7431
7432 static PyTypeObject lsa_DATA_BUF_PTR_Type = {
7433         PyObject_HEAD_INIT(NULL) 0,
7434         .tp_name = "lsa.DATA_BUF_PTR",
7435         .tp_getset = py_lsa_DATA_BUF_PTR_getsetters,
7436         .tp_methods = NULL,
7437         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7438         .tp_basicsize = sizeof(pytalloc_Object),
7439         .tp_new = py_lsa_DATA_BUF_PTR_new,
7440 };
7441
7442
7443 static PyObject *py_lsa_RightAttribute_get_name(PyObject *obj, void *closure)
7444 {
7445         struct lsa_RightAttribute *object = (struct lsa_RightAttribute *)pytalloc_get_ptr(obj);
7446         PyObject *py_name;
7447         if (object->name == NULL) {
7448                 py_name = Py_None;
7449                 Py_INCREF(py_name);
7450         } else {
7451                 if (object->name == NULL) {
7452                         py_name = Py_None;
7453                         Py_INCREF(py_name);
7454                 } else {
7455                         py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
7456                 }
7457         }
7458         return py_name;
7459 }
7460
7461 static int py_lsa_RightAttribute_set_name(PyObject *py_obj, PyObject *value, void *closure)
7462 {
7463         struct lsa_RightAttribute *object = (struct lsa_RightAttribute *)pytalloc_get_ptr(py_obj);
7464         if (value == Py_None) {
7465                 object->name = NULL;
7466         } else {
7467                 object->name = NULL;
7468                 if (PyUnicode_Check(value)) {
7469                         object->name = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
7470                 } else if (PyString_Check(value)) {
7471                         object->name = PyString_AS_STRING(value);
7472                 } else {
7473                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7474                         return -1;
7475                 }
7476         }
7477         return 0;
7478 }
7479
7480 static PyGetSetDef py_lsa_RightAttribute_getsetters[] = {
7481         { discard_const_p(char, "name"), py_lsa_RightAttribute_get_name, py_lsa_RightAttribute_set_name },
7482         { NULL }
7483 };
7484
7485 static PyObject *py_lsa_RightAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7486 {
7487         return pytalloc_new(struct lsa_RightAttribute, type);
7488 }
7489
7490
7491 static PyTypeObject lsa_RightAttribute_Type = {
7492         PyObject_HEAD_INIT(NULL) 0,
7493         .tp_name = "lsa.RightAttribute",
7494         .tp_getset = py_lsa_RightAttribute_getsetters,
7495         .tp_methods = NULL,
7496         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7497         .tp_basicsize = sizeof(pytalloc_Object),
7498         .tp_new = py_lsa_RightAttribute_new,
7499 };
7500
7501
7502 static PyObject *py_lsa_RightSet_get_count(PyObject *obj, void *closure)
7503 {
7504         struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(obj);
7505         PyObject *py_count;
7506         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
7507         return py_count;
7508 }
7509
7510 static int py_lsa_RightSet_set_count(PyObject *py_obj, PyObject *value, void *closure)
7511 {
7512         struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(py_obj);
7513         {
7514                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
7515                 if (PyLong_Check(value)) {
7516                         unsigned long long test_var;
7517                         test_var = PyLong_AsUnsignedLongLong(value);
7518                         if (PyErr_Occurred() != NULL) {
7519                                 return -1;
7520                         }
7521                         if (test_var > uint_max) {
7522                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7523                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7524                                 return -1;
7525                         }
7526                         object->count = test_var;
7527                 } else if (PyInt_Check(value)) {
7528                         long test_var;
7529                         test_var = PyInt_AsLong(value);
7530                         if (test_var < 0 || test_var > uint_max) {
7531                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7532                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7533                                 return -1;
7534                         }
7535                         object->count = test_var;
7536                 } else {
7537                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7538                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7539                         return -1;
7540                 }
7541         }
7542         return 0;
7543 }
7544
7545 static PyObject *py_lsa_RightSet_get_names(PyObject *obj, void *closure)
7546 {
7547         struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(obj);
7548         PyObject *py_names;
7549         if (object->names == NULL) {
7550                 py_names = Py_None;
7551                 Py_INCREF(py_names);
7552         } else {
7553                 py_names = PyList_New(object->count);
7554                 if (py_names == NULL) {
7555                         return NULL;
7556                 }
7557                 {
7558                         int names_cntr_1;
7559                         for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
7560                                 PyObject *py_names_1;
7561                                 py_names_1 = pytalloc_reference_ex(&lsa_StringLarge_Type, object->names, &object->names[names_cntr_1]);
7562                                 PyList_SetItem(py_names, names_cntr_1, py_names_1);
7563                         }
7564                 }
7565         }
7566         return py_names;
7567 }
7568
7569 static int py_lsa_RightSet_set_names(PyObject *py_obj, PyObject *value, void *closure)
7570 {
7571         struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(py_obj);
7572         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
7573         if (value == Py_None) {
7574                 object->names = NULL;
7575         } else {
7576                 object->names = NULL;
7577                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
7578                 {
7579                         int names_cntr_1;
7580                         object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
7581                         if (!object->names) { return -1;; }
7582                         talloc_set_name_const(object->names, "ARRAY: object->names");
7583                         for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
7584                                 PY_CHECK_TYPE(&lsa_StringLarge_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
7585                                 if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
7586                                         PyErr_NoMemory();
7587                                         return -1;
7588                                 }
7589                                 object->names[names_cntr_1] = *(struct lsa_StringLarge *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
7590                         }
7591                 }
7592         }
7593         return 0;
7594 }
7595
7596 static PyGetSetDef py_lsa_RightSet_getsetters[] = {
7597         { discard_const_p(char, "count"), py_lsa_RightSet_get_count, py_lsa_RightSet_set_count },
7598         { discard_const_p(char, "names"), py_lsa_RightSet_get_names, py_lsa_RightSet_set_names },
7599         { NULL }
7600 };
7601
7602 static PyObject *py_lsa_RightSet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7603 {
7604         return pytalloc_new(struct lsa_RightSet, type);
7605 }
7606
7607
7608 static PyTypeObject lsa_RightSet_Type = {
7609         PyObject_HEAD_INIT(NULL) 0,
7610         .tp_name = "lsa.RightSet",
7611         .tp_getset = py_lsa_RightSet_getsetters,
7612         .tp_methods = NULL,
7613         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7614         .tp_basicsize = sizeof(pytalloc_Object),
7615         .tp_new = py_lsa_RightSet_new,
7616 };
7617
7618
7619 static PyObject *py_lsa_DomainListEx_get_count(PyObject *obj, void *closure)
7620 {
7621         struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(obj);
7622         PyObject *py_count;
7623         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
7624         return py_count;
7625 }
7626
7627 static int py_lsa_DomainListEx_set_count(PyObject *py_obj, PyObject *value, void *closure)
7628 {
7629         struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(py_obj);
7630         {
7631                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
7632                 if (PyLong_Check(value)) {
7633                         unsigned long long test_var;
7634                         test_var = PyLong_AsUnsignedLongLong(value);
7635                         if (PyErr_Occurred() != NULL) {
7636                                 return -1;
7637                         }
7638                         if (test_var > uint_max) {
7639                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7640                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7641                                 return -1;
7642                         }
7643                         object->count = test_var;
7644                 } else if (PyInt_Check(value)) {
7645                         long test_var;
7646                         test_var = PyInt_AsLong(value);
7647                         if (test_var < 0 || test_var > uint_max) {
7648                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7649                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7650                                 return -1;
7651                         }
7652                         object->count = test_var;
7653                 } else {
7654                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7655                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7656                         return -1;
7657                 }
7658         }
7659         return 0;
7660 }
7661
7662 static PyObject *py_lsa_DomainListEx_get_domains(PyObject *obj, void *closure)
7663 {
7664         struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(obj);
7665         PyObject *py_domains;
7666         if (object->domains == NULL) {
7667                 py_domains = Py_None;
7668                 Py_INCREF(py_domains);
7669         } else {
7670                 py_domains = PyList_New(object->count);
7671                 if (py_domains == NULL) {
7672                         return NULL;
7673                 }
7674                 {
7675                         int domains_cntr_1;
7676                         for (domains_cntr_1 = 0; domains_cntr_1 < (object->count); domains_cntr_1++) {
7677                                 PyObject *py_domains_1;
7678                                 py_domains_1 = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, object->domains, &object->domains[domains_cntr_1]);
7679                                 PyList_SetItem(py_domains, domains_cntr_1, py_domains_1);
7680                         }
7681                 }
7682         }
7683         return py_domains;
7684 }
7685
7686 static int py_lsa_DomainListEx_set_domains(PyObject *py_obj, PyObject *value, void *closure)
7687 {
7688         struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(py_obj);
7689         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domains));
7690         if (value == Py_None) {
7691                 object->domains = NULL;
7692         } else {
7693                 object->domains = NULL;
7694                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
7695                 {
7696                         int domains_cntr_1;
7697                         object->domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->domains, PyList_GET_SIZE(value));
7698                         if (!object->domains) { return -1;; }
7699                         talloc_set_name_const(object->domains, "ARRAY: object->domains");
7700                         for (domains_cntr_1 = 0; domains_cntr_1 < PyList_GET_SIZE(value); domains_cntr_1++) {
7701                                 PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, PyList_GET_ITEM(value, domains_cntr_1), return -1;);
7702                                 if (talloc_reference(object->domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, domains_cntr_1))) == NULL) {
7703                                         PyErr_NoMemory();
7704                                         return -1;
7705                                 }
7706                                 object->domains[domains_cntr_1] = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
7707                         }
7708                 }
7709         }
7710         return 0;
7711 }
7712
7713 static PyGetSetDef py_lsa_DomainListEx_getsetters[] = {
7714         { discard_const_p(char, "count"), py_lsa_DomainListEx_get_count, py_lsa_DomainListEx_set_count },
7715         { discard_const_p(char, "domains"), py_lsa_DomainListEx_get_domains, py_lsa_DomainListEx_set_domains },
7716         { NULL }
7717 };
7718
7719 static PyObject *py_lsa_DomainListEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7720 {
7721         return pytalloc_new(struct lsa_DomainListEx, type);
7722 }
7723
7724
7725 static PyTypeObject lsa_DomainListEx_Type = {
7726         PyObject_HEAD_INIT(NULL) 0,
7727         .tp_name = "lsa.DomainListEx",
7728         .tp_getset = py_lsa_DomainListEx_getsetters,
7729         .tp_methods = NULL,
7730         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7731         .tp_basicsize = sizeof(pytalloc_Object),
7732         .tp_new = py_lsa_DomainListEx_new,
7733 };
7734
7735
7736 static PyObject *py_lsa_DomainInfoKerberos_get_authentication_options(PyObject *obj, void *closure)
7737 {
7738         struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
7739         PyObject *py_authentication_options;
7740         py_authentication_options = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->authentication_options);
7741         return py_authentication_options;
7742 }
7743
7744 static int py_lsa_DomainInfoKerberos_set_authentication_options(PyObject *py_obj, PyObject *value, void *closure)
7745 {
7746         struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
7747         {
7748                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->authentication_options));
7749                 if (PyLong_Check(value)) {
7750                         unsigned long long test_var;
7751                         test_var = PyLong_AsUnsignedLongLong(value);
7752                         if (PyErr_Occurred() != NULL) {
7753                                 return -1;
7754                         }
7755                         if (test_var > uint_max) {
7756                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7757                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7758                                 return -1;
7759                         }
7760                         object->authentication_options = test_var;
7761                 } else if (PyInt_Check(value)) {
7762                         long test_var;
7763                         test_var = PyInt_AsLong(value);
7764                         if (test_var < 0 || test_var > uint_max) {
7765                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7766                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7767                                 return -1;
7768                         }
7769                         object->authentication_options = test_var;
7770                 } else {
7771                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7772                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7773                         return -1;
7774                 }
7775         }
7776         return 0;
7777 }
7778
7779 static PyObject *py_lsa_DomainInfoKerberos_get_service_tkt_lifetime(PyObject *obj, void *closure)
7780 {
7781         struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
7782         PyObject *py_service_tkt_lifetime;
7783         py_service_tkt_lifetime = ndr_PyLong_FromUnsignedLongLong(object->service_tkt_lifetime);
7784         return py_service_tkt_lifetime;
7785 }
7786
7787 static int py_lsa_DomainInfoKerberos_set_service_tkt_lifetime(PyObject *py_obj, PyObject *value, void *closure)
7788 {
7789         struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
7790         {
7791                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_tkt_lifetime));
7792                 if (PyLong_Check(value)) {
7793                         unsigned long long test_var;
7794                         test_var = PyLong_AsUnsignedLongLong(value);
7795                         if (PyErr_Occurred() != NULL) {
7796                                 return -1;
7797                         }
7798                         if (test_var > uint_max) {
7799                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7800                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7801                                 return -1;
7802                         }
7803                         object->service_tkt_lifetime = test_var;
7804                 } else if (PyInt_Check(value)) {
7805                         long test_var;
7806                         test_var = PyInt_AsLong(value);
7807                         if (test_var < 0 || test_var > uint_max) {
7808                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7809                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7810                                 return -1;
7811                         }
7812                         object->service_tkt_lifetime = test_var;
7813                 } else {
7814                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7815                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7816                         return -1;
7817                 }
7818         }
7819         return 0;
7820 }
7821
7822 static PyObject *py_lsa_DomainInfoKerberos_get_user_tkt_lifetime(PyObject *obj, void *closure)
7823 {
7824         struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
7825         PyObject *py_user_tkt_lifetime;
7826         py_user_tkt_lifetime = ndr_PyLong_FromUnsignedLongLong(object->user_tkt_lifetime);
7827         return py_user_tkt_lifetime;
7828 }
7829
7830 static int py_lsa_DomainInfoKerberos_set_user_tkt_lifetime(PyObject *py_obj, PyObject *value, void *closure)
7831 {
7832         struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
7833         {
7834                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_tkt_lifetime));
7835                 if (PyLong_Check(value)) {
7836                         unsigned long long test_var;
7837                         test_var = PyLong_AsUnsignedLongLong(value);
7838                         if (PyErr_Occurred() != NULL) {
7839                                 return -1;
7840                         }
7841                         if (test_var > uint_max) {
7842                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7843                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7844                                 return -1;
7845                         }
7846                         object->user_tkt_lifetime = test_var;
7847                 } else if (PyInt_Check(value)) {
7848                         long test_var;
7849                         test_var = PyInt_AsLong(value);
7850                         if (test_var < 0 || test_var > uint_max) {
7851                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7852                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7853                                 return -1;
7854                         }
7855                         object->user_tkt_lifetime = test_var;
7856                 } else {
7857                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7858                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7859                         return -1;
7860                 }
7861         }
7862         return 0;
7863 }
7864
7865 static PyObject *py_lsa_DomainInfoKerberos_get_user_tkt_renewaltime(PyObject *obj, void *closure)
7866 {
7867         struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
7868         PyObject *py_user_tkt_renewaltime;
7869         py_user_tkt_renewaltime = ndr_PyLong_FromUnsignedLongLong(object->user_tkt_renewaltime);
7870         return py_user_tkt_renewaltime;
7871 }
7872
7873 static int py_lsa_DomainInfoKerberos_set_user_tkt_renewaltime(PyObject *py_obj, PyObject *value, void *closure)
7874 {
7875         struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
7876         {
7877                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_tkt_renewaltime));
7878                 if (PyLong_Check(value)) {
7879                         unsigned long long test_var;
7880                         test_var = PyLong_AsUnsignedLongLong(value);
7881                         if (PyErr_Occurred() != NULL) {
7882                                 return -1;
7883                         }
7884                         if (test_var > uint_max) {
7885                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7886                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7887                                 return -1;
7888                         }
7889                         object->user_tkt_renewaltime = test_var;
7890                 } else if (PyInt_Check(value)) {
7891                         long test_var;
7892                         test_var = PyInt_AsLong(value);
7893                         if (test_var < 0 || test_var > uint_max) {
7894                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7895                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7896                                 return -1;
7897                         }
7898                         object->user_tkt_renewaltime = test_var;
7899                 } else {
7900                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7901                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7902                         return -1;
7903                 }
7904         }
7905         return 0;
7906 }
7907
7908 static PyObject *py_lsa_DomainInfoKerberos_get_clock_skew(PyObject *obj, void *closure)
7909 {
7910         struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
7911         PyObject *py_clock_skew;
7912         py_clock_skew = ndr_PyLong_FromUnsignedLongLong(object->clock_skew);
7913         return py_clock_skew;
7914 }
7915
7916 static int py_lsa_DomainInfoKerberos_set_clock_skew(PyObject *py_obj, PyObject *value, void *closure)
7917 {
7918         struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
7919         {
7920                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->clock_skew));
7921                 if (PyLong_Check(value)) {
7922                         unsigned long long test_var;
7923                         test_var = PyLong_AsUnsignedLongLong(value);
7924                         if (PyErr_Occurred() != NULL) {
7925                                 return -1;
7926                         }
7927                         if (test_var > uint_max) {
7928                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7929                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7930                                 return -1;
7931                         }
7932                         object->clock_skew = test_var;
7933                 } else if (PyInt_Check(value)) {
7934                         long test_var;
7935                         test_var = PyInt_AsLong(value);
7936                         if (test_var < 0 || test_var > uint_max) {
7937                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7938                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7939                                 return -1;
7940                         }
7941                         object->clock_skew = test_var;
7942                 } else {
7943                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7944                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7945                         return -1;
7946                 }
7947         }
7948         return 0;
7949 }
7950
7951 static PyObject *py_lsa_DomainInfoKerberos_get_reserved(PyObject *obj, void *closure)
7952 {
7953         struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
7954         PyObject *py_reserved;
7955         py_reserved = ndr_PyLong_FromUnsignedLongLong(object->reserved);
7956         return py_reserved;
7957 }
7958
7959 static int py_lsa_DomainInfoKerberos_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
7960 {
7961         struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
7962         {
7963                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
7964                 if (PyLong_Check(value)) {
7965                         unsigned long long test_var;
7966                         test_var = PyLong_AsUnsignedLongLong(value);
7967                         if (PyErr_Occurred() != NULL) {
7968                                 return -1;
7969                         }
7970                         if (test_var > uint_max) {
7971                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7972                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7973                                 return -1;
7974                         }
7975                         object->reserved = test_var;
7976                 } else if (PyInt_Check(value)) {
7977                         long test_var;
7978                         test_var = PyInt_AsLong(value);
7979                         if (test_var < 0 || test_var > uint_max) {
7980                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7981                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7982                                 return -1;
7983                         }
7984                         object->reserved = test_var;
7985                 } else {
7986                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7987                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7988                         return -1;
7989                 }
7990         }
7991         return 0;
7992 }
7993
7994 static PyGetSetDef py_lsa_DomainInfoKerberos_getsetters[] = {
7995         { discard_const_p(char, "authentication_options"), py_lsa_DomainInfoKerberos_get_authentication_options, py_lsa_DomainInfoKerberos_set_authentication_options },
7996         { discard_const_p(char, "service_tkt_lifetime"), py_lsa_DomainInfoKerberos_get_service_tkt_lifetime, py_lsa_DomainInfoKerberos_set_service_tkt_lifetime },
7997         { discard_const_p(char, "user_tkt_lifetime"), py_lsa_DomainInfoKerberos_get_user_tkt_lifetime, py_lsa_DomainInfoKerberos_set_user_tkt_lifetime },
7998         { discard_const_p(char, "user_tkt_renewaltime"), py_lsa_DomainInfoKerberos_get_user_tkt_renewaltime, py_lsa_DomainInfoKerberos_set_user_tkt_renewaltime },
7999         { discard_const_p(char, "clock_skew"), py_lsa_DomainInfoKerberos_get_clock_skew, py_lsa_DomainInfoKerberos_set_clock_skew },
8000         { discard_const_p(char, "reserved"), py_lsa_DomainInfoKerberos_get_reserved, py_lsa_DomainInfoKerberos_set_reserved },
8001         { NULL }
8002 };
8003
8004 static PyObject *py_lsa_DomainInfoKerberos_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8005 {
8006         return pytalloc_new(struct lsa_DomainInfoKerberos, type);
8007 }
8008
8009
8010 static PyTypeObject lsa_DomainInfoKerberos_Type = {
8011         PyObject_HEAD_INIT(NULL) 0,
8012         .tp_name = "lsa.DomainInfoKerberos",
8013         .tp_getset = py_lsa_DomainInfoKerberos_getsetters,
8014         .tp_methods = NULL,
8015         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8016         .tp_basicsize = sizeof(pytalloc_Object),
8017         .tp_new = py_lsa_DomainInfoKerberos_new,
8018 };
8019
8020
8021 static PyObject *py_lsa_DomainInfoEfs_get_blob_size(PyObject *obj, void *closure)
8022 {
8023         struct lsa_DomainInfoEfs *object = (struct lsa_DomainInfoEfs *)pytalloc_get_ptr(obj);
8024         PyObject *py_blob_size;
8025         py_blob_size = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->blob_size);
8026         return py_blob_size;
8027 }
8028
8029 static int py_lsa_DomainInfoEfs_set_blob_size(PyObject *py_obj, PyObject *value, void *closure)
8030 {
8031         struct lsa_DomainInfoEfs *object = (struct lsa_DomainInfoEfs *)pytalloc_get_ptr(py_obj);
8032         {
8033                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->blob_size));
8034                 if (PyLong_Check(value)) {
8035                         unsigned long long test_var;
8036                         test_var = PyLong_AsUnsignedLongLong(value);
8037                         if (PyErr_Occurred() != NULL) {
8038                                 return -1;
8039                         }
8040                         if (test_var > uint_max) {
8041                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8042                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8043                                 return -1;
8044                         }
8045                         object->blob_size = test_var;
8046                 } else if (PyInt_Check(value)) {
8047                         long test_var;
8048                         test_var = PyInt_AsLong(value);
8049                         if (test_var < 0 || test_var > uint_max) {
8050                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8051                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8052                                 return -1;
8053                         }
8054                         object->blob_size = test_var;
8055                 } else {
8056                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8057                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8058                         return -1;
8059                 }
8060         }
8061         return 0;
8062 }
8063
8064 static PyObject *py_lsa_DomainInfoEfs_get_efs_blob(PyObject *obj, void *closure)
8065 {
8066         struct lsa_DomainInfoEfs *object = (struct lsa_DomainInfoEfs *)pytalloc_get_ptr(obj);
8067         PyObject *py_efs_blob;
8068         if (object->efs_blob == NULL) {
8069                 py_efs_blob = Py_None;
8070                 Py_INCREF(py_efs_blob);
8071         } else {
8072                 py_efs_blob = PyList_New(object->blob_size);
8073                 if (py_efs_blob == NULL) {
8074                         return NULL;
8075                 }
8076                 {
8077                         int efs_blob_cntr_1;
8078                         for (efs_blob_cntr_1 = 0; efs_blob_cntr_1 < (object->blob_size); efs_blob_cntr_1++) {
8079                                 PyObject *py_efs_blob_1;
8080                                 py_efs_blob_1 = PyInt_FromLong((uint16_t)object->efs_blob[efs_blob_cntr_1]);
8081                                 PyList_SetItem(py_efs_blob, efs_blob_cntr_1, py_efs_blob_1);
8082                         }
8083                 }
8084         }
8085         return py_efs_blob;
8086 }
8087
8088 static int py_lsa_DomainInfoEfs_set_efs_blob(PyObject *py_obj, PyObject *value, void *closure)
8089 {
8090         struct lsa_DomainInfoEfs *object = (struct lsa_DomainInfoEfs *)pytalloc_get_ptr(py_obj);
8091         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->efs_blob));
8092         if (value == Py_None) {
8093                 object->efs_blob = NULL;
8094         } else {
8095                 object->efs_blob = NULL;
8096                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8097                 {
8098                         int efs_blob_cntr_1;
8099                         object->efs_blob = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->efs_blob, PyList_GET_SIZE(value));
8100                         if (!object->efs_blob) { return -1;; }
8101                         talloc_set_name_const(object->efs_blob, "ARRAY: object->efs_blob");
8102                         for (efs_blob_cntr_1 = 0; efs_blob_cntr_1 < PyList_GET_SIZE(value); efs_blob_cntr_1++) {
8103                                 {
8104                                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->efs_blob[efs_blob_cntr_1]));
8105                                         if (PyLong_Check(PyList_GET_ITEM(value, efs_blob_cntr_1))) {
8106                                                 unsigned long long test_var;
8107                                                 test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, efs_blob_cntr_1));
8108                                                 if (PyErr_Occurred() != NULL) {
8109                                                         return -1;
8110                                                 }
8111                                                 if (test_var > uint_max) {
8112                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8113                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8114                                                         return -1;
8115                                                 }
8116                                                 object->efs_blob[efs_blob_cntr_1] = test_var;
8117                                         } else if (PyInt_Check(PyList_GET_ITEM(value, efs_blob_cntr_1))) {
8118                                                 long test_var;
8119                                                 test_var = PyInt_AsLong(PyList_GET_ITEM(value, efs_blob_cntr_1));
8120                                                 if (test_var < 0 || test_var > uint_max) {
8121                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8122                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8123                                                         return -1;
8124                                                 }
8125                                                 object->efs_blob[efs_blob_cntr_1] = test_var;
8126                                         } else {
8127                                                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8128                                                   PyInt_Type.tp_name, PyLong_Type.tp_name);
8129                                                 return -1;
8130                                         }
8131                                 }
8132                         }
8133                 }
8134         }
8135         return 0;
8136 }
8137
8138 static PyGetSetDef py_lsa_DomainInfoEfs_getsetters[] = {
8139         { discard_const_p(char, "blob_size"), py_lsa_DomainInfoEfs_get_blob_size, py_lsa_DomainInfoEfs_set_blob_size },
8140         { discard_const_p(char, "efs_blob"), py_lsa_DomainInfoEfs_get_efs_blob, py_lsa_DomainInfoEfs_set_efs_blob },
8141         { NULL }
8142 };
8143
8144 static PyObject *py_lsa_DomainInfoEfs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8145 {
8146         return pytalloc_new(struct lsa_DomainInfoEfs, type);
8147 }
8148
8149
8150 static PyTypeObject lsa_DomainInfoEfs_Type = {
8151         PyObject_HEAD_INIT(NULL) 0,
8152         .tp_name = "lsa.DomainInfoEfs",
8153         .tp_getset = py_lsa_DomainInfoEfs_getsetters,
8154         .tp_methods = NULL,
8155         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8156         .tp_basicsize = sizeof(pytalloc_Object),
8157         .tp_new = py_lsa_DomainInfoEfs_new,
8158 };
8159
8160 PyObject *py_import_lsa_DomainInformationPolicy(TALLOC_CTX *mem_ctx, int level, union lsa_DomainInformationPolicy *in)
8161 {
8162         PyObject *ret;
8163
8164         switch (level) {
8165                 case LSA_DOMAIN_INFO_POLICY_EFS:
8166                         ret = pytalloc_reference_ex(&lsa_DomainInfoEfs_Type, mem_ctx, &in->efs_info);
8167                         return ret;
8168
8169                 case LSA_DOMAIN_INFO_POLICY_KERBEROS:
8170                         ret = pytalloc_reference_ex(&lsa_DomainInfoKerberos_Type, mem_ctx, &in->kerberos_info);
8171                         return ret;
8172
8173         }
8174         PyErr_SetString(PyExc_TypeError, "unknown union level");
8175         return NULL;
8176 }
8177
8178 union lsa_DomainInformationPolicy *py_export_lsa_DomainInformationPolicy(TALLOC_CTX *mem_ctx, int level, PyObject *in)
8179 {
8180         union lsa_DomainInformationPolicy *ret = talloc_zero(mem_ctx, union lsa_DomainInformationPolicy);
8181         switch (level) {
8182                 case LSA_DOMAIN_INFO_POLICY_EFS:
8183                         PY_CHECK_TYPE(&lsa_DomainInfoEfs_Type, in, talloc_free(ret); return NULL;);
8184                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8185                                 PyErr_NoMemory();
8186                                 talloc_free(ret); return NULL;
8187                         }
8188                         ret->efs_info = *(struct lsa_DomainInfoEfs *)pytalloc_get_ptr(in);
8189                         break;
8190
8191                 case LSA_DOMAIN_INFO_POLICY_KERBEROS:
8192                         PY_CHECK_TYPE(&lsa_DomainInfoKerberos_Type, in, talloc_free(ret); return NULL;);
8193                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8194                                 PyErr_NoMemory();
8195                                 talloc_free(ret); return NULL;
8196                         }
8197                         ret->kerberos_info = *(struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(in);
8198                         break;
8199
8200                 default:
8201                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
8202                         talloc_free(ret);
8203                         ret = NULL;
8204         }
8205
8206         return ret;
8207 }
8208
8209
8210 static PyObject *py_lsa_TranslatedName2_get_sid_type(PyObject *obj, void *closure)
8211 {
8212         struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(obj);
8213         PyObject *py_sid_type;
8214         py_sid_type = PyInt_FromLong((uint16_t)object->sid_type);
8215         return py_sid_type;
8216 }
8217
8218 static int py_lsa_TranslatedName2_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
8219 {
8220         struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
8221         {
8222                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
8223                 if (PyLong_Check(value)) {
8224                         unsigned long long test_var;
8225                         test_var = PyLong_AsUnsignedLongLong(value);
8226                         if (PyErr_Occurred() != NULL) {
8227                                 return -1;
8228                         }
8229                         if (test_var > uint_max) {
8230                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8231                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8232                                 return -1;
8233                         }
8234                         object->sid_type = test_var;
8235                 } else if (PyInt_Check(value)) {
8236                         long test_var;
8237                         test_var = PyInt_AsLong(value);
8238                         if (test_var < 0 || test_var > uint_max) {
8239                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8240                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8241                                 return -1;
8242                         }
8243                         object->sid_type = test_var;
8244                 } else {
8245                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8246                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8247                         return -1;
8248                 }
8249         }
8250         return 0;
8251 }
8252
8253 static PyObject *py_lsa_TranslatedName2_get_name(PyObject *obj, void *closure)
8254 {
8255         struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(obj);
8256         PyObject *py_name;
8257         py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
8258         return py_name;
8259 }
8260
8261 static int py_lsa_TranslatedName2_set_name(PyObject *py_obj, PyObject *value, void *closure)
8262 {
8263         struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
8264         PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
8265         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8266                 PyErr_NoMemory();
8267                 return -1;
8268         }
8269         object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
8270         return 0;
8271 }
8272
8273 static PyObject *py_lsa_TranslatedName2_get_sid_index(PyObject *obj, void *closure)
8274 {
8275         struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(obj);
8276         PyObject *py_sid_index;
8277         py_sid_index = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
8278         return py_sid_index;
8279 }
8280
8281 static int py_lsa_TranslatedName2_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
8282 {
8283         struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
8284         {
8285                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
8286                 if (PyLong_Check(value)) {
8287                         unsigned long long test_var;
8288                         test_var = PyLong_AsUnsignedLongLong(value);
8289                         if (PyErr_Occurred() != NULL) {
8290                                 return -1;
8291                         }
8292                         if (test_var > uint_max) {
8293                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8294                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8295                                 return -1;
8296                         }
8297                         object->sid_index = test_var;
8298                 } else if (PyInt_Check(value)) {
8299                         long test_var;
8300                         test_var = PyInt_AsLong(value);
8301                         if (test_var < 0 || test_var > uint_max) {
8302                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8303                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8304                                 return -1;
8305                         }
8306                         object->sid_index = test_var;
8307                 } else {
8308                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8309                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8310                         return -1;
8311                 }
8312         }
8313         return 0;
8314 }
8315
8316 static PyObject *py_lsa_TranslatedName2_get_unknown(PyObject *obj, void *closure)
8317 {
8318         struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(obj);
8319         PyObject *py_unknown;
8320         py_unknown = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->unknown);
8321         return py_unknown;
8322 }
8323
8324 static int py_lsa_TranslatedName2_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
8325 {
8326         struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
8327         {
8328                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
8329                 if (PyLong_Check(value)) {
8330                         unsigned long long test_var;
8331                         test_var = PyLong_AsUnsignedLongLong(value);
8332                         if (PyErr_Occurred() != NULL) {
8333                                 return -1;
8334                         }
8335                         if (test_var > uint_max) {
8336                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8337                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8338                                 return -1;
8339                         }
8340                         object->unknown = test_var;
8341                 } else if (PyInt_Check(value)) {
8342                         long test_var;
8343                         test_var = PyInt_AsLong(value);
8344                         if (test_var < 0 || test_var > uint_max) {
8345                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8346                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8347                                 return -1;
8348                         }
8349                         object->unknown = test_var;
8350                 } else {
8351                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8352                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8353                         return -1;
8354                 }
8355         }
8356         return 0;
8357 }
8358
8359 static PyGetSetDef py_lsa_TranslatedName2_getsetters[] = {
8360         { discard_const_p(char, "sid_type"), py_lsa_TranslatedName2_get_sid_type, py_lsa_TranslatedName2_set_sid_type },
8361         { discard_const_p(char, "name"), py_lsa_TranslatedName2_get_name, py_lsa_TranslatedName2_set_name },
8362         { discard_const_p(char, "sid_index"), py_lsa_TranslatedName2_get_sid_index, py_lsa_TranslatedName2_set_sid_index },
8363         { discard_const_p(char, "unknown"), py_lsa_TranslatedName2_get_unknown, py_lsa_TranslatedName2_set_unknown },
8364         { NULL }
8365 };
8366
8367 static PyObject *py_lsa_TranslatedName2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8368 {
8369         return pytalloc_new(struct lsa_TranslatedName2, type);
8370 }
8371
8372
8373 static PyTypeObject lsa_TranslatedName2_Type = {
8374         PyObject_HEAD_INIT(NULL) 0,
8375         .tp_name = "lsa.TranslatedName2",
8376         .tp_getset = py_lsa_TranslatedName2_getsetters,
8377         .tp_methods = NULL,
8378         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8379         .tp_basicsize = sizeof(pytalloc_Object),
8380         .tp_new = py_lsa_TranslatedName2_new,
8381 };
8382
8383
8384 static PyObject *py_lsa_TransNameArray2_get_count(PyObject *obj, void *closure)
8385 {
8386         struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(obj);
8387         PyObject *py_count;
8388         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
8389         return py_count;
8390 }
8391
8392 static int py_lsa_TransNameArray2_set_count(PyObject *py_obj, PyObject *value, void *closure)
8393 {
8394         struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_obj);
8395         {
8396                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
8397                 if (PyLong_Check(value)) {
8398                         unsigned long long test_var;
8399                         test_var = PyLong_AsUnsignedLongLong(value);
8400                         if (PyErr_Occurred() != NULL) {
8401                                 return -1;
8402                         }
8403                         if (test_var > uint_max) {
8404                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8405                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8406                                 return -1;
8407                         }
8408                         object->count = test_var;
8409                 } else if (PyInt_Check(value)) {
8410                         long test_var;
8411                         test_var = PyInt_AsLong(value);
8412                         if (test_var < 0 || test_var > uint_max) {
8413                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8414                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8415                                 return -1;
8416                         }
8417                         object->count = test_var;
8418                 } else {
8419                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8420                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8421                         return -1;
8422                 }
8423         }
8424         return 0;
8425 }
8426
8427 static PyObject *py_lsa_TransNameArray2_get_names(PyObject *obj, void *closure)
8428 {
8429         struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(obj);
8430         PyObject *py_names;
8431         if (object->names == NULL) {
8432                 py_names = Py_None;
8433                 Py_INCREF(py_names);
8434         } else {
8435                 py_names = PyList_New(object->count);
8436                 if (py_names == NULL) {
8437                         return NULL;
8438                 }
8439                 {
8440                         int names_cntr_1;
8441                         for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
8442                                 PyObject *py_names_1;
8443                                 py_names_1 = pytalloc_reference_ex(&lsa_TranslatedName2_Type, object->names, &object->names[names_cntr_1]);
8444                                 PyList_SetItem(py_names, names_cntr_1, py_names_1);
8445                         }
8446                 }
8447         }
8448         return py_names;
8449 }
8450
8451 static int py_lsa_TransNameArray2_set_names(PyObject *py_obj, PyObject *value, void *closure)
8452 {
8453         struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_obj);
8454         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
8455         if (value == Py_None) {
8456                 object->names = NULL;
8457         } else {
8458                 object->names = NULL;
8459                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8460                 {
8461                         int names_cntr_1;
8462                         object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
8463                         if (!object->names) { return -1;; }
8464                         talloc_set_name_const(object->names, "ARRAY: object->names");
8465                         for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
8466                                 PY_CHECK_TYPE(&lsa_TranslatedName2_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
8467                                 if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
8468                                         PyErr_NoMemory();
8469                                         return -1;
8470                                 }
8471                                 object->names[names_cntr_1] = *(struct lsa_TranslatedName2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
8472                         }
8473                 }
8474         }
8475         return 0;
8476 }
8477
8478 static PyGetSetDef py_lsa_TransNameArray2_getsetters[] = {
8479         { discard_const_p(char, "count"), py_lsa_TransNameArray2_get_count, py_lsa_TransNameArray2_set_count },
8480         { discard_const_p(char, "names"), py_lsa_TransNameArray2_get_names, py_lsa_TransNameArray2_set_names },
8481         { NULL }
8482 };
8483
8484 static PyObject *py_lsa_TransNameArray2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8485 {
8486         return pytalloc_new(struct lsa_TransNameArray2, type);
8487 }
8488
8489
8490 static PyTypeObject lsa_TransNameArray2_Type = {
8491         PyObject_HEAD_INIT(NULL) 0,
8492         .tp_name = "lsa.TransNameArray2",
8493         .tp_getset = py_lsa_TransNameArray2_getsetters,
8494         .tp_methods = NULL,
8495         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8496         .tp_basicsize = sizeof(pytalloc_Object),
8497         .tp_new = py_lsa_TransNameArray2_new,
8498 };
8499
8500
8501 static PyObject *py_lsa_TranslatedSid2_get_sid_type(PyObject *obj, void *closure)
8502 {
8503         struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(obj);
8504         PyObject *py_sid_type;
8505         py_sid_type = PyInt_FromLong((uint16_t)object->sid_type);
8506         return py_sid_type;
8507 }
8508
8509 static int py_lsa_TranslatedSid2_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
8510 {
8511         struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
8512         {
8513                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
8514                 if (PyLong_Check(value)) {
8515                         unsigned long long test_var;
8516                         test_var = PyLong_AsUnsignedLongLong(value);
8517                         if (PyErr_Occurred() != NULL) {
8518                                 return -1;
8519                         }
8520                         if (test_var > uint_max) {
8521                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8522                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8523                                 return -1;
8524                         }
8525                         object->sid_type = test_var;
8526                 } else if (PyInt_Check(value)) {
8527                         long test_var;
8528                         test_var = PyInt_AsLong(value);
8529                         if (test_var < 0 || test_var > uint_max) {
8530                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8531                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8532                                 return -1;
8533                         }
8534                         object->sid_type = test_var;
8535                 } else {
8536                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8537                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8538                         return -1;
8539                 }
8540         }
8541         return 0;
8542 }
8543
8544 static PyObject *py_lsa_TranslatedSid2_get_rid(PyObject *obj, void *closure)
8545 {
8546         struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(obj);
8547         PyObject *py_rid;
8548         py_rid = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->rid);
8549         return py_rid;
8550 }
8551
8552 static int py_lsa_TranslatedSid2_set_rid(PyObject *py_obj, PyObject *value, void *closure)
8553 {
8554         struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
8555         {
8556                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
8557                 if (PyLong_Check(value)) {
8558                         unsigned long long test_var;
8559                         test_var = PyLong_AsUnsignedLongLong(value);
8560                         if (PyErr_Occurred() != NULL) {
8561                                 return -1;
8562                         }
8563                         if (test_var > uint_max) {
8564                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8565                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8566                                 return -1;
8567                         }
8568                         object->rid = test_var;
8569                 } else if (PyInt_Check(value)) {
8570                         long test_var;
8571                         test_var = PyInt_AsLong(value);
8572                         if (test_var < 0 || test_var > uint_max) {
8573                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8574                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8575                                 return -1;
8576                         }
8577                         object->rid = test_var;
8578                 } else {
8579                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8580                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8581                         return -1;
8582                 }
8583         }
8584         return 0;
8585 }
8586
8587 static PyObject *py_lsa_TranslatedSid2_get_sid_index(PyObject *obj, void *closure)
8588 {
8589         struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(obj);
8590         PyObject *py_sid_index;
8591         py_sid_index = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
8592         return py_sid_index;
8593 }
8594
8595 static int py_lsa_TranslatedSid2_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
8596 {
8597         struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
8598         {
8599                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
8600                 if (PyLong_Check(value)) {
8601                         unsigned long long test_var;
8602                         test_var = PyLong_AsUnsignedLongLong(value);
8603                         if (PyErr_Occurred() != NULL) {
8604                                 return -1;
8605                         }
8606                         if (test_var > uint_max) {
8607                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8608                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8609                                 return -1;
8610                         }
8611                         object->sid_index = test_var;
8612                 } else if (PyInt_Check(value)) {
8613                         long test_var;
8614                         test_var = PyInt_AsLong(value);
8615                         if (test_var < 0 || test_var > uint_max) {
8616                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8617                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8618                                 return -1;
8619                         }
8620                         object->sid_index = test_var;
8621                 } else {
8622                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8623                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8624                         return -1;
8625                 }
8626         }
8627         return 0;
8628 }
8629
8630 static PyObject *py_lsa_TranslatedSid2_get_unknown(PyObject *obj, void *closure)
8631 {
8632         struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(obj);
8633         PyObject *py_unknown;
8634         py_unknown = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->unknown);
8635         return py_unknown;
8636 }
8637
8638 static int py_lsa_TranslatedSid2_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
8639 {
8640         struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
8641         {
8642                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
8643                 if (PyLong_Check(value)) {
8644                         unsigned long long test_var;
8645                         test_var = PyLong_AsUnsignedLongLong(value);
8646                         if (PyErr_Occurred() != NULL) {
8647                                 return -1;
8648                         }
8649                         if (test_var > uint_max) {
8650                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8651                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8652                                 return -1;
8653                         }
8654                         object->unknown = test_var;
8655                 } else if (PyInt_Check(value)) {
8656                         long test_var;
8657                         test_var = PyInt_AsLong(value);
8658                         if (test_var < 0 || test_var > uint_max) {
8659                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8660                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8661                                 return -1;
8662                         }
8663                         object->unknown = test_var;
8664                 } else {
8665                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8666                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8667                         return -1;
8668                 }
8669         }
8670         return 0;
8671 }
8672
8673 static PyGetSetDef py_lsa_TranslatedSid2_getsetters[] = {
8674         { discard_const_p(char, "sid_type"), py_lsa_TranslatedSid2_get_sid_type, py_lsa_TranslatedSid2_set_sid_type },
8675         { discard_const_p(char, "rid"), py_lsa_TranslatedSid2_get_rid, py_lsa_TranslatedSid2_set_rid },
8676         { discard_const_p(char, "sid_index"), py_lsa_TranslatedSid2_get_sid_index, py_lsa_TranslatedSid2_set_sid_index },
8677         { discard_const_p(char, "unknown"), py_lsa_TranslatedSid2_get_unknown, py_lsa_TranslatedSid2_set_unknown },
8678         { NULL }
8679 };
8680
8681 static PyObject *py_lsa_TranslatedSid2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8682 {
8683         return pytalloc_new(struct lsa_TranslatedSid2, type);
8684 }
8685
8686
8687 static PyTypeObject lsa_TranslatedSid2_Type = {
8688         PyObject_HEAD_INIT(NULL) 0,
8689         .tp_name = "lsa.TranslatedSid2",
8690         .tp_getset = py_lsa_TranslatedSid2_getsetters,
8691         .tp_methods = NULL,
8692         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8693         .tp_basicsize = sizeof(pytalloc_Object),
8694         .tp_new = py_lsa_TranslatedSid2_new,
8695 };
8696
8697
8698 static PyObject *py_lsa_TransSidArray2_get_count(PyObject *obj, void *closure)
8699 {
8700         struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(obj);
8701         PyObject *py_count;
8702         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
8703         return py_count;
8704 }
8705
8706 static int py_lsa_TransSidArray2_set_count(PyObject *py_obj, PyObject *value, void *closure)
8707 {
8708         struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(py_obj);
8709         {
8710                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
8711                 if (PyLong_Check(value)) {
8712                         unsigned long long test_var;
8713                         test_var = PyLong_AsUnsignedLongLong(value);
8714                         if (PyErr_Occurred() != NULL) {
8715                                 return -1;
8716                         }
8717                         if (test_var > uint_max) {
8718                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8719                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8720                                 return -1;
8721                         }
8722                         object->count = test_var;
8723                 } else if (PyInt_Check(value)) {
8724                         long test_var;
8725                         test_var = PyInt_AsLong(value);
8726                         if (test_var < 0 || test_var > uint_max) {
8727                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8728                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8729                                 return -1;
8730                         }
8731                         object->count = test_var;
8732                 } else {
8733                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8734                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8735                         return -1;
8736                 }
8737         }
8738         return 0;
8739 }
8740
8741 static PyObject *py_lsa_TransSidArray2_get_sids(PyObject *obj, void *closure)
8742 {
8743         struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(obj);
8744         PyObject *py_sids;
8745         if (object->sids == NULL) {
8746                 py_sids = Py_None;
8747                 Py_INCREF(py_sids);
8748         } else {
8749                 py_sids = PyList_New(object->count);
8750                 if (py_sids == NULL) {
8751                         return NULL;
8752                 }
8753                 {
8754                         int sids_cntr_1;
8755                         for (sids_cntr_1 = 0; sids_cntr_1 < (object->count); sids_cntr_1++) {
8756                                 PyObject *py_sids_1;
8757                                 py_sids_1 = pytalloc_reference_ex(&lsa_TranslatedSid2_Type, object->sids, &object->sids[sids_cntr_1]);
8758                                 PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
8759                         }
8760                 }
8761         }
8762         return py_sids;
8763 }
8764
8765 static int py_lsa_TransSidArray2_set_sids(PyObject *py_obj, PyObject *value, void *closure)
8766 {
8767         struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(py_obj);
8768         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
8769         if (value == Py_None) {
8770                 object->sids = NULL;
8771         } else {
8772                 object->sids = NULL;
8773                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8774                 {
8775                         int sids_cntr_1;
8776                         object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
8777                         if (!object->sids) { return -1;; }
8778                         talloc_set_name_const(object->sids, "ARRAY: object->sids");
8779                         for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
8780                                 PY_CHECK_TYPE(&lsa_TranslatedSid2_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
8781                                 if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
8782                                         PyErr_NoMemory();
8783                                         return -1;
8784                                 }
8785                                 object->sids[sids_cntr_1] = *(struct lsa_TranslatedSid2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
8786                         }
8787                 }
8788         }
8789         return 0;
8790 }
8791
8792 static PyGetSetDef py_lsa_TransSidArray2_getsetters[] = {
8793         { discard_const_p(char, "count"), py_lsa_TransSidArray2_get_count, py_lsa_TransSidArray2_set_count },
8794         { discard_const_p(char, "sids"), py_lsa_TransSidArray2_get_sids, py_lsa_TransSidArray2_set_sids },
8795         { NULL }
8796 };
8797
8798 static PyObject *py_lsa_TransSidArray2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8799 {
8800         return pytalloc_new(struct lsa_TransSidArray2, type);
8801 }
8802
8803
8804 static PyTypeObject lsa_TransSidArray2_Type = {
8805         PyObject_HEAD_INIT(NULL) 0,
8806         .tp_name = "lsa.TransSidArray2",
8807         .tp_getset = py_lsa_TransSidArray2_getsetters,
8808         .tp_methods = NULL,
8809         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8810         .tp_basicsize = sizeof(pytalloc_Object),
8811         .tp_new = py_lsa_TransSidArray2_new,
8812 };
8813
8814
8815 static PyObject *py_lsa_TranslatedSid3_get_sid_type(PyObject *obj, void *closure)
8816 {
8817         struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
8818         PyObject *py_sid_type;
8819         py_sid_type = PyInt_FromLong((uint16_t)object->sid_type);
8820         return py_sid_type;
8821 }
8822
8823 static int py_lsa_TranslatedSid3_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
8824 {
8825         struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
8826         {
8827                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
8828                 if (PyLong_Check(value)) {
8829                         unsigned long long test_var;
8830                         test_var = PyLong_AsUnsignedLongLong(value);
8831                         if (PyErr_Occurred() != NULL) {
8832                                 return -1;
8833                         }
8834                         if (test_var > uint_max) {
8835                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8836                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8837                                 return -1;
8838                         }
8839                         object->sid_type = test_var;
8840                 } else if (PyInt_Check(value)) {
8841                         long test_var;
8842                         test_var = PyInt_AsLong(value);
8843                         if (test_var < 0 || test_var > uint_max) {
8844                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8845                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8846                                 return -1;
8847                         }
8848                         object->sid_type = test_var;
8849                 } else {
8850                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8851                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8852                         return -1;
8853                 }
8854         }
8855         return 0;
8856 }
8857
8858 static PyObject *py_lsa_TranslatedSid3_get_sid(PyObject *obj, void *closure)
8859 {
8860         struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
8861         PyObject *py_sid;
8862         if (object->sid == NULL) {
8863                 py_sid = Py_None;
8864                 Py_INCREF(py_sid);
8865         } else {
8866                 py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
8867         }
8868         return py_sid;
8869 }
8870
8871 static int py_lsa_TranslatedSid3_set_sid(PyObject *py_obj, PyObject *value, void *closure)
8872 {
8873         struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
8874         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
8875         if (value == Py_None) {
8876                 object->sid = NULL;
8877         } else {
8878                 object->sid = NULL;
8879                 PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
8880                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8881                         PyErr_NoMemory();
8882                         return -1;
8883                 }
8884                 object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
8885         }
8886         return 0;
8887 }
8888
8889 static PyObject *py_lsa_TranslatedSid3_get_sid_index(PyObject *obj, void *closure)
8890 {
8891         struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
8892         PyObject *py_sid_index;
8893         py_sid_index = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
8894         return py_sid_index;
8895 }
8896
8897 static int py_lsa_TranslatedSid3_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
8898 {
8899         struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
8900         {
8901                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
8902                 if (PyLong_Check(value)) {
8903                         unsigned long long test_var;
8904                         test_var = PyLong_AsUnsignedLongLong(value);
8905                         if (PyErr_Occurred() != NULL) {
8906                                 return -1;
8907                         }
8908                         if (test_var > uint_max) {
8909                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8910                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8911                                 return -1;
8912                         }
8913                         object->sid_index = test_var;
8914                 } else if (PyInt_Check(value)) {
8915                         long test_var;
8916                         test_var = PyInt_AsLong(value);
8917                         if (test_var < 0 || test_var > uint_max) {
8918                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8919                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8920                                 return -1;
8921                         }
8922                         object->sid_index = test_var;
8923                 } else {
8924                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8925                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8926                         return -1;
8927                 }
8928         }
8929         return 0;
8930 }
8931
8932 static PyObject *py_lsa_TranslatedSid3_get_flags(PyObject *obj, void *closure)
8933 {
8934         struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
8935         PyObject *py_flags;
8936         py_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->flags);
8937         return py_flags;
8938 }
8939
8940 static int py_lsa_TranslatedSid3_set_flags(PyObject *py_obj, PyObject *value, void *closure)
8941 {
8942         struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
8943         {
8944                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
8945                 if (PyLong_Check(value)) {
8946                         unsigned long long test_var;
8947                         test_var = PyLong_AsUnsignedLongLong(value);
8948                         if (PyErr_Occurred() != NULL) {
8949                                 return -1;
8950                         }
8951                         if (test_var > uint_max) {
8952                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8953                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8954                                 return -1;
8955                         }
8956                         object->flags = test_var;
8957                 } else if (PyInt_Check(value)) {
8958                         long test_var;
8959                         test_var = PyInt_AsLong(value);
8960                         if (test_var < 0 || test_var > uint_max) {
8961                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8962                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8963                                 return -1;
8964                         }
8965                         object->flags = test_var;
8966                 } else {
8967                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8968                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8969                         return -1;
8970                 }
8971         }
8972         return 0;
8973 }
8974
8975 static PyGetSetDef py_lsa_TranslatedSid3_getsetters[] = {
8976         { discard_const_p(char, "sid_type"), py_lsa_TranslatedSid3_get_sid_type, py_lsa_TranslatedSid3_set_sid_type },
8977         { discard_const_p(char, "sid"), py_lsa_TranslatedSid3_get_sid, py_lsa_TranslatedSid3_set_sid },
8978         { discard_const_p(char, "sid_index"), py_lsa_TranslatedSid3_get_sid_index, py_lsa_TranslatedSid3_set_sid_index },
8979         { discard_const_p(char, "flags"), py_lsa_TranslatedSid3_get_flags, py_lsa_TranslatedSid3_set_flags },
8980         { NULL }
8981 };
8982
8983 static PyObject *py_lsa_TranslatedSid3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8984 {
8985         return pytalloc_new(struct lsa_TranslatedSid3, type);
8986 }
8987
8988
8989 static PyTypeObject lsa_TranslatedSid3_Type = {
8990         PyObject_HEAD_INIT(NULL) 0,
8991         .tp_name = "lsa.TranslatedSid3",
8992         .tp_getset = py_lsa_TranslatedSid3_getsetters,
8993         .tp_methods = NULL,
8994         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8995         .tp_basicsize = sizeof(pytalloc_Object),
8996         .tp_new = py_lsa_TranslatedSid3_new,
8997 };
8998
8999
9000 static PyObject *py_lsa_TransSidArray3_get_count(PyObject *obj, void *closure)
9001 {
9002         struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(obj);
9003         PyObject *py_count;
9004         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
9005         return py_count;
9006 }
9007
9008 static int py_lsa_TransSidArray3_set_count(PyObject *py_obj, PyObject *value, void *closure)
9009 {
9010         struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_obj);
9011         {
9012                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
9013                 if (PyLong_Check(value)) {
9014                         unsigned long long test_var;
9015                         test_var = PyLong_AsUnsignedLongLong(value);
9016                         if (PyErr_Occurred() != NULL) {
9017                                 return -1;
9018                         }
9019                         if (test_var > uint_max) {
9020                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9021                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9022                                 return -1;
9023                         }
9024                         object->count = test_var;
9025                 } else if (PyInt_Check(value)) {
9026                         long test_var;
9027                         test_var = PyInt_AsLong(value);
9028                         if (test_var < 0 || test_var > uint_max) {
9029                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9030                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9031                                 return -1;
9032                         }
9033                         object->count = test_var;
9034                 } else {
9035                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9036                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9037                         return -1;
9038                 }
9039         }
9040         return 0;
9041 }
9042
9043 static PyObject *py_lsa_TransSidArray3_get_sids(PyObject *obj, void *closure)
9044 {
9045         struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(obj);
9046         PyObject *py_sids;
9047         if (object->sids == NULL) {
9048                 py_sids = Py_None;
9049                 Py_INCREF(py_sids);
9050         } else {
9051                 py_sids = PyList_New(object->count);
9052                 if (py_sids == NULL) {
9053                         return NULL;
9054                 }
9055                 {
9056                         int sids_cntr_1;
9057                         for (sids_cntr_1 = 0; sids_cntr_1 < (object->count); sids_cntr_1++) {
9058                                 PyObject *py_sids_1;
9059                                 py_sids_1 = pytalloc_reference_ex(&lsa_TranslatedSid3_Type, object->sids, &object->sids[sids_cntr_1]);
9060                                 PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
9061                         }
9062                 }
9063         }
9064         return py_sids;
9065 }
9066
9067 static int py_lsa_TransSidArray3_set_sids(PyObject *py_obj, PyObject *value, void *closure)
9068 {
9069         struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_obj);
9070         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
9071         if (value == Py_None) {
9072                 object->sids = NULL;
9073         } else {
9074                 object->sids = NULL;
9075                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9076                 {
9077                         int sids_cntr_1;
9078                         object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
9079                         if (!object->sids) { return -1;; }
9080                         talloc_set_name_const(object->sids, "ARRAY: object->sids");
9081                         for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
9082                                 PY_CHECK_TYPE(&lsa_TranslatedSid3_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
9083                                 if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
9084                                         PyErr_NoMemory();
9085                                         return -1;
9086                                 }
9087                                 object->sids[sids_cntr_1] = *(struct lsa_TranslatedSid3 *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
9088                         }
9089                 }
9090         }
9091         return 0;
9092 }
9093
9094 static PyGetSetDef py_lsa_TransSidArray3_getsetters[] = {
9095         { discard_const_p(char, "count"), py_lsa_TransSidArray3_get_count, py_lsa_TransSidArray3_set_count },
9096         { discard_const_p(char, "sids"), py_lsa_TransSidArray3_get_sids, py_lsa_TransSidArray3_set_sids },
9097         { NULL }
9098 };
9099
9100 static PyObject *py_lsa_TransSidArray3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9101 {
9102         return pytalloc_new(struct lsa_TransSidArray3, type);
9103 }
9104
9105
9106 static PyTypeObject lsa_TransSidArray3_Type = {
9107         PyObject_HEAD_INIT(NULL) 0,
9108         .tp_name = "lsa.TransSidArray3",
9109         .tp_getset = py_lsa_TransSidArray3_getsetters,
9110         .tp_methods = NULL,
9111         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9112         .tp_basicsize = sizeof(pytalloc_Object),
9113         .tp_new = py_lsa_TransSidArray3_new,
9114 };
9115
9116
9117 static PyObject *py_lsa_ForestTrustBinaryData_get_length(PyObject *obj, void *closure)
9118 {
9119         struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(obj);
9120         PyObject *py_length;
9121         py_length = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->length);
9122         return py_length;
9123 }
9124
9125 static int py_lsa_ForestTrustBinaryData_set_length(PyObject *py_obj, PyObject *value, void *closure)
9126 {
9127         struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(py_obj);
9128         {
9129                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
9130                 if (PyLong_Check(value)) {
9131                         unsigned long long test_var;
9132                         test_var = PyLong_AsUnsignedLongLong(value);
9133                         if (PyErr_Occurred() != NULL) {
9134                                 return -1;
9135                         }
9136                         if (test_var > uint_max) {
9137                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9138                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9139                                 return -1;
9140                         }
9141                         object->length = test_var;
9142                 } else if (PyInt_Check(value)) {
9143                         long test_var;
9144                         test_var = PyInt_AsLong(value);
9145                         if (test_var < 0 || test_var > uint_max) {
9146                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9147                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9148                                 return -1;
9149                         }
9150                         object->length = test_var;
9151                 } else {
9152                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9153                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9154                         return -1;
9155                 }
9156         }
9157         return 0;
9158 }
9159
9160 static PyObject *py_lsa_ForestTrustBinaryData_get_data(PyObject *obj, void *closure)
9161 {
9162         struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(obj);
9163         PyObject *py_data;
9164         if (object->data == NULL) {
9165                 py_data = Py_None;
9166                 Py_INCREF(py_data);
9167         } else {
9168                 py_data = PyList_New(object->length);
9169                 if (py_data == NULL) {
9170                         return NULL;
9171                 }
9172                 {
9173                         int data_cntr_1;
9174                         for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
9175                                 PyObject *py_data_1;
9176                                 py_data_1 = PyInt_FromLong((uint16_t)object->data[data_cntr_1]);
9177                                 PyList_SetItem(py_data, data_cntr_1, py_data_1);
9178                         }
9179                 }
9180         }
9181         return py_data;
9182 }
9183
9184 static int py_lsa_ForestTrustBinaryData_set_data(PyObject *py_obj, PyObject *value, void *closure)
9185 {
9186         struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(py_obj);
9187         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
9188         if (value == Py_None) {
9189                 object->data = NULL;
9190         } else {
9191                 object->data = NULL;
9192                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9193                 {
9194                         int data_cntr_1;
9195                         object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
9196                         if (!object->data) { return -1;; }
9197                         talloc_set_name_const(object->data, "ARRAY: object->data");
9198                         for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
9199                                 {
9200                                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
9201                                         if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
9202                                                 unsigned long long test_var;
9203                                                 test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
9204                                                 if (PyErr_Occurred() != NULL) {
9205                                                         return -1;
9206                                                 }
9207                                                 if (test_var > uint_max) {
9208                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9209                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9210                                                         return -1;
9211                                                 }
9212                                                 object->data[data_cntr_1] = test_var;
9213                                         } else if (PyInt_Check(PyList_GET_ITEM(value, data_cntr_1))) {
9214                                                 long test_var;
9215                                                 test_var = PyInt_AsLong(PyList_GET_ITEM(value, data_cntr_1));
9216                                                 if (test_var < 0 || test_var > uint_max) {
9217                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9218                                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9219                                                         return -1;
9220                                                 }
9221                                                 object->data[data_cntr_1] = test_var;
9222                                         } else {
9223                                                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9224                                                   PyInt_Type.tp_name, PyLong_Type.tp_name);
9225                                                 return -1;
9226                                         }
9227                                 }
9228                         }
9229                 }
9230         }
9231         return 0;
9232 }
9233
9234 static PyGetSetDef py_lsa_ForestTrustBinaryData_getsetters[] = {
9235         { discard_const_p(char, "length"), py_lsa_ForestTrustBinaryData_get_length, py_lsa_ForestTrustBinaryData_set_length },
9236         { discard_const_p(char, "data"), py_lsa_ForestTrustBinaryData_get_data, py_lsa_ForestTrustBinaryData_set_data },
9237         { NULL }
9238 };
9239
9240 static PyObject *py_lsa_ForestTrustBinaryData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9241 {
9242         return pytalloc_new(struct lsa_ForestTrustBinaryData, type);
9243 }
9244
9245
9246 static PyTypeObject lsa_ForestTrustBinaryData_Type = {
9247         PyObject_HEAD_INIT(NULL) 0,
9248         .tp_name = "lsa.ForestTrustBinaryData",
9249         .tp_getset = py_lsa_ForestTrustBinaryData_getsetters,
9250         .tp_methods = NULL,
9251         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9252         .tp_basicsize = sizeof(pytalloc_Object),
9253         .tp_new = py_lsa_ForestTrustBinaryData_new,
9254 };
9255
9256
9257 static PyObject *py_lsa_ForestTrustDomainInfo_get_domain_sid(PyObject *obj, void *closure)
9258 {
9259         struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(obj);
9260         PyObject *py_domain_sid;
9261         if (object->domain_sid == NULL) {
9262                 py_domain_sid = Py_None;
9263                 Py_INCREF(py_domain_sid);
9264         } else {
9265                 py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->domain_sid, object->domain_sid);
9266         }
9267         return py_domain_sid;
9268 }
9269
9270 static int py_lsa_ForestTrustDomainInfo_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
9271 {
9272         struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(py_obj);
9273         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domain_sid));
9274         if (value == Py_None) {
9275                 object->domain_sid = NULL;
9276         } else {
9277                 object->domain_sid = NULL;
9278                 PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
9279                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9280                         PyErr_NoMemory();
9281                         return -1;
9282                 }
9283                 object->domain_sid = (struct dom_sid *)pytalloc_get_ptr(value);
9284         }
9285         return 0;
9286 }
9287
9288 static PyObject *py_lsa_ForestTrustDomainInfo_get_dns_domain_name(PyObject *obj, void *closure)
9289 {
9290         struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(obj);
9291         PyObject *py_dns_domain_name;
9292         py_dns_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_domain_name);
9293         return py_dns_domain_name;
9294 }
9295
9296 static int py_lsa_ForestTrustDomainInfo_set_dns_domain_name(PyObject *py_obj, PyObject *value, void *closure)
9297 {
9298         struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(py_obj);
9299         PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
9300         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9301                 PyErr_NoMemory();
9302                 return -1;
9303         }
9304         object->dns_domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
9305         return 0;
9306 }
9307
9308 static PyObject *py_lsa_ForestTrustDomainInfo_get_netbios_domain_name(PyObject *obj, void *closure)
9309 {
9310         struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(obj);
9311         PyObject *py_netbios_domain_name;
9312         py_netbios_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->netbios_domain_name);
9313         return py_netbios_domain_name;
9314 }
9315
9316 static int py_lsa_ForestTrustDomainInfo_set_netbios_domain_name(PyObject *py_obj, PyObject *value, void *closure)
9317 {
9318         struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(py_obj);
9319         PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
9320         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9321                 PyErr_NoMemory();
9322                 return -1;
9323         }
9324         object->netbios_domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
9325         return 0;
9326 }
9327
9328 static PyGetSetDef py_lsa_ForestTrustDomainInfo_getsetters[] = {
9329         { discard_const_p(char, "domain_sid"), py_lsa_ForestTrustDomainInfo_get_domain_sid, py_lsa_ForestTrustDomainInfo_set_domain_sid },
9330         { discard_const_p(char, "dns_domain_name"), py_lsa_ForestTrustDomainInfo_get_dns_domain_name, py_lsa_ForestTrustDomainInfo_set_dns_domain_name },
9331         { discard_const_p(char, "netbios_domain_name"), py_lsa_ForestTrustDomainInfo_get_netbios_domain_name, py_lsa_ForestTrustDomainInfo_set_netbios_domain_name },
9332         { NULL }
9333 };
9334
9335 static PyObject *py_lsa_ForestTrustDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9336 {
9337         return pytalloc_new(struct lsa_ForestTrustDomainInfo, type);
9338 }
9339
9340
9341 static PyTypeObject lsa_ForestTrustDomainInfo_Type = {
9342         PyObject_HEAD_INIT(NULL) 0,
9343         .tp_name = "lsa.ForestTrustDomainInfo",
9344         .tp_getset = py_lsa_ForestTrustDomainInfo_getsetters,
9345         .tp_methods = NULL,
9346         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9347         .tp_basicsize = sizeof(pytalloc_Object),
9348         .tp_new = py_lsa_ForestTrustDomainInfo_new,
9349 };
9350
9351 PyObject *py_import_lsa_ForestTrustData(TALLOC_CTX *mem_ctx, int level, union lsa_ForestTrustData *in)
9352 {
9353         PyObject *ret;
9354
9355         switch (level) {
9356                 case LSA_FOREST_TRUST_TOP_LEVEL_NAME:
9357                         ret = pytalloc_reference_ex(&lsa_StringLarge_Type, mem_ctx, &in->top_level_name);
9358                         return ret;
9359
9360                 case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX:
9361                         ret = pytalloc_reference_ex(&lsa_StringLarge_Type, mem_ctx, &in->top_level_name_ex);
9362                         return ret;
9363
9364                 case LSA_FOREST_TRUST_DOMAIN_INFO:
9365                         ret = pytalloc_reference_ex(&lsa_ForestTrustDomainInfo_Type, mem_ctx, &in->domain_info);
9366                         return ret;
9367
9368                 default:
9369                         ret = pytalloc_reference_ex(&lsa_ForestTrustBinaryData_Type, mem_ctx, &in->data);
9370                         return ret;
9371
9372         }
9373         PyErr_SetString(PyExc_TypeError, "unknown union level");
9374         return NULL;
9375 }
9376
9377 union lsa_ForestTrustData *py_export_lsa_ForestTrustData(TALLOC_CTX *mem_ctx, int level, PyObject *in)
9378 {
9379         union lsa_ForestTrustData *ret = talloc_zero(mem_ctx, union lsa_ForestTrustData);
9380         switch (level) {
9381                 case LSA_FOREST_TRUST_TOP_LEVEL_NAME:
9382                         PY_CHECK_TYPE(&lsa_StringLarge_Type, in, talloc_free(ret); return NULL;);
9383                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9384                                 PyErr_NoMemory();
9385                                 talloc_free(ret); return NULL;
9386                         }
9387                         ret->top_level_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(in);
9388                         break;
9389
9390                 case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX:
9391                         PY_CHECK_TYPE(&lsa_StringLarge_Type, in, talloc_free(ret); return NULL;);
9392                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9393                                 PyErr_NoMemory();
9394                                 talloc_free(ret); return NULL;
9395                         }
9396                         ret->top_level_name_ex = *(struct lsa_StringLarge *)pytalloc_get_ptr(in);
9397                         break;
9398
9399                 case LSA_FOREST_TRUST_DOMAIN_INFO:
9400                         PY_CHECK_TYPE(&lsa_ForestTrustDomainInfo_Type, in, talloc_free(ret); return NULL;);
9401                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9402                                 PyErr_NoMemory();
9403                                 talloc_free(ret); return NULL;
9404                         }
9405                         ret->domain_info = *(struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(in);
9406                         break;
9407
9408                 default:
9409                         PY_CHECK_TYPE(&lsa_ForestTrustBinaryData_Type, in, talloc_free(ret); return NULL;);
9410                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9411                                 PyErr_NoMemory();
9412                                 talloc_free(ret); return NULL;
9413                         }
9414                         ret->data = *(struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(in);
9415                         break;
9416
9417         }
9418
9419         return ret;
9420 }
9421
9422
9423 static PyObject *py_lsa_ForestTrustRecord_get_flags(PyObject *obj, void *closure)
9424 {
9425         struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
9426         PyObject *py_flags;
9427         py_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->flags);
9428         return py_flags;
9429 }
9430
9431 static int py_lsa_ForestTrustRecord_set_flags(PyObject *py_obj, PyObject *value, void *closure)
9432 {
9433         struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
9434         {
9435                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
9436                 if (PyLong_Check(value)) {
9437                         unsigned long long test_var;
9438                         test_var = PyLong_AsUnsignedLongLong(value);
9439                         if (PyErr_Occurred() != NULL) {
9440                                 return -1;
9441                         }
9442                         if (test_var > uint_max) {
9443                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9444                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9445                                 return -1;
9446                         }
9447                         object->flags = test_var;
9448                 } else if (PyInt_Check(value)) {
9449                         long test_var;
9450                         test_var = PyInt_AsLong(value);
9451                         if (test_var < 0 || test_var > uint_max) {
9452                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9453                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9454                                 return -1;
9455                         }
9456                         object->flags = test_var;
9457                 } else {
9458                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9459                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9460                         return -1;
9461                 }
9462         }
9463         return 0;
9464 }
9465
9466 static PyObject *py_lsa_ForestTrustRecord_get_type(PyObject *obj, void *closure)
9467 {
9468         struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
9469         PyObject *py_type;
9470         py_type = PyInt_FromLong((uint16_t)object->type);
9471         return py_type;
9472 }
9473
9474 static int py_lsa_ForestTrustRecord_set_type(PyObject *py_obj, PyObject *value, void *closure)
9475 {
9476         struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
9477         {
9478                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
9479                 if (PyLong_Check(value)) {
9480                         unsigned long long test_var;
9481                         test_var = PyLong_AsUnsignedLongLong(value);
9482                         if (PyErr_Occurred() != NULL) {
9483                                 return -1;
9484                         }
9485                         if (test_var > uint_max) {
9486                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9487                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9488                                 return -1;
9489                         }
9490                         object->type = test_var;
9491                 } else if (PyInt_Check(value)) {
9492                         long test_var;
9493                         test_var = PyInt_AsLong(value);
9494                         if (test_var < 0 || test_var > uint_max) {
9495                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9496                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9497                                 return -1;
9498                         }
9499                         object->type = test_var;
9500                 } else {
9501                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9502                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9503                         return -1;
9504                 }
9505         }
9506         return 0;
9507 }
9508
9509 static PyObject *py_lsa_ForestTrustRecord_get_time(PyObject *obj, void *closure)
9510 {
9511         struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
9512         PyObject *py_time;
9513         py_time = ndr_PyLong_FromUnsignedLongLong(object->time);
9514         return py_time;
9515 }
9516
9517 static int py_lsa_ForestTrustRecord_set_time(PyObject *py_obj, PyObject *value, void *closure)
9518 {
9519         struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
9520         {
9521                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
9522                 if (PyLong_Check(value)) {
9523                         unsigned long long test_var;
9524                         test_var = PyLong_AsUnsignedLongLong(value);
9525                         if (PyErr_Occurred() != NULL) {
9526                                 return -1;
9527                         }
9528                         if (test_var > uint_max) {
9529                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9530                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9531                                 return -1;
9532                         }
9533                         object->time = test_var;
9534                 } else if (PyInt_Check(value)) {
9535                         long test_var;
9536                         test_var = PyInt_AsLong(value);
9537                         if (test_var < 0 || test_var > uint_max) {
9538                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9539                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9540                                 return -1;
9541                         }
9542                         object->time = test_var;
9543                 } else {
9544                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9545                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9546                         return -1;
9547                 }
9548         }
9549         return 0;
9550 }
9551
9552 static PyObject *py_lsa_ForestTrustRecord_get_forest_trust_data(PyObject *obj, void *closure)
9553 {
9554         struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
9555         PyObject *py_forest_trust_data;
9556         py_forest_trust_data = py_import_lsa_ForestTrustData(pytalloc_get_mem_ctx(obj), object->type, &object->forest_trust_data);
9557         if (py_forest_trust_data == NULL) {
9558                 return NULL;
9559         }
9560         return py_forest_trust_data;
9561 }
9562
9563 static int py_lsa_ForestTrustRecord_set_forest_trust_data(PyObject *py_obj, PyObject *value, void *closure)
9564 {
9565         struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
9566         {
9567                 union lsa_ForestTrustData *forest_trust_data_switch_0;
9568                 forest_trust_data_switch_0 = py_export_lsa_ForestTrustData(pytalloc_get_mem_ctx(py_obj), object->type, value);
9569                 if (forest_trust_data_switch_0 == NULL) {
9570                         return -1;
9571                 }
9572                 object->forest_trust_data = *forest_trust_data_switch_0;
9573         }
9574         return 0;
9575 }
9576
9577 static PyGetSetDef py_lsa_ForestTrustRecord_getsetters[] = {
9578         { discard_const_p(char, "flags"), py_lsa_ForestTrustRecord_get_flags, py_lsa_ForestTrustRecord_set_flags },
9579         { discard_const_p(char, "type"), py_lsa_ForestTrustRecord_get_type, py_lsa_ForestTrustRecord_set_type },
9580         { discard_const_p(char, "time"), py_lsa_ForestTrustRecord_get_time, py_lsa_ForestTrustRecord_set_time },
9581         { discard_const_p(char, "forest_trust_data"), py_lsa_ForestTrustRecord_get_forest_trust_data, py_lsa_ForestTrustRecord_set_forest_trust_data },
9582         { NULL }
9583 };
9584
9585 static PyObject *py_lsa_ForestTrustRecord_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9586 {
9587         return pytalloc_new(struct lsa_ForestTrustRecord, type);
9588 }
9589
9590
9591 static PyTypeObject lsa_ForestTrustRecord_Type = {
9592         PyObject_HEAD_INIT(NULL) 0,
9593         .tp_name = "lsa.ForestTrustRecord",
9594         .tp_getset = py_lsa_ForestTrustRecord_getsetters,
9595         .tp_methods = NULL,
9596         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9597         .tp_basicsize = sizeof(pytalloc_Object),
9598         .tp_new = py_lsa_ForestTrustRecord_new,
9599 };
9600
9601
9602 static PyObject *py_lsa_ForestTrustInformation_get_count(PyObject *obj, void *closure)
9603 {
9604         struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(obj);
9605         PyObject *py_count;
9606         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
9607         return py_count;
9608 }
9609
9610 static int py_lsa_ForestTrustInformation_set_count(PyObject *py_obj, PyObject *value, void *closure)
9611 {
9612         struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
9613         {
9614                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
9615                 if (PyLong_Check(value)) {
9616                         unsigned long long test_var;
9617                         test_var = PyLong_AsUnsignedLongLong(value);
9618                         if (PyErr_Occurred() != NULL) {
9619                                 return -1;
9620                         }
9621                         if (test_var > uint_max) {
9622                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9623                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9624                                 return -1;
9625                         }
9626                         object->count = test_var;
9627                 } else if (PyInt_Check(value)) {
9628                         long test_var;
9629                         test_var = PyInt_AsLong(value);
9630                         if (test_var < 0 || test_var > uint_max) {
9631                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9632                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9633                                 return -1;
9634                         }
9635                         object->count = test_var;
9636                 } else {
9637                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9638                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9639                         return -1;
9640                 }
9641         }
9642         return 0;
9643 }
9644
9645 static PyObject *py_lsa_ForestTrustInformation_get_entries(PyObject *obj, void *closure)
9646 {
9647         struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(obj);
9648         PyObject *py_entries;
9649         if (object->entries == NULL) {
9650                 py_entries = Py_None;
9651                 Py_INCREF(py_entries);
9652         } else {
9653                 py_entries = PyList_New(object->count);
9654                 if (py_entries == NULL) {
9655                         return NULL;
9656                 }
9657                 {
9658                         int entries_cntr_1;
9659                         for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
9660                                 PyObject *py_entries_1;
9661                                 if (object->entries[entries_cntr_1] == NULL) {
9662                                         py_entries_1 = Py_None;
9663                                         Py_INCREF(py_entries_1);
9664                                 } else {
9665                                         py_entries_1 = pytalloc_reference_ex(&lsa_ForestTrustRecord_Type, object->entries[entries_cntr_1], object->entries[entries_cntr_1]);
9666                                 }
9667                                 PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
9668                         }
9669                 }
9670         }
9671         return py_entries;
9672 }
9673
9674 static int py_lsa_ForestTrustInformation_set_entries(PyObject *py_obj, PyObject *value, void *closure)
9675 {
9676         struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
9677         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
9678         if (value == Py_None) {
9679                 object->entries = NULL;
9680         } else {
9681                 object->entries = NULL;
9682                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9683                 {
9684                         int entries_cntr_1;
9685                         object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
9686                         if (!object->entries) { return -1;; }
9687                         talloc_set_name_const(object->entries, "ARRAY: object->entries");
9688                         for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
9689                                 if (PyList_GET_ITEM(value, entries_cntr_1) == Py_None) {
9690                                         object->entries[entries_cntr_1] = NULL;
9691                                 } else {
9692                                         object->entries[entries_cntr_1] = NULL;
9693                                         PY_CHECK_TYPE(&lsa_ForestTrustRecord_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
9694                                         if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
9695                                                 PyErr_NoMemory();
9696                                                 return -1;
9697                                         }
9698                                         object->entries[entries_cntr_1] = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
9699                                 }
9700                         }
9701                 }
9702         }
9703         return 0;
9704 }
9705
9706 static PyGetSetDef py_lsa_ForestTrustInformation_getsetters[] = {
9707         { discard_const_p(char, "count"), py_lsa_ForestTrustInformation_get_count, py_lsa_ForestTrustInformation_set_count },
9708         { discard_const_p(char, "entries"), py_lsa_ForestTrustInformation_get_entries, py_lsa_ForestTrustInformation_set_entries },
9709         { NULL }
9710 };
9711
9712 static PyObject *py_lsa_ForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9713 {
9714         return pytalloc_new(struct lsa_ForestTrustInformation, type);
9715 }
9716
9717 static PyObject *py_lsa_ForestTrustInformation_ndr_pack(PyObject *py_obj)
9718 {
9719         struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
9720         DATA_BLOB blob;
9721         enum ndr_err_code err;
9722         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_ForestTrustInformation);
9723         if (err != NDR_ERR_SUCCESS) {
9724                 PyErr_SetNdrError(err);
9725                 return NULL;
9726         }
9727
9728         return PyString_FromStringAndSize((char *)blob.data, blob.length);
9729 }
9730
9731 static PyObject *py_lsa_ForestTrustInformation_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9732 {
9733         struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
9734         DATA_BLOB blob;
9735         int blob_length = 0;
9736         enum ndr_err_code err;
9737         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
9738         PyObject *allow_remaining_obj = NULL;
9739         bool allow_remaining = false;
9740
9741         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
9742                 discard_const_p(char *, kwnames),
9743                 &blob.data, &blob_length,
9744                 &allow_remaining_obj)) {
9745                 return NULL;
9746         }
9747         blob.length = blob_length;
9748
9749         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9750                 allow_remaining = true;
9751         }
9752
9753         if (allow_remaining) {
9754                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustInformation);
9755         } else {
9756                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustInformation);
9757         }
9758         if (err != NDR_ERR_SUCCESS) {
9759                 PyErr_SetNdrError(err);
9760                 return NULL;
9761         }
9762
9763         Py_RETURN_NONE;
9764 }
9765
9766 static PyObject *py_lsa_ForestTrustInformation_ndr_print(PyObject *py_obj)
9767 {
9768         struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
9769         PyObject *ret;
9770         char *retstr;
9771
9772         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_ForestTrustInformation, "lsa_ForestTrustInformation", object);
9773         ret = PyString_FromString(retstr);
9774         talloc_free(retstr);
9775
9776         return ret;
9777 }
9778
9779 static PyMethodDef py_lsa_ForestTrustInformation_methods[] = {
9780         { "__ndr_pack__", (PyCFunction)py_lsa_ForestTrustInformation_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
9781         { "__ndr_unpack__", (PyCFunction)py_lsa_ForestTrustInformation_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
9782         { "__ndr_print__", (PyCFunction)py_lsa_ForestTrustInformation_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
9783         { NULL, NULL, 0, NULL }
9784 };
9785
9786
9787 static PyTypeObject lsa_ForestTrustInformation_Type = {
9788         PyObject_HEAD_INIT(NULL) 0,
9789         .tp_name = "lsa.ForestTrustInformation",
9790         .tp_getset = py_lsa_ForestTrustInformation_getsetters,
9791         .tp_methods = py_lsa_ForestTrustInformation_methods,
9792         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9793         .tp_basicsize = sizeof(pytalloc_Object),
9794         .tp_new = py_lsa_ForestTrustInformation_new,
9795 };
9796
9797
9798 static PyObject *py_lsa_ForestTrustCollisionRecord_get_index(PyObject *obj, void *closure)
9799 {
9800         struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
9801         PyObject *py_index;
9802         py_index = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->index);
9803         return py_index;
9804 }
9805
9806 static int py_lsa_ForestTrustCollisionRecord_set_index(PyObject *py_obj, PyObject *value, void *closure)
9807 {
9808         struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
9809         {
9810                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->index));
9811                 if (PyLong_Check(value)) {
9812                         unsigned long long test_var;
9813                         test_var = PyLong_AsUnsignedLongLong(value);
9814                         if (PyErr_Occurred() != NULL) {
9815                                 return -1;
9816                         }
9817                         if (test_var > uint_max) {
9818                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9819                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9820                                 return -1;
9821                         }
9822                         object->index = test_var;
9823                 } else if (PyInt_Check(value)) {
9824                         long test_var;
9825                         test_var = PyInt_AsLong(value);
9826                         if (test_var < 0 || test_var > uint_max) {
9827                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9828                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9829                                 return -1;
9830                         }
9831                         object->index = test_var;
9832                 } else {
9833                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9834                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9835                         return -1;
9836                 }
9837         }
9838         return 0;
9839 }
9840
9841 static PyObject *py_lsa_ForestTrustCollisionRecord_get_type(PyObject *obj, void *closure)
9842 {
9843         struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
9844         PyObject *py_type;
9845         py_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->type);
9846         return py_type;
9847 }
9848
9849 static int py_lsa_ForestTrustCollisionRecord_set_type(PyObject *py_obj, PyObject *value, void *closure)
9850 {
9851         struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
9852         {
9853                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
9854                 if (PyLong_Check(value)) {
9855                         unsigned long long test_var;
9856                         test_var = PyLong_AsUnsignedLongLong(value);
9857                         if (PyErr_Occurred() != NULL) {
9858                                 return -1;
9859                         }
9860                         if (test_var > uint_max) {
9861                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9862                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9863                                 return -1;
9864                         }
9865                         object->type = test_var;
9866                 } else if (PyInt_Check(value)) {
9867                         long test_var;
9868                         test_var = PyInt_AsLong(value);
9869                         if (test_var < 0 || test_var > uint_max) {
9870                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9871                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9872                                 return -1;
9873                         }
9874                         object->type = test_var;
9875                 } else {
9876                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9877                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9878                         return -1;
9879                 }
9880         }
9881         return 0;
9882 }
9883
9884 static PyObject *py_lsa_ForestTrustCollisionRecord_get_flags(PyObject *obj, void *closure)
9885 {
9886         struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
9887         PyObject *py_flags;
9888         py_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->flags);
9889         return py_flags;
9890 }
9891
9892 static int py_lsa_ForestTrustCollisionRecord_set_flags(PyObject *py_obj, PyObject *value, void *closure)
9893 {
9894         struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
9895         {
9896                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
9897                 if (PyLong_Check(value)) {
9898                         unsigned long long test_var;
9899                         test_var = PyLong_AsUnsignedLongLong(value);
9900                         if (PyErr_Occurred() != NULL) {
9901                                 return -1;
9902                         }
9903                         if (test_var > uint_max) {
9904                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9905                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9906                                 return -1;
9907                         }
9908                         object->flags = test_var;
9909                 } else if (PyInt_Check(value)) {
9910                         long test_var;
9911                         test_var = PyInt_AsLong(value);
9912                         if (test_var < 0 || test_var > uint_max) {
9913                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9914                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9915                                 return -1;
9916                         }
9917                         object->flags = test_var;
9918                 } else {
9919                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9920                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9921                         return -1;
9922                 }
9923         }
9924         return 0;
9925 }
9926
9927 static PyObject *py_lsa_ForestTrustCollisionRecord_get_name(PyObject *obj, void *closure)
9928 {
9929         struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
9930         PyObject *py_name;
9931         py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
9932         return py_name;
9933 }
9934
9935 static int py_lsa_ForestTrustCollisionRecord_set_name(PyObject *py_obj, PyObject *value, void *closure)
9936 {
9937         struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
9938         PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
9939         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9940                 PyErr_NoMemory();
9941                 return -1;
9942         }
9943         object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
9944         return 0;
9945 }
9946
9947 static PyGetSetDef py_lsa_ForestTrustCollisionRecord_getsetters[] = {
9948         { discard_const_p(char, "index"), py_lsa_ForestTrustCollisionRecord_get_index, py_lsa_ForestTrustCollisionRecord_set_index },
9949         { discard_const_p(char, "type"), py_lsa_ForestTrustCollisionRecord_get_type, py_lsa_ForestTrustCollisionRecord_set_type },
9950         { discard_const_p(char, "flags"), py_lsa_ForestTrustCollisionRecord_get_flags, py_lsa_ForestTrustCollisionRecord_set_flags },
9951         { discard_const_p(char, "name"), py_lsa_ForestTrustCollisionRecord_get_name, py_lsa_ForestTrustCollisionRecord_set_name },
9952         { NULL }
9953 };
9954
9955 static PyObject *py_lsa_ForestTrustCollisionRecord_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9956 {
9957         return pytalloc_new(struct lsa_ForestTrustCollisionRecord, type);
9958 }
9959
9960 static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_pack(PyObject *py_obj)
9961 {
9962         struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
9963         DATA_BLOB blob;
9964         enum ndr_err_code err;
9965         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_ForestTrustCollisionRecord);
9966         if (err != NDR_ERR_SUCCESS) {
9967                 PyErr_SetNdrError(err);
9968                 return NULL;
9969         }
9970
9971         return PyString_FromStringAndSize((char *)blob.data, blob.length);
9972 }
9973
9974 static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9975 {
9976         struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
9977         DATA_BLOB blob;
9978         int blob_length = 0;
9979         enum ndr_err_code err;
9980         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
9981         PyObject *allow_remaining_obj = NULL;
9982         bool allow_remaining = false;
9983
9984         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
9985                 discard_const_p(char *, kwnames),
9986                 &blob.data, &blob_length,
9987                 &allow_remaining_obj)) {
9988                 return NULL;
9989         }
9990         blob.length = blob_length;
9991
9992         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9993                 allow_remaining = true;
9994         }
9995
9996         if (allow_remaining) {
9997                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionRecord);
9998         } else {
9999                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionRecord);
10000         }
10001         if (err != NDR_ERR_SUCCESS) {
10002                 PyErr_SetNdrError(err);
10003                 return NULL;
10004         }
10005
10006         Py_RETURN_NONE;
10007 }
10008
10009 static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_print(PyObject *py_obj)
10010 {
10011         struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
10012         PyObject *ret;
10013         char *retstr;
10014
10015         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_ForestTrustCollisionRecord, "lsa_ForestTrustCollisionRecord", object);
10016         ret = PyString_FromString(retstr);
10017         talloc_free(retstr);
10018
10019         return ret;
10020 }
10021
10022 static PyMethodDef py_lsa_ForestTrustCollisionRecord_methods[] = {
10023         { "__ndr_pack__", (PyCFunction)py_lsa_ForestTrustCollisionRecord_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
10024         { "__ndr_unpack__", (PyCFunction)py_lsa_ForestTrustCollisionRecord_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
10025         { "__ndr_print__", (PyCFunction)py_lsa_ForestTrustCollisionRecord_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
10026         { NULL, NULL, 0, NULL }
10027 };
10028
10029
10030 static PyTypeObject lsa_ForestTrustCollisionRecord_Type = {
10031         PyObject_HEAD_INIT(NULL) 0,
10032         .tp_name = "lsa.ForestTrustCollisionRecord",
10033         .tp_getset = py_lsa_ForestTrustCollisionRecord_getsetters,
10034         .tp_methods = py_lsa_ForestTrustCollisionRecord_methods,
10035         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10036         .tp_basicsize = sizeof(pytalloc_Object),
10037         .tp_new = py_lsa_ForestTrustCollisionRecord_new,
10038 };
10039
10040
10041 static PyObject *py_lsa_ForestTrustCollisionInfo_get_count(PyObject *obj, void *closure)
10042 {
10043         struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(obj);
10044         PyObject *py_count;
10045         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
10046         return py_count;
10047 }
10048
10049 static int py_lsa_ForestTrustCollisionInfo_set_count(PyObject *py_obj, PyObject *value, void *closure)
10050 {
10051         struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
10052         {
10053                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
10054                 if (PyLong_Check(value)) {
10055                         unsigned long long test_var;
10056                         test_var = PyLong_AsUnsignedLongLong(value);
10057                         if (PyErr_Occurred() != NULL) {
10058                                 return -1;
10059                         }
10060                         if (test_var > uint_max) {
10061                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
10062                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10063                                 return -1;
10064                         }
10065                         object->count = test_var;
10066                 } else if (PyInt_Check(value)) {
10067                         long test_var;
10068                         test_var = PyInt_AsLong(value);
10069                         if (test_var < 0 || test_var > uint_max) {
10070                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
10071                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10072                                 return -1;
10073                         }
10074                         object->count = test_var;
10075                 } else {
10076                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10077                           PyInt_Type.tp_name, PyLong_Type.tp_name);
10078                         return -1;
10079                 }
10080         }
10081         return 0;
10082 }
10083
10084 static PyObject *py_lsa_ForestTrustCollisionInfo_get_entries(PyObject *obj, void *closure)
10085 {
10086         struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(obj);
10087         PyObject *py_entries;
10088         if (object->entries == NULL) {
10089                 py_entries = Py_None;
10090                 Py_INCREF(py_entries);
10091         } else {
10092                 py_entries = PyList_New(object->count);
10093                 if (py_entries == NULL) {
10094                         return NULL;
10095                 }
10096                 {
10097                         int entries_cntr_1;
10098                         for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
10099                                 PyObject *py_entries_1;
10100                                 if (object->entries[entries_cntr_1] == NULL) {
10101                                         py_entries_1 = Py_None;
10102                                         Py_INCREF(py_entries_1);
10103                                 } else {
10104                                         py_entries_1 = pytalloc_reference_ex(&lsa_ForestTrustCollisionRecord_Type, object->entries[entries_cntr_1], object->entries[entries_cntr_1]);
10105                                 }
10106                                 PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
10107                         }
10108                 }
10109         }
10110         return py_entries;
10111 }
10112
10113 static int py_lsa_ForestTrustCollisionInfo_set_entries(PyObject *py_obj, PyObject *value, void *closure)
10114 {
10115         struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
10116         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
10117         if (value == Py_None) {
10118                 object->entries = NULL;
10119         } else {
10120                 object->entries = NULL;
10121                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10122                 {
10123                         int entries_cntr_1;
10124                         object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
10125                         if (!object->entries) { return -1;; }
10126                         talloc_set_name_const(object->entries, "ARRAY: object->entries");
10127                         for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
10128                                 if (PyList_GET_ITEM(value, entries_cntr_1) == Py_None) {
10129                                         object->entries[entries_cntr_1] = NULL;
10130                                 } else {
10131                                         object->entries[entries_cntr_1] = NULL;
10132                                         PY_CHECK_TYPE(&lsa_ForestTrustCollisionRecord_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
10133                                         if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
10134                                                 PyErr_NoMemory();
10135                                                 return -1;
10136                                         }
10137                                         object->entries[entries_cntr_1] = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
10138                                 }
10139                         }
10140                 }
10141         }
10142         return 0;
10143 }
10144
10145 static PyGetSetDef py_lsa_ForestTrustCollisionInfo_getsetters[] = {
10146         { discard_const_p(char, "count"), py_lsa_ForestTrustCollisionInfo_get_count, py_lsa_ForestTrustCollisionInfo_set_count },
10147         { discard_const_p(char, "entries"), py_lsa_ForestTrustCollisionInfo_get_entries, py_lsa_ForestTrustCollisionInfo_set_entries },
10148         { NULL }
10149 };
10150
10151 static PyObject *py_lsa_ForestTrustCollisionInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10152 {
10153         return pytalloc_new(struct lsa_ForestTrustCollisionInfo, type);
10154 }
10155
10156 static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_pack(PyObject *py_obj)
10157 {
10158         struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
10159         DATA_BLOB blob;
10160         enum ndr_err_code err;
10161         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_lsa_ForestTrustCollisionInfo);
10162         if (err != NDR_ERR_SUCCESS) {
10163                 PyErr_SetNdrError(err);
10164                 return NULL;
10165         }
10166
10167         return PyString_FromStringAndSize((char *)blob.data, blob.length);
10168 }
10169
10170 static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10171 {
10172         struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
10173         DATA_BLOB blob;
10174         int blob_length = 0;
10175         enum ndr_err_code err;
10176         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
10177         PyObject *allow_remaining_obj = NULL;
10178         bool allow_remaining = false;
10179
10180         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
10181                 discard_const_p(char *, kwnames),
10182                 &blob.data, &blob_length,
10183                 &allow_remaining_obj)) {
10184                 return NULL;
10185         }
10186         blob.length = blob_length;
10187
10188         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10189                 allow_remaining = true;
10190         }
10191
10192         if (allow_remaining) {
10193                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionInfo);
10194         } else {
10195                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionInfo);
10196         }
10197         if (err != NDR_ERR_SUCCESS) {
10198                 PyErr_SetNdrError(err);
10199                 return NULL;
10200         }
10201
10202         Py_RETURN_NONE;
10203 }
10204
10205 static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_print(PyObject *py_obj)
10206 {
10207         struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
10208         PyObject *ret;
10209         char *retstr;
10210
10211         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_ForestTrustCollisionInfo, "lsa_ForestTrustCollisionInfo", object);
10212         ret = PyString_FromString(retstr);
10213         talloc_free(retstr);
10214
10215         return ret;
10216 }
10217
10218 static PyMethodDef py_lsa_ForestTrustCollisionInfo_methods[] = {
10219         { "__ndr_pack__", (PyCFunction)py_lsa_ForestTrustCollisionInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
10220         { "__ndr_unpack__", (PyCFunction)py_lsa_ForestTrustCollisionInfo_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
10221         { "__ndr_print__", (PyCFunction)py_lsa_ForestTrustCollisionInfo_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
10222         { NULL, NULL, 0, NULL }
10223 };
10224
10225
10226 static PyTypeObject lsa_ForestTrustCollisionInfo_Type = {
10227         PyObject_HEAD_INIT(NULL) 0,
10228         .tp_name = "lsa.ForestTrustCollisionInfo",
10229         .tp_getset = py_lsa_ForestTrustCollisionInfo_getsetters,
10230         .tp_methods = py_lsa_ForestTrustCollisionInfo_methods,
10231         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10232         .tp_basicsize = sizeof(pytalloc_Object),
10233         .tp_new = py_lsa_ForestTrustCollisionInfo_new,
10234 };
10235
10236
10237 static bool pack_py_lsa_Close_args_in(PyObject *args, PyObject *kwargs, struct lsa_Close *r)
10238 {
10239         PyObject *py_handle;
10240         const char *kwnames[] = {
10241                 "handle", NULL
10242         };
10243
10244         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_Close", discard_const_p(char *, kwnames), &py_handle)) {
10245                 return false;
10246         }
10247
10248         r->in.handle = talloc_ptrtype(r, r->in.handle);
10249         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
10250         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
10251                 PyErr_NoMemory();
10252                 return false;
10253         }
10254         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10255         return true;
10256 }
10257
10258 static PyObject *unpack_py_lsa_Close_args_out(struct lsa_Close *r)
10259 {
10260         PyObject *result;
10261         PyObject *py_handle;
10262         py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
10263         result = py_handle;
10264         if (NT_STATUS_IS_ERR(r->out.result)) {
10265                 PyErr_SetNTSTATUS(r->out.result);
10266                 return NULL;
10267         }
10268
10269         return result;
10270 }
10271
10272 static bool pack_py_lsa_Delete_args_in(PyObject *args, PyObject *kwargs, struct lsa_Delete *r)
10273 {
10274         PyObject *py_handle;
10275         const char *kwnames[] = {
10276                 "handle", NULL
10277         };
10278
10279         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_Delete", discard_const_p(char *, kwnames), &py_handle)) {
10280                 return false;
10281         }
10282
10283         r->in.handle = talloc_ptrtype(r, r->in.handle);
10284         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
10285         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
10286                 PyErr_NoMemory();
10287                 return false;
10288         }
10289         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10290         return true;
10291 }
10292
10293 static PyObject *unpack_py_lsa_Delete_args_out(struct lsa_Delete *r)
10294 {
10295         PyObject *result;
10296         result = Py_None;
10297         Py_INCREF(result);
10298         if (NT_STATUS_IS_ERR(r->out.result)) {
10299                 PyErr_SetNTSTATUS(r->out.result);
10300                 return NULL;
10301         }
10302
10303         return result;
10304 }
10305
10306 static bool pack_py_lsa_EnumPrivs_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumPrivs *r)
10307 {
10308         PyObject *py_handle;
10309         PyObject *py_resume_handle;
10310         PyObject *py_max_count;
10311         const char *kwnames[] = {
10312                 "handle", "resume_handle", "max_count", NULL
10313         };
10314
10315         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumPrivs", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_count)) {
10316                 return false;
10317         }
10318
10319         r->in.handle = talloc_ptrtype(r, r->in.handle);
10320         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
10321         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
10322                 PyErr_NoMemory();
10323                 return false;
10324         }
10325         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10326         r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
10327         {
10328                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
10329                 if (PyLong_Check(py_resume_handle)) {
10330                         unsigned long long test_var;
10331                         test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
10332                         if (PyErr_Occurred() != NULL) {
10333                                 return false;
10334                         }
10335                         if (test_var > uint_max) {
10336                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
10337                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10338                                 return false;
10339                         }
10340                         *r->in.resume_handle = test_var;
10341                 } else if (PyInt_Check(py_resume_handle)) {
10342                         long test_var;
10343                         test_var = PyInt_AsLong(py_resume_handle);
10344                         if (test_var < 0 || test_var > uint_max) {
10345                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
10346                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10347                                 return false;
10348                         }
10349                         *r->in.resume_handle = test_var;
10350                 } else {
10351                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10352                           PyInt_Type.tp_name, PyLong_Type.tp_name);
10353                         return false;
10354                 }
10355         }
10356         {
10357                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_count));
10358                 if (PyLong_Check(py_max_count)) {
10359                         unsigned long long test_var;
10360                         test_var = PyLong_AsUnsignedLongLong(py_max_count);
10361                         if (PyErr_Occurred() != NULL) {
10362                                 return false;
10363                         }
10364                         if (test_var > uint_max) {
10365                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
10366                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10367                                 return false;
10368                         }
10369                         r->in.max_count = test_var;
10370                 } else if (PyInt_Check(py_max_count)) {
10371                         long test_var;
10372                         test_var = PyInt_AsLong(py_max_count);
10373                         if (test_var < 0 || test_var > uint_max) {
10374                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
10375                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10376                                 return false;
10377                         }
10378                         r->in.max_count = test_var;
10379                 } else {
10380                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10381                           PyInt_Type.tp_name, PyLong_Type.tp_name);
10382                         return false;
10383                 }
10384         }
10385         return true;
10386 }
10387
10388 static PyObject *unpack_py_lsa_EnumPrivs_args_out(struct lsa_EnumPrivs *r)
10389 {
10390         PyObject *result;
10391         PyObject *py_resume_handle;
10392         PyObject *py_privs;
10393         result = PyTuple_New(2);
10394         py_resume_handle = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
10395         PyTuple_SetItem(result, 0, py_resume_handle);
10396         py_privs = pytalloc_reference_ex(&lsa_PrivArray_Type, r->out.privs, r->out.privs);
10397         PyTuple_SetItem(result, 1, py_privs);
10398         if (NT_STATUS_IS_ERR(r->out.result)) {
10399                 PyErr_SetNTSTATUS(r->out.result);
10400                 return NULL;
10401         }
10402
10403         return result;
10404 }
10405
10406 static bool pack_py_lsa_QuerySecurity_args_in(PyObject *args, PyObject *kwargs, struct lsa_QuerySecurity *r)
10407 {
10408         PyObject *py_handle;
10409         PyObject *py_sec_info;
10410         const char *kwnames[] = {
10411                 "handle", "sec_info", NULL
10412         };
10413
10414         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QuerySecurity", discard_const_p(char *, kwnames), &py_handle, &py_sec_info)) {
10415                 return false;
10416         }
10417
10418         r->in.handle = talloc_ptrtype(r, r->in.handle);
10419         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
10420         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
10421                 PyErr_NoMemory();
10422                 return false;
10423         }
10424         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10425         {
10426                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.sec_info));
10427                 if (PyLong_Check(py_sec_info)) {
10428                         unsigned long long test_var;
10429                         test_var = PyLong_AsUnsignedLongLong(py_sec_info);
10430                         if (PyErr_Occurred() != NULL) {
10431                                 return false;
10432                         }
10433                         if (test_var > uint_max) {
10434                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
10435                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10436                                 return false;
10437                         }
10438                         r->in.sec_info = test_var;
10439                 } else if (PyInt_Check(py_sec_info)) {
10440                         long test_var;
10441                         test_var = PyInt_AsLong(py_sec_info);
10442                         if (test_var < 0 || test_var > uint_max) {
10443                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
10444                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10445                                 return false;
10446                         }
10447                         r->in.sec_info = test_var;
10448                 } else {
10449                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10450                           PyInt_Type.tp_name, PyLong_Type.tp_name);
10451                         return false;
10452                 }
10453         }
10454         return true;
10455 }
10456
10457 static PyObject *unpack_py_lsa_QuerySecurity_args_out(struct lsa_QuerySecurity *r)
10458 {
10459         PyObject *result;
10460         PyObject *py_sdbuf;
10461         if (*r->out.sdbuf == NULL) {
10462                 py_sdbuf = Py_None;
10463                 Py_INCREF(py_sdbuf);
10464         } else {
10465                 py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *r->out.sdbuf, *r->out.sdbuf);
10466         }
10467         result = py_sdbuf;
10468         if (NT_STATUS_IS_ERR(r->out.result)) {
10469                 PyErr_SetNTSTATUS(r->out.result);
10470                 return NULL;
10471         }
10472
10473         return result;
10474 }
10475
10476 static bool pack_py_lsa_SetSecObj_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSecObj *r)
10477 {
10478         PyObject *py_handle;
10479         PyObject *py_sec_info;
10480         PyObject *py_sdbuf;
10481         const char *kwnames[] = {
10482                 "handle", "sec_info", "sdbuf", NULL
10483         };
10484
10485         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetSecObj", discard_const_p(char *, kwnames), &py_handle, &py_sec_info, &py_sdbuf)) {
10486                 return false;
10487         }
10488
10489         r->in.handle = talloc_ptrtype(r, r->in.handle);
10490         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
10491         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
10492                 PyErr_NoMemory();
10493                 return false;
10494         }
10495         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10496         {
10497                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.sec_info));
10498                 if (PyLong_Check(py_sec_info)) {
10499                         unsigned long long test_var;
10500                         test_var = PyLong_AsUnsignedLongLong(py_sec_info);
10501                         if (PyErr_Occurred() != NULL) {
10502                                 return false;
10503                         }
10504                         if (test_var > uint_max) {
10505                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
10506                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10507                                 return false;
10508                         }
10509                         r->in.sec_info = test_var;
10510                 } else if (PyInt_Check(py_sec_info)) {
10511                         long test_var;
10512                         test_var = PyInt_AsLong(py_sec_info);
10513                         if (test_var < 0 || test_var > uint_max) {
10514                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
10515                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10516                                 return false;
10517                         }
10518                         r->in.sec_info = test_var;
10519                 } else {
10520                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10521                           PyInt_Type.tp_name, PyLong_Type.tp_name);
10522                         return false;
10523                 }
10524         }
10525         r->in.sdbuf = talloc_ptrtype(r, r->in.sdbuf);
10526         PY_CHECK_TYPE(sec_desc_buf_Type, py_sdbuf, return false;);
10527         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sdbuf)) == NULL) {
10528                 PyErr_NoMemory();
10529                 return false;
10530         }
10531         r->in.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(py_sdbuf);
10532         return true;
10533 }
10534
10535 static PyObject *unpack_py_lsa_SetSecObj_args_out(struct lsa_SetSecObj *r)
10536 {
10537         PyObject *result;
10538         result = Py_None;
10539         Py_INCREF(result);
10540         if (NT_STATUS_IS_ERR(r->out.result)) {
10541                 PyErr_SetNTSTATUS(r->out.result);
10542                 return NULL;
10543         }
10544
10545         return result;
10546 }
10547
10548 static bool pack_py_lsa_OpenPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenPolicy *r)
10549 {
10550         PyObject *py_system_name;
10551         PyObject *py_attr;
10552         PyObject *py_access_mask;
10553         const char *kwnames[] = {
10554                 "system_name", "attr", "access_mask", NULL
10555         };
10556
10557         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenPolicy", discard_const_p(char *, kwnames), &py_system_name, &py_attr, &py_access_mask)) {
10558                 return false;
10559         }
10560
10561         if (py_system_name == Py_None) {
10562                 r->in.system_name = NULL;
10563         } else {
10564                 r->in.system_name = talloc_ptrtype(r, r->in.system_name);
10565                 {
10566                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.system_name));
10567                         if (PyLong_Check(py_system_name)) {
10568                                 unsigned long long test_var;
10569                                 test_var = PyLong_AsUnsignedLongLong(py_system_name);
10570                                 if (PyErr_Occurred() != NULL) {
10571                                         return false;
10572                                 }
10573                                 if (test_var > uint_max) {
10574                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
10575                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10576                                         return false;
10577                                 }
10578                                 *r->in.system_name = test_var;
10579                         } else if (PyInt_Check(py_system_name)) {
10580                                 long test_var;
10581                                 test_var = PyInt_AsLong(py_system_name);
10582                                 if (test_var < 0 || test_var > uint_max) {
10583                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
10584                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10585                                         return false;
10586                                 }
10587                                 *r->in.system_name = test_var;
10588                         } else {
10589                                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10590                                   PyInt_Type.tp_name, PyLong_Type.tp_name);
10591                                 return false;
10592                         }
10593                 }
10594         }
10595         r->in.attr = talloc_ptrtype(r, r->in.attr);
10596         PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, py_attr, return false;);
10597         if (talloc_reference(r, pytalloc_get_mem_ctx(py_attr)) == NULL) {
10598                 PyErr_NoMemory();
10599                 return false;
10600         }
10601         r->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_attr);
10602         {
10603                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
10604                 if (PyLong_Check(py_access_mask)) {
10605                         unsigned long long test_var;
10606                         test_var = PyLong_AsUnsignedLongLong(py_access_mask);
10607                         if (PyErr_Occurred() != NULL) {
10608                                 return false;
10609                         }
10610                         if (test_var > uint_max) {
10611                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
10612                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10613                                 return false;
10614                         }
10615                         r->in.access_mask = test_var;
10616                 } else if (PyInt_Check(py_access_mask)) {
10617                         long test_var;
10618                         test_var = PyInt_AsLong(py_access_mask);
10619                         if (test_var < 0 || test_var > uint_max) {
10620                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
10621                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10622                                 return false;
10623                         }
10624                         r->in.access_mask = test_var;
10625                 } else {
10626                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10627                           PyInt_Type.tp_name, PyLong_Type.tp_name);
10628                         return false;
10629                 }
10630         }
10631         return true;
10632 }
10633
10634 static PyObject *unpack_py_lsa_OpenPolicy_args_out(struct lsa_OpenPolicy *r)
10635 {
10636         PyObject *result;
10637         PyObject *py_handle;
10638         py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
10639         result = py_handle;
10640         if (NT_STATUS_IS_ERR(r->out.result)) {
10641                 PyErr_SetNTSTATUS(r->out.result);
10642                 return NULL;
10643         }
10644
10645         return result;
10646 }
10647
10648 static bool pack_py_lsa_QueryInfoPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryInfoPolicy *r)
10649 {
10650         PyObject *py_handle;
10651         PyObject *py_level;
10652         const char *kwnames[] = {
10653                 "handle", "level", NULL
10654         };
10655
10656         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryInfoPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
10657                 return false;
10658         }
10659
10660         r->in.handle = talloc_ptrtype(r, r->in.handle);
10661         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
10662         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
10663                 PyErr_NoMemory();
10664                 return false;
10665         }
10666         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10667         {
10668                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
10669                 if (PyLong_Check(py_level)) {
10670                         unsigned long long test_var;
10671                         test_var = PyLong_AsUnsignedLongLong(py_level);
10672                         if (PyErr_Occurred() != NULL) {
10673                                 return false;
10674                         }
10675                         if (test_var > uint_max) {
10676                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
10677                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10678                                 return false;
10679                         }
10680                         r->in.level = test_var;
10681                 } else if (PyInt_Check(py_level)) {
10682                         long test_var;
10683                         test_var = PyInt_AsLong(py_level);
10684                         if (test_var < 0 || test_var > uint_max) {
10685                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
10686                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10687                                 return false;
10688                         }
10689                         r->in.level = test_var;
10690                 } else {
10691                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10692                           PyInt_Type.tp_name, PyLong_Type.tp_name);
10693                         return false;
10694                 }
10695         }
10696         return true;
10697 }
10698
10699 static PyObject *unpack_py_lsa_QueryInfoPolicy_args_out(struct lsa_QueryInfoPolicy *r)
10700 {
10701         PyObject *result;
10702         PyObject *py_info;
10703         if (*r->out.info == NULL) {
10704                 py_info = Py_None;
10705                 Py_INCREF(py_info);
10706         } else {
10707                 py_info = py_import_lsa_PolicyInformation(*r->out.info, r->in.level, *r->out.info);
10708                 if (py_info == NULL) {
10709                         return NULL;
10710                 }
10711         }
10712         result = py_info;
10713         if (NT_STATUS_IS_ERR(r->out.result)) {
10714                 PyErr_SetNTSTATUS(r->out.result);
10715                 return NULL;
10716         }
10717
10718         return result;
10719 }
10720
10721 static bool pack_py_lsa_SetInfoPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInfoPolicy *r)
10722 {
10723         PyObject *py_handle;
10724         PyObject *py_level;
10725         PyObject *py_info;
10726         const char *kwnames[] = {
10727                 "handle", "level", "info", NULL
10728         };
10729
10730         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInfoPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
10731                 return false;
10732         }
10733
10734         r->in.handle = talloc_ptrtype(r, r->in.handle);
10735         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
10736         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
10737                 PyErr_NoMemory();
10738                 return false;
10739         }
10740         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10741         {
10742                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
10743                 if (PyLong_Check(py_level)) {
10744                         unsigned long long test_var;
10745                         test_var = PyLong_AsUnsignedLongLong(py_level);
10746                         if (PyErr_Occurred() != NULL) {
10747                                 return false;
10748                         }
10749                         if (test_var > uint_max) {
10750                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
10751                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10752                                 return false;
10753                         }
10754                         r->in.level = test_var;
10755                 } else if (PyInt_Check(py_level)) {
10756                         long test_var;
10757                         test_var = PyInt_AsLong(py_level);
10758                         if (test_var < 0 || test_var > uint_max) {
10759                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
10760                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10761                                 return false;
10762                         }
10763                         r->in.level = test_var;
10764                 } else {
10765                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10766                           PyInt_Type.tp_name, PyLong_Type.tp_name);
10767                         return false;
10768                 }
10769         }
10770         r->in.info = talloc_ptrtype(r, r->in.info);
10771         {
10772                 union lsa_PolicyInformation *info_switch_1;
10773                 info_switch_1 = py_export_lsa_PolicyInformation(r, r->in.level, py_info);
10774                 if (info_switch_1 == NULL) {
10775                         return false;
10776                 }
10777                 r->in.info = info_switch_1;
10778         }
10779         return true;
10780 }
10781
10782 static PyObject *unpack_py_lsa_SetInfoPolicy_args_out(struct lsa_SetInfoPolicy *r)
10783 {
10784         PyObject *result;
10785         result = Py_None;
10786         Py_INCREF(result);
10787         if (NT_STATUS_IS_ERR(r->out.result)) {
10788                 PyErr_SetNTSTATUS(r->out.result);
10789                 return NULL;
10790         }
10791
10792         return result;
10793 }
10794
10795 static bool pack_py_lsa_CreateAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateAccount *r)
10796 {
10797         PyObject *py_handle;
10798         PyObject *py_sid;
10799         PyObject *py_access_mask;
10800         const char *kwnames[] = {
10801                 "handle", "sid", "access_mask", NULL
10802         };
10803
10804         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateAccount", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
10805                 return false;
10806         }
10807
10808         r->in.handle = talloc_ptrtype(r, r->in.handle);
10809         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
10810         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
10811                 PyErr_NoMemory();
10812                 return false;
10813         }
10814         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10815         r->in.sid = talloc_ptrtype(r, r->in.sid);
10816         PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
10817         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
10818                 PyErr_NoMemory();
10819                 return false;
10820         }
10821         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
10822         {
10823                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
10824                 if (PyLong_Check(py_access_mask)) {
10825                         unsigned long long test_var;
10826                         test_var = PyLong_AsUnsignedLongLong(py_access_mask);
10827                         if (PyErr_Occurred() != NULL) {
10828                                 return false;
10829                         }
10830                         if (test_var > uint_max) {
10831                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
10832                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10833                                 return false;
10834                         }
10835                         r->in.access_mask = test_var;
10836                 } else if (PyInt_Check(py_access_mask)) {
10837                         long test_var;
10838                         test_var = PyInt_AsLong(py_access_mask);
10839                         if (test_var < 0 || test_var > uint_max) {
10840                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
10841                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10842                                 return false;
10843                         }
10844                         r->in.access_mask = test_var;
10845                 } else {
10846                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10847                           PyInt_Type.tp_name, PyLong_Type.tp_name);
10848                         return false;
10849                 }
10850         }
10851         return true;
10852 }
10853
10854 static PyObject *unpack_py_lsa_CreateAccount_args_out(struct lsa_CreateAccount *r)
10855 {
10856         PyObject *result;
10857         PyObject *py_acct_handle;
10858         py_acct_handle = pytalloc_reference_ex(policy_handle_Type, r->out.acct_handle, r->out.acct_handle);
10859         result = py_acct_handle;
10860         if (NT_STATUS_IS_ERR(r->out.result)) {
10861                 PyErr_SetNTSTATUS(r->out.result);
10862                 return NULL;
10863         }
10864
10865         return result;
10866 }
10867
10868 static bool pack_py_lsa_EnumAccounts_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccounts *r)
10869 {
10870         PyObject *py_handle;
10871         PyObject *py_resume_handle;
10872         PyObject *py_num_entries;
10873         const char *kwnames[] = {
10874                 "handle", "resume_handle", "num_entries", NULL
10875         };
10876
10877         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumAccounts", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_num_entries)) {
10878                 return false;
10879         }
10880
10881         r->in.handle = talloc_ptrtype(r, r->in.handle);
10882         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
10883         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
10884                 PyErr_NoMemory();
10885                 return false;
10886         }
10887         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10888         r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
10889         {
10890                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
10891                 if (PyLong_Check(py_resume_handle)) {
10892                         unsigned long long test_var;
10893                         test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
10894                         if (PyErr_Occurred() != NULL) {
10895                                 return false;
10896                         }
10897                         if (test_var > uint_max) {
10898                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
10899                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10900                                 return false;
10901                         }
10902                         *r->in.resume_handle = test_var;
10903                 } else if (PyInt_Check(py_resume_handle)) {
10904                         long test_var;
10905                         test_var = PyInt_AsLong(py_resume_handle);
10906                         if (test_var < 0 || test_var > uint_max) {
10907                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
10908                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10909                                 return false;
10910                         }
10911                         *r->in.resume_handle = test_var;
10912                 } else {
10913                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10914                           PyInt_Type.tp_name, PyLong_Type.tp_name);
10915                         return false;
10916                 }
10917         }
10918         {
10919                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.num_entries));
10920                 if (PyLong_Check(py_num_entries)) {
10921                         unsigned long long test_var;
10922                         test_var = PyLong_AsUnsignedLongLong(py_num_entries);
10923                         if (PyErr_Occurred() != NULL) {
10924                                 return false;
10925                         }
10926                         if (test_var > uint_max) {
10927                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
10928                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10929                                 return false;
10930                         }
10931                         r->in.num_entries = test_var;
10932                 } else if (PyInt_Check(py_num_entries)) {
10933                         long test_var;
10934                         test_var = PyInt_AsLong(py_num_entries);
10935                         if (test_var < 0 || test_var > uint_max) {
10936                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
10937                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
10938                                 return false;
10939                         }
10940                         r->in.num_entries = test_var;
10941                 } else {
10942                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10943                           PyInt_Type.tp_name, PyLong_Type.tp_name);
10944                         return false;
10945                 }
10946         }
10947         return true;
10948 }
10949
10950 static PyObject *unpack_py_lsa_EnumAccounts_args_out(struct lsa_EnumAccounts *r)
10951 {
10952         PyObject *result;
10953         PyObject *py_resume_handle;
10954         PyObject *py_sids;
10955         result = PyTuple_New(2);
10956         py_resume_handle = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
10957         PyTuple_SetItem(result, 0, py_resume_handle);
10958         py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, r->out.sids, r->out.sids);
10959         PyTuple_SetItem(result, 1, py_sids);
10960         if (NT_STATUS_IS_ERR(r->out.result)) {
10961                 PyErr_SetNTSTATUS(r->out.result);
10962                 return NULL;
10963         }
10964
10965         return result;
10966 }
10967
10968 static bool pack_py_lsa_CreateTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomain *r)
10969 {
10970         PyObject *py_policy_handle;
10971         PyObject *py_info;
10972         PyObject *py_access_mask;
10973         const char *kwnames[] = {
10974                 "policy_handle", "info", "access_mask", NULL
10975         };
10976
10977         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateTrustedDomain", discard_const_p(char *, kwnames), &py_policy_handle, &py_info, &py_access_mask)) {
10978                 return false;
10979         }
10980
10981         r->in.policy_handle = talloc_ptrtype(r, r->in.policy_handle);
10982         PY_CHECK_TYPE(policy_handle_Type, py_policy_handle, return false;);
10983         if (talloc_reference(r, pytalloc_get_mem_ctx(py_policy_handle)) == NULL) {
10984                 PyErr_NoMemory();
10985                 return false;
10986         }
10987         r->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(py_policy_handle);
10988         r->in.info = talloc_ptrtype(r, r->in.info);
10989         PY_CHECK_TYPE(&lsa_DomainInfo_Type, py_info, return false;);
10990         if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
10991                 PyErr_NoMemory();
10992                 return false;
10993         }
10994         r->in.info = (struct lsa_DomainInfo *)pytalloc_get_ptr(py_info);
10995         {
10996                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
10997                 if (PyLong_Check(py_access_mask)) {
10998                         unsigned long long test_var;
10999                         test_var = PyLong_AsUnsignedLongLong(py_access_mask);
11000                         if (PyErr_Occurred() != NULL) {
11001                                 return false;
11002                         }
11003                         if (test_var > uint_max) {
11004                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11005                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11006                                 return false;
11007                         }
11008                         r->in.access_mask = test_var;
11009                 } else if (PyInt_Check(py_access_mask)) {
11010                         long test_var;
11011                         test_var = PyInt_AsLong(py_access_mask);
11012                         if (test_var < 0 || test_var > uint_max) {
11013                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11014                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11015                                 return false;
11016                         }
11017                         r->in.access_mask = test_var;
11018                 } else {
11019                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11020                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11021                         return false;
11022                 }
11023         }
11024         return true;
11025 }
11026
11027 static PyObject *unpack_py_lsa_CreateTrustedDomain_args_out(struct lsa_CreateTrustedDomain *r)
11028 {
11029         PyObject *result;
11030         PyObject *py_trustdom_handle;
11031         py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
11032         result = py_trustdom_handle;
11033         if (NT_STATUS_IS_ERR(r->out.result)) {
11034                 PyErr_SetNTSTATUS(r->out.result);
11035                 return NULL;
11036         }
11037
11038         return result;
11039 }
11040
11041 static bool pack_py_lsa_EnumTrustDom_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumTrustDom *r)
11042 {
11043         PyObject *py_handle;
11044         PyObject *py_resume_handle;
11045         PyObject *py_max_size;
11046         const char *kwnames[] = {
11047                 "handle", "resume_handle", "max_size", NULL
11048         };
11049
11050         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumTrustDom", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_size)) {
11051                 return false;
11052         }
11053
11054         r->in.handle = talloc_ptrtype(r, r->in.handle);
11055         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
11056         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
11057                 PyErr_NoMemory();
11058                 return false;
11059         }
11060         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11061         r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
11062         {
11063                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
11064                 if (PyLong_Check(py_resume_handle)) {
11065                         unsigned long long test_var;
11066                         test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
11067                         if (PyErr_Occurred() != NULL) {
11068                                 return false;
11069                         }
11070                         if (test_var > uint_max) {
11071                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11072                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11073                                 return false;
11074                         }
11075                         *r->in.resume_handle = test_var;
11076                 } else if (PyInt_Check(py_resume_handle)) {
11077                         long test_var;
11078                         test_var = PyInt_AsLong(py_resume_handle);
11079                         if (test_var < 0 || test_var > uint_max) {
11080                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11081                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11082                                 return false;
11083                         }
11084                         *r->in.resume_handle = test_var;
11085                 } else {
11086                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11087                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11088                         return false;
11089                 }
11090         }
11091         {
11092                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size));
11093                 if (PyLong_Check(py_max_size)) {
11094                         unsigned long long test_var;
11095                         test_var = PyLong_AsUnsignedLongLong(py_max_size);
11096                         if (PyErr_Occurred() != NULL) {
11097                                 return false;
11098                         }
11099                         if (test_var > uint_max) {
11100                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11101                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11102                                 return false;
11103                         }
11104                         r->in.max_size = test_var;
11105                 } else if (PyInt_Check(py_max_size)) {
11106                         long test_var;
11107                         test_var = PyInt_AsLong(py_max_size);
11108                         if (test_var < 0 || test_var > uint_max) {
11109                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11110                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11111                                 return false;
11112                         }
11113                         r->in.max_size = test_var;
11114                 } else {
11115                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11116                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11117                         return false;
11118                 }
11119         }
11120         return true;
11121 }
11122
11123 static PyObject *unpack_py_lsa_EnumTrustDom_args_out(struct lsa_EnumTrustDom *r)
11124 {
11125         PyObject *result;
11126         PyObject *py_resume_handle;
11127         PyObject *py_domains;
11128         result = PyTuple_New(2);
11129         py_resume_handle = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
11130         PyTuple_SetItem(result, 0, py_resume_handle);
11131         py_domains = pytalloc_reference_ex(&lsa_DomainList_Type, r->out.domains, r->out.domains);
11132         PyTuple_SetItem(result, 1, py_domains);
11133         if (NT_STATUS_IS_ERR(r->out.result)) {
11134                 PyErr_SetNTSTATUS(r->out.result);
11135                 return NULL;
11136         }
11137
11138         return result;
11139 }
11140
11141 static bool pack_py_lsa_LookupNames_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames *r)
11142 {
11143         PyObject *py_handle;
11144         PyObject *py_names;
11145         PyObject *py_sids;
11146         PyObject *py_level;
11147         PyObject *py_count;
11148         const char *kwnames[] = {
11149                 "handle", "names", "sids", "level", "count", NULL
11150         };
11151
11152         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_LookupNames", discard_const_p(char *, kwnames), &py_handle, &py_names, &py_sids, &py_level, &py_count)) {
11153                 return false;
11154         }
11155
11156         r->in.handle = talloc_ptrtype(r, r->in.handle);
11157         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
11158         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
11159                 PyErr_NoMemory();
11160                 return false;
11161         }
11162         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11163         PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
11164         r->in.num_names = PyList_GET_SIZE(py_names);
11165         PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
11166         {
11167                 int names_cntr_0;
11168                 r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
11169                 if (!r->in.names) { return false;; }
11170                 talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
11171                 for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
11172                         PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
11173                         if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
11174                                 PyErr_NoMemory();
11175                                 return false;
11176                         }
11177                         r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
11178                 }
11179         }
11180         r->in.sids = talloc_ptrtype(r, r->in.sids);
11181         PY_CHECK_TYPE(&lsa_TransSidArray_Type, py_sids, return false;);
11182         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
11183                 PyErr_NoMemory();
11184                 return false;
11185         }
11186         r->in.sids = (struct lsa_TransSidArray *)pytalloc_get_ptr(py_sids);
11187         {
11188                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
11189                 if (PyLong_Check(py_level)) {
11190                         unsigned long long test_var;
11191                         test_var = PyLong_AsUnsignedLongLong(py_level);
11192                         if (PyErr_Occurred() != NULL) {
11193                                 return false;
11194                         }
11195                         if (test_var > uint_max) {
11196                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11197                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11198                                 return false;
11199                         }
11200                         r->in.level = test_var;
11201                 } else if (PyInt_Check(py_level)) {
11202                         long test_var;
11203                         test_var = PyInt_AsLong(py_level);
11204                         if (test_var < 0 || test_var > uint_max) {
11205                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11206                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11207                                 return false;
11208                         }
11209                         r->in.level = test_var;
11210                 } else {
11211                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11212                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11213                         return false;
11214                 }
11215         }
11216         r->in.count = talloc_ptrtype(r, r->in.count);
11217         {
11218                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
11219                 if (PyLong_Check(py_count)) {
11220                         unsigned long long test_var;
11221                         test_var = PyLong_AsUnsignedLongLong(py_count);
11222                         if (PyErr_Occurred() != NULL) {
11223                                 return false;
11224                         }
11225                         if (test_var > uint_max) {
11226                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11227                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11228                                 return false;
11229                         }
11230                         *r->in.count = test_var;
11231                 } else if (PyInt_Check(py_count)) {
11232                         long test_var;
11233                         test_var = PyInt_AsLong(py_count);
11234                         if (test_var < 0 || test_var > uint_max) {
11235                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11236                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11237                                 return false;
11238                         }
11239                         *r->in.count = test_var;
11240                 } else {
11241                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11242                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11243                         return false;
11244                 }
11245         }
11246         return true;
11247 }
11248
11249 static PyObject *unpack_py_lsa_LookupNames_args_out(struct lsa_LookupNames *r)
11250 {
11251         PyObject *result;
11252         PyObject *py_domains;
11253         PyObject *py_sids;
11254         PyObject *py_count;
11255         result = PyTuple_New(3);
11256         if (*r->out.domains == NULL) {
11257                 py_domains = Py_None;
11258                 Py_INCREF(py_domains);
11259         } else {
11260                 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
11261         }
11262         PyTuple_SetItem(result, 0, py_domains);
11263         py_sids = pytalloc_reference_ex(&lsa_TransSidArray_Type, r->out.sids, r->out.sids);
11264         PyTuple_SetItem(result, 1, py_sids);
11265         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
11266         PyTuple_SetItem(result, 2, py_count);
11267         if (NT_STATUS_IS_ERR(r->out.result)) {
11268                 PyErr_SetNTSTATUS(r->out.result);
11269                 return NULL;
11270         }
11271
11272         return result;
11273 }
11274
11275 static bool pack_py_lsa_LookupSids_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids *r)
11276 {
11277         PyObject *py_handle;
11278         PyObject *py_sids;
11279         PyObject *py_names;
11280         PyObject *py_level;
11281         PyObject *py_count;
11282         const char *kwnames[] = {
11283                 "handle", "sids", "names", "level", "count", NULL
11284         };
11285
11286         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_LookupSids", discard_const_p(char *, kwnames), &py_handle, &py_sids, &py_names, &py_level, &py_count)) {
11287                 return false;
11288         }
11289
11290         r->in.handle = talloc_ptrtype(r, r->in.handle);
11291         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
11292         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
11293                 PyErr_NoMemory();
11294                 return false;
11295         }
11296         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11297         r->in.sids = talloc_ptrtype(r, r->in.sids);
11298         PY_CHECK_TYPE(&lsa_SidArray_Type, py_sids, return false;);
11299         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
11300                 PyErr_NoMemory();
11301                 return false;
11302         }
11303         r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
11304         r->in.names = talloc_ptrtype(r, r->in.names);
11305         PY_CHECK_TYPE(&lsa_TransNameArray_Type, py_names, return false;);
11306         if (talloc_reference(r, pytalloc_get_mem_ctx(py_names)) == NULL) {
11307                 PyErr_NoMemory();
11308                 return false;
11309         }
11310         r->in.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_names);
11311         {
11312                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
11313                 if (PyLong_Check(py_level)) {
11314                         unsigned long long test_var;
11315                         test_var = PyLong_AsUnsignedLongLong(py_level);
11316                         if (PyErr_Occurred() != NULL) {
11317                                 return false;
11318                         }
11319                         if (test_var > uint_max) {
11320                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11321                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11322                                 return false;
11323                         }
11324                         r->in.level = test_var;
11325                 } else if (PyInt_Check(py_level)) {
11326                         long test_var;
11327                         test_var = PyInt_AsLong(py_level);
11328                         if (test_var < 0 || test_var > uint_max) {
11329                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11330                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11331                                 return false;
11332                         }
11333                         r->in.level = test_var;
11334                 } else {
11335                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11336                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11337                         return false;
11338                 }
11339         }
11340         r->in.count = talloc_ptrtype(r, r->in.count);
11341         {
11342                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
11343                 if (PyLong_Check(py_count)) {
11344                         unsigned long long test_var;
11345                         test_var = PyLong_AsUnsignedLongLong(py_count);
11346                         if (PyErr_Occurred() != NULL) {
11347                                 return false;
11348                         }
11349                         if (test_var > uint_max) {
11350                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11351                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11352                                 return false;
11353                         }
11354                         *r->in.count = test_var;
11355                 } else if (PyInt_Check(py_count)) {
11356                         long test_var;
11357                         test_var = PyInt_AsLong(py_count);
11358                         if (test_var < 0 || test_var > uint_max) {
11359                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11360                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11361                                 return false;
11362                         }
11363                         *r->in.count = test_var;
11364                 } else {
11365                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11366                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11367                         return false;
11368                 }
11369         }
11370         return true;
11371 }
11372
11373 static PyObject *unpack_py_lsa_LookupSids_args_out(struct lsa_LookupSids *r)
11374 {
11375         PyObject *result;
11376         PyObject *py_domains;
11377         PyObject *py_names;
11378         PyObject *py_count;
11379         result = PyTuple_New(3);
11380         if (*r->out.domains == NULL) {
11381                 py_domains = Py_None;
11382                 Py_INCREF(py_domains);
11383         } else {
11384                 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
11385         }
11386         PyTuple_SetItem(result, 0, py_domains);
11387         py_names = pytalloc_reference_ex(&lsa_TransNameArray_Type, r->out.names, r->out.names);
11388         PyTuple_SetItem(result, 1, py_names);
11389         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
11390         PyTuple_SetItem(result, 2, py_count);
11391         if (NT_STATUS_IS_ERR(r->out.result)) {
11392                 PyErr_SetNTSTATUS(r->out.result);
11393                 return NULL;
11394         }
11395
11396         return result;
11397 }
11398
11399 static bool pack_py_lsa_CreateSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateSecret *r)
11400 {
11401         PyObject *py_handle;
11402         PyObject *py_name;
11403         PyObject *py_access_mask;
11404         const char *kwnames[] = {
11405                 "handle", "name", "access_mask", NULL
11406         };
11407
11408         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateSecret", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
11409                 return false;
11410         }
11411
11412         r->in.handle = talloc_ptrtype(r, r->in.handle);
11413         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
11414         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
11415                 PyErr_NoMemory();
11416                 return false;
11417         }
11418         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11419         PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
11420         if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
11421                 PyErr_NoMemory();
11422                 return false;
11423         }
11424         r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
11425         {
11426                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
11427                 if (PyLong_Check(py_access_mask)) {
11428                         unsigned long long test_var;
11429                         test_var = PyLong_AsUnsignedLongLong(py_access_mask);
11430                         if (PyErr_Occurred() != NULL) {
11431                                 return false;
11432                         }
11433                         if (test_var > uint_max) {
11434                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11435                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11436                                 return false;
11437                         }
11438                         r->in.access_mask = test_var;
11439                 } else if (PyInt_Check(py_access_mask)) {
11440                         long test_var;
11441                         test_var = PyInt_AsLong(py_access_mask);
11442                         if (test_var < 0 || test_var > uint_max) {
11443                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11444                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11445                                 return false;
11446                         }
11447                         r->in.access_mask = test_var;
11448                 } else {
11449                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11450                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11451                         return false;
11452                 }
11453         }
11454         return true;
11455 }
11456
11457 static PyObject *unpack_py_lsa_CreateSecret_args_out(struct lsa_CreateSecret *r)
11458 {
11459         PyObject *result;
11460         PyObject *py_sec_handle;
11461         py_sec_handle = pytalloc_reference_ex(policy_handle_Type, r->out.sec_handle, r->out.sec_handle);
11462         result = py_sec_handle;
11463         if (NT_STATUS_IS_ERR(r->out.result)) {
11464                 PyErr_SetNTSTATUS(r->out.result);
11465                 return NULL;
11466         }
11467
11468         return result;
11469 }
11470
11471 static bool pack_py_lsa_OpenAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenAccount *r)
11472 {
11473         PyObject *py_handle;
11474         PyObject *py_sid;
11475         PyObject *py_access_mask;
11476         const char *kwnames[] = {
11477                 "handle", "sid", "access_mask", NULL
11478         };
11479
11480         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenAccount", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
11481                 return false;
11482         }
11483
11484         r->in.handle = talloc_ptrtype(r, r->in.handle);
11485         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
11486         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
11487                 PyErr_NoMemory();
11488                 return false;
11489         }
11490         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11491         r->in.sid = talloc_ptrtype(r, r->in.sid);
11492         PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
11493         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
11494                 PyErr_NoMemory();
11495                 return false;
11496         }
11497         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
11498         {
11499                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
11500                 if (PyLong_Check(py_access_mask)) {
11501                         unsigned long long test_var;
11502                         test_var = PyLong_AsUnsignedLongLong(py_access_mask);
11503                         if (PyErr_Occurred() != NULL) {
11504                                 return false;
11505                         }
11506                         if (test_var > uint_max) {
11507                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11508                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11509                                 return false;
11510                         }
11511                         r->in.access_mask = test_var;
11512                 } else if (PyInt_Check(py_access_mask)) {
11513                         long test_var;
11514                         test_var = PyInt_AsLong(py_access_mask);
11515                         if (test_var < 0 || test_var > uint_max) {
11516                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11517                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11518                                 return false;
11519                         }
11520                         r->in.access_mask = test_var;
11521                 } else {
11522                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11523                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11524                         return false;
11525                 }
11526         }
11527         return true;
11528 }
11529
11530 static PyObject *unpack_py_lsa_OpenAccount_args_out(struct lsa_OpenAccount *r)
11531 {
11532         PyObject *result;
11533         PyObject *py_acct_handle;
11534         py_acct_handle = pytalloc_reference_ex(policy_handle_Type, r->out.acct_handle, r->out.acct_handle);
11535         result = py_acct_handle;
11536         if (NT_STATUS_IS_ERR(r->out.result)) {
11537                 PyErr_SetNTSTATUS(r->out.result);
11538                 return NULL;
11539         }
11540
11541         return result;
11542 }
11543
11544 static bool pack_py_lsa_EnumPrivsAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumPrivsAccount *r)
11545 {
11546         PyObject *py_handle;
11547         const char *kwnames[] = {
11548                 "handle", NULL
11549         };
11550
11551         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_EnumPrivsAccount", discard_const_p(char *, kwnames), &py_handle)) {
11552                 return false;
11553         }
11554
11555         r->in.handle = talloc_ptrtype(r, r->in.handle);
11556         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
11557         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
11558                 PyErr_NoMemory();
11559                 return false;
11560         }
11561         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11562         return true;
11563 }
11564
11565 static PyObject *unpack_py_lsa_EnumPrivsAccount_args_out(struct lsa_EnumPrivsAccount *r)
11566 {
11567         PyObject *result;
11568         PyObject *py_privs;
11569         if (*r->out.privs == NULL) {
11570                 py_privs = Py_None;
11571                 Py_INCREF(py_privs);
11572         } else {
11573                 py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, *r->out.privs, *r->out.privs);
11574         }
11575         result = py_privs;
11576         if (NT_STATUS_IS_ERR(r->out.result)) {
11577                 PyErr_SetNTSTATUS(r->out.result);
11578                 return NULL;
11579         }
11580
11581         return result;
11582 }
11583
11584 static bool pack_py_lsa_AddPrivilegesToAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_AddPrivilegesToAccount *r)
11585 {
11586         PyObject *py_handle;
11587         PyObject *py_privs;
11588         const char *kwnames[] = {
11589                 "handle", "privs", NULL
11590         };
11591
11592         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_AddPrivilegesToAccount", discard_const_p(char *, kwnames), &py_handle, &py_privs)) {
11593                 return false;
11594         }
11595
11596         r->in.handle = talloc_ptrtype(r, r->in.handle);
11597         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
11598         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
11599                 PyErr_NoMemory();
11600                 return false;
11601         }
11602         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11603         r->in.privs = talloc_ptrtype(r, r->in.privs);
11604         PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, py_privs, return false;);
11605         if (talloc_reference(r, pytalloc_get_mem_ctx(py_privs)) == NULL) {
11606                 PyErr_NoMemory();
11607                 return false;
11608         }
11609         r->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_privs);
11610         return true;
11611 }
11612
11613 static PyObject *unpack_py_lsa_AddPrivilegesToAccount_args_out(struct lsa_AddPrivilegesToAccount *r)
11614 {
11615         PyObject *result;
11616         result = Py_None;
11617         Py_INCREF(result);
11618         if (NT_STATUS_IS_ERR(r->out.result)) {
11619                 PyErr_SetNTSTATUS(r->out.result);
11620                 return NULL;
11621         }
11622
11623         return result;
11624 }
11625
11626 static bool pack_py_lsa_RemovePrivilegesFromAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_RemovePrivilegesFromAccount *r)
11627 {
11628         PyObject *py_handle;
11629         PyObject *py_remove_all;
11630         PyObject *py_privs;
11631         const char *kwnames[] = {
11632                 "handle", "remove_all", "privs", NULL
11633         };
11634
11635         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_RemovePrivilegesFromAccount", discard_const_p(char *, kwnames), &py_handle, &py_remove_all, &py_privs)) {
11636                 return false;
11637         }
11638
11639         r->in.handle = talloc_ptrtype(r, r->in.handle);
11640         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
11641         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
11642                 PyErr_NoMemory();
11643                 return false;
11644         }
11645         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11646         {
11647                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.remove_all));
11648                 if (PyLong_Check(py_remove_all)) {
11649                         unsigned long long test_var;
11650                         test_var = PyLong_AsUnsignedLongLong(py_remove_all);
11651                         if (PyErr_Occurred() != NULL) {
11652                                 return false;
11653                         }
11654                         if (test_var > uint_max) {
11655                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11656                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11657                                 return false;
11658                         }
11659                         r->in.remove_all = test_var;
11660                 } else if (PyInt_Check(py_remove_all)) {
11661                         long test_var;
11662                         test_var = PyInt_AsLong(py_remove_all);
11663                         if (test_var < 0 || test_var > uint_max) {
11664                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11665                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11666                                 return false;
11667                         }
11668                         r->in.remove_all = test_var;
11669                 } else {
11670                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11671                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11672                         return false;
11673                 }
11674         }
11675         if (py_privs == Py_None) {
11676                 r->in.privs = NULL;
11677         } else {
11678                 r->in.privs = NULL;
11679                 PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, py_privs, return false;);
11680                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_privs)) == NULL) {
11681                         PyErr_NoMemory();
11682                         return false;
11683                 }
11684                 r->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_privs);
11685         }
11686         return true;
11687 }
11688
11689 static PyObject *unpack_py_lsa_RemovePrivilegesFromAccount_args_out(struct lsa_RemovePrivilegesFromAccount *r)
11690 {
11691         PyObject *result;
11692         result = Py_None;
11693         Py_INCREF(result);
11694         if (NT_STATUS_IS_ERR(r->out.result)) {
11695                 PyErr_SetNTSTATUS(r->out.result);
11696                 return NULL;
11697         }
11698
11699         return result;
11700 }
11701
11702 static bool pack_py_lsa_GetSystemAccessAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_GetSystemAccessAccount *r)
11703 {
11704         PyObject *py_handle;
11705         const char *kwnames[] = {
11706                 "handle", NULL
11707         };
11708
11709         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_GetSystemAccessAccount", discard_const_p(char *, kwnames), &py_handle)) {
11710                 return false;
11711         }
11712
11713         r->in.handle = talloc_ptrtype(r, r->in.handle);
11714         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
11715         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
11716                 PyErr_NoMemory();
11717                 return false;
11718         }
11719         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11720         return true;
11721 }
11722
11723 static PyObject *unpack_py_lsa_GetSystemAccessAccount_args_out(struct lsa_GetSystemAccessAccount *r)
11724 {
11725         PyObject *result;
11726         PyObject *py_access_mask;
11727         py_access_mask = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.access_mask);
11728         result = py_access_mask;
11729         if (NT_STATUS_IS_ERR(r->out.result)) {
11730                 PyErr_SetNTSTATUS(r->out.result);
11731                 return NULL;
11732         }
11733
11734         return result;
11735 }
11736
11737 static bool pack_py_lsa_SetSystemAccessAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSystemAccessAccount *r)
11738 {
11739         PyObject *py_handle;
11740         PyObject *py_access_mask;
11741         const char *kwnames[] = {
11742                 "handle", "access_mask", NULL
11743         };
11744
11745         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_SetSystemAccessAccount", discard_const_p(char *, kwnames), &py_handle, &py_access_mask)) {
11746                 return false;
11747         }
11748
11749         r->in.handle = talloc_ptrtype(r, r->in.handle);
11750         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
11751         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
11752                 PyErr_NoMemory();
11753                 return false;
11754         }
11755         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11756         {
11757                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
11758                 if (PyLong_Check(py_access_mask)) {
11759                         unsigned long long test_var;
11760                         test_var = PyLong_AsUnsignedLongLong(py_access_mask);
11761                         if (PyErr_Occurred() != NULL) {
11762                                 return false;
11763                         }
11764                         if (test_var > uint_max) {
11765                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11766                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11767                                 return false;
11768                         }
11769                         r->in.access_mask = test_var;
11770                 } else if (PyInt_Check(py_access_mask)) {
11771                         long test_var;
11772                         test_var = PyInt_AsLong(py_access_mask);
11773                         if (test_var < 0 || test_var > uint_max) {
11774                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11775                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11776                                 return false;
11777                         }
11778                         r->in.access_mask = test_var;
11779                 } else {
11780                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11781                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11782                         return false;
11783                 }
11784         }
11785         return true;
11786 }
11787
11788 static PyObject *unpack_py_lsa_SetSystemAccessAccount_args_out(struct lsa_SetSystemAccessAccount *r)
11789 {
11790         PyObject *result;
11791         result = Py_None;
11792         Py_INCREF(result);
11793         if (NT_STATUS_IS_ERR(r->out.result)) {
11794                 PyErr_SetNTSTATUS(r->out.result);
11795                 return NULL;
11796         }
11797
11798         return result;
11799 }
11800
11801 static bool pack_py_lsa_OpenTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenTrustedDomain *r)
11802 {
11803         PyObject *py_handle;
11804         PyObject *py_sid;
11805         PyObject *py_access_mask;
11806         const char *kwnames[] = {
11807                 "handle", "sid", "access_mask", NULL
11808         };
11809
11810         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenTrustedDomain", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
11811                 return false;
11812         }
11813
11814         r->in.handle = talloc_ptrtype(r, r->in.handle);
11815         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
11816         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
11817                 PyErr_NoMemory();
11818                 return false;
11819         }
11820         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11821         r->in.sid = talloc_ptrtype(r, r->in.sid);
11822         PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
11823         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
11824                 PyErr_NoMemory();
11825                 return false;
11826         }
11827         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
11828         {
11829                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
11830                 if (PyLong_Check(py_access_mask)) {
11831                         unsigned long long test_var;
11832                         test_var = PyLong_AsUnsignedLongLong(py_access_mask);
11833                         if (PyErr_Occurred() != NULL) {
11834                                 return false;
11835                         }
11836                         if (test_var > uint_max) {
11837                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11838                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11839                                 return false;
11840                         }
11841                         r->in.access_mask = test_var;
11842                 } else if (PyInt_Check(py_access_mask)) {
11843                         long test_var;
11844                         test_var = PyInt_AsLong(py_access_mask);
11845                         if (test_var < 0 || test_var > uint_max) {
11846                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11847                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11848                                 return false;
11849                         }
11850                         r->in.access_mask = test_var;
11851                 } else {
11852                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11853                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11854                         return false;
11855                 }
11856         }
11857         return true;
11858 }
11859
11860 static PyObject *unpack_py_lsa_OpenTrustedDomain_args_out(struct lsa_OpenTrustedDomain *r)
11861 {
11862         PyObject *result;
11863         PyObject *py_trustdom_handle;
11864         py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
11865         result = py_trustdom_handle;
11866         if (NT_STATUS_IS_ERR(r->out.result)) {
11867                 PyErr_SetNTSTATUS(r->out.result);
11868                 return NULL;
11869         }
11870
11871         return result;
11872 }
11873
11874 static bool pack_py_lsa_QueryTrustedDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfo *r)
11875 {
11876         PyObject *py_trustdom_handle;
11877         PyObject *py_level;
11878         const char *kwnames[] = {
11879                 "trustdom_handle", "level", NULL
11880         };
11881
11882         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryTrustedDomainInfo", discard_const_p(char *, kwnames), &py_trustdom_handle, &py_level)) {
11883                 return false;
11884         }
11885
11886         r->in.trustdom_handle = talloc_ptrtype(r, r->in.trustdom_handle);
11887         PY_CHECK_TYPE(policy_handle_Type, py_trustdom_handle, return false;);
11888         if (talloc_reference(r, pytalloc_get_mem_ctx(py_trustdom_handle)) == NULL) {
11889                 PyErr_NoMemory();
11890                 return false;
11891         }
11892         r->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(py_trustdom_handle);
11893         {
11894                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
11895                 if (PyLong_Check(py_level)) {
11896                         unsigned long long test_var;
11897                         test_var = PyLong_AsUnsignedLongLong(py_level);
11898                         if (PyErr_Occurred() != NULL) {
11899                                 return false;
11900                         }
11901                         if (test_var > uint_max) {
11902                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11903                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11904                                 return false;
11905                         }
11906                         r->in.level = test_var;
11907                 } else if (PyInt_Check(py_level)) {
11908                         long test_var;
11909                         test_var = PyInt_AsLong(py_level);
11910                         if (test_var < 0 || test_var > uint_max) {
11911                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11912                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11913                                 return false;
11914                         }
11915                         r->in.level = test_var;
11916                 } else {
11917                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11918                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11919                         return false;
11920                 }
11921         }
11922         return true;
11923 }
11924
11925 static PyObject *unpack_py_lsa_QueryTrustedDomainInfo_args_out(struct lsa_QueryTrustedDomainInfo *r)
11926 {
11927         PyObject *result;
11928         PyObject *py_info;
11929         if (*r->out.info == NULL) {
11930                 py_info = Py_None;
11931                 Py_INCREF(py_info);
11932         } else {
11933                 py_info = py_import_lsa_TrustedDomainInfo(*r->out.info, r->in.level, *r->out.info);
11934                 if (py_info == NULL) {
11935                         return NULL;
11936                 }
11937         }
11938         result = py_info;
11939         if (NT_STATUS_IS_ERR(r->out.result)) {
11940                 PyErr_SetNTSTATUS(r->out.result);
11941                 return NULL;
11942         }
11943
11944         return result;
11945 }
11946
11947 static bool pack_py_lsa_SetInformationTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInformationTrustedDomain *r)
11948 {
11949         PyObject *py_trustdom_handle;
11950         PyObject *py_level;
11951         PyObject *py_info;
11952         const char *kwnames[] = {
11953                 "trustdom_handle", "level", "info", NULL
11954         };
11955
11956         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInformationTrustedDomain", discard_const_p(char *, kwnames), &py_trustdom_handle, &py_level, &py_info)) {
11957                 return false;
11958         }
11959
11960         r->in.trustdom_handle = talloc_ptrtype(r, r->in.trustdom_handle);
11961         PY_CHECK_TYPE(policy_handle_Type, py_trustdom_handle, return false;);
11962         if (talloc_reference(r, pytalloc_get_mem_ctx(py_trustdom_handle)) == NULL) {
11963                 PyErr_NoMemory();
11964                 return false;
11965         }
11966         r->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(py_trustdom_handle);
11967         {
11968                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
11969                 if (PyLong_Check(py_level)) {
11970                         unsigned long long test_var;
11971                         test_var = PyLong_AsUnsignedLongLong(py_level);
11972                         if (PyErr_Occurred() != NULL) {
11973                                 return false;
11974                         }
11975                         if (test_var > uint_max) {
11976                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
11977                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11978                                 return false;
11979                         }
11980                         r->in.level = test_var;
11981                 } else if (PyInt_Check(py_level)) {
11982                         long test_var;
11983                         test_var = PyInt_AsLong(py_level);
11984                         if (test_var < 0 || test_var > uint_max) {
11985                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
11986                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
11987                                 return false;
11988                         }
11989                         r->in.level = test_var;
11990                 } else {
11991                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11992                           PyInt_Type.tp_name, PyLong_Type.tp_name);
11993                         return false;
11994                 }
11995         }
11996         r->in.info = talloc_ptrtype(r, r->in.info);
11997         {
11998                 union lsa_TrustedDomainInfo *info_switch_1;
11999                 info_switch_1 = py_export_lsa_TrustedDomainInfo(r, r->in.level, py_info);
12000                 if (info_switch_1 == NULL) {
12001                         return false;
12002                 }
12003                 r->in.info = info_switch_1;
12004         }
12005         return true;
12006 }
12007
12008 static PyObject *unpack_py_lsa_SetInformationTrustedDomain_args_out(struct lsa_SetInformationTrustedDomain *r)
12009 {
12010         PyObject *result;
12011         result = Py_None;
12012         Py_INCREF(result);
12013         if (NT_STATUS_IS_ERR(r->out.result)) {
12014                 PyErr_SetNTSTATUS(r->out.result);
12015                 return NULL;
12016         }
12017
12018         return result;
12019 }
12020
12021 static bool pack_py_lsa_OpenSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenSecret *r)
12022 {
12023         PyObject *py_handle;
12024         PyObject *py_name;
12025         PyObject *py_access_mask;
12026         const char *kwnames[] = {
12027                 "handle", "name", "access_mask", NULL
12028         };
12029
12030         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenSecret", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
12031                 return false;
12032         }
12033
12034         r->in.handle = talloc_ptrtype(r, r->in.handle);
12035         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12036         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12037                 PyErr_NoMemory();
12038                 return false;
12039         }
12040         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12041         PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
12042         if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
12043                 PyErr_NoMemory();
12044                 return false;
12045         }
12046         r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
12047         {
12048                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
12049                 if (PyLong_Check(py_access_mask)) {
12050                         unsigned long long test_var;
12051                         test_var = PyLong_AsUnsignedLongLong(py_access_mask);
12052                         if (PyErr_Occurred() != NULL) {
12053                                 return false;
12054                         }
12055                         if (test_var > uint_max) {
12056                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
12057                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12058                                 return false;
12059                         }
12060                         r->in.access_mask = test_var;
12061                 } else if (PyInt_Check(py_access_mask)) {
12062                         long test_var;
12063                         test_var = PyInt_AsLong(py_access_mask);
12064                         if (test_var < 0 || test_var > uint_max) {
12065                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
12066                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12067                                 return false;
12068                         }
12069                         r->in.access_mask = test_var;
12070                 } else {
12071                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12072                           PyInt_Type.tp_name, PyLong_Type.tp_name);
12073                         return false;
12074                 }
12075         }
12076         return true;
12077 }
12078
12079 static PyObject *unpack_py_lsa_OpenSecret_args_out(struct lsa_OpenSecret *r)
12080 {
12081         PyObject *result;
12082         PyObject *py_sec_handle;
12083         py_sec_handle = pytalloc_reference_ex(policy_handle_Type, r->out.sec_handle, r->out.sec_handle);
12084         result = py_sec_handle;
12085         if (NT_STATUS_IS_ERR(r->out.result)) {
12086                 PyErr_SetNTSTATUS(r->out.result);
12087                 return NULL;
12088         }
12089
12090         return result;
12091 }
12092
12093 static bool pack_py_lsa_SetSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSecret *r)
12094 {
12095         PyObject *py_sec_handle;
12096         PyObject *py_new_val;
12097         PyObject *py_old_val;
12098         const char *kwnames[] = {
12099                 "sec_handle", "new_val", "old_val", NULL
12100         };
12101
12102         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetSecret", discard_const_p(char *, kwnames), &py_sec_handle, &py_new_val, &py_old_val)) {
12103                 return false;
12104         }
12105
12106         r->in.sec_handle = talloc_ptrtype(r, r->in.sec_handle);
12107         PY_CHECK_TYPE(policy_handle_Type, py_sec_handle, return false;);
12108         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sec_handle)) == NULL) {
12109                 PyErr_NoMemory();
12110                 return false;
12111         }
12112         r->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(py_sec_handle);
12113         if (py_new_val == Py_None) {
12114                 r->in.new_val = NULL;
12115         } else {
12116                 r->in.new_val = NULL;
12117                 PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_new_val, return false;);
12118                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_val)) == NULL) {
12119                         PyErr_NoMemory();
12120                         return false;
12121                 }
12122                 r->in.new_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_new_val);
12123         }
12124         if (py_old_val == Py_None) {
12125                 r->in.old_val = NULL;
12126         } else {
12127                 r->in.old_val = NULL;
12128                 PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_old_val, return false;);
12129                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_val)) == NULL) {
12130                         PyErr_NoMemory();
12131                         return false;
12132                 }
12133                 r->in.old_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_old_val);
12134         }
12135         return true;
12136 }
12137
12138 static PyObject *unpack_py_lsa_SetSecret_args_out(struct lsa_SetSecret *r)
12139 {
12140         PyObject *result;
12141         result = Py_None;
12142         Py_INCREF(result);
12143         if (NT_STATUS_IS_ERR(r->out.result)) {
12144                 PyErr_SetNTSTATUS(r->out.result);
12145                 return NULL;
12146         }
12147
12148         return result;
12149 }
12150
12151 static bool pack_py_lsa_QuerySecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_QuerySecret *r)
12152 {
12153         PyObject *py_sec_handle;
12154         PyObject *py_new_val;
12155         PyObject *py_new_mtime;
12156         PyObject *py_old_val;
12157         PyObject *py_old_mtime;
12158         const char *kwnames[] = {
12159                 "sec_handle", "new_val", "new_mtime", "old_val", "old_mtime", NULL
12160         };
12161
12162         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_QuerySecret", discard_const_p(char *, kwnames), &py_sec_handle, &py_new_val, &py_new_mtime, &py_old_val, &py_old_mtime)) {
12163                 return false;
12164         }
12165
12166         r->in.sec_handle = talloc_ptrtype(r, r->in.sec_handle);
12167         PY_CHECK_TYPE(policy_handle_Type, py_sec_handle, return false;);
12168         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sec_handle)) == NULL) {
12169                 PyErr_NoMemory();
12170                 return false;
12171         }
12172         r->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(py_sec_handle);
12173         if (py_new_val == Py_None) {
12174                 r->in.new_val = NULL;
12175         } else {
12176                 r->in.new_val = NULL;
12177                 PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, py_new_val, return false;);
12178                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_val)) == NULL) {
12179                         PyErr_NoMemory();
12180                         return false;
12181                 }
12182                 r->in.new_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(py_new_val);
12183         }
12184         if (py_new_mtime == Py_None) {
12185                 r->in.new_mtime = NULL;
12186         } else {
12187                 r->in.new_mtime = talloc_ptrtype(r, r->in.new_mtime);
12188                 {
12189                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.new_mtime));
12190                         if (PyLong_Check(py_new_mtime)) {
12191                                 unsigned long long test_var;
12192                                 test_var = PyLong_AsUnsignedLongLong(py_new_mtime);
12193                                 if (PyErr_Occurred() != NULL) {
12194                                         return false;
12195                                 }
12196                                 if (test_var > uint_max) {
12197                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
12198                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12199                                         return false;
12200                                 }
12201                                 *r->in.new_mtime = test_var;
12202                         } else if (PyInt_Check(py_new_mtime)) {
12203                                 long test_var;
12204                                 test_var = PyInt_AsLong(py_new_mtime);
12205                                 if (test_var < 0 || test_var > uint_max) {
12206                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
12207                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12208                                         return false;
12209                                 }
12210                                 *r->in.new_mtime = test_var;
12211                         } else {
12212                                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12213                                   PyInt_Type.tp_name, PyLong_Type.tp_name);
12214                                 return false;
12215                         }
12216                 }
12217         }
12218         if (py_old_val == Py_None) {
12219                 r->in.old_val = NULL;
12220         } else {
12221                 r->in.old_val = NULL;
12222                 PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, py_old_val, return false;);
12223                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_val)) == NULL) {
12224                         PyErr_NoMemory();
12225                         return false;
12226                 }
12227                 r->in.old_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(py_old_val);
12228         }
12229         if (py_old_mtime == Py_None) {
12230                 r->in.old_mtime = NULL;
12231         } else {
12232                 r->in.old_mtime = talloc_ptrtype(r, r->in.old_mtime);
12233                 {
12234                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.old_mtime));
12235                         if (PyLong_Check(py_old_mtime)) {
12236                                 unsigned long long test_var;
12237                                 test_var = PyLong_AsUnsignedLongLong(py_old_mtime);
12238                                 if (PyErr_Occurred() != NULL) {
12239                                         return false;
12240                                 }
12241                                 if (test_var > uint_max) {
12242                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
12243                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12244                                         return false;
12245                                 }
12246                                 *r->in.old_mtime = test_var;
12247                         } else if (PyInt_Check(py_old_mtime)) {
12248                                 long test_var;
12249                                 test_var = PyInt_AsLong(py_old_mtime);
12250                                 if (test_var < 0 || test_var > uint_max) {
12251                                         PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
12252                                           PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12253                                         return false;
12254                                 }
12255                                 *r->in.old_mtime = test_var;
12256                         } else {
12257                                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12258                                   PyInt_Type.tp_name, PyLong_Type.tp_name);
12259                                 return false;
12260                         }
12261                 }
12262         }
12263         return true;
12264 }
12265
12266 static PyObject *unpack_py_lsa_QuerySecret_args_out(struct lsa_QuerySecret *r)
12267 {
12268         PyObject *result;
12269         PyObject *py_new_val;
12270         PyObject *py_new_mtime;
12271         PyObject *py_old_val;
12272         PyObject *py_old_mtime;
12273         result = PyTuple_New(4);
12274         if (r->out.new_val == NULL) {
12275                 py_new_val = Py_None;
12276                 Py_INCREF(py_new_val);
12277         } else {
12278                 py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, r->out.new_val, r->out.new_val);
12279         }
12280         PyTuple_SetItem(result, 0, py_new_val);
12281         if (r->out.new_mtime == NULL) {
12282                 py_new_mtime = Py_None;
12283                 Py_INCREF(py_new_mtime);
12284         } else {
12285                 py_new_mtime = ndr_PyLong_FromUnsignedLongLong(*r->out.new_mtime);
12286         }
12287         PyTuple_SetItem(result, 1, py_new_mtime);
12288         if (r->out.old_val == NULL) {
12289                 py_old_val = Py_None;
12290                 Py_INCREF(py_old_val);
12291         } else {
12292                 py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, r->out.old_val, r->out.old_val);
12293         }
12294         PyTuple_SetItem(result, 2, py_old_val);
12295         if (r->out.old_mtime == NULL) {
12296                 py_old_mtime = Py_None;
12297                 Py_INCREF(py_old_mtime);
12298         } else {
12299                 py_old_mtime = ndr_PyLong_FromUnsignedLongLong(*r->out.old_mtime);
12300         }
12301         PyTuple_SetItem(result, 3, py_old_mtime);
12302         if (NT_STATUS_IS_ERR(r->out.result)) {
12303                 PyErr_SetNTSTATUS(r->out.result);
12304                 return NULL;
12305         }
12306
12307         return result;
12308 }
12309
12310 static bool pack_py_lsa_LookupPrivValue_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivValue *r)
12311 {
12312         PyObject *py_handle;
12313         PyObject *py_name;
12314         const char *kwnames[] = {
12315                 "handle", "name", NULL
12316         };
12317
12318         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_LookupPrivValue", discard_const_p(char *, kwnames), &py_handle, &py_name)) {
12319                 return false;
12320         }
12321
12322         r->in.handle = talloc_ptrtype(r, r->in.handle);
12323         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12324         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12325                 PyErr_NoMemory();
12326                 return false;
12327         }
12328         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12329         r->in.name = talloc_ptrtype(r, r->in.name);
12330         PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
12331         if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
12332                 PyErr_NoMemory();
12333                 return false;
12334         }
12335         r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
12336         return true;
12337 }
12338
12339 static PyObject *unpack_py_lsa_LookupPrivValue_args_out(struct lsa_LookupPrivValue *r)
12340 {
12341         PyObject *result;
12342         PyObject *py_luid;
12343         py_luid = pytalloc_reference_ex(&lsa_LUID_Type, r->out.luid, r->out.luid);
12344         result = py_luid;
12345         if (NT_STATUS_IS_ERR(r->out.result)) {
12346                 PyErr_SetNTSTATUS(r->out.result);
12347                 return NULL;
12348         }
12349
12350         return result;
12351 }
12352
12353 static bool pack_py_lsa_LookupPrivName_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivName *r)
12354 {
12355         PyObject *py_handle;
12356         PyObject *py_luid;
12357         const char *kwnames[] = {
12358                 "handle", "luid", NULL
12359         };
12360
12361         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_LookupPrivName", discard_const_p(char *, kwnames), &py_handle, &py_luid)) {
12362                 return false;
12363         }
12364
12365         r->in.handle = talloc_ptrtype(r, r->in.handle);
12366         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12367         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12368                 PyErr_NoMemory();
12369                 return false;
12370         }
12371         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12372         r->in.luid = talloc_ptrtype(r, r->in.luid);
12373         PY_CHECK_TYPE(&lsa_LUID_Type, py_luid, return false;);
12374         if (talloc_reference(r, pytalloc_get_mem_ctx(py_luid)) == NULL) {
12375                 PyErr_NoMemory();
12376                 return false;
12377         }
12378         r->in.luid = (struct lsa_LUID *)pytalloc_get_ptr(py_luid);
12379         return true;
12380 }
12381
12382 static PyObject *unpack_py_lsa_LookupPrivName_args_out(struct lsa_LookupPrivName *r)
12383 {
12384         PyObject *result;
12385         PyObject *py_name;
12386         if (*r->out.name == NULL) {
12387                 py_name = Py_None;
12388                 Py_INCREF(py_name);
12389         } else {
12390                 py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *r->out.name, *r->out.name);
12391         }
12392         result = py_name;
12393         if (NT_STATUS_IS_ERR(r->out.result)) {
12394                 PyErr_SetNTSTATUS(r->out.result);
12395                 return NULL;
12396         }
12397
12398         return result;
12399 }
12400
12401 static bool pack_py_lsa_LookupPrivDisplayName_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivDisplayName *r)
12402 {
12403         PyObject *py_handle;
12404         PyObject *py_name;
12405         PyObject *py_language_id;
12406         PyObject *py_language_id_sys;
12407         const char *kwnames[] = {
12408                 "handle", "name", "language_id", "language_id_sys", NULL
12409         };
12410
12411         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_LookupPrivDisplayName", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_language_id, &py_language_id_sys)) {
12412                 return false;
12413         }
12414
12415         r->in.handle = talloc_ptrtype(r, r->in.handle);
12416         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12417         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12418                 PyErr_NoMemory();
12419                 return false;
12420         }
12421         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12422         r->in.name = talloc_ptrtype(r, r->in.name);
12423         PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
12424         if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
12425                 PyErr_NoMemory();
12426                 return false;
12427         }
12428         r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
12429         {
12430                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.language_id));
12431                 if (PyLong_Check(py_language_id)) {
12432                         unsigned long long test_var;
12433                         test_var = PyLong_AsUnsignedLongLong(py_language_id);
12434                         if (PyErr_Occurred() != NULL) {
12435                                 return false;
12436                         }
12437                         if (test_var > uint_max) {
12438                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
12439                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12440                                 return false;
12441                         }
12442                         r->in.language_id = test_var;
12443                 } else if (PyInt_Check(py_language_id)) {
12444                         long test_var;
12445                         test_var = PyInt_AsLong(py_language_id);
12446                         if (test_var < 0 || test_var > uint_max) {
12447                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
12448                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12449                                 return false;
12450                         }
12451                         r->in.language_id = test_var;
12452                 } else {
12453                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12454                           PyInt_Type.tp_name, PyLong_Type.tp_name);
12455                         return false;
12456                 }
12457         }
12458         {
12459                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.language_id_sys));
12460                 if (PyLong_Check(py_language_id_sys)) {
12461                         unsigned long long test_var;
12462                         test_var = PyLong_AsUnsignedLongLong(py_language_id_sys);
12463                         if (PyErr_Occurred() != NULL) {
12464                                 return false;
12465                         }
12466                         if (test_var > uint_max) {
12467                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
12468                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12469                                 return false;
12470                         }
12471                         r->in.language_id_sys = test_var;
12472                 } else if (PyInt_Check(py_language_id_sys)) {
12473                         long test_var;
12474                         test_var = PyInt_AsLong(py_language_id_sys);
12475                         if (test_var < 0 || test_var > uint_max) {
12476                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
12477                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12478                                 return false;
12479                         }
12480                         r->in.language_id_sys = test_var;
12481                 } else {
12482                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12483                           PyInt_Type.tp_name, PyLong_Type.tp_name);
12484                         return false;
12485                 }
12486         }
12487         return true;
12488 }
12489
12490 static PyObject *unpack_py_lsa_LookupPrivDisplayName_args_out(struct lsa_LookupPrivDisplayName *r)
12491 {
12492         PyObject *result;
12493         PyObject *py_disp_name;
12494         PyObject *py_returned_language_id;
12495         result = PyTuple_New(2);
12496         if (*r->out.disp_name == NULL) {
12497                 py_disp_name = Py_None;
12498                 Py_INCREF(py_disp_name);
12499         } else {
12500                 py_disp_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *r->out.disp_name, *r->out.disp_name);
12501         }
12502         PyTuple_SetItem(result, 0, py_disp_name);
12503         py_returned_language_id = PyInt_FromLong((uint16_t)*r->out.returned_language_id);
12504         PyTuple_SetItem(result, 1, py_returned_language_id);
12505         if (NT_STATUS_IS_ERR(r->out.result)) {
12506                 PyErr_SetNTSTATUS(r->out.result);
12507                 return NULL;
12508         }
12509
12510         return result;
12511 }
12512
12513 static bool pack_py_lsa_DeleteObject_args_in(PyObject *args, PyObject *kwargs, struct lsa_DeleteObject *r)
12514 {
12515         PyObject *py_handle;
12516         const char *kwnames[] = {
12517                 "handle", NULL
12518         };
12519
12520         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_DeleteObject", discard_const_p(char *, kwnames), &py_handle)) {
12521                 return false;
12522         }
12523
12524         r->in.handle = talloc_ptrtype(r, r->in.handle);
12525         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12526         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12527                 PyErr_NoMemory();
12528                 return false;
12529         }
12530         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12531         return true;
12532 }
12533
12534 static PyObject *unpack_py_lsa_DeleteObject_args_out(struct lsa_DeleteObject *r)
12535 {
12536         PyObject *result;
12537         PyObject *py_handle;
12538         py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
12539         result = py_handle;
12540         if (NT_STATUS_IS_ERR(r->out.result)) {
12541                 PyErr_SetNTSTATUS(r->out.result);
12542                 return NULL;
12543         }
12544
12545         return result;
12546 }
12547
12548 static bool pack_py_lsa_EnumAccountsWithUserRight_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccountsWithUserRight *r)
12549 {
12550         PyObject *py_handle;
12551         PyObject *py_name;
12552         const char *kwnames[] = {
12553                 "handle", "name", NULL
12554         };
12555
12556         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_EnumAccountsWithUserRight", discard_const_p(char *, kwnames), &py_handle, &py_name)) {
12557                 return false;
12558         }
12559
12560         r->in.handle = talloc_ptrtype(r, r->in.handle);
12561         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12562         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12563                 PyErr_NoMemory();
12564                 return false;
12565         }
12566         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12567         if (py_name == Py_None) {
12568                 r->in.name = NULL;
12569         } else {
12570                 r->in.name = NULL;
12571                 PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
12572                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
12573                         PyErr_NoMemory();
12574                         return false;
12575                 }
12576                 r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
12577         }
12578         return true;
12579 }
12580
12581 static PyObject *unpack_py_lsa_EnumAccountsWithUserRight_args_out(struct lsa_EnumAccountsWithUserRight *r)
12582 {
12583         PyObject *result;
12584         PyObject *py_sids;
12585         py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, r->out.sids, r->out.sids);
12586         result = py_sids;
12587         if (NT_STATUS_IS_ERR(r->out.result)) {
12588                 PyErr_SetNTSTATUS(r->out.result);
12589                 return NULL;
12590         }
12591
12592         return result;
12593 }
12594
12595 static bool pack_py_lsa_EnumAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccountRights *r)
12596 {
12597         PyObject *py_handle;
12598         PyObject *py_sid;
12599         const char *kwnames[] = {
12600                 "handle", "sid", NULL
12601         };
12602
12603         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_EnumAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid)) {
12604                 return false;
12605         }
12606
12607         r->in.handle = talloc_ptrtype(r, r->in.handle);
12608         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12609         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12610                 PyErr_NoMemory();
12611                 return false;
12612         }
12613         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12614         r->in.sid = talloc_ptrtype(r, r->in.sid);
12615         PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
12616         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
12617                 PyErr_NoMemory();
12618                 return false;
12619         }
12620         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
12621         return true;
12622 }
12623
12624 static PyObject *unpack_py_lsa_EnumAccountRights_args_out(struct lsa_EnumAccountRights *r)
12625 {
12626         PyObject *result;
12627         PyObject *py_rights;
12628         py_rights = pytalloc_reference_ex(&lsa_RightSet_Type, r->out.rights, r->out.rights);
12629         result = py_rights;
12630         if (NT_STATUS_IS_ERR(r->out.result)) {
12631                 PyErr_SetNTSTATUS(r->out.result);
12632                 return NULL;
12633         }
12634
12635         return result;
12636 }
12637
12638 static bool pack_py_lsa_AddAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_AddAccountRights *r)
12639 {
12640         PyObject *py_handle;
12641         PyObject *py_sid;
12642         PyObject *py_rights;
12643         const char *kwnames[] = {
12644                 "handle", "sid", "rights", NULL
12645         };
12646
12647         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_AddAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_rights)) {
12648                 return false;
12649         }
12650
12651         r->in.handle = talloc_ptrtype(r, r->in.handle);
12652         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12653         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12654                 PyErr_NoMemory();
12655                 return false;
12656         }
12657         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12658         r->in.sid = talloc_ptrtype(r, r->in.sid);
12659         PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
12660         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
12661                 PyErr_NoMemory();
12662                 return false;
12663         }
12664         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
12665         r->in.rights = talloc_ptrtype(r, r->in.rights);
12666         PY_CHECK_TYPE(&lsa_RightSet_Type, py_rights, return false;);
12667         if (talloc_reference(r, pytalloc_get_mem_ctx(py_rights)) == NULL) {
12668                 PyErr_NoMemory();
12669                 return false;
12670         }
12671         r->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(py_rights);
12672         return true;
12673 }
12674
12675 static PyObject *unpack_py_lsa_AddAccountRights_args_out(struct lsa_AddAccountRights *r)
12676 {
12677         PyObject *result;
12678         result = Py_None;
12679         Py_INCREF(result);
12680         if (NT_STATUS_IS_ERR(r->out.result)) {
12681                 PyErr_SetNTSTATUS(r->out.result);
12682                 return NULL;
12683         }
12684
12685         return result;
12686 }
12687
12688 static bool pack_py_lsa_RemoveAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_RemoveAccountRights *r)
12689 {
12690         PyObject *py_handle;
12691         PyObject *py_sid;
12692         PyObject *py_remove_all;
12693         PyObject *py_rights;
12694         const char *kwnames[] = {
12695                 "handle", "sid", "remove_all", "rights", NULL
12696         };
12697
12698         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_RemoveAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_remove_all, &py_rights)) {
12699                 return false;
12700         }
12701
12702         r->in.handle = talloc_ptrtype(r, r->in.handle);
12703         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12704         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12705                 PyErr_NoMemory();
12706                 return false;
12707         }
12708         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12709         r->in.sid = talloc_ptrtype(r, r->in.sid);
12710         PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
12711         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
12712                 PyErr_NoMemory();
12713                 return false;
12714         }
12715         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
12716         {
12717                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.remove_all));
12718                 if (PyLong_Check(py_remove_all)) {
12719                         unsigned long long test_var;
12720                         test_var = PyLong_AsUnsignedLongLong(py_remove_all);
12721                         if (PyErr_Occurred() != NULL) {
12722                                 return false;
12723                         }
12724                         if (test_var > uint_max) {
12725                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
12726                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12727                                 return false;
12728                         }
12729                         r->in.remove_all = test_var;
12730                 } else if (PyInt_Check(py_remove_all)) {
12731                         long test_var;
12732                         test_var = PyInt_AsLong(py_remove_all);
12733                         if (test_var < 0 || test_var > uint_max) {
12734                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
12735                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12736                                 return false;
12737                         }
12738                         r->in.remove_all = test_var;
12739                 } else {
12740                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12741                           PyInt_Type.tp_name, PyLong_Type.tp_name);
12742                         return false;
12743                 }
12744         }
12745         r->in.rights = talloc_ptrtype(r, r->in.rights);
12746         PY_CHECK_TYPE(&lsa_RightSet_Type, py_rights, return false;);
12747         if (talloc_reference(r, pytalloc_get_mem_ctx(py_rights)) == NULL) {
12748                 PyErr_NoMemory();
12749                 return false;
12750         }
12751         r->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(py_rights);
12752         return true;
12753 }
12754
12755 static PyObject *unpack_py_lsa_RemoveAccountRights_args_out(struct lsa_RemoveAccountRights *r)
12756 {
12757         PyObject *result;
12758         result = Py_None;
12759         Py_INCREF(result);
12760         if (NT_STATUS_IS_ERR(r->out.result)) {
12761                 PyErr_SetNTSTATUS(r->out.result);
12762                 return NULL;
12763         }
12764
12765         return result;
12766 }
12767
12768 static bool pack_py_lsa_QueryTrustedDomainInfoBySid_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfoBySid *r)
12769 {
12770         PyObject *py_handle;
12771         PyObject *py_dom_sid;
12772         PyObject *py_level;
12773         const char *kwnames[] = {
12774                 "handle", "dom_sid", "level", NULL
12775         };
12776
12777         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_QueryTrustedDomainInfoBySid", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid, &py_level)) {
12778                 return false;
12779         }
12780
12781         r->in.handle = talloc_ptrtype(r, r->in.handle);
12782         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12783         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12784                 PyErr_NoMemory();
12785                 return false;
12786         }
12787         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12788         r->in.dom_sid = talloc_ptrtype(r, r->in.dom_sid);
12789         PY_CHECK_TYPE(dom_sid_Type, py_dom_sid, return false;);
12790         if (talloc_reference(r, pytalloc_get_mem_ctx(py_dom_sid)) == NULL) {
12791                 PyErr_NoMemory();
12792                 return false;
12793         }
12794         r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
12795         {
12796                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
12797                 if (PyLong_Check(py_level)) {
12798                         unsigned long long test_var;
12799                         test_var = PyLong_AsUnsignedLongLong(py_level);
12800                         if (PyErr_Occurred() != NULL) {
12801                                 return false;
12802                         }
12803                         if (test_var > uint_max) {
12804                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
12805                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12806                                 return false;
12807                         }
12808                         r->in.level = test_var;
12809                 } else if (PyInt_Check(py_level)) {
12810                         long test_var;
12811                         test_var = PyInt_AsLong(py_level);
12812                         if (test_var < 0 || test_var > uint_max) {
12813                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
12814                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12815                                 return false;
12816                         }
12817                         r->in.level = test_var;
12818                 } else {
12819                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12820                           PyInt_Type.tp_name, PyLong_Type.tp_name);
12821                         return false;
12822                 }
12823         }
12824         return true;
12825 }
12826
12827 static PyObject *unpack_py_lsa_QueryTrustedDomainInfoBySid_args_out(struct lsa_QueryTrustedDomainInfoBySid *r)
12828 {
12829         PyObject *result;
12830         PyObject *py_info;
12831         if (*r->out.info == NULL) {
12832                 py_info = Py_None;
12833                 Py_INCREF(py_info);
12834         } else {
12835                 py_info = py_import_lsa_TrustedDomainInfo(*r->out.info, r->in.level, *r->out.info);
12836                 if (py_info == NULL) {
12837                         return NULL;
12838                 }
12839         }
12840         result = py_info;
12841         if (NT_STATUS_IS_ERR(r->out.result)) {
12842                 PyErr_SetNTSTATUS(r->out.result);
12843                 return NULL;
12844         }
12845
12846         return result;
12847 }
12848
12849 static bool pack_py_lsa_SetTrustedDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetTrustedDomainInfo *r)
12850 {
12851         PyObject *py_handle;
12852         PyObject *py_dom_sid;
12853         PyObject *py_level;
12854         PyObject *py_info;
12855         const char *kwnames[] = {
12856                 "handle", "dom_sid", "level", "info", NULL
12857         };
12858
12859         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_SetTrustedDomainInfo", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid, &py_level, &py_info)) {
12860                 return false;
12861         }
12862
12863         r->in.handle = talloc_ptrtype(r, r->in.handle);
12864         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12865         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12866                 PyErr_NoMemory();
12867                 return false;
12868         }
12869         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12870         r->in.dom_sid = talloc_ptrtype(r, r->in.dom_sid);
12871         PY_CHECK_TYPE(dom_sid_Type, py_dom_sid, return false;);
12872         if (talloc_reference(r, pytalloc_get_mem_ctx(py_dom_sid)) == NULL) {
12873                 PyErr_NoMemory();
12874                 return false;
12875         }
12876         r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
12877         {
12878                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
12879                 if (PyLong_Check(py_level)) {
12880                         unsigned long long test_var;
12881                         test_var = PyLong_AsUnsignedLongLong(py_level);
12882                         if (PyErr_Occurred() != NULL) {
12883                                 return false;
12884                         }
12885                         if (test_var > uint_max) {
12886                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
12887                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12888                                 return false;
12889                         }
12890                         r->in.level = test_var;
12891                 } else if (PyInt_Check(py_level)) {
12892                         long test_var;
12893                         test_var = PyInt_AsLong(py_level);
12894                         if (test_var < 0 || test_var > uint_max) {
12895                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
12896                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
12897                                 return false;
12898                         }
12899                         r->in.level = test_var;
12900                 } else {
12901                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12902                           PyInt_Type.tp_name, PyLong_Type.tp_name);
12903                         return false;
12904                 }
12905         }
12906         r->in.info = talloc_ptrtype(r, r->in.info);
12907         {
12908                 union lsa_TrustedDomainInfo *info_switch_1;
12909                 info_switch_1 = py_export_lsa_TrustedDomainInfo(r, r->in.level, py_info);
12910                 if (info_switch_1 == NULL) {
12911                         return false;
12912                 }
12913                 r->in.info = info_switch_1;
12914         }
12915         return true;
12916 }
12917
12918 static PyObject *unpack_py_lsa_SetTrustedDomainInfo_args_out(struct lsa_SetTrustedDomainInfo *r)
12919 {
12920         PyObject *result;
12921         result = Py_None;
12922         Py_INCREF(result);
12923         if (NT_STATUS_IS_ERR(r->out.result)) {
12924                 PyErr_SetNTSTATUS(r->out.result);
12925                 return NULL;
12926         }
12927
12928         return result;
12929 }
12930
12931 static bool pack_py_lsa_DeleteTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_DeleteTrustedDomain *r)
12932 {
12933         PyObject *py_handle;
12934         PyObject *py_dom_sid;
12935         const char *kwnames[] = {
12936                 "handle", "dom_sid", NULL
12937         };
12938
12939         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_DeleteTrustedDomain", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid)) {
12940                 return false;
12941         }
12942
12943         r->in.handle = talloc_ptrtype(r, r->in.handle);
12944         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12945         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12946                 PyErr_NoMemory();
12947                 return false;
12948         }
12949         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12950         r->in.dom_sid = talloc_ptrtype(r, r->in.dom_sid);
12951         PY_CHECK_TYPE(dom_sid_Type, py_dom_sid, return false;);
12952         if (talloc_reference(r, pytalloc_get_mem_ctx(py_dom_sid)) == NULL) {
12953                 PyErr_NoMemory();
12954                 return false;
12955         }
12956         r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
12957         return true;
12958 }
12959
12960 static PyObject *unpack_py_lsa_DeleteTrustedDomain_args_out(struct lsa_DeleteTrustedDomain *r)
12961 {
12962         PyObject *result;
12963         result = Py_None;
12964         Py_INCREF(result);
12965         if (NT_STATUS_IS_ERR(r->out.result)) {
12966                 PyErr_SetNTSTATUS(r->out.result);
12967                 return NULL;
12968         }
12969
12970         return result;
12971 }
12972
12973 static bool pack_py_lsa_StorePrivateData_args_in(PyObject *args, PyObject *kwargs, struct lsa_StorePrivateData *r)
12974 {
12975         PyObject *py_handle;
12976         PyObject *py_name;
12977         PyObject *py_val;
12978         const char *kwnames[] = {
12979                 "handle", "name", "val", NULL
12980         };
12981
12982         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_StorePrivateData", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_val)) {
12983                 return false;
12984         }
12985
12986         r->in.handle = talloc_ptrtype(r, r->in.handle);
12987         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12988         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12989                 PyErr_NoMemory();
12990                 return false;
12991         }
12992         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12993         r->in.name = talloc_ptrtype(r, r->in.name);
12994         PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
12995         if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
12996                 PyErr_NoMemory();
12997                 return false;
12998         }
12999         r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
13000         if (py_val == Py_None) {
13001                 r->in.val = NULL;
13002         } else {
13003                 r->in.val = NULL;
13004                 PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_val, return false;);
13005                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_val)) == NULL) {
13006                         PyErr_NoMemory();
13007                         return false;
13008                 }
13009                 r->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_val);
13010         }
13011         return true;
13012 }
13013
13014 static PyObject *unpack_py_lsa_StorePrivateData_args_out(struct lsa_StorePrivateData *r)
13015 {
13016         PyObject *result;
13017         result = Py_None;
13018         Py_INCREF(result);
13019         if (NT_STATUS_IS_ERR(r->out.result)) {
13020                 PyErr_SetNTSTATUS(r->out.result);
13021                 return NULL;
13022         }
13023
13024         return result;
13025 }
13026
13027 static bool pack_py_lsa_RetrievePrivateData_args_in(PyObject *args, PyObject *kwargs, struct lsa_RetrievePrivateData *r)
13028 {
13029         PyObject *py_handle;
13030         PyObject *py_name;
13031         PyObject *py_val;
13032         const char *kwnames[] = {
13033                 "handle", "name", "val", NULL
13034         };
13035
13036         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_RetrievePrivateData", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_val)) {
13037                 return false;
13038         }
13039
13040         r->in.handle = talloc_ptrtype(r, r->in.handle);
13041         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13042         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13043                 PyErr_NoMemory();
13044                 return false;
13045         }
13046         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13047         r->in.name = talloc_ptrtype(r, r->in.name);
13048         PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
13049         if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
13050                 PyErr_NoMemory();
13051                 return false;
13052         }
13053         r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
13054         r->in.val = talloc_ptrtype(r, r->in.val);
13055         if (py_val == Py_None) {
13056                 *r->in.val = NULL;
13057         } else {
13058                 *r->in.val = NULL;
13059                 PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_val, return false;);
13060                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_val)) == NULL) {
13061                         PyErr_NoMemory();
13062                         return false;
13063                 }
13064                 *r->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_val);
13065         }
13066         return true;
13067 }
13068
13069 static PyObject *unpack_py_lsa_RetrievePrivateData_args_out(struct lsa_RetrievePrivateData *r)
13070 {
13071         PyObject *result;
13072         PyObject *py_val;
13073         if (*r->out.val == NULL) {
13074                 py_val = Py_None;
13075                 Py_INCREF(py_val);
13076         } else {
13077                 py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, *r->out.val, *r->out.val);
13078         }
13079         result = py_val;
13080         if (NT_STATUS_IS_ERR(r->out.result)) {
13081                 PyErr_SetNTSTATUS(r->out.result);
13082                 return NULL;
13083         }
13084
13085         return result;
13086 }
13087
13088 static bool pack_py_lsa_OpenPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenPolicy2 *r)
13089 {
13090         PyObject *py_system_name;
13091         PyObject *py_attr;
13092         PyObject *py_access_mask;
13093         const char *kwnames[] = {
13094                 "system_name", "attr", "access_mask", NULL
13095         };
13096
13097         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenPolicy2", discard_const_p(char *, kwnames), &py_system_name, &py_attr, &py_access_mask)) {
13098                 return false;
13099         }
13100
13101         if (py_system_name == Py_None) {
13102                 r->in.system_name = NULL;
13103         } else {
13104                 r->in.system_name = NULL;
13105                 if (PyUnicode_Check(py_system_name)) {
13106                         r->in.system_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore"));
13107                 } else if (PyString_Check(py_system_name)) {
13108                         r->in.system_name = PyString_AS_STRING(py_system_name);
13109                 } else {
13110                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
13111                         return false;
13112                 }
13113         }
13114         r->in.attr = talloc_ptrtype(r, r->in.attr);
13115         PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, py_attr, return false;);
13116         if (talloc_reference(r, pytalloc_get_mem_ctx(py_attr)) == NULL) {
13117                 PyErr_NoMemory();
13118                 return false;
13119         }
13120         r->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_attr);
13121         {
13122                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
13123                 if (PyLong_Check(py_access_mask)) {
13124                         unsigned long long test_var;
13125                         test_var = PyLong_AsUnsignedLongLong(py_access_mask);
13126                         if (PyErr_Occurred() != NULL) {
13127                                 return false;
13128                         }
13129                         if (test_var > uint_max) {
13130                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
13131                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13132                                 return false;
13133                         }
13134                         r->in.access_mask = test_var;
13135                 } else if (PyInt_Check(py_access_mask)) {
13136                         long test_var;
13137                         test_var = PyInt_AsLong(py_access_mask);
13138                         if (test_var < 0 || test_var > uint_max) {
13139                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
13140                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13141                                 return false;
13142                         }
13143                         r->in.access_mask = test_var;
13144                 } else {
13145                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13146                           PyInt_Type.tp_name, PyLong_Type.tp_name);
13147                         return false;
13148                 }
13149         }
13150         return true;
13151 }
13152
13153 static PyObject *unpack_py_lsa_OpenPolicy2_args_out(struct lsa_OpenPolicy2 *r)
13154 {
13155         PyObject *result;
13156         PyObject *py_handle;
13157         py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
13158         result = py_handle;
13159         if (NT_STATUS_IS_ERR(r->out.result)) {
13160                 PyErr_SetNTSTATUS(r->out.result);
13161                 return NULL;
13162         }
13163
13164         return result;
13165 }
13166
13167 static bool pack_py_lsa_GetUserName_args_in(PyObject *args, PyObject *kwargs, struct lsa_GetUserName *r)
13168 {
13169         PyObject *py_system_name;
13170         PyObject *py_account_name;
13171         PyObject *py_authority_name;
13172         const char *kwnames[] = {
13173                 "system_name", "account_name", "authority_name", NULL
13174         };
13175
13176         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_GetUserName", discard_const_p(char *, kwnames), &py_system_name, &py_account_name, &py_authority_name)) {
13177                 return false;
13178         }
13179
13180         if (py_system_name == Py_None) {
13181                 r->in.system_name = NULL;
13182         } else {
13183                 r->in.system_name = NULL;
13184                 if (PyUnicode_Check(py_system_name)) {
13185                         r->in.system_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore"));
13186                 } else if (PyString_Check(py_system_name)) {
13187                         r->in.system_name = PyString_AS_STRING(py_system_name);
13188                 } else {
13189                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
13190                         return false;
13191                 }
13192         }
13193         r->in.account_name = talloc_ptrtype(r, r->in.account_name);
13194         if (py_account_name == Py_None) {
13195                 *r->in.account_name = NULL;
13196         } else {
13197                 *r->in.account_name = NULL;
13198                 PY_CHECK_TYPE(&lsa_String_Type, py_account_name, return false;);
13199                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_account_name)) == NULL) {
13200                         PyErr_NoMemory();
13201                         return false;
13202                 }
13203                 *r->in.account_name = (struct lsa_String *)pytalloc_get_ptr(py_account_name);
13204         }
13205         if (py_authority_name == Py_None) {
13206                 r->in.authority_name = NULL;
13207         } else {
13208                 r->in.authority_name = NULL;
13209                 if (py_authority_name == Py_None) {
13210                         *r->in.authority_name = NULL;
13211                 } else {
13212                         *r->in.authority_name = NULL;
13213                         PY_CHECK_TYPE(&lsa_String_Type, py_authority_name, return false;);
13214                         if (talloc_reference(r, pytalloc_get_mem_ctx(py_authority_name)) == NULL) {
13215                                 PyErr_NoMemory();
13216                                 return false;
13217                         }
13218                         *r->in.authority_name = (struct lsa_String *)pytalloc_get_ptr(py_authority_name);
13219                 }
13220         }
13221         return true;
13222 }
13223
13224 static PyObject *unpack_py_lsa_GetUserName_args_out(struct lsa_GetUserName *r)
13225 {
13226         PyObject *result;
13227         PyObject *py_account_name;
13228         PyObject *py_authority_name;
13229         result = PyTuple_New(2);
13230         if (*r->out.account_name == NULL) {
13231                 py_account_name = Py_None;
13232                 Py_INCREF(py_account_name);
13233         } else {
13234                 py_account_name = pytalloc_reference_ex(&lsa_String_Type, *r->out.account_name, *r->out.account_name);
13235         }
13236         PyTuple_SetItem(result, 0, py_account_name);
13237         if (r->out.authority_name == NULL) {
13238                 py_authority_name = Py_None;
13239                 Py_INCREF(py_authority_name);
13240         } else {
13241                 if (*r->out.authority_name == NULL) {
13242                         py_authority_name = Py_None;
13243                         Py_INCREF(py_authority_name);
13244                 } else {
13245                         py_authority_name = pytalloc_reference_ex(&lsa_String_Type, *r->out.authority_name, *r->out.authority_name);
13246                 }
13247         }
13248         PyTuple_SetItem(result, 1, py_authority_name);
13249         if (NT_STATUS_IS_ERR(r->out.result)) {
13250                 PyErr_SetNTSTATUS(r->out.result);
13251                 return NULL;
13252         }
13253
13254         return result;
13255 }
13256
13257 static bool pack_py_lsa_QueryInfoPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryInfoPolicy2 *r)
13258 {
13259         PyObject *py_handle;
13260         PyObject *py_level;
13261         const char *kwnames[] = {
13262                 "handle", "level", NULL
13263         };
13264
13265         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryInfoPolicy2", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
13266                 return false;
13267         }
13268
13269         r->in.handle = talloc_ptrtype(r, r->in.handle);
13270         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13271         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13272                 PyErr_NoMemory();
13273                 return false;
13274         }
13275         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13276         {
13277                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
13278                 if (PyLong_Check(py_level)) {
13279                         unsigned long long test_var;
13280                         test_var = PyLong_AsUnsignedLongLong(py_level);
13281                         if (PyErr_Occurred() != NULL) {
13282                                 return false;
13283                         }
13284                         if (test_var > uint_max) {
13285                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
13286                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13287                                 return false;
13288                         }
13289                         r->in.level = test_var;
13290                 } else if (PyInt_Check(py_level)) {
13291                         long test_var;
13292                         test_var = PyInt_AsLong(py_level);
13293                         if (test_var < 0 || test_var > uint_max) {
13294                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
13295                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13296                                 return false;
13297                         }
13298                         r->in.level = test_var;
13299                 } else {
13300                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13301                           PyInt_Type.tp_name, PyLong_Type.tp_name);
13302                         return false;
13303                 }
13304         }
13305         return true;
13306 }
13307
13308 static PyObject *unpack_py_lsa_QueryInfoPolicy2_args_out(struct lsa_QueryInfoPolicy2 *r)
13309 {
13310         PyObject *result;
13311         PyObject *py_info;
13312         if (*r->out.info == NULL) {
13313                 py_info = Py_None;
13314                 Py_INCREF(py_info);
13315         } else {
13316                 py_info = py_import_lsa_PolicyInformation(*r->out.info, r->in.level, *r->out.info);
13317                 if (py_info == NULL) {
13318                         return NULL;
13319                 }
13320         }
13321         result = py_info;
13322         if (NT_STATUS_IS_ERR(r->out.result)) {
13323                 PyErr_SetNTSTATUS(r->out.result);
13324                 return NULL;
13325         }
13326
13327         return result;
13328 }
13329
13330 static bool pack_py_lsa_SetInfoPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInfoPolicy2 *r)
13331 {
13332         PyObject *py_handle;
13333         PyObject *py_level;
13334         PyObject *py_info;
13335         const char *kwnames[] = {
13336                 "handle", "level", "info", NULL
13337         };
13338
13339         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInfoPolicy2", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
13340                 return false;
13341         }
13342
13343         r->in.handle = talloc_ptrtype(r, r->in.handle);
13344         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13345         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13346                 PyErr_NoMemory();
13347                 return false;
13348         }
13349         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13350         {
13351                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
13352                 if (PyLong_Check(py_level)) {
13353                         unsigned long long test_var;
13354                         test_var = PyLong_AsUnsignedLongLong(py_level);
13355                         if (PyErr_Occurred() != NULL) {
13356                                 return false;
13357                         }
13358                         if (test_var > uint_max) {
13359                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
13360                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13361                                 return false;
13362                         }
13363                         r->in.level = test_var;
13364                 } else if (PyInt_Check(py_level)) {
13365                         long test_var;
13366                         test_var = PyInt_AsLong(py_level);
13367                         if (test_var < 0 || test_var > uint_max) {
13368                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
13369                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13370                                 return false;
13371                         }
13372                         r->in.level = test_var;
13373                 } else {
13374                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13375                           PyInt_Type.tp_name, PyLong_Type.tp_name);
13376                         return false;
13377                 }
13378         }
13379         r->in.info = talloc_ptrtype(r, r->in.info);
13380         {
13381                 union lsa_PolicyInformation *info_switch_1;
13382                 info_switch_1 = py_export_lsa_PolicyInformation(r, r->in.level, py_info);
13383                 if (info_switch_1 == NULL) {
13384                         return false;
13385                 }
13386                 r->in.info = info_switch_1;
13387         }
13388         return true;
13389 }
13390
13391 static PyObject *unpack_py_lsa_SetInfoPolicy2_args_out(struct lsa_SetInfoPolicy2 *r)
13392 {
13393         PyObject *result;
13394         result = Py_None;
13395         Py_INCREF(result);
13396         if (NT_STATUS_IS_ERR(r->out.result)) {
13397                 PyErr_SetNTSTATUS(r->out.result);
13398                 return NULL;
13399         }
13400
13401         return result;
13402 }
13403
13404 static bool pack_py_lsa_QueryTrustedDomainInfoByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfoByName *r)
13405 {
13406         PyObject *py_handle;
13407         PyObject *py_trusted_domain;
13408         PyObject *py_level;
13409         const char *kwnames[] = {
13410                 "handle", "trusted_domain", "level", NULL
13411         };
13412
13413         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_QueryTrustedDomainInfoByName", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain, &py_level)) {
13414                 return false;
13415         }
13416
13417         r->in.handle = talloc_ptrtype(r, r->in.handle);
13418         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13419         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13420                 PyErr_NoMemory();
13421                 return false;
13422         }
13423         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13424         r->in.trusted_domain = talloc_ptrtype(r, r->in.trusted_domain);
13425         PY_CHECK_TYPE(&lsa_String_Type, py_trusted_domain, return false;);
13426         if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain)) == NULL) {
13427                 PyErr_NoMemory();
13428                 return false;
13429         }
13430         r->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain);
13431         {
13432                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
13433                 if (PyLong_Check(py_level)) {
13434                         unsigned long long test_var;
13435                         test_var = PyLong_AsUnsignedLongLong(py_level);
13436                         if (PyErr_Occurred() != NULL) {
13437                                 return false;
13438                         }
13439                         if (test_var > uint_max) {
13440                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
13441                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13442                                 return false;
13443                         }
13444                         r->in.level = test_var;
13445                 } else if (PyInt_Check(py_level)) {
13446                         long test_var;
13447                         test_var = PyInt_AsLong(py_level);
13448                         if (test_var < 0 || test_var > uint_max) {
13449                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
13450                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13451                                 return false;
13452                         }
13453                         r->in.level = test_var;
13454                 } else {
13455                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13456                           PyInt_Type.tp_name, PyLong_Type.tp_name);
13457                         return false;
13458                 }
13459         }
13460         return true;
13461 }
13462
13463 static PyObject *unpack_py_lsa_QueryTrustedDomainInfoByName_args_out(struct lsa_QueryTrustedDomainInfoByName *r)
13464 {
13465         PyObject *result;
13466         PyObject *py_info;
13467         if (*r->out.info == NULL) {
13468                 py_info = Py_None;
13469                 Py_INCREF(py_info);
13470         } else {
13471                 py_info = py_import_lsa_TrustedDomainInfo(*r->out.info, r->in.level, *r->out.info);
13472                 if (py_info == NULL) {
13473                         return NULL;
13474                 }
13475         }
13476         result = py_info;
13477         if (NT_STATUS_IS_ERR(r->out.result)) {
13478                 PyErr_SetNTSTATUS(r->out.result);
13479                 return NULL;
13480         }
13481
13482         return result;
13483 }
13484
13485 static bool pack_py_lsa_SetTrustedDomainInfoByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetTrustedDomainInfoByName *r)
13486 {
13487         PyObject *py_handle;
13488         PyObject *py_trusted_domain;
13489         PyObject *py_level;
13490         PyObject *py_info;
13491         const char *kwnames[] = {
13492                 "handle", "trusted_domain", "level", "info", NULL
13493         };
13494
13495         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_SetTrustedDomainInfoByName", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain, &py_level, &py_info)) {
13496                 return false;
13497         }
13498
13499         r->in.handle = talloc_ptrtype(r, r->in.handle);
13500         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13501         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13502                 PyErr_NoMemory();
13503                 return false;
13504         }
13505         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13506         r->in.trusted_domain = talloc_ptrtype(r, r->in.trusted_domain);
13507         PY_CHECK_TYPE(&lsa_String_Type, py_trusted_domain, return false;);
13508         if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain)) == NULL) {
13509                 PyErr_NoMemory();
13510                 return false;
13511         }
13512         r->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain);
13513         {
13514                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
13515                 if (PyLong_Check(py_level)) {
13516                         unsigned long long test_var;
13517                         test_var = PyLong_AsUnsignedLongLong(py_level);
13518                         if (PyErr_Occurred() != NULL) {
13519                                 return false;
13520                         }
13521                         if (test_var > uint_max) {
13522                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
13523                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13524                                 return false;
13525                         }
13526                         r->in.level = test_var;
13527                 } else if (PyInt_Check(py_level)) {
13528                         long test_var;
13529                         test_var = PyInt_AsLong(py_level);
13530                         if (test_var < 0 || test_var > uint_max) {
13531                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
13532                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13533                                 return false;
13534                         }
13535                         r->in.level = test_var;
13536                 } else {
13537                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13538                           PyInt_Type.tp_name, PyLong_Type.tp_name);
13539                         return false;
13540                 }
13541         }
13542         r->in.info = talloc_ptrtype(r, r->in.info);
13543         {
13544                 union lsa_TrustedDomainInfo *info_switch_1;
13545                 info_switch_1 = py_export_lsa_TrustedDomainInfo(r, r->in.level, py_info);
13546                 if (info_switch_1 == NULL) {
13547                         return false;
13548                 }
13549                 r->in.info = info_switch_1;
13550         }
13551         return true;
13552 }
13553
13554 static PyObject *unpack_py_lsa_SetTrustedDomainInfoByName_args_out(struct lsa_SetTrustedDomainInfoByName *r)
13555 {
13556         PyObject *result;
13557         result = Py_None;
13558         Py_INCREF(result);
13559         if (NT_STATUS_IS_ERR(r->out.result)) {
13560                 PyErr_SetNTSTATUS(r->out.result);
13561                 return NULL;
13562         }
13563
13564         return result;
13565 }
13566
13567 static bool pack_py_lsa_EnumTrustedDomainsEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumTrustedDomainsEx *r)
13568 {
13569         PyObject *py_handle;
13570         PyObject *py_resume_handle;
13571         PyObject *py_max_size;
13572         const char *kwnames[] = {
13573                 "handle", "resume_handle", "max_size", NULL
13574         };
13575
13576         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumTrustedDomainsEx", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_size)) {
13577                 return false;
13578         }
13579
13580         r->in.handle = talloc_ptrtype(r, r->in.handle);
13581         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13582         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13583                 PyErr_NoMemory();
13584                 return false;
13585         }
13586         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13587         r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
13588         {
13589                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
13590                 if (PyLong_Check(py_resume_handle)) {
13591                         unsigned long long test_var;
13592                         test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
13593                         if (PyErr_Occurred() != NULL) {
13594                                 return false;
13595                         }
13596                         if (test_var > uint_max) {
13597                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
13598                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13599                                 return false;
13600                         }
13601                         *r->in.resume_handle = test_var;
13602                 } else if (PyInt_Check(py_resume_handle)) {
13603                         long test_var;
13604                         test_var = PyInt_AsLong(py_resume_handle);
13605                         if (test_var < 0 || test_var > uint_max) {
13606                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
13607                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13608                                 return false;
13609                         }
13610                         *r->in.resume_handle = test_var;
13611                 } else {
13612                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13613                           PyInt_Type.tp_name, PyLong_Type.tp_name);
13614                         return false;
13615                 }
13616         }
13617         {
13618                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size));
13619                 if (PyLong_Check(py_max_size)) {
13620                         unsigned long long test_var;
13621                         test_var = PyLong_AsUnsignedLongLong(py_max_size);
13622                         if (PyErr_Occurred() != NULL) {
13623                                 return false;
13624                         }
13625                         if (test_var > uint_max) {
13626                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
13627                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13628                                 return false;
13629                         }
13630                         r->in.max_size = test_var;
13631                 } else if (PyInt_Check(py_max_size)) {
13632                         long test_var;
13633                         test_var = PyInt_AsLong(py_max_size);
13634                         if (test_var < 0 || test_var > uint_max) {
13635                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
13636                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13637                                 return false;
13638                         }
13639                         r->in.max_size = test_var;
13640                 } else {
13641                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13642                           PyInt_Type.tp_name, PyLong_Type.tp_name);
13643                         return false;
13644                 }
13645         }
13646         return true;
13647 }
13648
13649 static PyObject *unpack_py_lsa_EnumTrustedDomainsEx_args_out(struct lsa_EnumTrustedDomainsEx *r)
13650 {
13651         PyObject *result;
13652         PyObject *py_resume_handle;
13653         PyObject *py_domains;
13654         result = PyTuple_New(2);
13655         py_resume_handle = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
13656         PyTuple_SetItem(result, 0, py_resume_handle);
13657         py_domains = pytalloc_reference_ex(&lsa_DomainListEx_Type, r->out.domains, r->out.domains);
13658         PyTuple_SetItem(result, 1, py_domains);
13659         if (NT_STATUS_IS_ERR(r->out.result)) {
13660                 PyErr_SetNTSTATUS(r->out.result);
13661                 return NULL;
13662         }
13663
13664         return result;
13665 }
13666
13667 static bool pack_py_lsa_CreateTrustedDomainEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomainEx *r)
13668 {
13669         PyObject *py_policy_handle;
13670         PyObject *py_info;
13671         PyObject *py_auth_info;
13672         PyObject *py_access_mask;
13673         const char *kwnames[] = {
13674                 "policy_handle", "info", "auth_info", "access_mask", NULL
13675         };
13676
13677         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_CreateTrustedDomainEx", discard_const_p(char *, kwnames), &py_policy_handle, &py_info, &py_auth_info, &py_access_mask)) {
13678                 return false;
13679         }
13680
13681         r->in.policy_handle = talloc_ptrtype(r, r->in.policy_handle);
13682         PY_CHECK_TYPE(policy_handle_Type, py_policy_handle, return false;);
13683         if (talloc_reference(r, pytalloc_get_mem_ctx(py_policy_handle)) == NULL) {
13684                 PyErr_NoMemory();
13685                 return false;
13686         }
13687         r->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(py_policy_handle);
13688         r->in.info = talloc_ptrtype(r, r->in.info);
13689         PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, py_info, return false;);
13690         if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
13691                 PyErr_NoMemory();
13692                 return false;
13693         }
13694         r->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_info);
13695         r->in.auth_info = talloc_ptrtype(r, r->in.auth_info);
13696         PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, py_auth_info, return false;);
13697         if (talloc_reference(r, pytalloc_get_mem_ctx(py_auth_info)) == NULL) {
13698                 PyErr_NoMemory();
13699                 return false;
13700         }
13701         r->in.auth_info = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_auth_info);
13702         {
13703                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
13704                 if (PyLong_Check(py_access_mask)) {
13705                         unsigned long long test_var;
13706                         test_var = PyLong_AsUnsignedLongLong(py_access_mask);
13707                         if (PyErr_Occurred() != NULL) {
13708                                 return false;
13709                         }
13710                         if (test_var > uint_max) {
13711                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
13712                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13713                                 return false;
13714                         }
13715                         r->in.access_mask = test_var;
13716                 } else if (PyInt_Check(py_access_mask)) {
13717                         long test_var;
13718                         test_var = PyInt_AsLong(py_access_mask);
13719                         if (test_var < 0 || test_var > uint_max) {
13720                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
13721                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13722                                 return false;
13723                         }
13724                         r->in.access_mask = test_var;
13725                 } else {
13726                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13727                           PyInt_Type.tp_name, PyLong_Type.tp_name);
13728                         return false;
13729                 }
13730         }
13731         return true;
13732 }
13733
13734 static PyObject *unpack_py_lsa_CreateTrustedDomainEx_args_out(struct lsa_CreateTrustedDomainEx *r)
13735 {
13736         PyObject *result;
13737         PyObject *py_trustdom_handle;
13738         py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
13739         result = py_trustdom_handle;
13740         if (NT_STATUS_IS_ERR(r->out.result)) {
13741                 PyErr_SetNTSTATUS(r->out.result);
13742                 return NULL;
13743         }
13744
13745         return result;
13746 }
13747
13748 static bool pack_py_lsa_CloseTrustedDomainEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_CloseTrustedDomainEx *r)
13749 {
13750         PyObject *py_handle;
13751         const char *kwnames[] = {
13752                 "handle", NULL
13753         };
13754
13755         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_CloseTrustedDomainEx", discard_const_p(char *, kwnames), &py_handle)) {
13756                 return false;
13757         }
13758
13759         r->in.handle = talloc_ptrtype(r, r->in.handle);
13760         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13761         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13762                 PyErr_NoMemory();
13763                 return false;
13764         }
13765         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13766         return true;
13767 }
13768
13769 static PyObject *unpack_py_lsa_CloseTrustedDomainEx_args_out(struct lsa_CloseTrustedDomainEx *r)
13770 {
13771         PyObject *result;
13772         PyObject *py_handle;
13773         py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
13774         result = py_handle;
13775         if (NT_STATUS_IS_ERR(r->out.result)) {
13776                 PyErr_SetNTSTATUS(r->out.result);
13777                 return NULL;
13778         }
13779
13780         return result;
13781 }
13782
13783 static bool pack_py_lsa_QueryDomainInformationPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryDomainInformationPolicy *r)
13784 {
13785         PyObject *py_handle;
13786         PyObject *py_level;
13787         const char *kwnames[] = {
13788                 "handle", "level", NULL
13789         };
13790
13791         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryDomainInformationPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
13792                 return false;
13793         }
13794
13795         r->in.handle = talloc_ptrtype(r, r->in.handle);
13796         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13797         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13798                 PyErr_NoMemory();
13799                 return false;
13800         }
13801         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13802         {
13803                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
13804                 if (PyLong_Check(py_level)) {
13805                         unsigned long long test_var;
13806                         test_var = PyLong_AsUnsignedLongLong(py_level);
13807                         if (PyErr_Occurred() != NULL) {
13808                                 return false;
13809                         }
13810                         if (test_var > uint_max) {
13811                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
13812                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13813                                 return false;
13814                         }
13815                         r->in.level = test_var;
13816                 } else if (PyInt_Check(py_level)) {
13817                         long test_var;
13818                         test_var = PyInt_AsLong(py_level);
13819                         if (test_var < 0 || test_var > uint_max) {
13820                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
13821                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13822                                 return false;
13823                         }
13824                         r->in.level = test_var;
13825                 } else {
13826                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13827                           PyInt_Type.tp_name, PyLong_Type.tp_name);
13828                         return false;
13829                 }
13830         }
13831         return true;
13832 }
13833
13834 static PyObject *unpack_py_lsa_QueryDomainInformationPolicy_args_out(struct lsa_QueryDomainInformationPolicy *r)
13835 {
13836         PyObject *result;
13837         PyObject *py_info;
13838         if (*r->out.info == NULL) {
13839                 py_info = Py_None;
13840                 Py_INCREF(py_info);
13841         } else {
13842                 py_info = py_import_lsa_DomainInformationPolicy(*r->out.info, r->in.level, *r->out.info);
13843                 if (py_info == NULL) {
13844                         return NULL;
13845                 }
13846         }
13847         result = py_info;
13848         if (NT_STATUS_IS_ERR(r->out.result)) {
13849                 PyErr_SetNTSTATUS(r->out.result);
13850                 return NULL;
13851         }
13852
13853         return result;
13854 }
13855
13856 static bool pack_py_lsa_SetDomainInformationPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetDomainInformationPolicy *r)
13857 {
13858         PyObject *py_handle;
13859         PyObject *py_level;
13860         PyObject *py_info;
13861         const char *kwnames[] = {
13862                 "handle", "level", "info", NULL
13863         };
13864
13865         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetDomainInformationPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
13866                 return false;
13867         }
13868
13869         r->in.handle = talloc_ptrtype(r, r->in.handle);
13870         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13871         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13872                 PyErr_NoMemory();
13873                 return false;
13874         }
13875         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13876         {
13877                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
13878                 if (PyLong_Check(py_level)) {
13879                         unsigned long long test_var;
13880                         test_var = PyLong_AsUnsignedLongLong(py_level);
13881                         if (PyErr_Occurred() != NULL) {
13882                                 return false;
13883                         }
13884                         if (test_var > uint_max) {
13885                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
13886                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13887                                 return false;
13888                         }
13889                         r->in.level = test_var;
13890                 } else if (PyInt_Check(py_level)) {
13891                         long test_var;
13892                         test_var = PyInt_AsLong(py_level);
13893                         if (test_var < 0 || test_var > uint_max) {
13894                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
13895                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13896                                 return false;
13897                         }
13898                         r->in.level = test_var;
13899                 } else {
13900                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13901                           PyInt_Type.tp_name, PyLong_Type.tp_name);
13902                         return false;
13903                 }
13904         }
13905         if (py_info == Py_None) {
13906                 r->in.info = NULL;
13907         } else {
13908                 r->in.info = NULL;
13909                 {
13910                         union lsa_DomainInformationPolicy *info_switch_1;
13911                         info_switch_1 = py_export_lsa_DomainInformationPolicy(r, r->in.level, py_info);
13912                         if (info_switch_1 == NULL) {
13913                                 return false;
13914                         }
13915                         r->in.info = info_switch_1;
13916                 }
13917         }
13918         return true;
13919 }
13920
13921 static PyObject *unpack_py_lsa_SetDomainInformationPolicy_args_out(struct lsa_SetDomainInformationPolicy *r)
13922 {
13923         PyObject *result;
13924         result = Py_None;
13925         Py_INCREF(result);
13926         if (NT_STATUS_IS_ERR(r->out.result)) {
13927                 PyErr_SetNTSTATUS(r->out.result);
13928                 return NULL;
13929         }
13930
13931         return result;
13932 }
13933
13934 static bool pack_py_lsa_OpenTrustedDomainByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenTrustedDomainByName *r)
13935 {
13936         PyObject *py_handle;
13937         PyObject *py_name;
13938         PyObject *py_access_mask;
13939         const char *kwnames[] = {
13940                 "handle", "name", "access_mask", NULL
13941         };
13942
13943         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenTrustedDomainByName", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
13944                 return false;
13945         }
13946
13947         r->in.handle = talloc_ptrtype(r, r->in.handle);
13948         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13949         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13950                 PyErr_NoMemory();
13951                 return false;
13952         }
13953         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13954         PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
13955         if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
13956                 PyErr_NoMemory();
13957                 return false;
13958         }
13959         r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
13960         {
13961                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
13962                 if (PyLong_Check(py_access_mask)) {
13963                         unsigned long long test_var;
13964                         test_var = PyLong_AsUnsignedLongLong(py_access_mask);
13965                         if (PyErr_Occurred() != NULL) {
13966                                 return false;
13967                         }
13968                         if (test_var > uint_max) {
13969                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
13970                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13971                                 return false;
13972                         }
13973                         r->in.access_mask = test_var;
13974                 } else if (PyInt_Check(py_access_mask)) {
13975                         long test_var;
13976                         test_var = PyInt_AsLong(py_access_mask);
13977                         if (test_var < 0 || test_var > uint_max) {
13978                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
13979                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
13980                                 return false;
13981                         }
13982                         r->in.access_mask = test_var;
13983                 } else {
13984                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13985                           PyInt_Type.tp_name, PyLong_Type.tp_name);
13986                         return false;
13987                 }
13988         }
13989         return true;
13990 }
13991
13992 static PyObject *unpack_py_lsa_OpenTrustedDomainByName_args_out(struct lsa_OpenTrustedDomainByName *r)
13993 {
13994         PyObject *result;
13995         PyObject *py_trustdom_handle;
13996         py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
13997         result = py_trustdom_handle;
13998         if (NT_STATUS_IS_ERR(r->out.result)) {
13999                 PyErr_SetNTSTATUS(r->out.result);
14000                 return NULL;
14001         }
14002
14003         return result;
14004 }
14005
14006 static bool pack_py_lsa_LookupSids2_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids2 *r)
14007 {
14008         PyObject *py_handle;
14009         PyObject *py_sids;
14010         PyObject *py_names;
14011         PyObject *py_level;
14012         PyObject *py_count;
14013         PyObject *py_lookup_options;
14014         PyObject *py_client_revision;
14015         const char *kwnames[] = {
14016                 "handle", "sids", "names", "level", "count", "lookup_options", "client_revision", NULL
14017         };
14018
14019         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:lsa_LookupSids2", discard_const_p(char *, kwnames), &py_handle, &py_sids, &py_names, &py_level, &py_count, &py_lookup_options, &py_client_revision)) {
14020                 return false;
14021         }
14022
14023         r->in.handle = talloc_ptrtype(r, r->in.handle);
14024         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
14025         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
14026                 PyErr_NoMemory();
14027                 return false;
14028         }
14029         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
14030         r->in.sids = talloc_ptrtype(r, r->in.sids);
14031         PY_CHECK_TYPE(&lsa_SidArray_Type, py_sids, return false;);
14032         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
14033                 PyErr_NoMemory();
14034                 return false;
14035         }
14036         r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
14037         r->in.names = talloc_ptrtype(r, r->in.names);
14038         PY_CHECK_TYPE(&lsa_TransNameArray2_Type, py_names, return false;);
14039         if (talloc_reference(r, pytalloc_get_mem_ctx(py_names)) == NULL) {
14040                 PyErr_NoMemory();
14041                 return false;
14042         }
14043         r->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_names);
14044         {
14045                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
14046                 if (PyLong_Check(py_level)) {
14047                         unsigned long long test_var;
14048                         test_var = PyLong_AsUnsignedLongLong(py_level);
14049                         if (PyErr_Occurred() != NULL) {
14050                                 return false;
14051                         }
14052                         if (test_var > uint_max) {
14053                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14054                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14055                                 return false;
14056                         }
14057                         r->in.level = test_var;
14058                 } else if (PyInt_Check(py_level)) {
14059                         long test_var;
14060                         test_var = PyInt_AsLong(py_level);
14061                         if (test_var < 0 || test_var > uint_max) {
14062                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14063                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14064                                 return false;
14065                         }
14066                         r->in.level = test_var;
14067                 } else {
14068                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14069                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14070                         return false;
14071                 }
14072         }
14073         r->in.count = talloc_ptrtype(r, r->in.count);
14074         {
14075                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
14076                 if (PyLong_Check(py_count)) {
14077                         unsigned long long test_var;
14078                         test_var = PyLong_AsUnsignedLongLong(py_count);
14079                         if (PyErr_Occurred() != NULL) {
14080                                 return false;
14081                         }
14082                         if (test_var > uint_max) {
14083                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14084                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14085                                 return false;
14086                         }
14087                         *r->in.count = test_var;
14088                 } else if (PyInt_Check(py_count)) {
14089                         long test_var;
14090                         test_var = PyInt_AsLong(py_count);
14091                         if (test_var < 0 || test_var > uint_max) {
14092                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14093                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14094                                 return false;
14095                         }
14096                         *r->in.count = test_var;
14097                 } else {
14098                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14099                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14100                         return false;
14101                 }
14102         }
14103         {
14104                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
14105                 if (PyLong_Check(py_lookup_options)) {
14106                         unsigned long long test_var;
14107                         test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
14108                         if (PyErr_Occurred() != NULL) {
14109                                 return false;
14110                         }
14111                         if (test_var > uint_max) {
14112                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14113                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14114                                 return false;
14115                         }
14116                         r->in.lookup_options = test_var;
14117                 } else if (PyInt_Check(py_lookup_options)) {
14118                         long test_var;
14119                         test_var = PyInt_AsLong(py_lookup_options);
14120                         if (test_var < 0 || test_var > uint_max) {
14121                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14122                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14123                                 return false;
14124                         }
14125                         r->in.lookup_options = test_var;
14126                 } else {
14127                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14128                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14129                         return false;
14130                 }
14131         }
14132         {
14133                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
14134                 if (PyLong_Check(py_client_revision)) {
14135                         unsigned long long test_var;
14136                         test_var = PyLong_AsUnsignedLongLong(py_client_revision);
14137                         if (PyErr_Occurred() != NULL) {
14138                                 return false;
14139                         }
14140                         if (test_var > uint_max) {
14141                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14142                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14143                                 return false;
14144                         }
14145                         r->in.client_revision = test_var;
14146                 } else if (PyInt_Check(py_client_revision)) {
14147                         long test_var;
14148                         test_var = PyInt_AsLong(py_client_revision);
14149                         if (test_var < 0 || test_var > uint_max) {
14150                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14151                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14152                                 return false;
14153                         }
14154                         r->in.client_revision = test_var;
14155                 } else {
14156                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14157                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14158                         return false;
14159                 }
14160         }
14161         return true;
14162 }
14163
14164 static PyObject *unpack_py_lsa_LookupSids2_args_out(struct lsa_LookupSids2 *r)
14165 {
14166         PyObject *result;
14167         PyObject *py_domains;
14168         PyObject *py_names;
14169         PyObject *py_count;
14170         result = PyTuple_New(3);
14171         if (*r->out.domains == NULL) {
14172                 py_domains = Py_None;
14173                 Py_INCREF(py_domains);
14174         } else {
14175                 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
14176         }
14177         PyTuple_SetItem(result, 0, py_domains);
14178         py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, r->out.names, r->out.names);
14179         PyTuple_SetItem(result, 1, py_names);
14180         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
14181         PyTuple_SetItem(result, 2, py_count);
14182         if (NT_STATUS_IS_ERR(r->out.result)) {
14183                 PyErr_SetNTSTATUS(r->out.result);
14184                 return NULL;
14185         }
14186
14187         return result;
14188 }
14189
14190 static bool pack_py_lsa_LookupNames2_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames2 *r)
14191 {
14192         PyObject *py_handle;
14193         PyObject *py_names;
14194         PyObject *py_sids;
14195         PyObject *py_level;
14196         PyObject *py_count;
14197         PyObject *py_lookup_options;
14198         PyObject *py_client_revision;
14199         const char *kwnames[] = {
14200                 "handle", "names", "sids", "level", "count", "lookup_options", "client_revision", NULL
14201         };
14202
14203         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:lsa_LookupNames2", discard_const_p(char *, kwnames), &py_handle, &py_names, &py_sids, &py_level, &py_count, &py_lookup_options, &py_client_revision)) {
14204                 return false;
14205         }
14206
14207         r->in.handle = talloc_ptrtype(r, r->in.handle);
14208         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
14209         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
14210                 PyErr_NoMemory();
14211                 return false;
14212         }
14213         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
14214         PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
14215         r->in.num_names = PyList_GET_SIZE(py_names);
14216         PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
14217         {
14218                 int names_cntr_0;
14219                 r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
14220                 if (!r->in.names) { return false;; }
14221                 talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
14222                 for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
14223                         PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
14224                         if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
14225                                 PyErr_NoMemory();
14226                                 return false;
14227                         }
14228                         r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
14229                 }
14230         }
14231         r->in.sids = talloc_ptrtype(r, r->in.sids);
14232         PY_CHECK_TYPE(&lsa_TransSidArray2_Type, py_sids, return false;);
14233         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
14234                 PyErr_NoMemory();
14235                 return false;
14236         }
14237         r->in.sids = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(py_sids);
14238         {
14239                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
14240                 if (PyLong_Check(py_level)) {
14241                         unsigned long long test_var;
14242                         test_var = PyLong_AsUnsignedLongLong(py_level);
14243                         if (PyErr_Occurred() != NULL) {
14244                                 return false;
14245                         }
14246                         if (test_var > uint_max) {
14247                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14248                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14249                                 return false;
14250                         }
14251                         r->in.level = test_var;
14252                 } else if (PyInt_Check(py_level)) {
14253                         long test_var;
14254                         test_var = PyInt_AsLong(py_level);
14255                         if (test_var < 0 || test_var > uint_max) {
14256                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14257                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14258                                 return false;
14259                         }
14260                         r->in.level = test_var;
14261                 } else {
14262                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14263                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14264                         return false;
14265                 }
14266         }
14267         r->in.count = talloc_ptrtype(r, r->in.count);
14268         {
14269                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
14270                 if (PyLong_Check(py_count)) {
14271                         unsigned long long test_var;
14272                         test_var = PyLong_AsUnsignedLongLong(py_count);
14273                         if (PyErr_Occurred() != NULL) {
14274                                 return false;
14275                         }
14276                         if (test_var > uint_max) {
14277                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14278                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14279                                 return false;
14280                         }
14281                         *r->in.count = test_var;
14282                 } else if (PyInt_Check(py_count)) {
14283                         long test_var;
14284                         test_var = PyInt_AsLong(py_count);
14285                         if (test_var < 0 || test_var > uint_max) {
14286                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14287                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14288                                 return false;
14289                         }
14290                         *r->in.count = test_var;
14291                 } else {
14292                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14293                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14294                         return false;
14295                 }
14296         }
14297         {
14298                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
14299                 if (PyLong_Check(py_lookup_options)) {
14300                         unsigned long long test_var;
14301                         test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
14302                         if (PyErr_Occurred() != NULL) {
14303                                 return false;
14304                         }
14305                         if (test_var > uint_max) {
14306                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14307                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14308                                 return false;
14309                         }
14310                         r->in.lookup_options = test_var;
14311                 } else if (PyInt_Check(py_lookup_options)) {
14312                         long test_var;
14313                         test_var = PyInt_AsLong(py_lookup_options);
14314                         if (test_var < 0 || test_var > uint_max) {
14315                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14316                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14317                                 return false;
14318                         }
14319                         r->in.lookup_options = test_var;
14320                 } else {
14321                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14322                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14323                         return false;
14324                 }
14325         }
14326         {
14327                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
14328                 if (PyLong_Check(py_client_revision)) {
14329                         unsigned long long test_var;
14330                         test_var = PyLong_AsUnsignedLongLong(py_client_revision);
14331                         if (PyErr_Occurred() != NULL) {
14332                                 return false;
14333                         }
14334                         if (test_var > uint_max) {
14335                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14336                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14337                                 return false;
14338                         }
14339                         r->in.client_revision = test_var;
14340                 } else if (PyInt_Check(py_client_revision)) {
14341                         long test_var;
14342                         test_var = PyInt_AsLong(py_client_revision);
14343                         if (test_var < 0 || test_var > uint_max) {
14344                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14345                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14346                                 return false;
14347                         }
14348                         r->in.client_revision = test_var;
14349                 } else {
14350                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14351                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14352                         return false;
14353                 }
14354         }
14355         return true;
14356 }
14357
14358 static PyObject *unpack_py_lsa_LookupNames2_args_out(struct lsa_LookupNames2 *r)
14359 {
14360         PyObject *result;
14361         PyObject *py_domains;
14362         PyObject *py_sids;
14363         PyObject *py_count;
14364         result = PyTuple_New(3);
14365         if (*r->out.domains == NULL) {
14366                 py_domains = Py_None;
14367                 Py_INCREF(py_domains);
14368         } else {
14369                 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
14370         }
14371         PyTuple_SetItem(result, 0, py_domains);
14372         py_sids = pytalloc_reference_ex(&lsa_TransSidArray2_Type, r->out.sids, r->out.sids);
14373         PyTuple_SetItem(result, 1, py_sids);
14374         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
14375         PyTuple_SetItem(result, 2, py_count);
14376         if (NT_STATUS_IS_ERR(r->out.result)) {
14377                 PyErr_SetNTSTATUS(r->out.result);
14378                 return NULL;
14379         }
14380
14381         return result;
14382 }
14383
14384 static bool pack_py_lsa_CreateTrustedDomainEx2_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomainEx2 *r)
14385 {
14386         PyObject *py_policy_handle;
14387         PyObject *py_info;
14388         PyObject *py_auth_info_internal;
14389         PyObject *py_access_mask;
14390         const char *kwnames[] = {
14391                 "policy_handle", "info", "auth_info_internal", "access_mask", NULL
14392         };
14393
14394         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_CreateTrustedDomainEx2", discard_const_p(char *, kwnames), &py_policy_handle, &py_info, &py_auth_info_internal, &py_access_mask)) {
14395                 return false;
14396         }
14397
14398         r->in.policy_handle = talloc_ptrtype(r, r->in.policy_handle);
14399         PY_CHECK_TYPE(policy_handle_Type, py_policy_handle, return false;);
14400         if (talloc_reference(r, pytalloc_get_mem_ctx(py_policy_handle)) == NULL) {
14401                 PyErr_NoMemory();
14402                 return false;
14403         }
14404         r->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(py_policy_handle);
14405         r->in.info = talloc_ptrtype(r, r->in.info);
14406         PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, py_info, return false;);
14407         if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
14408                 PyErr_NoMemory();
14409                 return false;
14410         }
14411         r->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_info);
14412         r->in.auth_info_internal = talloc_ptrtype(r, r->in.auth_info_internal);
14413         PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, py_auth_info_internal, return false;);
14414         if (talloc_reference(r, pytalloc_get_mem_ctx(py_auth_info_internal)) == NULL) {
14415                 PyErr_NoMemory();
14416                 return false;
14417         }
14418         r->in.auth_info_internal = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(py_auth_info_internal);
14419         {
14420                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
14421                 if (PyLong_Check(py_access_mask)) {
14422                         unsigned long long test_var;
14423                         test_var = PyLong_AsUnsignedLongLong(py_access_mask);
14424                         if (PyErr_Occurred() != NULL) {
14425                                 return false;
14426                         }
14427                         if (test_var > uint_max) {
14428                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14429                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14430                                 return false;
14431                         }
14432                         r->in.access_mask = test_var;
14433                 } else if (PyInt_Check(py_access_mask)) {
14434                         long test_var;
14435                         test_var = PyInt_AsLong(py_access_mask);
14436                         if (test_var < 0 || test_var > uint_max) {
14437                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14438                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14439                                 return false;
14440                         }
14441                         r->in.access_mask = test_var;
14442                 } else {
14443                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14444                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14445                         return false;
14446                 }
14447         }
14448         return true;
14449 }
14450
14451 static PyObject *unpack_py_lsa_CreateTrustedDomainEx2_args_out(struct lsa_CreateTrustedDomainEx2 *r)
14452 {
14453         PyObject *result;
14454         PyObject *py_trustdom_handle;
14455         py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
14456         result = py_trustdom_handle;
14457         if (NT_STATUS_IS_ERR(r->out.result)) {
14458                 PyErr_SetNTSTATUS(r->out.result);
14459                 return NULL;
14460         }
14461
14462         return result;
14463 }
14464
14465 static bool pack_py_lsa_LookupNames3_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames3 *r)
14466 {
14467         PyObject *py_handle;
14468         PyObject *py_names;
14469         PyObject *py_sids;
14470         PyObject *py_level;
14471         PyObject *py_count;
14472         PyObject *py_lookup_options;
14473         PyObject *py_client_revision;
14474         const char *kwnames[] = {
14475                 "handle", "names", "sids", "level", "count", "lookup_options", "client_revision", NULL
14476         };
14477
14478         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:lsa_LookupNames3", discard_const_p(char *, kwnames), &py_handle, &py_names, &py_sids, &py_level, &py_count, &py_lookup_options, &py_client_revision)) {
14479                 return false;
14480         }
14481
14482         r->in.handle = talloc_ptrtype(r, r->in.handle);
14483         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
14484         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
14485                 PyErr_NoMemory();
14486                 return false;
14487         }
14488         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
14489         PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
14490         r->in.num_names = PyList_GET_SIZE(py_names);
14491         PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
14492         {
14493                 int names_cntr_0;
14494                 r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
14495                 if (!r->in.names) { return false;; }
14496                 talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
14497                 for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
14498                         PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
14499                         if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
14500                                 PyErr_NoMemory();
14501                                 return false;
14502                         }
14503                         r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
14504                 }
14505         }
14506         r->in.sids = talloc_ptrtype(r, r->in.sids);
14507         PY_CHECK_TYPE(&lsa_TransSidArray3_Type, py_sids, return false;);
14508         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
14509                 PyErr_NoMemory();
14510                 return false;
14511         }
14512         r->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_sids);
14513         {
14514                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
14515                 if (PyLong_Check(py_level)) {
14516                         unsigned long long test_var;
14517                         test_var = PyLong_AsUnsignedLongLong(py_level);
14518                         if (PyErr_Occurred() != NULL) {
14519                                 return false;
14520                         }
14521                         if (test_var > uint_max) {
14522                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14523                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14524                                 return false;
14525                         }
14526                         r->in.level = test_var;
14527                 } else if (PyInt_Check(py_level)) {
14528                         long test_var;
14529                         test_var = PyInt_AsLong(py_level);
14530                         if (test_var < 0 || test_var > uint_max) {
14531                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14532                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14533                                 return false;
14534                         }
14535                         r->in.level = test_var;
14536                 } else {
14537                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14538                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14539                         return false;
14540                 }
14541         }
14542         r->in.count = talloc_ptrtype(r, r->in.count);
14543         {
14544                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
14545                 if (PyLong_Check(py_count)) {
14546                         unsigned long long test_var;
14547                         test_var = PyLong_AsUnsignedLongLong(py_count);
14548                         if (PyErr_Occurred() != NULL) {
14549                                 return false;
14550                         }
14551                         if (test_var > uint_max) {
14552                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14553                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14554                                 return false;
14555                         }
14556                         *r->in.count = test_var;
14557                 } else if (PyInt_Check(py_count)) {
14558                         long test_var;
14559                         test_var = PyInt_AsLong(py_count);
14560                         if (test_var < 0 || test_var > uint_max) {
14561                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14562                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14563                                 return false;
14564                         }
14565                         *r->in.count = test_var;
14566                 } else {
14567                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14568                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14569                         return false;
14570                 }
14571         }
14572         {
14573                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
14574                 if (PyLong_Check(py_lookup_options)) {
14575                         unsigned long long test_var;
14576                         test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
14577                         if (PyErr_Occurred() != NULL) {
14578                                 return false;
14579                         }
14580                         if (test_var > uint_max) {
14581                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14582                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14583                                 return false;
14584                         }
14585                         r->in.lookup_options = test_var;
14586                 } else if (PyInt_Check(py_lookup_options)) {
14587                         long test_var;
14588                         test_var = PyInt_AsLong(py_lookup_options);
14589                         if (test_var < 0 || test_var > uint_max) {
14590                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14591                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14592                                 return false;
14593                         }
14594                         r->in.lookup_options = test_var;
14595                 } else {
14596                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14597                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14598                         return false;
14599                 }
14600         }
14601         {
14602                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
14603                 if (PyLong_Check(py_client_revision)) {
14604                         unsigned long long test_var;
14605                         test_var = PyLong_AsUnsignedLongLong(py_client_revision);
14606                         if (PyErr_Occurred() != NULL) {
14607                                 return false;
14608                         }
14609                         if (test_var > uint_max) {
14610                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14611                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14612                                 return false;
14613                         }
14614                         r->in.client_revision = test_var;
14615                 } else if (PyInt_Check(py_client_revision)) {
14616                         long test_var;
14617                         test_var = PyInt_AsLong(py_client_revision);
14618                         if (test_var < 0 || test_var > uint_max) {
14619                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14620                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14621                                 return false;
14622                         }
14623                         r->in.client_revision = test_var;
14624                 } else {
14625                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14626                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14627                         return false;
14628                 }
14629         }
14630         return true;
14631 }
14632
14633 static PyObject *unpack_py_lsa_LookupNames3_args_out(struct lsa_LookupNames3 *r)
14634 {
14635         PyObject *result;
14636         PyObject *py_domains;
14637         PyObject *py_sids;
14638         PyObject *py_count;
14639         result = PyTuple_New(3);
14640         if (*r->out.domains == NULL) {
14641                 py_domains = Py_None;
14642                 Py_INCREF(py_domains);
14643         } else {
14644                 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
14645         }
14646         PyTuple_SetItem(result, 0, py_domains);
14647         py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, r->out.sids, r->out.sids);
14648         PyTuple_SetItem(result, 1, py_sids);
14649         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
14650         PyTuple_SetItem(result, 2, py_count);
14651         if (NT_STATUS_IS_ERR(r->out.result)) {
14652                 PyErr_SetNTSTATUS(r->out.result);
14653                 return NULL;
14654         }
14655
14656         return result;
14657 }
14658
14659 static bool pack_py_lsa_lsaRQueryForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct lsa_lsaRQueryForestTrustInformation *r)
14660 {
14661         PyObject *py_handle;
14662         PyObject *py_trusted_domain_name;
14663         PyObject *py_highest_record_type;
14664         const char *kwnames[] = {
14665                 "handle", "trusted_domain_name", "highest_record_type", NULL
14666         };
14667
14668         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_lsaRQueryForestTrustInformation", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain_name, &py_highest_record_type)) {
14669                 return false;
14670         }
14671
14672         r->in.handle = talloc_ptrtype(r, r->in.handle);
14673         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
14674         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
14675                 PyErr_NoMemory();
14676                 return false;
14677         }
14678         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
14679         r->in.trusted_domain_name = talloc_ptrtype(r, r->in.trusted_domain_name);
14680         PY_CHECK_TYPE(&lsa_String_Type, py_trusted_domain_name, return false;);
14681         if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain_name)) == NULL) {
14682                 PyErr_NoMemory();
14683                 return false;
14684         }
14685         r->in.trusted_domain_name = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain_name);
14686         {
14687                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.highest_record_type));
14688                 if (PyLong_Check(py_highest_record_type)) {
14689                         unsigned long long test_var;
14690                         test_var = PyLong_AsUnsignedLongLong(py_highest_record_type);
14691                         if (PyErr_Occurred() != NULL) {
14692                                 return false;
14693                         }
14694                         if (test_var > uint_max) {
14695                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14696                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14697                                 return false;
14698                         }
14699                         r->in.highest_record_type = test_var;
14700                 } else if (PyInt_Check(py_highest_record_type)) {
14701                         long test_var;
14702                         test_var = PyInt_AsLong(py_highest_record_type);
14703                         if (test_var < 0 || test_var > uint_max) {
14704                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14705                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14706                                 return false;
14707                         }
14708                         r->in.highest_record_type = test_var;
14709                 } else {
14710                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14711                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14712                         return false;
14713                 }
14714         }
14715         return true;
14716 }
14717
14718 static PyObject *unpack_py_lsa_lsaRQueryForestTrustInformation_args_out(struct lsa_lsaRQueryForestTrustInformation *r)
14719 {
14720         PyObject *result;
14721         PyObject *py_forest_trust_info;
14722         if (*r->out.forest_trust_info == NULL) {
14723                 py_forest_trust_info = Py_None;
14724                 Py_INCREF(py_forest_trust_info);
14725         } else {
14726                 py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation_Type, *r->out.forest_trust_info, *r->out.forest_trust_info);
14727         }
14728         result = py_forest_trust_info;
14729         if (NT_STATUS_IS_ERR(r->out.result)) {
14730                 PyErr_SetNTSTATUS(r->out.result);
14731                 return NULL;
14732         }
14733
14734         return result;
14735 }
14736
14737 static bool pack_py_lsa_lsaRSetForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct lsa_lsaRSetForestTrustInformation *r)
14738 {
14739         PyObject *py_handle;
14740         PyObject *py_trusted_domain_name;
14741         PyObject *py_highest_record_type;
14742         PyObject *py_forest_trust_info;
14743         PyObject *py_check_only;
14744         const char *kwnames[] = {
14745                 "handle", "trusted_domain_name", "highest_record_type", "forest_trust_info", "check_only", NULL
14746         };
14747
14748         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_lsaRSetForestTrustInformation", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain_name, &py_highest_record_type, &py_forest_trust_info, &py_check_only)) {
14749                 return false;
14750         }
14751
14752         r->in.handle = talloc_ptrtype(r, r->in.handle);
14753         PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
14754         if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
14755                 PyErr_NoMemory();
14756                 return false;
14757         }
14758         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
14759         r->in.trusted_domain_name = talloc_ptrtype(r, r->in.trusted_domain_name);
14760         PY_CHECK_TYPE(&lsa_StringLarge_Type, py_trusted_domain_name, return false;);
14761         if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain_name)) == NULL) {
14762                 PyErr_NoMemory();
14763                 return false;
14764         }
14765         r->in.trusted_domain_name = (struct lsa_StringLarge *)pytalloc_get_ptr(py_trusted_domain_name);
14766         {
14767                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.highest_record_type));
14768                 if (PyLong_Check(py_highest_record_type)) {
14769                         unsigned long long test_var;
14770                         test_var = PyLong_AsUnsignedLongLong(py_highest_record_type);
14771                         if (PyErr_Occurred() != NULL) {
14772                                 return false;
14773                         }
14774                         if (test_var > uint_max) {
14775                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14776                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14777                                 return false;
14778                         }
14779                         r->in.highest_record_type = test_var;
14780                 } else if (PyInt_Check(py_highest_record_type)) {
14781                         long test_var;
14782                         test_var = PyInt_AsLong(py_highest_record_type);
14783                         if (test_var < 0 || test_var > uint_max) {
14784                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14785                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14786                                 return false;
14787                         }
14788                         r->in.highest_record_type = test_var;
14789                 } else {
14790                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14791                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14792                         return false;
14793                 }
14794         }
14795         r->in.forest_trust_info = talloc_ptrtype(r, r->in.forest_trust_info);
14796         PY_CHECK_TYPE(&lsa_ForestTrustInformation_Type, py_forest_trust_info, return false;);
14797         if (talloc_reference(r, pytalloc_get_mem_ctx(py_forest_trust_info)) == NULL) {
14798                 PyErr_NoMemory();
14799                 return false;
14800         }
14801         r->in.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_forest_trust_info);
14802         {
14803                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.check_only));
14804                 if (PyLong_Check(py_check_only)) {
14805                         unsigned long long test_var;
14806                         test_var = PyLong_AsUnsignedLongLong(py_check_only);
14807                         if (PyErr_Occurred() != NULL) {
14808                                 return false;
14809                         }
14810                         if (test_var > uint_max) {
14811                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14812                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14813                                 return false;
14814                         }
14815                         r->in.check_only = test_var;
14816                 } else if (PyInt_Check(py_check_only)) {
14817                         long test_var;
14818                         test_var = PyInt_AsLong(py_check_only);
14819                         if (test_var < 0 || test_var > uint_max) {
14820                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14821                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14822                                 return false;
14823                         }
14824                         r->in.check_only = test_var;
14825                 } else {
14826                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14827                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14828                         return false;
14829                 }
14830         }
14831         return true;
14832 }
14833
14834 static PyObject *unpack_py_lsa_lsaRSetForestTrustInformation_args_out(struct lsa_lsaRSetForestTrustInformation *r)
14835 {
14836         PyObject *result;
14837         PyObject *py_collision_info;
14838         if (*r->out.collision_info == NULL) {
14839                 py_collision_info = Py_None;
14840                 Py_INCREF(py_collision_info);
14841         } else {
14842                 py_collision_info = pytalloc_reference_ex(&lsa_ForestTrustCollisionInfo_Type, *r->out.collision_info, *r->out.collision_info);
14843         }
14844         result = py_collision_info;
14845         if (NT_STATUS_IS_ERR(r->out.result)) {
14846                 PyErr_SetNTSTATUS(r->out.result);
14847                 return NULL;
14848         }
14849
14850         return result;
14851 }
14852
14853 static bool pack_py_lsa_LookupSids3_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids3 *r)
14854 {
14855         PyObject *py_sids;
14856         PyObject *py_names;
14857         PyObject *py_level;
14858         PyObject *py_count;
14859         PyObject *py_lookup_options;
14860         PyObject *py_client_revision;
14861         const char *kwnames[] = {
14862                 "sids", "names", "level", "count", "lookup_options", "client_revision", NULL
14863         };
14864
14865         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:lsa_LookupSids3", discard_const_p(char *, kwnames), &py_sids, &py_names, &py_level, &py_count, &py_lookup_options, &py_client_revision)) {
14866                 return false;
14867         }
14868
14869         r->in.sids = talloc_ptrtype(r, r->in.sids);
14870         PY_CHECK_TYPE(&lsa_SidArray_Type, py_sids, return false;);
14871         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
14872                 PyErr_NoMemory();
14873                 return false;
14874         }
14875         r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
14876         r->in.names = talloc_ptrtype(r, r->in.names);
14877         PY_CHECK_TYPE(&lsa_TransNameArray2_Type, py_names, return false;);
14878         if (talloc_reference(r, pytalloc_get_mem_ctx(py_names)) == NULL) {
14879                 PyErr_NoMemory();
14880                 return false;
14881         }
14882         r->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_names);
14883         {
14884                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
14885                 if (PyLong_Check(py_level)) {
14886                         unsigned long long test_var;
14887                         test_var = PyLong_AsUnsignedLongLong(py_level);
14888                         if (PyErr_Occurred() != NULL) {
14889                                 return false;
14890                         }
14891                         if (test_var > uint_max) {
14892                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14893                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14894                                 return false;
14895                         }
14896                         r->in.level = test_var;
14897                 } else if (PyInt_Check(py_level)) {
14898                         long test_var;
14899                         test_var = PyInt_AsLong(py_level);
14900                         if (test_var < 0 || test_var > uint_max) {
14901                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14902                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14903                                 return false;
14904                         }
14905                         r->in.level = test_var;
14906                 } else {
14907                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14908                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14909                         return false;
14910                 }
14911         }
14912         r->in.count = talloc_ptrtype(r, r->in.count);
14913         {
14914                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
14915                 if (PyLong_Check(py_count)) {
14916                         unsigned long long test_var;
14917                         test_var = PyLong_AsUnsignedLongLong(py_count);
14918                         if (PyErr_Occurred() != NULL) {
14919                                 return false;
14920                         }
14921                         if (test_var > uint_max) {
14922                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14923                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14924                                 return false;
14925                         }
14926                         *r->in.count = test_var;
14927                 } else if (PyInt_Check(py_count)) {
14928                         long test_var;
14929                         test_var = PyInt_AsLong(py_count);
14930                         if (test_var < 0 || test_var > uint_max) {
14931                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14932                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14933                                 return false;
14934                         }
14935                         *r->in.count = test_var;
14936                 } else {
14937                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14938                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14939                         return false;
14940                 }
14941         }
14942         {
14943                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
14944                 if (PyLong_Check(py_lookup_options)) {
14945                         unsigned long long test_var;
14946                         test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
14947                         if (PyErr_Occurred() != NULL) {
14948                                 return false;
14949                         }
14950                         if (test_var > uint_max) {
14951                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14952                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14953                                 return false;
14954                         }
14955                         r->in.lookup_options = test_var;
14956                 } else if (PyInt_Check(py_lookup_options)) {
14957                         long test_var;
14958                         test_var = PyInt_AsLong(py_lookup_options);
14959                         if (test_var < 0 || test_var > uint_max) {
14960                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14961                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14962                                 return false;
14963                         }
14964                         r->in.lookup_options = test_var;
14965                 } else {
14966                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14967                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14968                         return false;
14969                 }
14970         }
14971         {
14972                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
14973                 if (PyLong_Check(py_client_revision)) {
14974                         unsigned long long test_var;
14975                         test_var = PyLong_AsUnsignedLongLong(py_client_revision);
14976                         if (PyErr_Occurred() != NULL) {
14977                                 return false;
14978                         }
14979                         if (test_var > uint_max) {
14980                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
14981                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14982                                 return false;
14983                         }
14984                         r->in.client_revision = test_var;
14985                 } else if (PyInt_Check(py_client_revision)) {
14986                         long test_var;
14987                         test_var = PyInt_AsLong(py_client_revision);
14988                         if (test_var < 0 || test_var > uint_max) {
14989                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
14990                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
14991                                 return false;
14992                         }
14993                         r->in.client_revision = test_var;
14994                 } else {
14995                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14996                           PyInt_Type.tp_name, PyLong_Type.tp_name);
14997                         return false;
14998                 }
14999         }
15000         return true;
15001 }
15002
15003 static PyObject *unpack_py_lsa_LookupSids3_args_out(struct lsa_LookupSids3 *r)
15004 {
15005         PyObject *result;
15006         PyObject *py_domains;
15007         PyObject *py_names;
15008         PyObject *py_count;
15009         result = PyTuple_New(3);
15010         if (*r->out.domains == NULL) {
15011                 py_domains = Py_None;
15012                 Py_INCREF(py_domains);
15013         } else {
15014                 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
15015         }
15016         PyTuple_SetItem(result, 0, py_domains);
15017         py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, r->out.names, r->out.names);
15018         PyTuple_SetItem(result, 1, py_names);
15019         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
15020         PyTuple_SetItem(result, 2, py_count);
15021         if (NT_STATUS_IS_ERR(r->out.result)) {
15022                 PyErr_SetNTSTATUS(r->out.result);
15023                 return NULL;
15024         }
15025
15026         return result;
15027 }
15028
15029 static bool pack_py_lsa_LookupNames4_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames4 *r)
15030 {
15031         PyObject *py_names;
15032         PyObject *py_sids;
15033         PyObject *py_level;
15034         PyObject *py_count;
15035         PyObject *py_lookup_options;
15036         PyObject *py_client_revision;
15037         const char *kwnames[] = {
15038                 "names", "sids", "level", "count", "lookup_options", "client_revision", NULL
15039         };
15040
15041         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:lsa_LookupNames4", discard_const_p(char *, kwnames), &py_names, &py_sids, &py_level, &py_count, &py_lookup_options, &py_client_revision)) {
15042                 return false;
15043         }
15044
15045         PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
15046         r->in.num_names = PyList_GET_SIZE(py_names);
15047         PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
15048         {
15049                 int names_cntr_0;
15050                 r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
15051                 if (!r->in.names) { return false;; }
15052                 talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
15053                 for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
15054                         PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
15055                         if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
15056                                 PyErr_NoMemory();
15057                                 return false;
15058                         }
15059                         r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
15060                 }
15061         }
15062         r->in.sids = talloc_ptrtype(r, r->in.sids);
15063         PY_CHECK_TYPE(&lsa_TransSidArray3_Type, py_sids, return false;);
15064         if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
15065                 PyErr_NoMemory();
15066                 return false;
15067         }
15068         r->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_sids);
15069         {
15070                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
15071                 if (PyLong_Check(py_level)) {
15072                         unsigned long long test_var;
15073                         test_var = PyLong_AsUnsignedLongLong(py_level);
15074                         if (PyErr_Occurred() != NULL) {
15075                                 return false;
15076                         }
15077                         if (test_var > uint_max) {
15078                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
15079                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
15080                                 return false;
15081                         }
15082                         r->in.level = test_var;
15083                 } else if (PyInt_Check(py_level)) {
15084                         long test_var;
15085                         test_var = PyInt_AsLong(py_level);
15086                         if (test_var < 0 || test_var > uint_max) {
15087                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
15088                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
15089                                 return false;
15090                         }
15091                         r->in.level = test_var;
15092                 } else {
15093                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
15094                           PyInt_Type.tp_name, PyLong_Type.tp_name);
15095                         return false;
15096                 }
15097         }
15098         r->in.count = talloc_ptrtype(r, r->in.count);
15099         {
15100                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
15101                 if (PyLong_Check(py_count)) {
15102                         unsigned long long test_var;
15103                         test_var = PyLong_AsUnsignedLongLong(py_count);
15104                         if (PyErr_Occurred() != NULL) {
15105                                 return false;
15106                         }
15107                         if (test_var > uint_max) {
15108                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
15109                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
15110                                 return false;
15111                         }
15112                         *r->in.count = test_var;
15113                 } else if (PyInt_Check(py_count)) {
15114                         long test_var;
15115                         test_var = PyInt_AsLong(py_count);
15116                         if (test_var < 0 || test_var > uint_max) {
15117                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
15118                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
15119                                 return false;
15120                         }
15121                         *r->in.count = test_var;
15122                 } else {
15123                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
15124                           PyInt_Type.tp_name, PyLong_Type.tp_name);
15125                         return false;
15126                 }
15127         }
15128         {
15129                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
15130                 if (PyLong_Check(py_lookup_options)) {
15131                         unsigned long long test_var;
15132                         test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
15133                         if (PyErr_Occurred() != NULL) {
15134                                 return false;
15135                         }
15136                         if (test_var > uint_max) {
15137                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
15138                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
15139                                 return false;
15140                         }
15141                         r->in.lookup_options = test_var;
15142                 } else if (PyInt_Check(py_lookup_options)) {
15143                         long test_var;
15144                         test_var = PyInt_AsLong(py_lookup_options);
15145                         if (test_var < 0 || test_var > uint_max) {
15146                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
15147                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
15148                                 return false;
15149                         }
15150                         r->in.lookup_options = test_var;
15151                 } else {
15152                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
15153                           PyInt_Type.tp_name, PyLong_Type.tp_name);
15154                         return false;
15155                 }
15156         }
15157         {
15158                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
15159                 if (PyLong_Check(py_client_revision)) {
15160                         unsigned long long test_var;
15161                         test_var = PyLong_AsUnsignedLongLong(py_client_revision);
15162                         if (PyErr_Occurred() != NULL) {
15163                                 return false;
15164                         }
15165                         if (test_var > uint_max) {
15166                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
15167                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
15168                                 return false;
15169                         }
15170                         r->in.client_revision = test_var;
15171                 } else if (PyInt_Check(py_client_revision)) {
15172                         long test_var;
15173                         test_var = PyInt_AsLong(py_client_revision);
15174                         if (test_var < 0 || test_var > uint_max) {
15175                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
15176                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
15177                                 return false;
15178                         }
15179                         r->in.client_revision = test_var;
15180                 } else {
15181                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
15182                           PyInt_Type.tp_name, PyLong_Type.tp_name);
15183                         return false;
15184                 }
15185         }
15186         return true;
15187 }
15188
15189 static PyObject *unpack_py_lsa_LookupNames4_args_out(struct lsa_LookupNames4 *r)
15190 {
15191         PyObject *result;
15192         PyObject *py_domains;
15193         PyObject *py_sids;
15194         PyObject *py_count;
15195         result = PyTuple_New(3);
15196         if (*r->out.domains == NULL) {
15197                 py_domains = Py_None;
15198                 Py_INCREF(py_domains);
15199         } else {
15200                 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
15201         }
15202         PyTuple_SetItem(result, 0, py_domains);
15203         py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, r->out.sids, r->out.sids);
15204         PyTuple_SetItem(result, 1, py_sids);
15205         py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
15206         PyTuple_SetItem(result, 2, py_count);
15207         if (NT_STATUS_IS_ERR(r->out.result)) {
15208                 PyErr_SetNTSTATUS(r->out.result);
15209                 return NULL;
15210         }
15211
15212         return result;
15213 }
15214
15215 const struct PyNdrRpcMethodDef py_ndr_lsarpc_methods[] = {
15216         { "Close", "S.Close(handle) -> handle", (py_dcerpc_call_fn)dcerpc_lsa_Close_r, (py_data_pack_fn)pack_py_lsa_Close_args_in, (py_data_unpack_fn)unpack_py_lsa_Close_args_out, 0, &ndr_table_lsarpc },
15217         { "Delete", "S.Delete(handle) -> None", (py_dcerpc_call_fn)dcerpc_lsa_Delete_r, (py_data_pack_fn)pack_py_lsa_Delete_args_in, (py_data_unpack_fn)unpack_py_lsa_Delete_args_out, 1, &ndr_table_lsarpc },
15218         { "EnumPrivs", "S.EnumPrivs(handle, resume_handle, max_count) -> (resume_handle, privs)", (py_dcerpc_call_fn)dcerpc_lsa_EnumPrivs_r, (py_data_pack_fn)pack_py_lsa_EnumPrivs_args_in, (py_data_unpack_fn)unpack_py_lsa_EnumPrivs_args_out, 2, &ndr_table_lsarpc },
15219         { "QuerySecurity", "S.QuerySecurity(handle, sec_info) -> sdbuf", (py_dcerpc_call_fn)dcerpc_lsa_QuerySecurity_r, (py_data_pack_fn)pack_py_lsa_QuerySecurity_args_in, (py_data_unpack_fn)unpack_py_lsa_QuerySecurity_args_out, 3, &ndr_table_lsarpc },
15220         { "SetSecObj", "S.SetSecObj(handle, sec_info, sdbuf) -> None", (py_dcerpc_call_fn)dcerpc_lsa_SetSecObj_r, (py_data_pack_fn)pack_py_lsa_SetSecObj_args_in, (py_data_unpack_fn)unpack_py_lsa_SetSecObj_args_out, 4, &ndr_table_lsarpc },
15221         { "OpenPolicy", "S.OpenPolicy(system_name, attr, access_mask) -> handle", (py_dcerpc_call_fn)dcerpc_lsa_OpenPolicy_r, (py_data_pack_fn)pack_py_lsa_OpenPolicy_args_in, (py_data_unpack_fn)unpack_py_lsa_OpenPolicy_args_out, 6, &ndr_table_lsarpc },
15222         { "QueryInfoPolicy", "S.QueryInfoPolicy(handle, level) -> info", (py_dcerpc_call_fn)dcerpc_lsa_QueryInfoPolicy_r, (py_data_pack_fn)pack_py_lsa_QueryInfoPolicy_args_in, (py_data_unpack_fn)unpack_py_lsa_QueryInfoPolicy_args_out, 7, &ndr_table_lsarpc },
15223         { "SetInfoPolicy", "S.SetInfoPolicy(handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_lsa_SetInfoPolicy_r, (py_data_pack_fn)pack_py_lsa_SetInfoPolicy_args_in, (py_data_unpack_fn)unpack_py_lsa_SetInfoPolicy_args_out, 8, &ndr_table_lsarpc },
15224         { "CreateAccount", "S.CreateAccount(handle, sid, access_mask) -> acct_handle", (py_dcerpc_call_fn)dcerpc_lsa_CreateAccount_r, (py_data_pack_fn)pack_py_lsa_CreateAccount_args_in, (py_data_unpack_fn)unpack_py_lsa_CreateAccount_args_out, 10, &ndr_table_lsarpc },
15225         { "EnumAccounts", "S.EnumAccounts(handle, resume_handle, num_entries) -> (resume_handle, sids)", (py_dcerpc_call_fn)dcerpc_lsa_EnumAccounts_r, (py_data_pack_fn)pack_py_lsa_EnumAccounts_args_in, (py_data_unpack_fn)unpack_py_lsa_EnumAccounts_args_out, 11, &ndr_table_lsarpc },
15226         { "CreateTrustedDomain", "S.CreateTrustedDomain(policy_handle, info, access_mask) -> trustdom_handle", (py_dcerpc_call_fn)dcerpc_lsa_CreateTrustedDomain_r, (py_data_pack_fn)pack_py_lsa_CreateTrustedDomain_args_in, (py_data_unpack_fn)unpack_py_lsa_CreateTrustedDomain_args_out, 12, &ndr_table_lsarpc },
15227         { "EnumTrustDom", "S.EnumTrustDom(handle, resume_handle, max_size) -> (resume_handle, domains)", (py_dcerpc_call_fn)dcerpc_lsa_EnumTrustDom_r, (py_data_pack_fn)pack_py_lsa_EnumTrustDom_args_in, (py_data_unpack_fn)unpack_py_lsa_EnumTrustDom_args_out, 13, &ndr_table_lsarpc },
15228         { "LookupNames", "S.LookupNames(handle, names, sids, level, count) -> (domains, sids, count)", (py_dcerpc_call_fn)dcerpc_lsa_LookupNames_r, (py_data_pack_fn)pack_py_lsa_LookupNames_args_in, (py_data_unpack_fn)unpack_py_lsa_LookupNames_args_out, 14, &ndr_table_lsarpc },
15229         { "LookupSids", "S.LookupSids(handle, sids, names, level, count) -> (domains, names, count)", (py_dcerpc_call_fn)dcerpc_lsa_LookupSids_r, (py_data_pack_fn)pack_py_lsa_LookupSids_args_in, (py_data_unpack_fn)unpack_py_lsa_LookupSids_args_out, 15, &ndr_table_lsarpc },
15230         { "CreateSecret", "S.CreateSecret(handle, name, access_mask) -> sec_handle", (py_dcerpc_call_fn)dcerpc_lsa_CreateSecret_r, (py_data_pack_fn)pack_py_lsa_CreateSecret_args_in, (py_data_unpack_fn)unpack_py_lsa_CreateSecret_args_out, 16, &ndr_table_lsarpc },
15231         { "OpenAccount", "S.OpenAccount(handle, sid, access_mask) -> acct_handle", (py_dcerpc_call_fn)dcerpc_lsa_OpenAccount_r, (py_data_pack_fn)pack_py_lsa_OpenAccount_args_in, (py_data_unpack_fn)unpack_py_lsa_OpenAccount_args_out, 17, &ndr_table_lsarpc },
15232         { "EnumPrivsAccount", "S.EnumPrivsAccount(handle) -> privs", (py_dcerpc_call_fn)dcerpc_lsa_EnumPrivsAccount_r, (py_data_pack_fn)pack_py_lsa_EnumPrivsAccount_args_in, (py_data_unpack_fn)unpack_py_lsa_EnumPrivsAccount_args_out, 18, &ndr_table_lsarpc },
15233         { "AddPrivilegesToAccount", "S.AddPrivilegesToAccount(handle, privs) -> None", (py_dcerpc_call_fn)dcerpc_lsa_AddPrivilegesToAccount_r, (py_data_pack_fn)pack_py_lsa_AddPrivilegesToAccount_args_in, (py_data_unpack_fn)unpack_py_lsa_AddPrivilegesToAccount_args_out, 19, &ndr_table_lsarpc },
15234         { "RemovePrivilegesFromAccount", "S.RemovePrivilegesFromAccount(handle, remove_all, privs) -> None", (py_dcerpc_call_fn)dcerpc_lsa_RemovePrivilegesFromAccount_r, (py_data_pack_fn)pack_py_lsa_RemovePrivilegesFromAccount_args_in, (py_data_unpack_fn)unpack_py_lsa_RemovePrivilegesFromAccount_args_out, 20, &ndr_table_lsarpc },
15235         { "GetSystemAccessAccount", "S.GetSystemAccessAccount(handle) -> access_mask", (py_dcerpc_call_fn)dcerpc_lsa_GetSystemAccessAccount_r, (py_data_pack_fn)pack_py_lsa_GetSystemAccessAccount_args_in, (py_data_unpack_fn)unpack_py_lsa_GetSystemAccessAccount_args_out, 23, &ndr_table_lsarpc },
15236         { "SetSystemAccessAccount", "S.SetSystemAccessAccount(handle, access_mask) -> None", (py_dcerpc_call_fn)dcerpc_lsa_SetSystemAccessAccount_r, (py_data_pack_fn)pack_py_lsa_SetSystemAccessAccount_args_in, (py_data_unpack_fn)unpack_py_lsa_SetSystemAccessAccount_args_out, 24, &ndr_table_lsarpc },
15237         { "OpenTrustedDomain", "S.OpenTrustedDomain(handle, sid, access_mask) -> trustdom_handle", (py_dcerpc_call_fn)dcerpc_lsa_OpenTrustedDomain_r, (py_data_pack_fn)pack_py_lsa_OpenTrustedDomain_args_in, (py_data_unpack_fn)unpack_py_lsa_OpenTrustedDomain_args_out, 25, &ndr_table_lsarpc },
15238         { "QueryTrustedDomainInfo", "S.QueryTrustedDomainInfo(trustdom_handle, level) -> info", (py_dcerpc_call_fn)dcerpc_lsa_QueryTrustedDomainInfo_r, (py_data_pack_fn)pack_py_lsa_QueryTrustedDomainInfo_args_in, (py_data_unpack_fn)unpack_py_lsa_QueryTrustedDomainInfo_args_out, 26, &ndr_table_lsarpc },
15239         { "SetInformationTrustedDomain", "S.SetInformationTrustedDomain(trustdom_handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_lsa_SetInformationTrustedDomain_r, (py_data_pack_fn)pack_py_lsa_SetInformationTrustedDomain_args_in, (py_data_unpack_fn)unpack_py_lsa_SetInformationTrustedDomain_args_out, 27, &ndr_table_lsarpc },
15240         { "OpenSecret", "S.OpenSecret(handle, name, access_mask) -> sec_handle", (py_dcerpc_call_fn)dcerpc_lsa_OpenSecret_r, (py_data_pack_fn)pack_py_lsa_OpenSecret_args_in, (py_data_unpack_fn)unpack_py_lsa_OpenSecret_args_out, 28, &ndr_table_lsarpc },
15241         { "SetSecret", "S.SetSecret(sec_handle, new_val, old_val) -> None", (py_dcerpc_call_fn)dcerpc_lsa_SetSecret_r, (py_data_pack_fn)pack_py_lsa_SetSecret_args_in, (py_data_unpack_fn)unpack_py_lsa_SetSecret_args_out, 29, &ndr_table_lsarpc },
15242         { "QuerySecret", "S.QuerySecret(sec_handle, new_val, new_mtime, old_val, old_mtime) -> (new_val, new_mtime, old_val, old_mtime)", (py_dcerpc_call_fn)dcerpc_lsa_QuerySecret_r, (py_data_pack_fn)pack_py_lsa_QuerySecret_args_in, (py_data_unpack_fn)unpack_py_lsa_QuerySecret_args_out, 30, &ndr_table_lsarpc },
15243         { "LookupPrivValue", "S.LookupPrivValue(handle, name) -> luid", (py_dcerpc_call_fn)dcerpc_lsa_LookupPrivValue_r, (py_data_pack_fn)pack_py_lsa_LookupPrivValue_args_in, (py_data_unpack_fn)unpack_py_lsa_LookupPrivValue_args_out, 31, &ndr_table_lsarpc },
15244         { "LookupPrivName", "S.LookupPrivName(handle, luid) -> name", (py_dcerpc_call_fn)dcerpc_lsa_LookupPrivName_r, (py_data_pack_fn)pack_py_lsa_LookupPrivName_args_in, (py_data_unpack_fn)unpack_py_lsa_LookupPrivName_args_out, 32, &ndr_table_lsarpc },
15245         { "LookupPrivDisplayName", "S.LookupPrivDisplayName(handle, name, language_id, language_id_sys) -> (disp_name, returned_language_id)", (py_dcerpc_call_fn)dcerpc_lsa_LookupPrivDisplayName_r, (py_data_pack_fn)pack_py_lsa_LookupPrivDisplayName_args_in, (py_data_unpack_fn)unpack_py_lsa_LookupPrivDisplayName_args_out, 33, &ndr_table_lsarpc },
15246         { "DeleteObject", "S.DeleteObject(handle) -> handle", (py_dcerpc_call_fn)dcerpc_lsa_DeleteObject_r, (py_data_pack_fn)pack_py_lsa_DeleteObject_args_in, (py_data_unpack_fn)unpack_py_lsa_DeleteObject_args_out, 34, &ndr_table_lsarpc },
15247         { "EnumAccountsWithUserRight", "S.EnumAccountsWithUserRight(handle, name) -> sids", (py_dcerpc_call_fn)dcerpc_lsa_EnumAccountsWithUserRight_r, (py_data_pack_fn)pack_py_lsa_EnumAccountsWithUserRight_args_in, (py_data_unpack_fn)unpack_py_lsa_EnumAccountsWithUserRight_args_out, 35, &ndr_table_lsarpc },
15248         { "EnumAccountRights", "S.EnumAccountRights(handle, sid) -> rights", (py_dcerpc_call_fn)dcerpc_lsa_EnumAccountRights_r, (py_data_pack_fn)pack_py_lsa_EnumAccountRights_args_in, (py_data_unpack_fn)unpack_py_lsa_EnumAccountRights_args_out, 36, &ndr_table_lsarpc },
15249         { "AddAccountRights", "S.AddAccountRights(handle, sid, rights) -> None", (py_dcerpc_call_fn)dcerpc_lsa_AddAccountRights_r, (py_data_pack_fn)pack_py_lsa_AddAccountRights_args_in, (py_data_unpack_fn)unpack_py_lsa_AddAccountRights_args_out, 37, &ndr_table_lsarpc },
15250         { "RemoveAccountRights", "S.RemoveAccountRights(handle, sid, remove_all, rights) -> None", (py_dcerpc_call_fn)dcerpc_lsa_RemoveAccountRights_r, (py_data_pack_fn)pack_py_lsa_RemoveAccountRights_args_in, (py_data_unpack_fn)unpack_py_lsa_RemoveAccountRights_args_out, 38, &ndr_table_lsarpc },
15251         { "QueryTrustedDomainInfoBySid", "S.QueryTrustedDomainInfoBySid(handle, dom_sid, level) -> info", (py_dcerpc_call_fn)dcerpc_lsa_QueryTrustedDomainInfoBySid_r, (py_data_pack_fn)pack_py_lsa_QueryTrustedDomainInfoBySid_args_in, (py_data_unpack_fn)unpack_py_lsa_QueryTrustedDomainInfoBySid_args_out, 39, &ndr_table_lsarpc },
15252         { "SetTrustedDomainInfo", "S.SetTrustedDomainInfo(handle, dom_sid, level, info) -> None", (py_dcerpc_call_fn)dcerpc_lsa_SetTrustedDomainInfo_r, (py_data_pack_fn)pack_py_lsa_SetTrustedDomainInfo_args_in, (py_data_unpack_fn)unpack_py_lsa_SetTrustedDomainInfo_args_out, 40, &ndr_table_lsarpc },
15253         { "DeleteTrustedDomain", "S.DeleteTrustedDomain(handle, dom_sid) -> None", (py_dcerpc_call_fn)dcerpc_lsa_DeleteTrustedDomain_r, (py_data_pack_fn)pack_py_lsa_DeleteTrustedDomain_args_in, (py_data_unpack_fn)unpack_py_lsa_DeleteTrustedDomain_args_out, 41, &ndr_table_lsarpc },
15254         { "StorePrivateData", "S.StorePrivateData(handle, name, val) -> None", (py_dcerpc_call_fn)dcerpc_lsa_StorePrivateData_r, (py_data_pack_fn)pack_py_lsa_StorePrivateData_args_in, (py_data_unpack_fn)unpack_py_lsa_StorePrivateData_args_out, 42, &ndr_table_lsarpc },
15255         { "RetrievePrivateData", "S.RetrievePrivateData(handle, name, val) -> val", (py_dcerpc_call_fn)dcerpc_lsa_RetrievePrivateData_r, (py_data_pack_fn)pack_py_lsa_RetrievePrivateData_args_in, (py_data_unpack_fn)unpack_py_lsa_RetrievePrivateData_args_out, 43, &ndr_table_lsarpc },
15256         { "OpenPolicy2", "S.OpenPolicy2(system_name, attr, access_mask) -> handle", (py_dcerpc_call_fn)dcerpc_lsa_OpenPolicy2_r, (py_data_pack_fn)pack_py_lsa_OpenPolicy2_args_in, (py_data_unpack_fn)unpack_py_lsa_OpenPolicy2_args_out, 44, &ndr_table_lsarpc },
15257         { "GetUserName", "S.GetUserName(system_name, account_name, authority_name) -> (account_name, authority_name)", (py_dcerpc_call_fn)dcerpc_lsa_GetUserName_r, (py_data_pack_fn)pack_py_lsa_GetUserName_args_in, (py_data_unpack_fn)unpack_py_lsa_GetUserName_args_out, 45, &ndr_table_lsarpc },
15258         { "QueryInfoPolicy2", "S.QueryInfoPolicy2(handle, level) -> info", (py_dcerpc_call_fn)dcerpc_lsa_QueryInfoPolicy2_r, (py_data_pack_fn)pack_py_lsa_QueryInfoPolicy2_args_in, (py_data_unpack_fn)unpack_py_lsa_QueryInfoPolicy2_args_out, 46, &ndr_table_lsarpc },
15259         { "SetInfoPolicy2", "S.SetInfoPolicy2(handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_lsa_SetInfoPolicy2_r, (py_data_pack_fn)pack_py_lsa_SetInfoPolicy2_args_in, (py_data_unpack_fn)unpack_py_lsa_SetInfoPolicy2_args_out, 47, &ndr_table_lsarpc },
15260         { "QueryTrustedDomainInfoByName", "S.QueryTrustedDomainInfoByName(handle, trusted_domain, level) -> info", (py_dcerpc_call_fn)dcerpc_lsa_QueryTrustedDomainInfoByName_r, (py_data_pack_fn)pack_py_lsa_QueryTrustedDomainInfoByName_args_in, (py_data_unpack_fn)unpack_py_lsa_QueryTrustedDomainInfoByName_args_out, 48, &ndr_table_lsarpc },
15261         { "SetTrustedDomainInfoByName", "S.SetTrustedDomainInfoByName(handle, trusted_domain, level, info) -> None", (py_dcerpc_call_fn)dcerpc_lsa_SetTrustedDomainInfoByName_r, (py_data_pack_fn)pack_py_lsa_SetTrustedDomainInfoByName_args_in, (py_data_unpack_fn)unpack_py_lsa_SetTrustedDomainInfoByName_args_out, 49, &ndr_table_lsarpc },
15262         { "EnumTrustedDomainsEx", "S.EnumTrustedDomainsEx(handle, resume_handle, max_size) -> (resume_handle, domains)", (py_dcerpc_call_fn)dcerpc_lsa_EnumTrustedDomainsEx_r, (py_data_pack_fn)pack_py_lsa_EnumTrustedDomainsEx_args_in, (py_data_unpack_fn)unpack_py_lsa_EnumTrustedDomainsEx_args_out, 50, &ndr_table_lsarpc },
15263         { "CreateTrustedDomainEx", "S.CreateTrustedDomainEx(policy_handle, info, auth_info, access_mask) -> trustdom_handle", (py_dcerpc_call_fn)dcerpc_lsa_CreateTrustedDomainEx_r, (py_data_pack_fn)pack_py_lsa_CreateTrustedDomainEx_args_in, (py_data_unpack_fn)unpack_py_lsa_CreateTrustedDomainEx_args_out, 51, &ndr_table_lsarpc },
15264         { "CloseTrustedDomainEx", "S.CloseTrustedDomainEx(handle) -> handle", (py_dcerpc_call_fn)dcerpc_lsa_CloseTrustedDomainEx_r, (py_data_pack_fn)pack_py_lsa_CloseTrustedDomainEx_args_in, (py_data_unpack_fn)unpack_py_lsa_CloseTrustedDomainEx_args_out, 52, &ndr_table_lsarpc },
15265         { "QueryDomainInformationPolicy", "S.QueryDomainInformationPolicy(handle, level) -> info", (py_dcerpc_call_fn)dcerpc_lsa_QueryDomainInformationPolicy_r, (py_data_pack_fn)pack_py_lsa_QueryDomainInformationPolicy_args_in, (py_data_unpack_fn)unpack_py_lsa_QueryDomainInformationPolicy_args_out, 53, &ndr_table_lsarpc },
15266         { "SetDomainInformationPolicy", "S.SetDomainInformationPolicy(handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_lsa_SetDomainInformationPolicy_r, (py_data_pack_fn)pack_py_lsa_SetDomainInformationPolicy_args_in, (py_data_unpack_fn)unpack_py_lsa_SetDomainInformationPolicy_args_out, 54, &ndr_table_lsarpc },
15267         { "OpenTrustedDomainByName", "S.OpenTrustedDomainByName(handle, name, access_mask) -> trustdom_handle", (py_dcerpc_call_fn)dcerpc_lsa_OpenTrustedDomainByName_r, (py_data_pack_fn)pack_py_lsa_OpenTrustedDomainByName_args_in, (py_data_unpack_fn)unpack_py_lsa_OpenTrustedDomainByName_args_out, 55, &ndr_table_lsarpc },
15268         { "LookupSids2", "S.LookupSids2(handle, sids, names, level, count, lookup_options, client_revision) -> (domains, names, count)", (py_dcerpc_call_fn)dcerpc_lsa_LookupSids2_r, (py_data_pack_fn)pack_py_lsa_LookupSids2_args_in, (py_data_unpack_fn)unpack_py_lsa_LookupSids2_args_out, 57, &ndr_table_lsarpc },
15269         { "LookupNames2", "S.LookupNames2(handle, names, sids, level, count, lookup_options, client_revision) -> (domains, sids, count)", (py_dcerpc_call_fn)dcerpc_lsa_LookupNames2_r, (py_data_pack_fn)pack_py_lsa_LookupNames2_args_in, (py_data_unpack_fn)unpack_py_lsa_LookupNames2_args_out, 58, &ndr_table_lsarpc },
15270         { "CreateTrustedDomainEx2", "S.CreateTrustedDomainEx2(policy_handle, info, auth_info_internal, access_mask) -> trustdom_handle", (py_dcerpc_call_fn)dcerpc_lsa_CreateTrustedDomainEx2_r, (py_data_pack_fn)pack_py_lsa_CreateTrustedDomainEx2_args_in, (py_data_unpack_fn)unpack_py_lsa_CreateTrustedDomainEx2_args_out, 59, &ndr_table_lsarpc },
15271         { "LookupNames3", "S.LookupNames3(handle, names, sids, level, count, lookup_options, client_revision) -> (domains, sids, count)", (py_dcerpc_call_fn)dcerpc_lsa_LookupNames3_r, (py_data_pack_fn)pack_py_lsa_LookupNames3_args_in, (py_data_unpack_fn)unpack_py_lsa_LookupNames3_args_out, 68, &ndr_table_lsarpc },
15272         { "lsaRQueryForestTrustInformation", "S.lsaRQueryForestTrustInformation(handle, trusted_domain_name, highest_record_type) -> forest_trust_info", (py_dcerpc_call_fn)dcerpc_lsa_lsaRQueryForestTrustInformation_r, (py_data_pack_fn)pack_py_lsa_lsaRQueryForestTrustInformation_args_in, (py_data_unpack_fn)unpack_py_lsa_lsaRQueryForestTrustInformation_args_out, 73, &ndr_table_lsarpc },
15273         { "lsaRSetForestTrustInformation", "S.lsaRSetForestTrustInformation(handle, trusted_domain_name, highest_record_type, forest_trust_info, check_only) -> collision_info", (py_dcerpc_call_fn)dcerpc_lsa_lsaRSetForestTrustInformation_r, (py_data_pack_fn)pack_py_lsa_lsaRSetForestTrustInformation_args_in, (py_data_unpack_fn)unpack_py_lsa_lsaRSetForestTrustInformation_args_out, 74, &ndr_table_lsarpc },
15274         { "LookupSids3", "S.LookupSids3(sids, names, level, count, lookup_options, client_revision) -> (domains, names, count)", (py_dcerpc_call_fn)dcerpc_lsa_LookupSids3_r, (py_data_pack_fn)pack_py_lsa_LookupSids3_args_in, (py_data_unpack_fn)unpack_py_lsa_LookupSids3_args_out, 76, &ndr_table_lsarpc },
15275         { "LookupNames4", "S.LookupNames4(names, sids, level, count, lookup_options, client_revision) -> (domains, sids, count)", (py_dcerpc_call_fn)dcerpc_lsa_LookupNames4_r, (py_data_pack_fn)pack_py_lsa_LookupNames4_args_in, (py_data_unpack_fn)unpack_py_lsa_LookupNames4_args_out, 77, &ndr_table_lsarpc },
15276         { NULL }
15277 };
15278
15279 static PyObject *interface_lsarpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15280 {
15281         return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_lsarpc);
15282 }
15283
15284 #define PY_DOC_LSARPC "Local Security Authority"
15285 static PyTypeObject lsarpc_InterfaceType = {
15286         PyObject_HEAD_INIT(NULL) 0,
15287         .tp_name = "lsa.lsarpc",
15288         .tp_basicsize = sizeof(dcerpc_InterfaceObject),
15289         .tp_doc = "lsarpc(binding, lp_ctx=None, credentials=None) -> connection\n"
15290 "\n"
15291 "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
15292 "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
15293 "credentials should be a credentials.Credentials object.\n\n"PY_DOC_LSARPC,
15294         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15295         .tp_new = interface_lsarpc_new,
15296 };
15297
15298 static PyObject *syntax_lsarpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15299 {
15300         return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_lsarpc.syntax_id);
15301 }
15302
15303 #define PY_DOC_LSARPC_SYNTAX "Local Security Authority"
15304 static PyTypeObject lsarpc_SyntaxType = {
15305         PyObject_HEAD_INIT(NULL) 0,
15306         .tp_name = "lsa.lsarpc",
15307         .tp_basicsize = sizeof(pytalloc_Object),
15308         .tp_doc = "abstract_syntax()\n"PY_DOC_LSARPC_SYNTAX,
15309         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15310         .tp_new = syntax_lsarpc_new,
15311 };
15312
15313 static PyMethodDef lsa_methods[] = {
15314         { NULL, NULL, 0, NULL }
15315 };
15316
15317 void initlsa(void)
15318 {
15319         PyObject *m;
15320         PyObject *dep_samba_dcerpc_misc;
15321         PyObject *dep_samba_dcerpc_security;
15322         PyObject *dep_talloc;
15323         PyObject *dep_samba_dcerpc_base;
15324
15325         dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
15326         if (dep_samba_dcerpc_misc == NULL)
15327                 return;
15328
15329         dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
15330         if (dep_samba_dcerpc_security == NULL)
15331                 return;
15332
15333         dep_talloc = PyImport_ImportModule("talloc");
15334         if (dep_talloc == NULL)
15335                 return;
15336
15337         dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
15338         if (dep_samba_dcerpc_base == NULL)
15339                 return;
15340
15341         Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
15342         if (Object_Type == NULL)
15343                 return;
15344
15345         security_descriptor_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "descriptor");
15346         if (security_descriptor_Type == NULL)
15347                 return;
15348
15349         dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
15350         if (dom_sid_Type == NULL)
15351                 return;
15352
15353         GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
15354         if (GUID_Type == NULL)
15355                 return;
15356
15357         policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
15358         if (policy_handle_Type == NULL)
15359                 return;
15360
15361         sec_desc_buf_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "sec_desc_buf");
15362         if (sec_desc_buf_Type == NULL)
15363                 return;
15364
15365         ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
15366         if (ClientConnection_Type == NULL)
15367                 return;
15368
15369         ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
15370         if (ndr_syntax_id_Type == NULL)
15371                 return;
15372
15373         lsa_String_Type.tp_base = Object_Type;
15374
15375         lsa_StringLarge_Type.tp_base = Object_Type;
15376
15377         lsa_Strings_Type.tp_base = Object_Type;
15378
15379         lsa_AsciiString_Type.tp_base = Object_Type;
15380
15381         lsa_AsciiStringLarge_Type.tp_base = Object_Type;
15382
15383         lsa_BinaryString_Type.tp_base = Object_Type;
15384
15385         lsa_LUID_Type.tp_base = Object_Type;
15386
15387         lsa_PrivEntry_Type.tp_base = Object_Type;
15388
15389         lsa_PrivArray_Type.tp_base = Object_Type;
15390
15391         lsa_QosInfo_Type.tp_base = Object_Type;
15392
15393         lsa_ObjectAttribute_Type.tp_base = Object_Type;
15394
15395         lsa_AuditLogInfo_Type.tp_base = Object_Type;
15396
15397         lsa_AuditEventsInfo_Type.tp_base = Object_Type;
15398
15399         lsa_DomainInfo_Type.tp_base = Object_Type;
15400
15401         lsa_PDAccountInfo_Type.tp_base = Object_Type;
15402
15403         lsa_ServerRole_Type.tp_base = Object_Type;
15404
15405         lsa_ReplicaSourceInfo_Type.tp_base = Object_Type;
15406
15407         lsa_DefaultQuotaInfo_Type.tp_base = Object_Type;
15408
15409         lsa_ModificationInfo_Type.tp_base = Object_Type;
15410
15411         lsa_AuditFullSetInfo_Type.tp_base = Object_Type;
15412
15413         lsa_AuditFullQueryInfo_Type.tp_base = Object_Type;
15414
15415         lsa_DnsDomainInfo_Type.tp_base = Object_Type;
15416
15417         lsa_SidPtr_Type.tp_base = Object_Type;
15418
15419         lsa_SidArray_Type.tp_base = Object_Type;
15420
15421         lsa_DomainList_Type.tp_base = Object_Type;
15422
15423         lsa_TranslatedSid_Type.tp_base = Object_Type;
15424
15425         lsa_TransSidArray_Type.tp_base = Object_Type;
15426
15427         lsa_RefDomainList_Type.tp_base = Object_Type;
15428
15429         lsa_TranslatedName_Type.tp_base = Object_Type;
15430
15431         lsa_TransNameArray_Type.tp_base = Object_Type;
15432
15433         lsa_LUIDAttribute_Type.tp_base = Object_Type;
15434
15435         lsa_PrivilegeSet_Type.tp_base = Object_Type;
15436
15437         lsa_DATA_BUF_Type.tp_base = Object_Type;
15438
15439         lsa_DATA_BUF2_Type.tp_base = Object_Type;
15440
15441         lsa_TrustDomainInfoName_Type.tp_base = Object_Type;
15442
15443         lsa_TrustDomainInfoControllers_Type.tp_base = Object_Type;
15444
15445         lsa_TrustDomainInfoPosixOffset_Type.tp_base = Object_Type;
15446
15447         lsa_TrustDomainInfoPassword_Type.tp_base = Object_Type;
15448
15449         lsa_TrustDomainInfoBasic_Type.tp_base = Object_Type;
15450
15451         lsa_TrustDomainInfoInfoEx_Type.tp_base = Object_Type;
15452
15453         lsa_TrustDomainInfoBuffer_Type.tp_base = Object_Type;
15454
15455         lsa_TrustDomainInfoAuthInfo_Type.tp_base = Object_Type;
15456
15457         lsa_TrustDomainInfoFullInfo_Type.tp_base = Object_Type;
15458
15459         lsa_TrustDomainInfoAuthInfoInternal_Type.tp_base = Object_Type;
15460
15461         lsa_TrustDomainInfoFullInfoInternal_Type.tp_base = Object_Type;
15462
15463         lsa_TrustDomainInfoInfoEx2Internal_Type.tp_base = Object_Type;
15464
15465         lsa_TrustDomainInfoFullInfo2Internal_Type.tp_base = Object_Type;
15466
15467         lsa_TrustDomainInfoSupportedEncTypes_Type.tp_base = Object_Type;
15468
15469         lsa_DATA_BUF_PTR_Type.tp_base = Object_Type;
15470
15471         lsa_RightAttribute_Type.tp_base = Object_Type;
15472
15473         lsa_RightSet_Type.tp_base = Object_Type;
15474
15475         lsa_DomainListEx_Type.tp_base = Object_Type;
15476
15477         lsa_DomainInfoKerberos_Type.tp_base = Object_Type;
15478
15479         lsa_DomainInfoEfs_Type.tp_base = Object_Type;
15480
15481         lsa_TranslatedName2_Type.tp_base = Object_Type;
15482
15483         lsa_TransNameArray2_Type.tp_base = Object_Type;
15484
15485         lsa_TranslatedSid2_Type.tp_base = Object_Type;
15486
15487         lsa_TransSidArray2_Type.tp_base = Object_Type;
15488
15489         lsa_TranslatedSid3_Type.tp_base = Object_Type;
15490
15491         lsa_TransSidArray3_Type.tp_base = Object_Type;
15492
15493         lsa_ForestTrustBinaryData_Type.tp_base = Object_Type;
15494
15495         lsa_ForestTrustDomainInfo_Type.tp_base = Object_Type;
15496
15497         lsa_ForestTrustRecord_Type.tp_base = Object_Type;
15498
15499         lsa_ForestTrustInformation_Type.tp_base = Object_Type;
15500
15501         lsa_ForestTrustCollisionRecord_Type.tp_base = Object_Type;
15502
15503         lsa_ForestTrustCollisionInfo_Type.tp_base = Object_Type;
15504
15505         lsarpc_InterfaceType.tp_base = ClientConnection_Type;
15506
15507         lsarpc_SyntaxType.tp_base = ndr_syntax_id_Type;
15508
15509         if (PyType_Ready(&lsa_String_Type) < 0)
15510                 return;
15511         if (PyType_Ready(&lsa_StringLarge_Type) < 0)
15512                 return;
15513         if (PyType_Ready(&lsa_Strings_Type) < 0)
15514                 return;
15515         if (PyType_Ready(&lsa_AsciiString_Type) < 0)
15516                 return;
15517         if (PyType_Ready(&lsa_AsciiStringLarge_Type) < 0)
15518                 return;
15519         if (PyType_Ready(&lsa_BinaryString_Type) < 0)
15520                 return;
15521         if (PyType_Ready(&lsa_LUID_Type) < 0)
15522                 return;
15523         if (PyType_Ready(&lsa_PrivEntry_Type) < 0)
15524                 return;
15525         if (PyType_Ready(&lsa_PrivArray_Type) < 0)
15526                 return;
15527         if (PyType_Ready(&lsa_QosInfo_Type) < 0)
15528                 return;
15529         if (PyType_Ready(&lsa_ObjectAttribute_Type) < 0)
15530                 return;
15531         if (PyType_Ready(&lsa_AuditLogInfo_Type) < 0)
15532                 return;
15533         if (PyType_Ready(&lsa_AuditEventsInfo_Type) < 0)
15534                 return;
15535         if (PyType_Ready(&lsa_DomainInfo_Type) < 0)
15536                 return;
15537         if (PyType_Ready(&lsa_PDAccountInfo_Type) < 0)
15538                 return;
15539         if (PyType_Ready(&lsa_ServerRole_Type) < 0)
15540                 return;
15541         if (PyType_Ready(&lsa_ReplicaSourceInfo_Type) < 0)
15542                 return;
15543         if (PyType_Ready(&lsa_DefaultQuotaInfo_Type) < 0)
15544                 return;
15545         if (PyType_Ready(&lsa_ModificationInfo_Type) < 0)
15546                 return;
15547         if (PyType_Ready(&lsa_AuditFullSetInfo_Type) < 0)
15548                 return;
15549         if (PyType_Ready(&lsa_AuditFullQueryInfo_Type) < 0)
15550                 return;
15551         if (PyType_Ready(&lsa_DnsDomainInfo_Type) < 0)
15552                 return;
15553         if (PyType_Ready(&lsa_SidPtr_Type) < 0)
15554                 return;
15555         if (PyType_Ready(&lsa_SidArray_Type) < 0)
15556                 return;
15557         if (PyType_Ready(&lsa_DomainList_Type) < 0)
15558                 return;
15559         if (PyType_Ready(&lsa_TranslatedSid_Type) < 0)
15560                 return;
15561         if (PyType_Ready(&lsa_TransSidArray_Type) < 0)
15562                 return;
15563         if (PyType_Ready(&lsa_RefDomainList_Type) < 0)
15564                 return;
15565         if (PyType_Ready(&lsa_TranslatedName_Type) < 0)
15566                 return;
15567         if (PyType_Ready(&lsa_TransNameArray_Type) < 0)
15568                 return;
15569         if (PyType_Ready(&lsa_LUIDAttribute_Type) < 0)
15570                 return;
15571         if (PyType_Ready(&lsa_PrivilegeSet_Type) < 0)
15572                 return;
15573         if (PyType_Ready(&lsa_DATA_BUF_Type) < 0)
15574                 return;
15575         if (PyType_Ready(&lsa_DATA_BUF2_Type) < 0)
15576                 return;
15577         if (PyType_Ready(&lsa_TrustDomainInfoName_Type) < 0)
15578                 return;
15579         if (PyType_Ready(&lsa_TrustDomainInfoControllers_Type) < 0)
15580                 return;
15581         if (PyType_Ready(&lsa_TrustDomainInfoPosixOffset_Type) < 0)
15582                 return;
15583         if (PyType_Ready(&lsa_TrustDomainInfoPassword_Type) < 0)
15584                 return;
15585         if (PyType_Ready(&lsa_TrustDomainInfoBasic_Type) < 0)
15586                 return;
15587         if (PyType_Ready(&lsa_TrustDomainInfoInfoEx_Type) < 0)
15588                 return;
15589         if (PyType_Ready(&lsa_TrustDomainInfoBuffer_Type) < 0)
15590                 return;
15591         if (PyType_Ready(&lsa_TrustDomainInfoAuthInfo_Type) < 0)
15592                 return;
15593         if (PyType_Ready(&lsa_TrustDomainInfoFullInfo_Type) < 0)
15594                 return;
15595         if (PyType_Ready(&lsa_TrustDomainInfoAuthInfoInternal_Type) < 0)
15596                 return;
15597         if (PyType_Ready(&lsa_TrustDomainInfoFullInfoInternal_Type) < 0)
15598                 return;
15599         if (PyType_Ready(&lsa_TrustDomainInfoInfoEx2Internal_Type) < 0)
15600                 return;
15601         if (PyType_Ready(&lsa_TrustDomainInfoFullInfo2Internal_Type) < 0)
15602                 return;
15603         if (PyType_Ready(&lsa_TrustDomainInfoSupportedEncTypes_Type) < 0)
15604                 return;
15605         if (PyType_Ready(&lsa_DATA_BUF_PTR_Type) < 0)
15606                 return;
15607         if (PyType_Ready(&lsa_RightAttribute_Type) < 0)
15608                 return;
15609         if (PyType_Ready(&lsa_RightSet_Type) < 0)
15610                 return;
15611         if (PyType_Ready(&lsa_DomainListEx_Type) < 0)
15612                 return;
15613         if (PyType_Ready(&lsa_DomainInfoKerberos_Type) < 0)
15614                 return;
15615         if (PyType_Ready(&lsa_DomainInfoEfs_Type) < 0)
15616                 return;
15617         if (PyType_Ready(&lsa_TranslatedName2_Type) < 0)
15618                 return;
15619         if (PyType_Ready(&lsa_TransNameArray2_Type) < 0)
15620                 return;
15621         if (PyType_Ready(&lsa_TranslatedSid2_Type) < 0)
15622                 return;
15623         if (PyType_Ready(&lsa_TransSidArray2_Type) < 0)
15624                 return;
15625         if (PyType_Ready(&lsa_TranslatedSid3_Type) < 0)
15626                 return;
15627         if (PyType_Ready(&lsa_TransSidArray3_Type) < 0)
15628                 return;
15629         if (PyType_Ready(&lsa_ForestTrustBinaryData_Type) < 0)
15630                 return;
15631         if (PyType_Ready(&lsa_ForestTrustDomainInfo_Type) < 0)
15632                 return;
15633         if (PyType_Ready(&lsa_ForestTrustRecord_Type) < 0)
15634                 return;
15635         if (PyType_Ready(&lsa_ForestTrustInformation_Type) < 0)
15636                 return;
15637         if (PyType_Ready(&lsa_ForestTrustCollisionRecord_Type) < 0)
15638                 return;
15639         if (PyType_Ready(&lsa_ForestTrustCollisionInfo_Type) < 0)
15640                 return;
15641         if (PyType_Ready(&lsarpc_InterfaceType) < 0)
15642                 return;
15643         if (PyType_Ready(&lsarpc_SyntaxType) < 0)
15644                 return;
15645         if (!PyInterface_AddNdrRpcMethods(&lsarpc_InterfaceType, py_ndr_lsarpc_methods))
15646                 return;
15647
15648 #ifdef PY_STRING_PATCH
15649         PY_STRING_PATCH(&lsa_String_Type);
15650 #endif
15651 #ifdef PY_STRINGLARGE_PATCH
15652         PY_STRINGLARGE_PATCH(&lsa_StringLarge_Type);
15653 #endif
15654 #ifdef PY_STRINGS_PATCH
15655         PY_STRINGS_PATCH(&lsa_Strings_Type);
15656 #endif
15657 #ifdef PY_ASCIISTRING_PATCH
15658         PY_ASCIISTRING_PATCH(&lsa_AsciiString_Type);
15659 #endif
15660 #ifdef PY_ASCIISTRINGLARGE_PATCH
15661         PY_ASCIISTRINGLARGE_PATCH(&lsa_AsciiStringLarge_Type);
15662 #endif
15663 #ifdef PY_BINARYSTRING_PATCH
15664         PY_BINARYSTRING_PATCH(&lsa_BinaryString_Type);
15665 #endif
15666 #ifdef PY_LUID_PATCH
15667         PY_LUID_PATCH(&lsa_LUID_Type);
15668 #endif
15669 #ifdef PY_PRIVENTRY_PATCH
15670         PY_PRIVENTRY_PATCH(&lsa_PrivEntry_Type);
15671 #endif
15672 #ifdef PY_PRIVARRAY_PATCH
15673         PY_PRIVARRAY_PATCH(&lsa_PrivArray_Type);
15674 #endif
15675 #ifdef PY_QOSINFO_PATCH
15676         PY_QOSINFO_PATCH(&lsa_QosInfo_Type);
15677 #endif
15678 #ifdef PY_OBJECTATTRIBUTE_PATCH
15679         PY_OBJECTATTRIBUTE_PATCH(&lsa_ObjectAttribute_Type);
15680 #endif
15681 #ifdef PY_AUDITLOGINFO_PATCH
15682         PY_AUDITLOGINFO_PATCH(&lsa_AuditLogInfo_Type);
15683 #endif
15684 #ifdef PY_AUDITEVENTSINFO_PATCH
15685         PY_AUDITEVENTSINFO_PATCH(&lsa_AuditEventsInfo_Type);
15686 #endif
15687 #ifdef PY_DOMAININFO_PATCH
15688         PY_DOMAININFO_PATCH(&lsa_DomainInfo_Type);
15689 #endif
15690 #ifdef PY_PDACCOUNTINFO_PATCH
15691         PY_PDACCOUNTINFO_PATCH(&lsa_PDAccountInfo_Type);
15692 #endif
15693 #ifdef PY_SERVERROLE_PATCH
15694         PY_SERVERROLE_PATCH(&lsa_ServerRole_Type);
15695 #endif
15696 #ifdef PY_REPLICASOURCEINFO_PATCH
15697         PY_REPLICASOURCEINFO_PATCH(&lsa_ReplicaSourceInfo_Type);
15698 #endif
15699 #ifdef PY_DEFAULTQUOTAINFO_PATCH
15700         PY_DEFAULTQUOTAINFO_PATCH(&lsa_DefaultQuotaInfo_Type);
15701 #endif
15702 #ifdef PY_MODIFICATIONINFO_PATCH
15703         PY_MODIFICATIONINFO_PATCH(&lsa_ModificationInfo_Type);
15704 #endif
15705 #ifdef PY_AUDITFULLSETINFO_PATCH
15706         PY_AUDITFULLSETINFO_PATCH(&lsa_AuditFullSetInfo_Type);
15707 #endif
15708 #ifdef PY_AUDITFULLQUERYINFO_PATCH
15709         PY_AUDITFULLQUERYINFO_PATCH(&lsa_AuditFullQueryInfo_Type);
15710 #endif
15711 #ifdef PY_DNSDOMAININFO_PATCH
15712         PY_DNSDOMAININFO_PATCH(&lsa_DnsDomainInfo_Type);
15713 #endif
15714 #ifdef PY_SIDPTR_PATCH
15715         PY_SIDPTR_PATCH(&lsa_SidPtr_Type);
15716 #endif
15717 #ifdef PY_SIDARRAY_PATCH
15718         PY_SIDARRAY_PATCH(&lsa_SidArray_Type);
15719 #endif
15720 #ifdef PY_DOMAINLIST_PATCH
15721         PY_DOMAINLIST_PATCH(&lsa_DomainList_Type);
15722 #endif
15723 #ifdef PY_TRANSLATEDSID_PATCH
15724         PY_TRANSLATEDSID_PATCH(&lsa_TranslatedSid_Type);
15725 #endif
15726 #ifdef PY_TRANSSIDARRAY_PATCH
15727         PY_TRANSSIDARRAY_PATCH(&lsa_TransSidArray_Type);
15728 #endif
15729 #ifdef PY_REFDOMAINLIST_PATCH
15730         PY_REFDOMAINLIST_PATCH(&lsa_RefDomainList_Type);
15731 #endif
15732 #ifdef PY_TRANSLATEDNAME_PATCH
15733         PY_TRANSLATEDNAME_PATCH(&lsa_TranslatedName_Type);
15734 #endif
15735 #ifdef PY_TRANSNAMEARRAY_PATCH
15736         PY_TRANSNAMEARRAY_PATCH(&lsa_TransNameArray_Type);
15737 #endif
15738 #ifdef PY_LUIDATTRIBUTE_PATCH
15739         PY_LUIDATTRIBUTE_PATCH(&lsa_LUIDAttribute_Type);
15740 #endif
15741 #ifdef PY_PRIVILEGESET_PATCH
15742         PY_PRIVILEGESET_PATCH(&lsa_PrivilegeSet_Type);
15743 #endif
15744 #ifdef PY_DATA_BUF_PATCH
15745         PY_DATA_BUF_PATCH(&lsa_DATA_BUF_Type);
15746 #endif
15747 #ifdef PY_DATA_BUF2_PATCH
15748         PY_DATA_BUF2_PATCH(&lsa_DATA_BUF2_Type);
15749 #endif
15750 #ifdef PY_TRUSTDOMAININFONAME_PATCH
15751         PY_TRUSTDOMAININFONAME_PATCH(&lsa_TrustDomainInfoName_Type);
15752 #endif
15753 #ifdef PY_TRUSTDOMAININFOCONTROLLERS_PATCH
15754         PY_TRUSTDOMAININFOCONTROLLERS_PATCH(&lsa_TrustDomainInfoControllers_Type);
15755 #endif
15756 #ifdef PY_TRUSTDOMAININFOPOSIXOFFSET_PATCH
15757         PY_TRUSTDOMAININFOPOSIXOFFSET_PATCH(&lsa_TrustDomainInfoPosixOffset_Type);
15758 #endif
15759 #ifdef PY_TRUSTDOMAININFOPASSWORD_PATCH
15760         PY_TRUSTDOMAININFOPASSWORD_PATCH(&lsa_TrustDomainInfoPassword_Type);
15761 #endif
15762 #ifdef PY_TRUSTDOMAININFOBASIC_PATCH
15763         PY_TRUSTDOMAININFOBASIC_PATCH(&lsa_TrustDomainInfoBasic_Type);
15764 #endif
15765 #ifdef PY_TRUSTDOMAININFOINFOEX_PATCH
15766         PY_TRUSTDOMAININFOINFOEX_PATCH(&lsa_TrustDomainInfoInfoEx_Type);
15767 #endif
15768 #ifdef PY_TRUSTDOMAININFOBUFFER_PATCH
15769         PY_TRUSTDOMAININFOBUFFER_PATCH(&lsa_TrustDomainInfoBuffer_Type);
15770 #endif
15771 #ifdef PY_TRUSTDOMAININFOAUTHINFO_PATCH
15772         PY_TRUSTDOMAININFOAUTHINFO_PATCH(&lsa_TrustDomainInfoAuthInfo_Type);
15773 #endif
15774 #ifdef PY_TRUSTDOMAININFOFULLINFO_PATCH
15775         PY_TRUSTDOMAININFOFULLINFO_PATCH(&lsa_TrustDomainInfoFullInfo_Type);
15776 #endif
15777 #ifdef PY_TRUSTDOMAININFOAUTHINFOINTERNAL_PATCH
15778         PY_TRUSTDOMAININFOAUTHINFOINTERNAL_PATCH(&lsa_TrustDomainInfoAuthInfoInternal_Type);
15779 #endif
15780 #ifdef PY_TRUSTDOMAININFOFULLINFOINTERNAL_PATCH
15781         PY_TRUSTDOMAININFOFULLINFOINTERNAL_PATCH(&lsa_TrustDomainInfoFullInfoInternal_Type);
15782 #endif
15783 #ifdef PY_TRUSTDOMAININFOINFOEX2INTERNAL_PATCH
15784         PY_TRUSTDOMAININFOINFOEX2INTERNAL_PATCH(&lsa_TrustDomainInfoInfoEx2Internal_Type);
15785 #endif
15786 #ifdef PY_TRUSTDOMAININFOFULLINFO2INTERNAL_PATCH
15787         PY_TRUSTDOMAININFOFULLINFO2INTERNAL_PATCH(&lsa_TrustDomainInfoFullInfo2Internal_Type);
15788 #endif
15789 #ifdef PY_TRUSTDOMAININFOSUPPORTEDENCTYPES_PATCH
15790         PY_TRUSTDOMAININFOSUPPORTEDENCTYPES_PATCH(&lsa_TrustDomainInfoSupportedEncTypes_Type);
15791 #endif
15792 #ifdef PY_DATA_BUF_PTR_PATCH
15793         PY_DATA_BUF_PTR_PATCH(&lsa_DATA_BUF_PTR_Type);
15794 #endif
15795 #ifdef PY_RIGHTATTRIBUTE_PATCH
15796         PY_RIGHTATTRIBUTE_PATCH(&lsa_RightAttribute_Type);
15797 #endif
15798 #ifdef PY_RIGHTSET_PATCH
15799         PY_RIGHTSET_PATCH(&lsa_RightSet_Type);
15800 #endif
15801 #ifdef PY_DOMAINLISTEX_PATCH
15802         PY_DOMAINLISTEX_PATCH(&lsa_DomainListEx_Type);
15803 #endif
15804 #ifdef PY_DOMAININFOKERBEROS_PATCH
15805         PY_DOMAININFOKERBEROS_PATCH(&lsa_DomainInfoKerberos_Type);
15806 #endif
15807 #ifdef PY_DOMAININFOEFS_PATCH
15808         PY_DOMAININFOEFS_PATCH(&lsa_DomainInfoEfs_Type);
15809 #endif
15810 #ifdef PY_TRANSLATEDNAME2_PATCH
15811         PY_TRANSLATEDNAME2_PATCH(&lsa_TranslatedName2_Type);
15812 #endif
15813 #ifdef PY_TRANSNAMEARRAY2_PATCH
15814         PY_TRANSNAMEARRAY2_PATCH(&lsa_TransNameArray2_Type);
15815 #endif
15816 #ifdef PY_TRANSLATEDSID2_PATCH
15817         PY_TRANSLATEDSID2_PATCH(&lsa_TranslatedSid2_Type);
15818 #endif
15819 #ifdef PY_TRANSSIDARRAY2_PATCH
15820         PY_TRANSSIDARRAY2_PATCH(&lsa_TransSidArray2_Type);
15821 #endif
15822 #ifdef PY_TRANSLATEDSID3_PATCH
15823         PY_TRANSLATEDSID3_PATCH(&lsa_TranslatedSid3_Type);
15824 #endif
15825 #ifdef PY_TRANSSIDARRAY3_PATCH
15826         PY_TRANSSIDARRAY3_PATCH(&lsa_TransSidArray3_Type);
15827 #endif
15828 #ifdef PY_FORESTTRUSTBINARYDATA_PATCH
15829         PY_FORESTTRUSTBINARYDATA_PATCH(&lsa_ForestTrustBinaryData_Type);
15830 #endif
15831 #ifdef PY_FORESTTRUSTDOMAININFO_PATCH
15832         PY_FORESTTRUSTDOMAININFO_PATCH(&lsa_ForestTrustDomainInfo_Type);
15833 #endif
15834 #ifdef PY_FORESTTRUSTRECORD_PATCH
15835         PY_FORESTTRUSTRECORD_PATCH(&lsa_ForestTrustRecord_Type);
15836 #endif
15837 #ifdef PY_FORESTTRUSTINFORMATION_PATCH
15838         PY_FORESTTRUSTINFORMATION_PATCH(&lsa_ForestTrustInformation_Type);
15839 #endif
15840 #ifdef PY_FORESTTRUSTCOLLISIONRECORD_PATCH
15841         PY_FORESTTRUSTCOLLISIONRECORD_PATCH(&lsa_ForestTrustCollisionRecord_Type);
15842 #endif
15843 #ifdef PY_FORESTTRUSTCOLLISIONINFO_PATCH
15844         PY_FORESTTRUSTCOLLISIONINFO_PATCH(&lsa_ForestTrustCollisionInfo_Type);
15845 #endif
15846 #ifdef PY_LSARPC_PATCH
15847         PY_LSARPC_PATCH(&lsarpc_InterfaceType);
15848 #endif
15849 #ifdef PY_ABSTRACT_SYNTAX_PATCH
15850         PY_ABSTRACT_SYNTAX_PATCH(&lsarpc_SyntaxType);
15851 #endif
15852
15853         m = Py_InitModule3("lsa", lsa_methods, "lsa DCE/RPC");
15854         if (m == NULL)
15855                 return;
15856
15857         PyModule_AddObject(m, "LSA_POLICY_ALL_ACCESS", PyInt_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|LSA_POLICY_VIEW_LOCAL_INFORMATION|LSA_POLICY_VIEW_AUDIT_INFORMATION|LSA_POLICY_GET_PRIVATE_INFORMATION|LSA_POLICY_TRUST_ADMIN|LSA_POLICY_CREATE_ACCOUNT|LSA_POLICY_CREATE_SECRET|LSA_POLICY_CREATE_PRIVILEGE|LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS|LSA_POLICY_SET_AUDIT_REQUIREMENTS|LSA_POLICY_AUDIT_LOG_ADMIN|LSA_POLICY_SERVER_ADMIN|LSA_POLICY_LOOKUP_NAMES|LSA_POLICY_NOTIFICATION)));
15858         PyModule_AddObject(m, "LSA_POLICY_READ", PyInt_FromLong((STANDARD_RIGHTS_READ_ACCESS|LSA_POLICY_VIEW_LOCAL_INFORMATION|LSA_POLICY_VIEW_AUDIT_INFORMATION|LSA_POLICY_GET_PRIVATE_INFORMATION)));
15859         PyModule_AddObject(m, "LSA_POLICY_WRITE", PyInt_FromLong((STANDARD_RIGHTS_READ_ACCESS|LSA_POLICY_TRUST_ADMIN|LSA_POLICY_CREATE_ACCOUNT|LSA_POLICY_CREATE_SECRET|LSA_POLICY_CREATE_PRIVILEGE|LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS|LSA_POLICY_SET_AUDIT_REQUIREMENTS|LSA_POLICY_AUDIT_LOG_ADMIN|LSA_POLICY_SERVER_ADMIN)));
15860         PyModule_AddObject(m, "LSA_POLICY_EXECUTE", PyInt_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|LSA_POLICY_VIEW_LOCAL_INFORMATION|LSA_POLICY_LOOKUP_NAMES)));
15861         PyModule_AddObject(m, "LSA_ACCOUNT_ALL_ACCESS", PyInt_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|LSA_ACCOUNT_VIEW|LSA_ACCOUNT_ADJUST_PRIVILEGES|LSA_ACCOUNT_ADJUST_QUOTAS|LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS)));
15862         PyModule_AddObject(m, "LSA_ACCOUNT_READ", PyInt_FromLong((STANDARD_RIGHTS_READ_ACCESS|LSA_ACCOUNT_VIEW)));
15863         PyModule_AddObject(m, "LSA_ACCOUNT_WRITE", PyInt_FromLong((STANDARD_RIGHTS_READ_ACCESS|LSA_ACCOUNT_ADJUST_PRIVILEGES|LSA_ACCOUNT_ADJUST_QUOTAS|LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS)));
15864         PyModule_AddObject(m, "LSA_ACCOUNT_EXECUTE", PyInt_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS)));
15865         PyModule_AddObject(m, "LSA_SECRET_ALL_ACCESS", PyInt_FromLong((LSA_SECRET_QUERY_VALUE|LSA_SECRET_SET_VALUE|SEC_STD_DELETE|STANDARD_RIGHTS_READ_ACCESS|SEC_STD_WRITE_DAC|SEC_STD_WRITE_OWNER)));
15866         PyModule_AddObject(m, "LSA_SECRET_READ", PyInt_FromLong((LSA_SECRET_QUERY_VALUE|STANDARD_RIGHTS_READ_ACCESS)));
15867         PyModule_AddObject(m, "LSA_SECRET_WRITE", PyInt_FromLong((LSA_SECRET_SET_VALUE|STANDARD_RIGHTS_READ_ACCESS)));
15868         PyModule_AddObject(m, "LSA_SECRET_EXECUTE", PyInt_FromLong((STANDARD_RIGHTS_READ_ACCESS)));
15869         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_ALL_ACCESS", PyInt_FromLong((LSA_TRUSTED_QUERY_DOMAIN_NAME|LSA_TRUSTED_QUERY_CONTROLLERS|LSA_TRUSTED_SET_CONTROLLERS|LSA_TRUSTED_QUERY_POSIX|LSA_TRUSTED_SET_POSIX|LSA_TRUSTED_SET_AUTH|LSA_TRUSTED_QUERY_AUTH|SEC_STD_DELETE|STANDARD_RIGHTS_READ_ACCESS|SEC_STD_WRITE_DAC|SEC_STD_WRITE_OWNER)));
15870         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_READ", PyInt_FromLong((LSA_TRUSTED_QUERY_DOMAIN_NAME|STANDARD_RIGHTS_READ_ACCESS)));
15871         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_WRITE", PyInt_FromLong((LSA_TRUSTED_SET_CONTROLLERS|LSA_TRUSTED_SET_POSIX|LSA_TRUSTED_SET_AUTH|STANDARD_RIGHTS_READ_ACCESS)));
15872         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_EXECUTE", PyInt_FromLong((LSA_TRUSTED_QUERY_DOMAIN_NAME|LSA_TRUSTED_QUERY_POSIX|STANDARD_RIGHTS_READ_ACCESS)));
15873         PyModule_AddObject(m, "LSA_ENUM_TRUST_DOMAIN_MULTIPLIER", ndr_PyLong_FromUnsignedLongLong(60));
15874         PyModule_AddObject(m, "LSA_REF_DOMAIN_LIST_MULTIPLIER", ndr_PyLong_FromUnsignedLongLong(32));
15875         PyModule_AddObject(m, "LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER", ndr_PyLong_FromUnsignedLongLong(82));
15876         PyModule_AddObject(m, "LSA_TLN_DISABLED_MASK", ndr_PyLong_FromUnsignedLongLong((uint32_t)(LSA_TLN_DISABLED_NEW|LSA_TLN_DISABLED_ADMIN|LSA_TLN_DISABLED_CONFLICT)));
15877         PyModule_AddObject(m, "LSA_SID_DISABLED_MASK", ndr_PyLong_FromUnsignedLongLong((uint32_t)(LSA_SID_DISABLED_ADMIN|LSA_SID_DISABLED_CONFLICT)));
15878         PyModule_AddObject(m, "LSA_NB_DISABLED_MASK", ndr_PyLong_FromUnsignedLongLong((uint32_t)(LSA_NB_DISABLED_ADMIN|LSA_NB_DISABLED_CONFLICT)));
15879         PyModule_AddObject(m, "LSA_CLIENT_REVISION_NO_DNS", ndr_PyLong_FromUnsignedLongLong(0x00000001));
15880         PyModule_AddObject(m, "LSA_CLIENT_REVISION_DNS", ndr_PyLong_FromUnsignedLongLong(0x00000002));
15881         PyModule_AddObject(m, "LSA_LOOKUP_OPTIONS_NO_ISOLATED", ndr_PyLong_FromUnsignedLongLong(0x80000000));
15882         PyModule_AddObject(m, "LSA_POLICY_VIEW_LOCAL_INFORMATION", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_VIEW_LOCAL_INFORMATION));
15883         PyModule_AddObject(m, "LSA_POLICY_VIEW_AUDIT_INFORMATION", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_VIEW_AUDIT_INFORMATION));
15884         PyModule_AddObject(m, "LSA_POLICY_GET_PRIVATE_INFORMATION", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_GET_PRIVATE_INFORMATION));
15885         PyModule_AddObject(m, "LSA_POLICY_TRUST_ADMIN", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_TRUST_ADMIN));
15886         PyModule_AddObject(m, "LSA_POLICY_CREATE_ACCOUNT", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_CREATE_ACCOUNT));
15887         PyModule_AddObject(m, "LSA_POLICY_CREATE_SECRET", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_CREATE_SECRET));
15888         PyModule_AddObject(m, "LSA_POLICY_CREATE_PRIVILEGE", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_CREATE_PRIVILEGE));
15889         PyModule_AddObject(m, "LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS));
15890         PyModule_AddObject(m, "LSA_POLICY_SET_AUDIT_REQUIREMENTS", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_SET_AUDIT_REQUIREMENTS));
15891         PyModule_AddObject(m, "LSA_POLICY_AUDIT_LOG_ADMIN", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_AUDIT_LOG_ADMIN));
15892         PyModule_AddObject(m, "LSA_POLICY_SERVER_ADMIN", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_SERVER_ADMIN));
15893         PyModule_AddObject(m, "LSA_POLICY_LOOKUP_NAMES", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_LOOKUP_NAMES));
15894         PyModule_AddObject(m, "LSA_POLICY_NOTIFICATION", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_NOTIFICATION));
15895         PyModule_AddObject(m, "LSA_ACCOUNT_VIEW", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_ACCOUNT_VIEW));
15896         PyModule_AddObject(m, "LSA_ACCOUNT_ADJUST_PRIVILEGES", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_ACCOUNT_ADJUST_PRIVILEGES));
15897         PyModule_AddObject(m, "LSA_ACCOUNT_ADJUST_QUOTAS", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_ACCOUNT_ADJUST_QUOTAS));
15898         PyModule_AddObject(m, "LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS));
15899         PyModule_AddObject(m, "LSA_SECRET_SET_VALUE", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_SECRET_SET_VALUE));
15900         PyModule_AddObject(m, "LSA_SECRET_QUERY_VALUE", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_SECRET_QUERY_VALUE));
15901         PyModule_AddObject(m, "LSA_TRUSTED_QUERY_DOMAIN_NAME", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_QUERY_DOMAIN_NAME));
15902         PyModule_AddObject(m, "LSA_TRUSTED_QUERY_CONTROLLERS", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_QUERY_CONTROLLERS));
15903         PyModule_AddObject(m, "LSA_TRUSTED_SET_CONTROLLERS", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_SET_CONTROLLERS));
15904         PyModule_AddObject(m, "LSA_TRUSTED_QUERY_POSIX", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_QUERY_POSIX));
15905         PyModule_AddObject(m, "LSA_TRUSTED_SET_POSIX", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_SET_POSIX));
15906         PyModule_AddObject(m, "LSA_TRUSTED_SET_AUTH", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_SET_AUTH));
15907         PyModule_AddObject(m, "LSA_TRUSTED_QUERY_AUTH", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_QUERY_AUTH));
15908         PyModule_AddObject(m, "LSA_AUDIT_POLICY_NONE", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_NONE));
15909         PyModule_AddObject(m, "LSA_AUDIT_POLICY_SUCCESS", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_SUCCESS));
15910         PyModule_AddObject(m, "LSA_AUDIT_POLICY_FAILURE", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_FAILURE));
15911         PyModule_AddObject(m, "LSA_AUDIT_POLICY_ALL", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_ALL));
15912         PyModule_AddObject(m, "LSA_AUDIT_POLICY_CLEAR", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_CLEAR));
15913         PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_SYSTEM", PyInt_FromLong((uint16_t)LSA_AUDIT_CATEGORY_SYSTEM));
15914         PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_LOGON", PyInt_FromLong((uint16_t)LSA_AUDIT_CATEGORY_LOGON));
15915         PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS", PyInt_FromLong((uint16_t)LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS));
15916         PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS", PyInt_FromLong((uint16_t)LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS));
15917         PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_PROCCESS_TRACKING", PyInt_FromLong((uint16_t)LSA_AUDIT_CATEGORY_PROCCESS_TRACKING));
15918         PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES", PyInt_FromLong((uint16_t)LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES));
15919         PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT", PyInt_FromLong((uint16_t)LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT));
15920         PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS", PyInt_FromLong((uint16_t)LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS));
15921         PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_ACCOUNT_LOGON", PyInt_FromLong((uint16_t)LSA_AUDIT_CATEGORY_ACCOUNT_LOGON));
15922         PyModule_AddObject(m, "LSA_ROLE_BACKUP", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_ROLE_BACKUP));
15923         PyModule_AddObject(m, "LSA_ROLE_PRIMARY", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_ROLE_PRIMARY));
15924         PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_LOG", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_AUDIT_LOG));
15925         PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_EVENTS", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_AUDIT_EVENTS));
15926         PyModule_AddObject(m, "LSA_POLICY_INFO_DOMAIN", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_DOMAIN));
15927         PyModule_AddObject(m, "LSA_POLICY_INFO_PD", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_PD));
15928         PyModule_AddObject(m, "LSA_POLICY_INFO_ACCOUNT_DOMAIN", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_ACCOUNT_DOMAIN));
15929         PyModule_AddObject(m, "LSA_POLICY_INFO_ROLE", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_ROLE));
15930         PyModule_AddObject(m, "LSA_POLICY_INFO_REPLICA", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_REPLICA));
15931         PyModule_AddObject(m, "LSA_POLICY_INFO_QUOTA", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_QUOTA));
15932         PyModule_AddObject(m, "LSA_POLICY_INFO_MOD", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_MOD));
15933         PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_FULL_SET", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_AUDIT_FULL_SET));
15934         PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_FULL_QUERY", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_AUDIT_FULL_QUERY));
15935         PyModule_AddObject(m, "LSA_POLICY_INFO_DNS", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_DNS));
15936         PyModule_AddObject(m, "LSA_POLICY_INFO_DNS_INT", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_DNS_INT));
15937         PyModule_AddObject(m, "LSA_POLICY_INFO_L_ACCOUNT_DOMAIN", PyInt_FromLong((uint16_t)LSA_POLICY_INFO_L_ACCOUNT_DOMAIN));
15938         PyModule_AddObject(m, "SID_NAME_USE_NONE", PyInt_FromLong((uint16_t)SID_NAME_USE_NONE));
15939         PyModule_AddObject(m, "SID_NAME_USER", PyInt_FromLong((uint16_t)SID_NAME_USER));
15940         PyModule_AddObject(m, "SID_NAME_DOM_GRP", PyInt_FromLong((uint16_t)SID_NAME_DOM_GRP));
15941         PyModule_AddObject(m, "SID_NAME_DOMAIN", PyInt_FromLong((uint16_t)SID_NAME_DOMAIN));
15942         PyModule_AddObject(m, "SID_NAME_ALIAS", PyInt_FromLong((uint16_t)SID_NAME_ALIAS));
15943         PyModule_AddObject(m, "SID_NAME_WKN_GRP", PyInt_FromLong((uint16_t)SID_NAME_WKN_GRP));
15944         PyModule_AddObject(m, "SID_NAME_DELETED", PyInt_FromLong((uint16_t)SID_NAME_DELETED));
15945         PyModule_AddObject(m, "SID_NAME_INVALID", PyInt_FromLong((uint16_t)SID_NAME_INVALID));
15946         PyModule_AddObject(m, "SID_NAME_UNKNOWN", PyInt_FromLong((uint16_t)SID_NAME_UNKNOWN));
15947         PyModule_AddObject(m, "SID_NAME_COMPUTER", PyInt_FromLong((uint16_t)SID_NAME_COMPUTER));
15948         PyModule_AddObject(m, "LSA_LOOKUP_NAMES_ALL", PyInt_FromLong((uint16_t)LSA_LOOKUP_NAMES_ALL));
15949         PyModule_AddObject(m, "LSA_LOOKUP_NAMES_DOMAINS_ONLY", PyInt_FromLong((uint16_t)LSA_LOOKUP_NAMES_DOMAINS_ONLY));
15950         PyModule_AddObject(m, "LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY", PyInt_FromLong((uint16_t)LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY));
15951         PyModule_AddObject(m, "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY", PyInt_FromLong((uint16_t)LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY));
15952         PyModule_AddObject(m, "LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY", PyInt_FromLong((uint16_t)LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY));
15953         PyModule_AddObject(m, "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2", PyInt_FromLong((uint16_t)LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2));
15954         PyModule_AddObject(m, "LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC", PyInt_FromLong((uint16_t)LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC));
15955         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_NAME", PyInt_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_NAME));
15956         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS", PyInt_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS));
15957         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET", PyInt_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET));
15958         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_PASSWORD", PyInt_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_PASSWORD));
15959         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_BASIC", PyInt_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_BASIC));
15960         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_INFO_EX", PyInt_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_INFO_EX));
15961         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO", PyInt_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO));
15962         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO", PyInt_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_FULL_INFO));
15963         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL", PyInt_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL));
15964         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL", PyInt_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL));
15965         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL", PyInt_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL));
15966         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL", PyInt_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL));
15967         PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES", PyInt_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES));
15968         PyModule_AddObject(m, "LSA_TRUST_DIRECTION_INBOUND", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_DIRECTION_INBOUND));
15969         PyModule_AddObject(m, "LSA_TRUST_DIRECTION_OUTBOUND", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_DIRECTION_OUTBOUND));
15970         PyModule_AddObject(m, "LSA_TRUST_TYPE_DOWNLEVEL", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_TYPE_DOWNLEVEL));
15971         PyModule_AddObject(m, "LSA_TRUST_TYPE_UPLEVEL", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_TYPE_UPLEVEL));
15972         PyModule_AddObject(m, "LSA_TRUST_TYPE_MIT", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_TYPE_MIT));
15973         PyModule_AddObject(m, "LSA_TRUST_TYPE_DCE", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_TYPE_DCE));
15974         PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE));
15975         PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY));
15976         PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN));
15977         PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE));
15978         PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION));
15979         PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_WITHIN_FOREST", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_WITHIN_FOREST));
15980         PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL));
15981         PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION));
15982         PyModule_AddObject(m, "TRUST_AUTH_TYPE_NONE", ndr_PyLong_FromUnsignedLongLong((uint32_t)TRUST_AUTH_TYPE_NONE));
15983         PyModule_AddObject(m, "TRUST_AUTH_TYPE_NT4OWF", ndr_PyLong_FromUnsignedLongLong((uint32_t)TRUST_AUTH_TYPE_NT4OWF));
15984         PyModule_AddObject(m, "TRUST_AUTH_TYPE_CLEAR", ndr_PyLong_FromUnsignedLongLong((uint32_t)TRUST_AUTH_TYPE_CLEAR));
15985         PyModule_AddObject(m, "TRUST_AUTH_TYPE_VERSION", ndr_PyLong_FromUnsignedLongLong((uint32_t)TRUST_AUTH_TYPE_VERSION));
15986         PyModule_AddObject(m, "LSA_POLICY_KERBEROS_VALIDATE_CLIENT", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_KERBEROS_VALIDATE_CLIENT));
15987         PyModule_AddObject(m, "LSA_DOMAIN_INFO_POLICY_EFS", PyInt_FromLong((uint16_t)LSA_DOMAIN_INFO_POLICY_EFS));
15988         PyModule_AddObject(m, "LSA_DOMAIN_INFO_POLICY_KERBEROS", PyInt_FromLong((uint16_t)LSA_DOMAIN_INFO_POLICY_KERBEROS));
15989         PyModule_AddObject(m, "LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES));
15990         PyModule_AddObject(m, "LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES_LOCAL", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES_LOCAL));
15991         PyModule_AddObject(m, "LSA_CLIENT_REVISION_1", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_CLIENT_REVISION_1));
15992         PyModule_AddObject(m, "LSA_CLIENT_REVISION_2", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_CLIENT_REVISION_2));
15993         PyModule_AddObject(m, "LSA_TLN_DISABLED_NEW", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TLN_DISABLED_NEW));
15994         PyModule_AddObject(m, "LSA_TLN_DISABLED_ADMIN", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TLN_DISABLED_ADMIN));
15995         PyModule_AddObject(m, "LSA_TLN_DISABLED_CONFLICT", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_TLN_DISABLED_CONFLICT));
15996         PyModule_AddObject(m, "LSA_SID_DISABLED_ADMIN", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_SID_DISABLED_ADMIN));
15997         PyModule_AddObject(m, "LSA_SID_DISABLED_CONFLICT", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_SID_DISABLED_CONFLICT));
15998         PyModule_AddObject(m, "LSA_NB_DISABLED_ADMIN", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_NB_DISABLED_ADMIN));
15999         PyModule_AddObject(m, "LSA_NB_DISABLED_CONFLICT", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_NB_DISABLED_CONFLICT));
16000         PyModule_AddObject(m, "LSA_FOREST_TRUST_TOP_LEVEL_NAME", PyInt_FromLong((uint16_t)LSA_FOREST_TRUST_TOP_LEVEL_NAME));
16001         PyModule_AddObject(m, "LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX", PyInt_FromLong((uint16_t)LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX));
16002         PyModule_AddObject(m, "LSA_FOREST_TRUST_DOMAIN_INFO", PyInt_FromLong((uint16_t)LSA_FOREST_TRUST_DOMAIN_INFO));
16003         PyModule_AddObject(m, "LSA_FOREST_TRUST_RECORD_TYPE_LAST", PyInt_FromLong((uint16_t)LSA_FOREST_TRUST_RECORD_TYPE_LAST));
16004         PyModule_AddObject(m, "LSA_FOREST_TRUST_COLLISION_TDO", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_FOREST_TRUST_COLLISION_TDO));
16005         PyModule_AddObject(m, "LSA_FOREST_TRUST_COLLISION_XREF", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_FOREST_TRUST_COLLISION_XREF));
16006         PyModule_AddObject(m, "LSA_FOREST_TRUST_COLLISION_OTHER", ndr_PyLong_FromUnsignedLongLong((uint32_t)LSA_FOREST_TRUST_COLLISION_OTHER));
16007         Py_INCREF((PyObject *)(void *)&lsa_String_Type);
16008         PyModule_AddObject(m, "String", (PyObject *)(void *)&lsa_String_Type);
16009         Py_INCREF((PyObject *)(void *)&lsa_StringLarge_Type);
16010         PyModule_AddObject(m, "StringLarge", (PyObject *)(void *)&lsa_StringLarge_Type);
16011         Py_INCREF((PyObject *)(void *)&lsa_Strings_Type);
16012         PyModule_AddObject(m, "Strings", (PyObject *)(void *)&lsa_Strings_Type);
16013         Py_INCREF((PyObject *)(void *)&lsa_AsciiString_Type);
16014         PyModule_AddObject(m, "AsciiString", (PyObject *)(void *)&lsa_AsciiString_Type);
16015         Py_INCREF((PyObject *)(void *)&lsa_AsciiStringLarge_Type);
16016         PyModule_AddObject(m, "AsciiStringLarge", (PyObject *)(void *)&lsa_AsciiStringLarge_Type);
16017         Py_INCREF((PyObject *)(void *)&lsa_BinaryString_Type);
16018         PyModule_AddObject(m, "BinaryString", (PyObject *)(void *)&lsa_BinaryString_Type);
16019         Py_INCREF((PyObject *)(void *)&lsa_LUID_Type);
16020         PyModule_AddObject(m, "LUID", (PyObject *)(void *)&lsa_LUID_Type);
16021         Py_INCREF((PyObject *)(void *)&lsa_PrivEntry_Type);
16022         PyModule_AddObject(m, "PrivEntry", (PyObject *)(void *)&lsa_PrivEntry_Type);
16023         Py_INCREF((PyObject *)(void *)&lsa_PrivArray_Type);
16024         PyModule_AddObject(m, "PrivArray", (PyObject *)(void *)&lsa_PrivArray_Type);
16025         Py_INCREF((PyObject *)(void *)&lsa_QosInfo_Type);
16026         PyModule_AddObject(m, "QosInfo", (PyObject *)(void *)&lsa_QosInfo_Type);
16027         Py_INCREF((PyObject *)(void *)&lsa_ObjectAttribute_Type);
16028         PyModule_AddObject(m, "ObjectAttribute", (PyObject *)(void *)&lsa_ObjectAttribute_Type);
16029         Py_INCREF((PyObject *)(void *)&lsa_AuditLogInfo_Type);
16030         PyModule_AddObject(m, "AuditLogInfo", (PyObject *)(void *)&lsa_AuditLogInfo_Type);
16031         Py_INCREF((PyObject *)(void *)&lsa_AuditEventsInfo_Type);
16032         PyModule_AddObject(m, "AuditEventsInfo", (PyObject *)(void *)&lsa_AuditEventsInfo_Type);
16033         Py_INCREF((PyObject *)(void *)&lsa_DomainInfo_Type);
16034         PyModule_AddObject(m, "DomainInfo", (PyObject *)(void *)&lsa_DomainInfo_Type);
16035         Py_INCREF((PyObject *)(void *)&lsa_PDAccountInfo_Type);
16036         PyModule_AddObject(m, "PDAccountInfo", (PyObject *)(void *)&lsa_PDAccountInfo_Type);
16037         Py_INCREF((PyObject *)(void *)&lsa_ServerRole_Type);
16038         PyModule_AddObject(m, "ServerRole", (PyObject *)(void *)&lsa_ServerRole_Type);
16039         Py_INCREF((PyObject *)(void *)&lsa_ReplicaSourceInfo_Type);
16040         PyModule_AddObject(m, "ReplicaSourceInfo", (PyObject *)(void *)&lsa_ReplicaSourceInfo_Type);
16041         Py_INCREF((PyObject *)(void *)&lsa_DefaultQuotaInfo_Type);
16042         PyModule_AddObject(m, "DefaultQuotaInfo", (PyObject *)(void *)&lsa_DefaultQuotaInfo_Type);
16043         Py_INCREF((PyObject *)(void *)&lsa_ModificationInfo_Type);
16044         PyModule_AddObject(m, "ModificationInfo", (PyObject *)(void *)&lsa_ModificationInfo_Type);
16045         Py_INCREF((PyObject *)(void *)&lsa_AuditFullSetInfo_Type);
16046         PyModule_AddObject(m, "AuditFullSetInfo", (PyObject *)(void *)&lsa_AuditFullSetInfo_Type);
16047         Py_INCREF((PyObject *)(void *)&lsa_AuditFullQueryInfo_Type);
16048         PyModule_AddObject(m, "AuditFullQueryInfo", (PyObject *)(void *)&lsa_AuditFullQueryInfo_Type);
16049         Py_INCREF((PyObject *)(void *)&lsa_DnsDomainInfo_Type);
16050         PyModule_AddObject(m, "DnsDomainInfo", (PyObject *)(void *)&lsa_DnsDomainInfo_Type);
16051         Py_INCREF((PyObject *)(void *)&lsa_SidPtr_Type);
16052         PyModule_AddObject(m, "SidPtr", (PyObject *)(void *)&lsa_SidPtr_Type);
16053         Py_INCREF((PyObject *)(void *)&lsa_SidArray_Type);
16054         PyModule_AddObject(m, "SidArray", (PyObject *)(void *)&lsa_SidArray_Type);
16055         Py_INCREF((PyObject *)(void *)&lsa_DomainList_Type);
16056         PyModule_AddObject(m, "DomainList", (PyObject *)(void *)&lsa_DomainList_Type);
16057         Py_INCREF((PyObject *)(void *)&lsa_TranslatedSid_Type);
16058         PyModule_AddObject(m, "TranslatedSid", (PyObject *)(void *)&lsa_TranslatedSid_Type);
16059         Py_INCREF((PyObject *)(void *)&lsa_TransSidArray_Type);
16060         PyModule_AddObject(m, "TransSidArray", (PyObject *)(void *)&lsa_TransSidArray_Type);
16061         Py_INCREF((PyObject *)(void *)&lsa_RefDomainList_Type);
16062         PyModule_AddObject(m, "RefDomainList", (PyObject *)(void *)&lsa_RefDomainList_Type);
16063         Py_INCREF((PyObject *)(void *)&lsa_TranslatedName_Type);
16064         PyModule_AddObject(m, "TranslatedName", (PyObject *)(void *)&lsa_TranslatedName_Type);
16065         Py_INCREF((PyObject *)(void *)&lsa_TransNameArray_Type);
16066         PyModule_AddObject(m, "TransNameArray", (PyObject *)(void *)&lsa_TransNameArray_Type);
16067         Py_INCREF((PyObject *)(void *)&lsa_LUIDAttribute_Type);
16068         PyModule_AddObject(m, "LUIDAttribute", (PyObject *)(void *)&lsa_LUIDAttribute_Type);
16069         Py_INCREF((PyObject *)(void *)&lsa_PrivilegeSet_Type);
16070         PyModule_AddObject(m, "PrivilegeSet", (PyObject *)(void *)&lsa_PrivilegeSet_Type);
16071         Py_INCREF((PyObject *)(void *)&lsa_DATA_BUF_Type);
16072         PyModule_AddObject(m, "DATA_BUF", (PyObject *)(void *)&lsa_DATA_BUF_Type);
16073         Py_INCREF((PyObject *)(void *)&lsa_DATA_BUF2_Type);
16074         PyModule_AddObject(m, "DATA_BUF2", (PyObject *)(void *)&lsa_DATA_BUF2_Type);
16075         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoName_Type);
16076         PyModule_AddObject(m, "TrustDomainInfoName", (PyObject *)(void *)&lsa_TrustDomainInfoName_Type);
16077         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoControllers_Type);
16078         PyModule_AddObject(m, "TrustDomainInfoControllers", (PyObject *)(void *)&lsa_TrustDomainInfoControllers_Type);
16079         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoPosixOffset_Type);
16080         PyModule_AddObject(m, "TrustDomainInfoPosixOffset", (PyObject *)(void *)&lsa_TrustDomainInfoPosixOffset_Type);
16081         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoPassword_Type);
16082         PyModule_AddObject(m, "TrustDomainInfoPassword", (PyObject *)(void *)&lsa_TrustDomainInfoPassword_Type);
16083         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoBasic_Type);
16084         PyModule_AddObject(m, "TrustDomainInfoBasic", (PyObject *)(void *)&lsa_TrustDomainInfoBasic_Type);
16085         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoInfoEx_Type);
16086         PyModule_AddObject(m, "TrustDomainInfoInfoEx", (PyObject *)(void *)&lsa_TrustDomainInfoInfoEx_Type);
16087         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoBuffer_Type);
16088         PyModule_AddObject(m, "TrustDomainInfoBuffer", (PyObject *)(void *)&lsa_TrustDomainInfoBuffer_Type);
16089         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoAuthInfo_Type);
16090         PyModule_AddObject(m, "TrustDomainInfoAuthInfo", (PyObject *)(void *)&lsa_TrustDomainInfoAuthInfo_Type);
16091         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoFullInfo_Type);
16092         PyModule_AddObject(m, "TrustDomainInfoFullInfo", (PyObject *)(void *)&lsa_TrustDomainInfoFullInfo_Type);
16093         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoAuthInfoInternal_Type);
16094         PyModule_AddObject(m, "TrustDomainInfoAuthInfoInternal", (PyObject *)(void *)&lsa_TrustDomainInfoAuthInfoInternal_Type);
16095         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoFullInfoInternal_Type);
16096         PyModule_AddObject(m, "TrustDomainInfoFullInfoInternal", (PyObject *)(void *)&lsa_TrustDomainInfoFullInfoInternal_Type);
16097         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoInfoEx2Internal_Type);
16098         PyModule_AddObject(m, "TrustDomainInfoInfoEx2Internal", (PyObject *)(void *)&lsa_TrustDomainInfoInfoEx2Internal_Type);
16099         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoFullInfo2Internal_Type);
16100         PyModule_AddObject(m, "TrustDomainInfoFullInfo2Internal", (PyObject *)(void *)&lsa_TrustDomainInfoFullInfo2Internal_Type);
16101         Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoSupportedEncTypes_Type);
16102         PyModule_AddObject(m, "TrustDomainInfoSupportedEncTypes", (PyObject *)(void *)&lsa_TrustDomainInfoSupportedEncTypes_Type);
16103         Py_INCREF((PyObject *)(void *)&lsa_DATA_BUF_PTR_Type);
16104         PyModule_AddObject(m, "DATA_BUF_PTR", (PyObject *)(void *)&lsa_DATA_BUF_PTR_Type);
16105         Py_INCREF((PyObject *)(void *)&lsa_RightAttribute_Type);
16106         PyModule_AddObject(m, "RightAttribute", (PyObject *)(void *)&lsa_RightAttribute_Type);
16107         Py_INCREF((PyObject *)(void *)&lsa_RightSet_Type);
16108         PyModule_AddObject(m, "RightSet", (PyObject *)(void *)&lsa_RightSet_Type);
16109         Py_INCREF((PyObject *)(void *)&lsa_DomainListEx_Type);
16110         PyModule_AddObject(m, "DomainListEx", (PyObject *)(void *)&lsa_DomainListEx_Type);
16111         Py_INCREF((PyObject *)(void *)&lsa_DomainInfoKerberos_Type);
16112         PyModule_AddObject(m, "DomainInfoKerberos", (PyObject *)(void *)&lsa_DomainInfoKerberos_Type);
16113         Py_INCREF((PyObject *)(void *)&lsa_DomainInfoEfs_Type);
16114         PyModule_AddObject(m, "DomainInfoEfs", (PyObject *)(void *)&lsa_DomainInfoEfs_Type);
16115         Py_INCREF((PyObject *)(void *)&lsa_TranslatedName2_Type);
16116         PyModule_AddObject(m, "TranslatedName2", (PyObject *)(void *)&lsa_TranslatedName2_Type);
16117         Py_INCREF((PyObject *)(void *)&lsa_TransNameArray2_Type);
16118         PyModule_AddObject(m, "TransNameArray2", (PyObject *)(void *)&lsa_TransNameArray2_Type);
16119         Py_INCREF((PyObject *)(void *)&lsa_TranslatedSid2_Type);
16120         PyModule_AddObject(m, "TranslatedSid2", (PyObject *)(void *)&lsa_TranslatedSid2_Type);
16121         Py_INCREF((PyObject *)(void *)&lsa_TransSidArray2_Type);
16122         PyModule_AddObject(m, "TransSidArray2", (PyObject *)(void *)&lsa_TransSidArray2_Type);
16123         Py_INCREF((PyObject *)(void *)&lsa_TranslatedSid3_Type);
16124         PyModule_AddObject(m, "TranslatedSid3", (PyObject *)(void *)&lsa_TranslatedSid3_Type);
16125         Py_INCREF((PyObject *)(void *)&lsa_TransSidArray3_Type);
16126         PyModule_AddObject(m, "TransSidArray3", (PyObject *)(void *)&lsa_TransSidArray3_Type);
16127         Py_INCREF((PyObject *)(void *)&lsa_ForestTrustBinaryData_Type);
16128         PyModule_AddObject(m, "ForestTrustBinaryData", (PyObject *)(void *)&lsa_ForestTrustBinaryData_Type);
16129         Py_INCREF((PyObject *)(void *)&lsa_ForestTrustDomainInfo_Type);
16130         PyModule_AddObject(m, "ForestTrustDomainInfo", (PyObject *)(void *)&lsa_ForestTrustDomainInfo_Type);
16131         Py_INCREF((PyObject *)(void *)&lsa_ForestTrustRecord_Type);
16132         PyModule_AddObject(m, "ForestTrustRecord", (PyObject *)(void *)&lsa_ForestTrustRecord_Type);
16133         Py_INCREF((PyObject *)(void *)&lsa_ForestTrustInformation_Type);
16134         PyModule_AddObject(m, "ForestTrustInformation", (PyObject *)(void *)&lsa_ForestTrustInformation_Type);
16135         Py_INCREF((PyObject *)(void *)&lsa_ForestTrustCollisionRecord_Type);
16136         PyModule_AddObject(m, "ForestTrustCollisionRecord", (PyObject *)(void *)&lsa_ForestTrustCollisionRecord_Type);
16137         Py_INCREF((PyObject *)(void *)&lsa_ForestTrustCollisionInfo_Type);
16138         PyModule_AddObject(m, "ForestTrustCollisionInfo", (PyObject *)(void *)&lsa_ForestTrustCollisionInfo_Type);
16139         Py_INCREF((PyObject *)(void *)&lsarpc_InterfaceType);
16140         PyModule_AddObject(m, "lsarpc", (PyObject *)(void *)&lsarpc_InterfaceType);
16141         Py_INCREF((PyObject *)(void *)&lsarpc_SyntaxType);
16142         PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&lsarpc_SyntaxType);
16143 #ifdef PY_MOD_LSA_PATCH
16144         PY_MOD_LSA_PATCH(m);
16145 #endif
16146
16147 }