2 /* Python wrapper functions auto-generated by pidl */
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"
12 * These functions are here to ensure they can be optomised out by
13 * the compiler based on the constant input values
16 static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
32 static inline long long ndr_sizeof2intmax(size_t var_size)
48 static inline PyObject *ndr_PyLong_FromLongLong(long long v)
50 if (v > LONG_MAX || v < LONG_MIN) {
51 return PyLong_FromLongLong(v);
53 return PyInt_FromLong(v);
57 static inline PyObject *ndr_PyLong_FromUnsignedLongLong(unsigned long long v)
60 return PyLong_FromUnsignedLongLong(v);
62 return PyInt_FromLong(v);
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;
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;
153 static PyObject *py_lsa_String_get_length(PyObject *obj, void *closure)
155 struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(obj);
157 py_length = PyInt_FromLong((uint16_t)object->length);
161 static int py_lsa_String_set_length(PyObject *py_obj, PyObject *value, void *closure)
163 struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
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) {
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);
177 object->length = test_var;
178 } else if (PyInt_Check(value)) {
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);
186 object->length = test_var;
188 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
189 PyInt_Type.tp_name, PyLong_Type.tp_name);
196 static PyObject *py_lsa_String_get_size(PyObject *obj, void *closure)
198 struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(obj);
200 py_size = PyInt_FromLong((uint16_t)object->size);
204 static int py_lsa_String_set_size(PyObject *py_obj, PyObject *value, void *closure)
206 struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
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) {
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);
220 object->size = test_var;
221 } else if (PyInt_Check(value)) {
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);
229 object->size = test_var;
231 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
232 PyInt_Type.tp_name, PyLong_Type.tp_name);
239 static PyObject *py_lsa_String_get_string(PyObject *obj, void *closure)
241 struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(obj);
243 if (object->string == NULL) {
245 Py_INCREF(py_string);
247 if (object->string == NULL) {
249 Py_INCREF(py_string);
251 py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
257 static int py_lsa_String_set_string(PyObject *py_obj, PyObject *value, void *closure)
259 struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
260 if (value == Py_None) {
261 object->string = NULL;
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);
269 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
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 },
283 static PyObject *py_lsa_String_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
285 return pytalloc_new(struct lsa_String, type);
288 static PyObject *py_lsa_String_ndr_pack(PyObject *py_obj)
290 struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
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);
299 return PyString_FromStringAndSize((char *)blob.data, blob.length);
302 static PyObject *py_lsa_String_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
304 struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
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;
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)) {
318 blob.length = blob_length;
320 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
321 allow_remaining = true;
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);
327 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_String);
329 if (err != NDR_ERR_SUCCESS) {
330 PyErr_SetNdrError(err);
337 static PyObject *py_lsa_String_ndr_print(PyObject *py_obj)
339 struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
369 static PyObject *py_lsa_StringLarge_get_length(PyObject *obj, void *closure)
371 struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(obj);
373 py_length = PyInt_FromLong((uint16_t)object->length);
377 static int py_lsa_StringLarge_set_length(PyObject *py_obj, PyObject *value, void *closure)
379 struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
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) {
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);
393 object->length = test_var;
394 } else if (PyInt_Check(value)) {
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);
402 object->length = test_var;
404 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
405 PyInt_Type.tp_name, PyLong_Type.tp_name);
412 static PyObject *py_lsa_StringLarge_get_size(PyObject *obj, void *closure)
414 struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(obj);
416 py_size = PyInt_FromLong((uint16_t)object->size);
420 static int py_lsa_StringLarge_set_size(PyObject *py_obj, PyObject *value, void *closure)
422 struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
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) {
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);
436 object->size = test_var;
437 } else if (PyInt_Check(value)) {
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);
445 object->size = test_var;
447 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
448 PyInt_Type.tp_name, PyLong_Type.tp_name);
455 static PyObject *py_lsa_StringLarge_get_string(PyObject *obj, void *closure)
457 struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(obj);
459 if (object->string == NULL) {
461 Py_INCREF(py_string);
463 if (object->string == NULL) {
465 Py_INCREF(py_string);
467 py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
473 static int py_lsa_StringLarge_set_string(PyObject *py_obj, PyObject *value, void *closure)
475 struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
476 if (value == Py_None) {
477 object->string = NULL;
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);
485 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
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 },
499 static PyObject *py_lsa_StringLarge_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
501 return pytalloc_new(struct lsa_StringLarge, type);
504 static PyObject *py_lsa_StringLarge_ndr_pack(PyObject *py_obj)
506 struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
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);
515 return PyString_FromStringAndSize((char *)blob.data, blob.length);
518 static PyObject *py_lsa_StringLarge_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
520 struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
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;
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)) {
534 blob.length = blob_length;
536 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
537 allow_remaining = true;
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);
543 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_StringLarge);
545 if (err != NDR_ERR_SUCCESS) {
546 PyErr_SetNdrError(err);
553 static PyObject *py_lsa_StringLarge_ndr_print(PyObject *py_obj)
555 struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
585 static PyObject *py_lsa_Strings_get_count(PyObject *obj, void *closure)
587 struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(obj);
589 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
593 static int py_lsa_Strings_set_count(PyObject *py_obj, PyObject *value, void *closure)
595 struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
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) {
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);
609 object->count = test_var;
610 } else if (PyInt_Check(value)) {
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);
618 object->count = test_var;
620 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
621 PyInt_Type.tp_name, PyLong_Type.tp_name);
628 static PyObject *py_lsa_Strings_get_names(PyObject *obj, void *closure)
630 struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(obj);
632 if (object->names == NULL) {
636 py_names = PyList_New(object->count);
637 if (py_names == NULL) {
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);
652 static int py_lsa_Strings_set_names(PyObject *py_obj, PyObject *value, void *closure)
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;
659 object->names = NULL;
660 PY_CHECK_TYPE(&PyList_Type, value, return -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) {
672 object->names[names_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
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 },
685 static PyObject *py_lsa_Strings_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
687 return pytalloc_new(struct lsa_Strings, type);
690 static PyObject *py_lsa_Strings_ndr_pack(PyObject *py_obj)
692 struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
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);
701 return PyString_FromStringAndSize((char *)blob.data, blob.length);
704 static PyObject *py_lsa_Strings_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
706 struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
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;
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)) {
720 blob.length = blob_length;
722 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
723 allow_remaining = true;
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);
729 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_Strings);
731 if (err != NDR_ERR_SUCCESS) {
732 PyErr_SetNdrError(err);
739 static PyObject *py_lsa_Strings_ndr_print(PyObject *py_obj)
741 struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
771 static PyObject *py_lsa_AsciiString_get_length(PyObject *obj, void *closure)
773 struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(obj);
775 py_length = PyInt_FromLong((uint16_t)object->length);
779 static int py_lsa_AsciiString_set_length(PyObject *py_obj, PyObject *value, void *closure)
781 struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
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) {
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);
795 object->length = test_var;
796 } else if (PyInt_Check(value)) {
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);
804 object->length = test_var;
806 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
807 PyInt_Type.tp_name, PyLong_Type.tp_name);
814 static PyObject *py_lsa_AsciiString_get_size(PyObject *obj, void *closure)
816 struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(obj);
818 py_size = PyInt_FromLong((uint16_t)object->size);
822 static int py_lsa_AsciiString_set_size(PyObject *py_obj, PyObject *value, void *closure)
824 struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
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) {
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);
838 object->size = test_var;
839 } else if (PyInt_Check(value)) {
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);
847 object->size = test_var;
849 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
850 PyInt_Type.tp_name, PyLong_Type.tp_name);
857 static PyObject *py_lsa_AsciiString_get_string(PyObject *obj, void *closure)
859 struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(obj);
861 if (object->string == NULL) {
863 Py_INCREF(py_string);
865 if (object->string == NULL) {
867 Py_INCREF(py_string);
869 py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
875 static int py_lsa_AsciiString_set_string(PyObject *py_obj, PyObject *value, void *closure)
877 struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
878 if (value == Py_None) {
879 object->string = NULL;
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);
887 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
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 },
901 static PyObject *py_lsa_AsciiString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
903 return pytalloc_new(struct lsa_AsciiString, type);
906 static PyObject *py_lsa_AsciiString_ndr_pack(PyObject *py_obj)
908 struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
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);
917 return PyString_FromStringAndSize((char *)blob.data, blob.length);
920 static PyObject *py_lsa_AsciiString_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
922 struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
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;
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)) {
936 blob.length = blob_length;
938 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
939 allow_remaining = true;
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);
945 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiString);
947 if (err != NDR_ERR_SUCCESS) {
948 PyErr_SetNdrError(err);
955 static PyObject *py_lsa_AsciiString_ndr_print(PyObject *py_obj)
957 struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
987 static PyObject *py_lsa_AsciiStringLarge_get_length(PyObject *obj, void *closure)
989 struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(obj);
991 py_length = PyInt_FromLong((uint16_t)object->length);
995 static int py_lsa_AsciiStringLarge_set_length(PyObject *py_obj, PyObject *value, void *closure)
997 struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
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) {
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);
1011 object->length = test_var;
1012 } else if (PyInt_Check(value)) {
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);
1020 object->length = test_var;
1022 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1023 PyInt_Type.tp_name, PyLong_Type.tp_name);
1030 static PyObject *py_lsa_AsciiStringLarge_get_size(PyObject *obj, void *closure)
1032 struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(obj);
1034 py_size = PyInt_FromLong((uint16_t)object->size);
1038 static int py_lsa_AsciiStringLarge_set_size(PyObject *py_obj, PyObject *value, void *closure)
1040 struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
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) {
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);
1054 object->size = test_var;
1055 } else if (PyInt_Check(value)) {
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);
1063 object->size = test_var;
1065 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1066 PyInt_Type.tp_name, PyLong_Type.tp_name);
1073 static PyObject *py_lsa_AsciiStringLarge_get_string(PyObject *obj, void *closure)
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);
1081 if (object->string == NULL) {
1082 py_string = Py_None;
1083 Py_INCREF(py_string);
1085 py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
1091 static int py_lsa_AsciiStringLarge_set_string(PyObject *py_obj, PyObject *value, void *closure)
1093 struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1094 if (value == Py_None) {
1095 object->string = NULL;
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);
1103 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
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 },
1117 static PyObject *py_lsa_AsciiStringLarge_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1119 return pytalloc_new(struct lsa_AsciiStringLarge, type);
1122 static PyObject *py_lsa_AsciiStringLarge_ndr_pack(PyObject *py_obj)
1124 struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
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);
1133 return PyString_FromStringAndSize((char *)blob.data, blob.length);
1136 static PyObject *py_lsa_AsciiStringLarge_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1138 struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
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;
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)) {
1152 blob.length = blob_length;
1154 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1155 allow_remaining = true;
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);
1161 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiStringLarge);
1163 if (err != NDR_ERR_SUCCESS) {
1164 PyErr_SetNdrError(err);
1171 static PyObject *py_lsa_AsciiStringLarge_ndr_print(PyObject *py_obj)
1173 struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
1203 static PyObject *py_lsa_BinaryString_get_length(PyObject *obj, void *closure)
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);
1211 static int py_lsa_BinaryString_set_length(PyObject *py_obj, PyObject *value, void *closure)
1213 struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
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) {
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);
1227 object->length = test_var;
1228 } else if (PyInt_Check(value)) {
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);
1236 object->length = test_var;
1238 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1239 PyInt_Type.tp_name, PyLong_Type.tp_name);
1246 static PyObject *py_lsa_BinaryString_get_size(PyObject *obj, void *closure)
1248 struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(obj);
1250 py_size = PyInt_FromLong((uint16_t)object->size);
1254 static int py_lsa_BinaryString_set_size(PyObject *py_obj, PyObject *value, void *closure)
1256 struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
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) {
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);
1270 object->size = test_var;
1271 } else if (PyInt_Check(value)) {
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);
1279 object->size = test_var;
1281 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1282 PyInt_Type.tp_name, PyLong_Type.tp_name);
1289 static PyObject *py_lsa_BinaryString_get_array(PyObject *obj, void *closure)
1291 struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(obj);
1293 if (object->array == NULL) {
1295 Py_INCREF(py_array);
1297 py_array = PyList_New(object->length / 2);
1298 if (py_array == NULL) {
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);
1313 static int py_lsa_BinaryString_set_array(PyObject *py_obj, PyObject *value, void *closure)
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;
1320 object->array = NULL;
1321 PY_CHECK_TYPE(&PyList_Type, value, return -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++) {
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) {
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);
1341 object->array[array_cntr_1] = test_var;
1342 } else if (PyInt_Check(PyList_GET_ITEM(value, array_cntr_1))) {
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);
1350 object->array[array_cntr_1] = test_var;
1352 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1353 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
1370 static PyObject *py_lsa_BinaryString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1372 return pytalloc_new(struct lsa_BinaryString, type);
1375 static PyObject *py_lsa_BinaryString_ndr_pack(PyObject *py_obj)
1377 struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
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);
1386 return PyString_FromStringAndSize((char *)blob.data, blob.length);
1389 static PyObject *py_lsa_BinaryString_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1391 struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
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;
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)) {
1405 blob.length = blob_length;
1407 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1408 allow_remaining = true;
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);
1414 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_BinaryString);
1416 if (err != NDR_ERR_SUCCESS) {
1417 PyErr_SetNdrError(err);
1424 static PyObject *py_lsa_BinaryString_ndr_print(PyObject *py_obj)
1426 struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
1456 static PyObject *py_lsa_LUID_get_low(PyObject *obj, void *closure)
1458 struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(obj);
1460 py_low = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->low);
1464 static int py_lsa_LUID_set_low(PyObject *py_obj, PyObject *value, void *closure)
1466 struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(py_obj);
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) {
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);
1480 object->low = test_var;
1481 } else if (PyInt_Check(value)) {
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);
1489 object->low = test_var;
1491 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1492 PyInt_Type.tp_name, PyLong_Type.tp_name);
1499 static PyObject *py_lsa_LUID_get_high(PyObject *obj, void *closure)
1501 struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(obj);
1503 py_high = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->high);
1507 static int py_lsa_LUID_set_high(PyObject *py_obj, PyObject *value, void *closure)
1509 struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(py_obj);
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) {
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);
1523 object->high = test_var;
1524 } else if (PyInt_Check(value)) {
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);
1532 object->high = test_var;
1534 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1535 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
1548 static PyObject *py_lsa_LUID_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1550 return pytalloc_new(struct lsa_LUID, type);
1554 static PyTypeObject lsa_LUID_Type = {
1555 PyObject_HEAD_INIT(NULL) 0,
1556 .tp_name = "lsa.LUID",
1557 .tp_getset = py_lsa_LUID_getsetters,
1559 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1560 .tp_basicsize = sizeof(pytalloc_Object),
1561 .tp_new = py_lsa_LUID_new,
1565 static PyObject *py_lsa_PrivEntry_get_name(PyObject *obj, void *closure)
1567 struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(obj);
1569 py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
1573 static int py_lsa_PrivEntry_set_name(PyObject *py_obj, PyObject *value, void *closure)
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) {
1581 object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
1585 static PyObject *py_lsa_PrivEntry_get_luid(PyObject *obj, void *closure)
1587 struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(obj);
1589 py_luid = pytalloc_reference_ex(&lsa_LUID_Type, pytalloc_get_mem_ctx(obj), &object->luid);
1593 static int py_lsa_PrivEntry_set_luid(PyObject *py_obj, PyObject *value, void *closure)
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) {
1601 object->luid = *(struct lsa_LUID *)pytalloc_get_ptr(value);
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 },
1611 static PyObject *py_lsa_PrivEntry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1613 return pytalloc_new(struct lsa_PrivEntry, type);
1617 static PyTypeObject lsa_PrivEntry_Type = {
1618 PyObject_HEAD_INIT(NULL) 0,
1619 .tp_name = "lsa.PrivEntry",
1620 .tp_getset = py_lsa_PrivEntry_getsetters,
1622 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1623 .tp_basicsize = sizeof(pytalloc_Object),
1624 .tp_new = py_lsa_PrivEntry_new,
1628 static PyObject *py_lsa_PrivArray_get_count(PyObject *obj, void *closure)
1630 struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(obj);
1632 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
1636 static int py_lsa_PrivArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
1638 struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(py_obj);
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) {
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);
1652 object->count = test_var;
1653 } else if (PyInt_Check(value)) {
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);
1661 object->count = test_var;
1663 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1664 PyInt_Type.tp_name, PyLong_Type.tp_name);
1671 static PyObject *py_lsa_PrivArray_get_privs(PyObject *obj, void *closure)
1673 struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(obj);
1675 if (object->privs == NULL) {
1677 Py_INCREF(py_privs);
1679 py_privs = PyList_New(object->count);
1680 if (py_privs == NULL) {
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);
1695 static int py_lsa_PrivArray_set_privs(PyObject *py_obj, PyObject *value, void *closure)
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;
1702 object->privs = NULL;
1703 PY_CHECK_TYPE(&PyList_Type, value, return -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) {
1715 object->privs[privs_cntr_1] = *(struct lsa_PrivEntry *)pytalloc_get_ptr(PyList_GET_ITEM(value, privs_cntr_1));
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 },
1728 static PyObject *py_lsa_PrivArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1730 return pytalloc_new(struct lsa_PrivArray, type);
1734 static PyTypeObject lsa_PrivArray_Type = {
1735 PyObject_HEAD_INIT(NULL) 0,
1736 .tp_name = "lsa.PrivArray",
1737 .tp_getset = py_lsa_PrivArray_getsetters,
1739 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1740 .tp_basicsize = sizeof(pytalloc_Object),
1741 .tp_new = py_lsa_PrivArray_new,
1745 static PyObject *py_lsa_QosInfo_get_len(PyObject *obj, void *closure)
1747 struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(obj);
1749 py_len = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->len);
1753 static int py_lsa_QosInfo_set_len(PyObject *py_obj, PyObject *value, void *closure)
1755 struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
1769 object->len = test_var;
1770 } else if (PyInt_Check(value)) {
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);
1778 object->len = test_var;
1780 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1781 PyInt_Type.tp_name, PyLong_Type.tp_name);
1788 static PyObject *py_lsa_QosInfo_get_impersonation_level(PyObject *obj, void *closure)
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;
1796 static int py_lsa_QosInfo_set_impersonation_level(PyObject *py_obj, PyObject *value, void *closure)
1798 struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
1812 object->impersonation_level = test_var;
1813 } else if (PyInt_Check(value)) {
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);
1821 object->impersonation_level = test_var;
1823 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1824 PyInt_Type.tp_name, PyLong_Type.tp_name);
1831 static PyObject *py_lsa_QosInfo_get_context_mode(PyObject *obj, void *closure)
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;
1839 static int py_lsa_QosInfo_set_context_mode(PyObject *py_obj, PyObject *value, void *closure)
1841 struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
1855 object->context_mode = test_var;
1856 } else if (PyInt_Check(value)) {
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);
1864 object->context_mode = test_var;
1866 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1867 PyInt_Type.tp_name, PyLong_Type.tp_name);
1874 static PyObject *py_lsa_QosInfo_get_effective_only(PyObject *obj, void *closure)
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;
1882 static int py_lsa_QosInfo_set_effective_only(PyObject *py_obj, PyObject *value, void *closure)
1884 struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
1898 object->effective_only = test_var;
1899 } else if (PyInt_Check(value)) {
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);
1907 object->effective_only = test_var;
1909 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1910 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
1925 static PyObject *py_lsa_QosInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1927 return pytalloc_new(struct lsa_QosInfo, type);
1931 static PyTypeObject lsa_QosInfo_Type = {
1932 PyObject_HEAD_INIT(NULL) 0,
1933 .tp_name = "lsa.QosInfo",
1934 .tp_getset = py_lsa_QosInfo_getsetters,
1936 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1937 .tp_basicsize = sizeof(pytalloc_Object),
1938 .tp_new = py_lsa_QosInfo_new,
1942 static PyObject *py_lsa_ObjectAttribute_get_len(PyObject *obj, void *closure)
1944 struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
1946 py_len = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->len);
1950 static int py_lsa_ObjectAttribute_set_len(PyObject *py_obj, PyObject *value, void *closure)
1952 struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
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) {
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);
1966 object->len = test_var;
1967 } else if (PyInt_Check(value)) {
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);
1975 object->len = test_var;
1977 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1978 PyInt_Type.tp_name, PyLong_Type.tp_name);
1985 static PyObject *py_lsa_ObjectAttribute_get_root_dir(PyObject *obj, void *closure)
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);
1993 py_root_dir = PyInt_FromLong((uint16_t)*object->root_dir);
1998 static int py_lsa_ObjectAttribute_set_root_dir(PyObject *py_obj, PyObject *value, void *closure)
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;
2005 object->root_dir = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->root_dir);
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) {
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);
2019 *object->root_dir = test_var;
2020 } else if (PyInt_Check(value)) {
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);
2028 *object->root_dir = test_var;
2030 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2031 PyInt_Type.tp_name, PyLong_Type.tp_name);
2039 static PyObject *py_lsa_ObjectAttribute_get_object_name(PyObject *obj, void *closure)
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);
2047 if (object->object_name == NULL) {
2048 py_object_name = Py_None;
2049 Py_INCREF(py_object_name);
2051 py_object_name = PyUnicode_Decode(object->object_name, strlen(object->object_name), "utf-8", "ignore");
2054 return py_object_name;
2057 static int py_lsa_ObjectAttribute_set_object_name(PyObject *py_obj, PyObject *value, void *closure)
2059 struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2060 if (value == Py_None) {
2061 object->object_name = NULL;
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);
2069 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2076 static PyObject *py_lsa_ObjectAttribute_get_attributes(PyObject *obj, void *closure)
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;
2084 static int py_lsa_ObjectAttribute_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
2086 struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
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) {
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);
2100 object->attributes = test_var;
2101 } else if (PyInt_Check(value)) {
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);
2109 object->attributes = test_var;
2111 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2112 PyInt_Type.tp_name, PyLong_Type.tp_name);
2119 static PyObject *py_lsa_ObjectAttribute_get_sec_desc(PyObject *obj, void *closure)
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);
2127 py_sec_desc = pytalloc_reference_ex(security_descriptor_Type, object->sec_desc, object->sec_desc);
2132 static int py_lsa_ObjectAttribute_set_sec_desc(PyObject *py_obj, PyObject *value, void *closure)
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;
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) {
2145 object->sec_desc = (struct security_descriptor *)pytalloc_get_ptr(value);
2150 static PyObject *py_lsa_ObjectAttribute_get_sec_qos(PyObject *obj, void *closure)
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);
2158 py_sec_qos = pytalloc_reference_ex(&lsa_QosInfo_Type, object->sec_qos, object->sec_qos);
2163 static int py_lsa_ObjectAttribute_set_sec_qos(PyObject *py_obj, PyObject *value, void *closure)
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;
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) {
2176 object->sec_qos = (struct lsa_QosInfo *)pytalloc_get_ptr(value);
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 },
2191 static PyObject *py_lsa_ObjectAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2193 return pytalloc_new(struct lsa_ObjectAttribute, type);
2197 static PyTypeObject lsa_ObjectAttribute_Type = {
2198 PyObject_HEAD_INIT(NULL) 0,
2199 .tp_name = "lsa.ObjectAttribute",
2200 .tp_getset = py_lsa_ObjectAttribute_getsetters,
2202 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2203 .tp_basicsize = sizeof(pytalloc_Object),
2204 .tp_new = py_lsa_ObjectAttribute_new,
2208 static PyObject *py_lsa_AuditLogInfo_get_percent_full(PyObject *obj, void *closure)
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;
2216 static int py_lsa_AuditLogInfo_set_percent_full(PyObject *py_obj, PyObject *value, void *closure)
2218 struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
2232 object->percent_full = test_var;
2233 } else if (PyInt_Check(value)) {
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);
2241 object->percent_full = test_var;
2243 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2244 PyInt_Type.tp_name, PyLong_Type.tp_name);
2251 static PyObject *py_lsa_AuditLogInfo_get_maximum_log_size(PyObject *obj, void *closure)
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;
2259 static int py_lsa_AuditLogInfo_set_maximum_log_size(PyObject *py_obj, PyObject *value, void *closure)
2261 struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
2275 object->maximum_log_size = test_var;
2276 } else if (PyInt_Check(value)) {
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);
2284 object->maximum_log_size = test_var;
2286 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2287 PyInt_Type.tp_name, PyLong_Type.tp_name);
2294 static PyObject *py_lsa_AuditLogInfo_get_retention_time(PyObject *obj, void *closure)
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;
2302 static int py_lsa_AuditLogInfo_set_retention_time(PyObject *py_obj, PyObject *value, void *closure)
2304 struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
2318 object->retention_time = test_var;
2319 } else if (PyInt_Check(value)) {
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);
2327 object->retention_time = test_var;
2329 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2330 PyInt_Type.tp_name, PyLong_Type.tp_name);
2337 static PyObject *py_lsa_AuditLogInfo_get_shutdown_in_progress(PyObject *obj, void *closure)
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;
2345 static int py_lsa_AuditLogInfo_set_shutdown_in_progress(PyObject *py_obj, PyObject *value, void *closure)
2347 struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
2361 object->shutdown_in_progress = test_var;
2362 } else if (PyInt_Check(value)) {
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);
2370 object->shutdown_in_progress = test_var;
2372 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2373 PyInt_Type.tp_name, PyLong_Type.tp_name);
2380 static PyObject *py_lsa_AuditLogInfo_get_time_to_shutdown(PyObject *obj, void *closure)
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;
2388 static int py_lsa_AuditLogInfo_set_time_to_shutdown(PyObject *py_obj, PyObject *value, void *closure)
2390 struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
2404 object->time_to_shutdown = test_var;
2405 } else if (PyInt_Check(value)) {
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);
2413 object->time_to_shutdown = test_var;
2415 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2416 PyInt_Type.tp_name, PyLong_Type.tp_name);
2423 static PyObject *py_lsa_AuditLogInfo_get_next_audit_record(PyObject *obj, void *closure)
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;
2431 static int py_lsa_AuditLogInfo_set_next_audit_record(PyObject *py_obj, PyObject *value, void *closure)
2433 struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
2447 object->next_audit_record = test_var;
2448 } else if (PyInt_Check(value)) {
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);
2456 object->next_audit_record = test_var;
2458 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2459 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
2476 static PyObject *py_lsa_AuditLogInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2478 return pytalloc_new(struct lsa_AuditLogInfo, type);
2482 static PyTypeObject lsa_AuditLogInfo_Type = {
2483 PyObject_HEAD_INIT(NULL) 0,
2484 .tp_name = "lsa.AuditLogInfo",
2485 .tp_getset = py_lsa_AuditLogInfo_getsetters,
2487 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2488 .tp_basicsize = sizeof(pytalloc_Object),
2489 .tp_new = py_lsa_AuditLogInfo_new,
2493 static PyObject *py_lsa_AuditEventsInfo_get_auditing_mode(PyObject *obj, void *closure)
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;
2501 static int py_lsa_AuditEventsInfo_set_auditing_mode(PyObject *py_obj, PyObject *value, void *closure)
2503 struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
2517 object->auditing_mode = test_var;
2518 } else if (PyInt_Check(value)) {
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);
2526 object->auditing_mode = test_var;
2528 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2529 PyInt_Type.tp_name, PyLong_Type.tp_name);
2536 static PyObject *py_lsa_AuditEventsInfo_get_settings(PyObject *obj, void *closure)
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);
2544 py_settings = PyList_New(object->count);
2545 if (py_settings == NULL) {
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);
2560 static int py_lsa_AuditEventsInfo_set_settings(PyObject *py_obj, PyObject *value, void *closure)
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;
2567 object->settings = NULL;
2568 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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++) {
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) {
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);
2588 object->settings[settings_cntr_1] = test_var;
2589 } else if (PyInt_Check(PyList_GET_ITEM(value, settings_cntr_1))) {
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);
2597 object->settings[settings_cntr_1] = test_var;
2599 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2600 PyInt_Type.tp_name, PyLong_Type.tp_name);
2610 static PyObject *py_lsa_AuditEventsInfo_get_count(PyObject *obj, void *closure)
2612 struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(obj);
2614 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
2618 static int py_lsa_AuditEventsInfo_set_count(PyObject *py_obj, PyObject *value, void *closure)
2620 struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
2634 object->count = test_var;
2635 } else if (PyInt_Check(value)) {
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);
2643 object->count = test_var;
2645 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2646 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
2660 static PyObject *py_lsa_AuditEventsInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2662 return pytalloc_new(struct lsa_AuditEventsInfo, type);
2666 static PyTypeObject lsa_AuditEventsInfo_Type = {
2667 PyObject_HEAD_INIT(NULL) 0,
2668 .tp_name = "lsa.AuditEventsInfo",
2669 .tp_getset = py_lsa_AuditEventsInfo_getsetters,
2671 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2672 .tp_basicsize = sizeof(pytalloc_Object),
2673 .tp_new = py_lsa_AuditEventsInfo_new,
2677 static PyObject *py_lsa_DomainInfo_get_name(PyObject *obj, void *closure)
2679 struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(obj);
2681 py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
2685 static int py_lsa_DomainInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
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) {
2693 object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
2697 static PyObject *py_lsa_DomainInfo_get_sid(PyObject *obj, void *closure)
2699 struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(obj);
2701 if (object->sid == NULL) {
2705 py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
2710 static int py_lsa_DomainInfo_set_sid(PyObject *py_obj, PyObject *value, void *closure)
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) {
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) {
2723 object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
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 },
2734 static PyObject *py_lsa_DomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2736 return pytalloc_new(struct lsa_DomainInfo, type);
2740 static PyTypeObject lsa_DomainInfo_Type = {
2741 PyObject_HEAD_INIT(NULL) 0,
2742 .tp_name = "lsa.DomainInfo",
2743 .tp_getset = py_lsa_DomainInfo_getsetters,
2745 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2746 .tp_basicsize = sizeof(pytalloc_Object),
2747 .tp_new = py_lsa_DomainInfo_new,
2751 static PyObject *py_lsa_PDAccountInfo_get_name(PyObject *obj, void *closure)
2753 struct lsa_PDAccountInfo *object = (struct lsa_PDAccountInfo *)pytalloc_get_ptr(obj);
2755 py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
2759 static int py_lsa_PDAccountInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
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) {
2767 object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
2771 static PyGetSetDef py_lsa_PDAccountInfo_getsetters[] = {
2772 { discard_const_p(char, "name"), py_lsa_PDAccountInfo_get_name, py_lsa_PDAccountInfo_set_name },
2776 static PyObject *py_lsa_PDAccountInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2778 return pytalloc_new(struct lsa_PDAccountInfo, type);
2782 static PyTypeObject lsa_PDAccountInfo_Type = {
2783 PyObject_HEAD_INIT(NULL) 0,
2784 .tp_name = "lsa.PDAccountInfo",
2785 .tp_getset = py_lsa_PDAccountInfo_getsetters,
2787 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2788 .tp_basicsize = sizeof(pytalloc_Object),
2789 .tp_new = py_lsa_PDAccountInfo_new,
2793 static PyObject *py_lsa_ServerRole_get_role(PyObject *obj, void *closure)
2795 struct lsa_ServerRole *object = (struct lsa_ServerRole *)pytalloc_get_ptr(obj);
2797 py_role = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->role);
2801 static int py_lsa_ServerRole_set_role(PyObject *py_obj, PyObject *value, void *closure)
2803 struct lsa_ServerRole *object = (struct lsa_ServerRole *)pytalloc_get_ptr(py_obj);
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) {
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);
2817 object->role = test_var;
2818 } else if (PyInt_Check(value)) {
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);
2826 object->role = test_var;
2828 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2829 PyInt_Type.tp_name, PyLong_Type.tp_name);
2836 static PyGetSetDef py_lsa_ServerRole_getsetters[] = {
2837 { discard_const_p(char, "role"), py_lsa_ServerRole_get_role, py_lsa_ServerRole_set_role },
2841 static PyObject *py_lsa_ServerRole_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2843 return pytalloc_new(struct lsa_ServerRole, type);
2847 static PyTypeObject lsa_ServerRole_Type = {
2848 PyObject_HEAD_INIT(NULL) 0,
2849 .tp_name = "lsa.ServerRole",
2850 .tp_getset = py_lsa_ServerRole_getsetters,
2852 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2853 .tp_basicsize = sizeof(pytalloc_Object),
2854 .tp_new = py_lsa_ServerRole_new,
2858 static PyObject *py_lsa_ReplicaSourceInfo_get_source(PyObject *obj, void *closure)
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);
2866 static int py_lsa_ReplicaSourceInfo_set_source(PyObject *py_obj, PyObject *value, void *closure)
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) {
2874 object->source = *(struct lsa_String *)pytalloc_get_ptr(value);
2878 static PyObject *py_lsa_ReplicaSourceInfo_get_account(PyObject *obj, void *closure)
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);
2886 static int py_lsa_ReplicaSourceInfo_set_account(PyObject *py_obj, PyObject *value, void *closure)
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) {
2894 object->account = *(struct lsa_String *)pytalloc_get_ptr(value);
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 },
2904 static PyObject *py_lsa_ReplicaSourceInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2906 return pytalloc_new(struct lsa_ReplicaSourceInfo, type);
2910 static PyTypeObject lsa_ReplicaSourceInfo_Type = {
2911 PyObject_HEAD_INIT(NULL) 0,
2912 .tp_name = "lsa.ReplicaSourceInfo",
2913 .tp_getset = py_lsa_ReplicaSourceInfo_getsetters,
2915 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2916 .tp_basicsize = sizeof(pytalloc_Object),
2917 .tp_new = py_lsa_ReplicaSourceInfo_new,
2921 static PyObject *py_lsa_DefaultQuotaInfo_get_paged_pool(PyObject *obj, void *closure)
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;
2929 static int py_lsa_DefaultQuotaInfo_set_paged_pool(PyObject *py_obj, PyObject *value, void *closure)
2931 struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
2945 object->paged_pool = test_var;
2946 } else if (PyInt_Check(value)) {
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);
2954 object->paged_pool = test_var;
2956 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2957 PyInt_Type.tp_name, PyLong_Type.tp_name);
2964 static PyObject *py_lsa_DefaultQuotaInfo_get_non_paged_pool(PyObject *obj, void *closure)
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;
2972 static int py_lsa_DefaultQuotaInfo_set_non_paged_pool(PyObject *py_obj, PyObject *value, void *closure)
2974 struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
2988 object->non_paged_pool = test_var;
2989 } else if (PyInt_Check(value)) {
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);
2997 object->non_paged_pool = test_var;
2999 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3000 PyInt_Type.tp_name, PyLong_Type.tp_name);
3007 static PyObject *py_lsa_DefaultQuotaInfo_get_min_wss(PyObject *obj, void *closure)
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);
3015 static int py_lsa_DefaultQuotaInfo_set_min_wss(PyObject *py_obj, PyObject *value, void *closure)
3017 struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
3031 object->min_wss = test_var;
3032 } else if (PyInt_Check(value)) {
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);
3040 object->min_wss = test_var;
3042 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3043 PyInt_Type.tp_name, PyLong_Type.tp_name);
3050 static PyObject *py_lsa_DefaultQuotaInfo_get_max_wss(PyObject *obj, void *closure)
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);
3058 static int py_lsa_DefaultQuotaInfo_set_max_wss(PyObject *py_obj, PyObject *value, void *closure)
3060 struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
3074 object->max_wss = test_var;
3075 } else if (PyInt_Check(value)) {
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);
3083 object->max_wss = test_var;
3085 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3086 PyInt_Type.tp_name, PyLong_Type.tp_name);
3093 static PyObject *py_lsa_DefaultQuotaInfo_get_pagefile(PyObject *obj, void *closure)
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);
3101 static int py_lsa_DefaultQuotaInfo_set_pagefile(PyObject *py_obj, PyObject *value, void *closure)
3103 struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
3117 object->pagefile = test_var;
3118 } else if (PyInt_Check(value)) {
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);
3126 object->pagefile = test_var;
3128 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3129 PyInt_Type.tp_name, PyLong_Type.tp_name);
3136 static PyObject *py_lsa_DefaultQuotaInfo_get_unknown(PyObject *obj, void *closure)
3138 struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3139 PyObject *py_unknown;
3140 py_unknown = ndr_PyLong_FromUnsignedLongLong(object->unknown);
3144 static int py_lsa_DefaultQuotaInfo_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
3146 struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
3160 object->unknown = test_var;
3161 } else if (PyInt_Check(value)) {
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);
3169 object->unknown = test_var;
3171 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3172 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
3189 static PyObject *py_lsa_DefaultQuotaInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3191 return pytalloc_new(struct lsa_DefaultQuotaInfo, type);
3195 static PyTypeObject lsa_DefaultQuotaInfo_Type = {
3196 PyObject_HEAD_INIT(NULL) 0,
3197 .tp_name = "lsa.DefaultQuotaInfo",
3198 .tp_getset = py_lsa_DefaultQuotaInfo_getsetters,
3200 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3201 .tp_basicsize = sizeof(pytalloc_Object),
3202 .tp_new = py_lsa_DefaultQuotaInfo_new,
3206 static PyObject *py_lsa_ModificationInfo_get_modified_id(PyObject *obj, void *closure)
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;
3214 static int py_lsa_ModificationInfo_set_modified_id(PyObject *py_obj, PyObject *value, void *closure)
3216 struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
3230 object->modified_id = test_var;
3231 } else if (PyInt_Check(value)) {
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);
3239 object->modified_id = test_var;
3241 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3242 PyInt_Type.tp_name, PyLong_Type.tp_name);
3249 static PyObject *py_lsa_ModificationInfo_get_db_create_time(PyObject *obj, void *closure)
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;
3257 static int py_lsa_ModificationInfo_set_db_create_time(PyObject *py_obj, PyObject *value, void *closure)
3259 struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
3273 object->db_create_time = test_var;
3274 } else if (PyInt_Check(value)) {
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);
3282 object->db_create_time = test_var;
3284 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3285 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
3298 static PyObject *py_lsa_ModificationInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3300 return pytalloc_new(struct lsa_ModificationInfo, type);
3304 static PyTypeObject lsa_ModificationInfo_Type = {
3305 PyObject_HEAD_INIT(NULL) 0,
3306 .tp_name = "lsa.ModificationInfo",
3307 .tp_getset = py_lsa_ModificationInfo_getsetters,
3309 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3310 .tp_basicsize = sizeof(pytalloc_Object),
3311 .tp_new = py_lsa_ModificationInfo_new,
3315 static PyObject *py_lsa_AuditFullSetInfo_get_shutdown_on_full(PyObject *obj, void *closure)
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;
3323 static int py_lsa_AuditFullSetInfo_set_shutdown_on_full(PyObject *py_obj, PyObject *value, void *closure)
3325 struct lsa_AuditFullSetInfo *object = (struct lsa_AuditFullSetInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
3339 object->shutdown_on_full = test_var;
3340 } else if (PyInt_Check(value)) {
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);
3348 object->shutdown_on_full = test_var;
3350 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3351 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
3363 static PyObject *py_lsa_AuditFullSetInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3365 return pytalloc_new(struct lsa_AuditFullSetInfo, type);
3369 static PyTypeObject lsa_AuditFullSetInfo_Type = {
3370 PyObject_HEAD_INIT(NULL) 0,
3371 .tp_name = "lsa.AuditFullSetInfo",
3372 .tp_getset = py_lsa_AuditFullSetInfo_getsetters,
3374 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3375 .tp_basicsize = sizeof(pytalloc_Object),
3376 .tp_new = py_lsa_AuditFullSetInfo_new,
3380 static PyObject *py_lsa_AuditFullQueryInfo_get_shutdown_on_full(PyObject *obj, void *closure)
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;
3388 static int py_lsa_AuditFullQueryInfo_set_shutdown_on_full(PyObject *py_obj, PyObject *value, void *closure)
3390 struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
3404 object->shutdown_on_full = test_var;
3405 } else if (PyInt_Check(value)) {
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);
3413 object->shutdown_on_full = test_var;
3415 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3416 PyInt_Type.tp_name, PyLong_Type.tp_name);
3423 static PyObject *py_lsa_AuditFullQueryInfo_get_log_is_full(PyObject *obj, void *closure)
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;
3431 static int py_lsa_AuditFullQueryInfo_set_log_is_full(PyObject *py_obj, PyObject *value, void *closure)
3433 struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
3447 object->log_is_full = test_var;
3448 } else if (PyInt_Check(value)) {
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);
3456 object->log_is_full = test_var;
3458 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3459 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
3472 static PyObject *py_lsa_AuditFullQueryInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3474 return pytalloc_new(struct lsa_AuditFullQueryInfo, type);
3478 static PyTypeObject lsa_AuditFullQueryInfo_Type = {
3479 PyObject_HEAD_INIT(NULL) 0,
3480 .tp_name = "lsa.AuditFullQueryInfo",
3481 .tp_getset = py_lsa_AuditFullQueryInfo_getsetters,
3483 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3484 .tp_basicsize = sizeof(pytalloc_Object),
3485 .tp_new = py_lsa_AuditFullQueryInfo_new,
3489 static PyObject *py_lsa_DnsDomainInfo_get_name(PyObject *obj, void *closure)
3491 struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3493 py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
3497 static int py_lsa_DnsDomainInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
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) {
3505 object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3509 static PyObject *py_lsa_DnsDomainInfo_get_dns_domain(PyObject *obj, void *closure)
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;
3517 static int py_lsa_DnsDomainInfo_set_dns_domain(PyObject *py_obj, PyObject *value, void *closure)
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) {
3525 object->dns_domain = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3529 static PyObject *py_lsa_DnsDomainInfo_get_dns_forest(PyObject *obj, void *closure)
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;
3537 static int py_lsa_DnsDomainInfo_set_dns_forest(PyObject *py_obj, PyObject *value, void *closure)
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) {
3545 object->dns_forest = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3549 static PyObject *py_lsa_DnsDomainInfo_get_domain_guid(PyObject *obj, void *closure)
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;
3557 static int py_lsa_DnsDomainInfo_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
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) {
3565 object->domain_guid = *(struct GUID *)pytalloc_get_ptr(value);
3569 static PyObject *py_lsa_DnsDomainInfo_get_sid(PyObject *obj, void *closure)
3571 struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3573 if (object->sid == NULL) {
3577 py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
3582 static int py_lsa_DnsDomainInfo_set_sid(PyObject *py_obj, PyObject *value, void *closure)
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) {
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) {
3595 object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
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 },
3609 static PyObject *py_lsa_DnsDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3611 return pytalloc_new(struct lsa_DnsDomainInfo, type);
3615 static PyTypeObject lsa_DnsDomainInfo_Type = {
3616 PyObject_HEAD_INIT(NULL) 0,
3617 .tp_name = "lsa.DnsDomainInfo",
3618 .tp_getset = py_lsa_DnsDomainInfo_getsetters,
3620 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3621 .tp_basicsize = sizeof(pytalloc_Object),
3622 .tp_new = py_lsa_DnsDomainInfo_new,
3625 PyObject *py_import_lsa_PolicyInformation(TALLOC_CTX *mem_ctx, int level, union lsa_PolicyInformation *in)
3630 case LSA_POLICY_INFO_AUDIT_LOG:
3631 ret = pytalloc_reference_ex(&lsa_AuditLogInfo_Type, mem_ctx, &in->audit_log);
3634 case LSA_POLICY_INFO_AUDIT_EVENTS:
3635 ret = pytalloc_reference_ex(&lsa_AuditEventsInfo_Type, mem_ctx, &in->audit_events);
3638 case LSA_POLICY_INFO_DOMAIN:
3639 ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->domain);
3642 case LSA_POLICY_INFO_PD:
3643 ret = pytalloc_reference_ex(&lsa_PDAccountInfo_Type, mem_ctx, &in->pd);
3646 case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
3647 ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->account_domain);
3650 case LSA_POLICY_INFO_ROLE:
3651 ret = pytalloc_reference_ex(&lsa_ServerRole_Type, mem_ctx, &in->role);
3654 case LSA_POLICY_INFO_REPLICA:
3655 ret = pytalloc_reference_ex(&lsa_ReplicaSourceInfo_Type, mem_ctx, &in->replica);
3658 case LSA_POLICY_INFO_QUOTA:
3659 ret = pytalloc_reference_ex(&lsa_DefaultQuotaInfo_Type, mem_ctx, &in->quota);
3662 case LSA_POLICY_INFO_MOD:
3663 ret = pytalloc_reference_ex(&lsa_ModificationInfo_Type, mem_ctx, &in->mod);
3666 case LSA_POLICY_INFO_AUDIT_FULL_SET:
3667 ret = pytalloc_reference_ex(&lsa_AuditFullSetInfo_Type, mem_ctx, &in->auditfullset);
3670 case LSA_POLICY_INFO_AUDIT_FULL_QUERY:
3671 ret = pytalloc_reference_ex(&lsa_AuditFullQueryInfo_Type, mem_ctx, &in->auditfullquery);
3674 case LSA_POLICY_INFO_DNS:
3675 ret = pytalloc_reference_ex(&lsa_DnsDomainInfo_Type, mem_ctx, &in->dns);
3678 case LSA_POLICY_INFO_DNS_INT:
3679 ret = pytalloc_reference_ex(&lsa_DnsDomainInfo_Type, mem_ctx, &in->dns);
3682 case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN:
3683 ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->l_account_domain);
3687 PyErr_SetString(PyExc_TypeError, "unknown union level");
3691 union lsa_PolicyInformation *py_export_lsa_PolicyInformation(TALLOC_CTX *mem_ctx, int level, PyObject *in)
3693 union lsa_PolicyInformation *ret = talloc_zero(mem_ctx, union lsa_PolicyInformation);
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) {
3699 talloc_free(ret); return NULL;
3701 ret->audit_log = *(struct lsa_AuditLogInfo *)pytalloc_get_ptr(in);
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) {
3708 talloc_free(ret); return NULL;
3710 ret->audit_events = *(struct lsa_AuditEventsInfo *)pytalloc_get_ptr(in);
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) {
3717 talloc_free(ret); return NULL;
3719 ret->domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
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) {
3726 talloc_free(ret); return NULL;
3728 ret->pd = *(struct lsa_PDAccountInfo *)pytalloc_get_ptr(in);
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) {
3735 talloc_free(ret); return NULL;
3737 ret->account_domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
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) {
3744 talloc_free(ret); return NULL;
3746 ret->role = *(struct lsa_ServerRole *)pytalloc_get_ptr(in);
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) {
3753 talloc_free(ret); return NULL;
3755 ret->replica = *(struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(in);
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) {
3762 talloc_free(ret); return NULL;
3764 ret->quota = *(struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(in);
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) {
3771 talloc_free(ret); return NULL;
3773 ret->mod = *(struct lsa_ModificationInfo *)pytalloc_get_ptr(in);
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) {
3780 talloc_free(ret); return NULL;
3782 ret->auditfullset = *(struct lsa_AuditFullSetInfo *)pytalloc_get_ptr(in);
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) {
3789 talloc_free(ret); return NULL;
3791 ret->auditfullquery = *(struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(in);
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) {
3798 talloc_free(ret); return NULL;
3800 ret->dns = *(struct lsa_DnsDomainInfo *)pytalloc_get_ptr(in);
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) {
3807 talloc_free(ret); return NULL;
3809 ret->dns = *(struct lsa_DnsDomainInfo *)pytalloc_get_ptr(in);
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) {
3816 talloc_free(ret); return NULL;
3818 ret->l_account_domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
3822 PyErr_SetString(PyExc_TypeError, "invalid union level value");
3831 static PyObject *py_lsa_SidPtr_get_sid(PyObject *obj, void *closure)
3833 struct lsa_SidPtr *object = (struct lsa_SidPtr *)pytalloc_get_ptr(obj);
3835 if (object->sid == NULL) {
3839 py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
3844 static int py_lsa_SidPtr_set_sid(PyObject *py_obj, PyObject *value, void *closure)
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) {
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) {
3857 object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
3862 static PyGetSetDef py_lsa_SidPtr_getsetters[] = {
3863 { discard_const_p(char, "sid"), py_lsa_SidPtr_get_sid, py_lsa_SidPtr_set_sid },
3867 static PyObject *py_lsa_SidPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3869 return pytalloc_new(struct lsa_SidPtr, type);
3873 static PyTypeObject lsa_SidPtr_Type = {
3874 PyObject_HEAD_INIT(NULL) 0,
3875 .tp_name = "lsa.SidPtr",
3876 .tp_getset = py_lsa_SidPtr_getsetters,
3878 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3879 .tp_basicsize = sizeof(pytalloc_Object),
3880 .tp_new = py_lsa_SidPtr_new,
3884 static PyObject *py_lsa_SidArray_get_num_sids(PyObject *obj, void *closure)
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);
3892 static int py_lsa_SidArray_set_num_sids(PyObject *py_obj, PyObject *value, void *closure)
3894 struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
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) {
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);
3908 object->num_sids = test_var;
3909 } else if (PyInt_Check(value)) {
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);
3917 object->num_sids = test_var;
3919 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3920 PyInt_Type.tp_name, PyLong_Type.tp_name);
3927 static PyObject *py_lsa_SidArray_get_sids(PyObject *obj, void *closure)
3929 struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(obj);
3931 if (object->sids == NULL) {
3935 py_sids = PyList_New(object->num_sids);
3936 if (py_sids == NULL) {
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);
3951 static int py_lsa_SidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure)
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;
3958 object->sids = NULL;
3959 PY_CHECK_TYPE(&PyList_Type, value, return -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) {
3971 object->sids[sids_cntr_1] = *(struct lsa_SidPtr *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
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 },
3984 static PyObject *py_lsa_SidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3986 return pytalloc_new(struct lsa_SidArray, type);
3989 static PyObject *py_lsa_SidArray_ndr_pack(PyObject *py_obj)
3991 struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
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);
4000 return PyString_FromStringAndSize((char *)blob.data, blob.length);
4003 static PyObject *py_lsa_SidArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4005 struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
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;
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)) {
4019 blob.length = blob_length;
4021 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4022 allow_remaining = true;
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);
4028 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_SidArray);
4030 if (err != NDR_ERR_SUCCESS) {
4031 PyErr_SetNdrError(err);
4038 static PyObject *py_lsa_SidArray_ndr_print(PyObject *py_obj)
4040 struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
4070 static PyObject *py_lsa_DomainList_get_count(PyObject *obj, void *closure)
4072 struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(obj);
4074 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
4078 static int py_lsa_DomainList_set_count(PyObject *py_obj, PyObject *value, void *closure)
4080 struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(py_obj);
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) {
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);
4094 object->count = test_var;
4095 } else if (PyInt_Check(value)) {
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);
4103 object->count = test_var;
4105 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4106 PyInt_Type.tp_name, PyLong_Type.tp_name);
4113 static PyObject *py_lsa_DomainList_get_domains(PyObject *obj, void *closure)
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);
4121 py_domains = PyList_New(object->count);
4122 if (py_domains == NULL) {
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);
4137 static int py_lsa_DomainList_set_domains(PyObject *py_obj, PyObject *value, void *closure)
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;
4144 object->domains = NULL;
4145 PY_CHECK_TYPE(&PyList_Type, value, return -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) {
4157 object->domains[domains_cntr_1] = *(struct lsa_DomainInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
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 },
4170 static PyObject *py_lsa_DomainList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4172 return pytalloc_new(struct lsa_DomainList, type);
4176 static PyTypeObject lsa_DomainList_Type = {
4177 PyObject_HEAD_INIT(NULL) 0,
4178 .tp_name = "lsa.DomainList",
4179 .tp_getset = py_lsa_DomainList_getsetters,
4181 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4182 .tp_basicsize = sizeof(pytalloc_Object),
4183 .tp_new = py_lsa_DomainList_new,
4187 static PyObject *py_lsa_TranslatedSid_get_sid_type(PyObject *obj, void *closure)
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);
4195 static int py_lsa_TranslatedSid_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
4197 struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(py_obj);
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) {
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);
4211 object->sid_type = test_var;
4212 } else if (PyInt_Check(value)) {
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);
4220 object->sid_type = test_var;
4222 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4223 PyInt_Type.tp_name, PyLong_Type.tp_name);
4230 static PyObject *py_lsa_TranslatedSid_get_rid(PyObject *obj, void *closure)
4232 struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(obj);
4234 py_rid = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->rid);
4238 static int py_lsa_TranslatedSid_set_rid(PyObject *py_obj, PyObject *value, void *closure)
4240 struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(py_obj);
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) {
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);
4254 object->rid = test_var;
4255 } else if (PyInt_Check(value)) {
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);
4263 object->rid = test_var;
4265 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4266 PyInt_Type.tp_name, PyLong_Type.tp_name);
4273 static PyObject *py_lsa_TranslatedSid_get_sid_index(PyObject *obj, void *closure)
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;
4281 static int py_lsa_TranslatedSid_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
4283 struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(py_obj);
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) {
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);
4297 object->sid_index = test_var;
4298 } else if (PyInt_Check(value)) {
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);
4306 object->sid_index = test_var;
4308 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4309 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
4323 static PyObject *py_lsa_TranslatedSid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4325 return pytalloc_new(struct lsa_TranslatedSid, type);
4329 static PyTypeObject lsa_TranslatedSid_Type = {
4330 PyObject_HEAD_INIT(NULL) 0,
4331 .tp_name = "lsa.TranslatedSid",
4332 .tp_getset = py_lsa_TranslatedSid_getsetters,
4334 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4335 .tp_basicsize = sizeof(pytalloc_Object),
4336 .tp_new = py_lsa_TranslatedSid_new,
4340 static PyObject *py_lsa_TransSidArray_get_count(PyObject *obj, void *closure)
4342 struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(obj);
4344 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
4348 static int py_lsa_TransSidArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
4350 struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(py_obj);
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) {
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);
4364 object->count = test_var;
4365 } else if (PyInt_Check(value)) {
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);
4373 object->count = test_var;
4375 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4376 PyInt_Type.tp_name, PyLong_Type.tp_name);
4383 static PyObject *py_lsa_TransSidArray_get_sids(PyObject *obj, void *closure)
4385 struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(obj);
4387 if (object->sids == NULL) {
4391 py_sids = PyList_New(object->count);
4392 if (py_sids == NULL) {
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);
4407 static int py_lsa_TransSidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure)
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;
4414 object->sids = NULL;
4415 PY_CHECK_TYPE(&PyList_Type, value, return -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) {
4427 object->sids[sids_cntr_1] = *(struct lsa_TranslatedSid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
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 },
4440 static PyObject *py_lsa_TransSidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4442 return pytalloc_new(struct lsa_TransSidArray, type);
4446 static PyTypeObject lsa_TransSidArray_Type = {
4447 PyObject_HEAD_INIT(NULL) 0,
4448 .tp_name = "lsa.TransSidArray",
4449 .tp_getset = py_lsa_TransSidArray_getsetters,
4451 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4452 .tp_basicsize = sizeof(pytalloc_Object),
4453 .tp_new = py_lsa_TransSidArray_new,
4457 static PyObject *py_lsa_RefDomainList_get_count(PyObject *obj, void *closure)
4459 struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(obj);
4461 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
4465 static int py_lsa_RefDomainList_set_count(PyObject *py_obj, PyObject *value, void *closure)
4467 struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
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) {
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);
4481 object->count = test_var;
4482 } else if (PyInt_Check(value)) {
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);
4490 object->count = test_var;
4492 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4493 PyInt_Type.tp_name, PyLong_Type.tp_name);
4500 static PyObject *py_lsa_RefDomainList_get_domains(PyObject *obj, void *closure)
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);
4508 py_domains = PyList_New(object->count);
4509 if (py_domains == NULL) {
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);
4524 static int py_lsa_RefDomainList_set_domains(PyObject *py_obj, PyObject *value, void *closure)
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;
4531 object->domains = NULL;
4532 PY_CHECK_TYPE(&PyList_Type, value, return -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) {
4544 object->domains[domains_cntr_1] = *(struct lsa_DomainInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
4551 static PyObject *py_lsa_RefDomainList_get_max_size(PyObject *obj, void *closure)
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);
4559 static int py_lsa_RefDomainList_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
4561 struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
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) {
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);
4575 object->max_size = test_var;
4576 } else if (PyInt_Check(value)) {
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);
4584 object->max_size = test_var;
4586 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4587 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
4601 static PyObject *py_lsa_RefDomainList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4603 return pytalloc_new(struct lsa_RefDomainList, type);
4606 static PyObject *py_lsa_RefDomainList_ndr_pack(PyObject *py_obj)
4608 struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
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);
4617 return PyString_FromStringAndSize((char *)blob.data, blob.length);
4620 static PyObject *py_lsa_RefDomainList_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4622 struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
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;
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)) {
4636 blob.length = blob_length;
4638 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4639 allow_remaining = true;
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);
4645 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_RefDomainList);
4647 if (err != NDR_ERR_SUCCESS) {
4648 PyErr_SetNdrError(err);
4655 static PyObject *py_lsa_RefDomainList_ndr_print(PyObject *py_obj)
4657 struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
4687 static PyObject *py_lsa_TranslatedName_get_sid_type(PyObject *obj, void *closure)
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);
4695 static int py_lsa_TranslatedName_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
4697 struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(py_obj);
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) {
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);
4711 object->sid_type = test_var;
4712 } else if (PyInt_Check(value)) {
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);
4720 object->sid_type = test_var;
4722 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4723 PyInt_Type.tp_name, PyLong_Type.tp_name);
4730 static PyObject *py_lsa_TranslatedName_get_name(PyObject *obj, void *closure)
4732 struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(obj);
4734 py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
4738 static int py_lsa_TranslatedName_set_name(PyObject *py_obj, PyObject *value, void *closure)
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) {
4746 object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
4750 static PyObject *py_lsa_TranslatedName_get_sid_index(PyObject *obj, void *closure)
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;
4758 static int py_lsa_TranslatedName_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
4760 struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(py_obj);
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) {
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);
4774 object->sid_index = test_var;
4775 } else if (PyInt_Check(value)) {
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);
4783 object->sid_index = test_var;
4785 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4786 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
4800 static PyObject *py_lsa_TranslatedName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4802 return pytalloc_new(struct lsa_TranslatedName, type);
4806 static PyTypeObject lsa_TranslatedName_Type = {
4807 PyObject_HEAD_INIT(NULL) 0,
4808 .tp_name = "lsa.TranslatedName",
4809 .tp_getset = py_lsa_TranslatedName_getsetters,
4811 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4812 .tp_basicsize = sizeof(pytalloc_Object),
4813 .tp_new = py_lsa_TranslatedName_new,
4817 static PyObject *py_lsa_TransNameArray_get_count(PyObject *obj, void *closure)
4819 struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(obj);
4821 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
4825 static int py_lsa_TransNameArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
4827 struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
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) {
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);
4841 object->count = test_var;
4842 } else if (PyInt_Check(value)) {
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);
4850 object->count = test_var;
4852 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4853 PyInt_Type.tp_name, PyLong_Type.tp_name);
4860 static PyObject *py_lsa_TransNameArray_get_names(PyObject *obj, void *closure)
4862 struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(obj);
4864 if (object->names == NULL) {
4866 Py_INCREF(py_names);
4868 py_names = PyList_New(object->count);
4869 if (py_names == NULL) {
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);
4884 static int py_lsa_TransNameArray_set_names(PyObject *py_obj, PyObject *value, void *closure)
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;
4891 object->names = NULL;
4892 PY_CHECK_TYPE(&PyList_Type, value, return -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) {
4904 object->names[names_cntr_1] = *(struct lsa_TranslatedName *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
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 },
4917 static PyObject *py_lsa_TransNameArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4919 return pytalloc_new(struct lsa_TransNameArray, type);
4922 static PyObject *py_lsa_TransNameArray_ndr_pack(PyObject *py_obj)
4924 struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
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);
4933 return PyString_FromStringAndSize((char *)blob.data, blob.length);
4936 static PyObject *py_lsa_TransNameArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4938 struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
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;
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)) {
4952 blob.length = blob_length;
4954 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4955 allow_remaining = true;
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);
4961 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TransNameArray);
4963 if (err != NDR_ERR_SUCCESS) {
4964 PyErr_SetNdrError(err);
4971 static PyObject *py_lsa_TransNameArray_ndr_print(PyObject *py_obj)
4973 struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
5003 static PyObject *py_lsa_LUIDAttribute_get_luid(PyObject *obj, void *closure)
5005 struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(obj);
5007 py_luid = pytalloc_reference_ex(&lsa_LUID_Type, pytalloc_get_mem_ctx(obj), &object->luid);
5011 static int py_lsa_LUIDAttribute_set_luid(PyObject *py_obj, PyObject *value, void *closure)
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) {
5019 object->luid = *(struct lsa_LUID *)pytalloc_get_ptr(value);
5023 static PyObject *py_lsa_LUIDAttribute_get_attribute(PyObject *obj, void *closure)
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;
5031 static int py_lsa_LUIDAttribute_set_attribute(PyObject *py_obj, PyObject *value, void *closure)
5033 struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(py_obj);
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) {
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);
5047 object->attribute = test_var;
5048 } else if (PyInt_Check(value)) {
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);
5056 object->attribute = test_var;
5058 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5059 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
5072 static PyObject *py_lsa_LUIDAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5074 return pytalloc_new(struct lsa_LUIDAttribute, type);
5078 static PyTypeObject lsa_LUIDAttribute_Type = {
5079 PyObject_HEAD_INIT(NULL) 0,
5080 .tp_name = "lsa.LUIDAttribute",
5081 .tp_getset = py_lsa_LUIDAttribute_getsetters,
5083 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5084 .tp_basicsize = sizeof(pytalloc_Object),
5085 .tp_new = py_lsa_LUIDAttribute_new,
5089 static PyObject *py_lsa_PrivilegeSet_get_count(PyObject *obj, void *closure)
5091 struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(obj);
5093 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
5097 static int py_lsa_PrivilegeSet_set_count(PyObject *py_obj, PyObject *value, void *closure)
5099 struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_obj);
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) {
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);
5113 object->count = test_var;
5114 } else if (PyInt_Check(value)) {
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);
5122 object->count = test_var;
5124 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5125 PyInt_Type.tp_name, PyLong_Type.tp_name);
5132 static PyObject *py_lsa_PrivilegeSet_get_unknown(PyObject *obj, void *closure)
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);
5140 static int py_lsa_PrivilegeSet_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
5142 struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_obj);
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) {
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);
5156 object->unknown = test_var;
5157 } else if (PyInt_Check(value)) {
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);
5165 object->unknown = test_var;
5167 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5168 PyInt_Type.tp_name, PyLong_Type.tp_name);
5175 static PyObject *py_lsa_PrivilegeSet_get_set(PyObject *obj, void *closure)
5177 struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(obj);
5179 py_set = PyList_New(object->count);
5180 if (py_set == NULL) {
5185 for (set_cntr_0 = 0; set_cntr_0 < (object->count); set_cntr_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);
5194 static int py_lsa_PrivilegeSet_set_set(PyObject *py_obj, PyObject *value, void *closure)
5196 struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_obj);
5197 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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) {
5209 object->set[set_cntr_0] = *(struct lsa_LUIDAttribute *)pytalloc_get_ptr(PyList_GET_ITEM(value, set_cntr_0));
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 },
5222 static PyObject *py_lsa_PrivilegeSet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5224 return pytalloc_new(struct lsa_PrivilegeSet, type);
5228 static PyTypeObject lsa_PrivilegeSet_Type = {
5229 PyObject_HEAD_INIT(NULL) 0,
5230 .tp_name = "lsa.PrivilegeSet",
5231 .tp_getset = py_lsa_PrivilegeSet_getsetters,
5233 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5234 .tp_basicsize = sizeof(pytalloc_Object),
5235 .tp_new = py_lsa_PrivilegeSet_new,
5239 static PyObject *py_lsa_DATA_BUF_get_length(PyObject *obj, void *closure)
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);
5247 static int py_lsa_DATA_BUF_set_length(PyObject *py_obj, PyObject *value, void *closure)
5249 struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_obj);
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) {
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);
5263 object->length = test_var;
5264 } else if (PyInt_Check(value)) {
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);
5272 object->length = test_var;
5274 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5275 PyInt_Type.tp_name, PyLong_Type.tp_name);
5282 static PyObject *py_lsa_DATA_BUF_get_size(PyObject *obj, void *closure)
5284 struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(obj);
5286 py_size = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->size);
5290 static int py_lsa_DATA_BUF_set_size(PyObject *py_obj, PyObject *value, void *closure)
5292 struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_obj);
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) {
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);
5306 object->size = test_var;
5307 } else if (PyInt_Check(value)) {
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);
5315 object->size = test_var;
5317 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5318 PyInt_Type.tp_name, PyLong_Type.tp_name);
5325 static PyObject *py_lsa_DATA_BUF_get_data(PyObject *obj, void *closure)
5327 struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(obj);
5329 if (object->data == NULL) {
5333 py_data = PyList_New(object->length);
5334 if (py_data == NULL) {
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);
5349 static int py_lsa_DATA_BUF_set_data(PyObject *py_obj, PyObject *value, void *closure)
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;
5356 object->data = NULL;
5357 PY_CHECK_TYPE(&PyList_Type, value, return -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++) {
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) {
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);
5377 object->data[data_cntr_1] = test_var;
5378 } else if (PyInt_Check(PyList_GET_ITEM(value, data_cntr_1))) {
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);
5386 object->data[data_cntr_1] = test_var;
5388 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5389 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
5406 static PyObject *py_lsa_DATA_BUF_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5408 return pytalloc_new(struct lsa_DATA_BUF, type);
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,
5417 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5418 .tp_basicsize = sizeof(pytalloc_Object),
5419 .tp_new = py_lsa_DATA_BUF_new,
5423 static PyObject *py_lsa_DATA_BUF2_get_size(PyObject *obj, void *closure)
5425 struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(obj);
5427 py_size = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->size);
5431 static int py_lsa_DATA_BUF2_set_size(PyObject *py_obj, PyObject *value, void *closure)
5433 struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(py_obj);
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) {
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);
5447 object->size = test_var;
5448 } else if (PyInt_Check(value)) {
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);
5456 object->size = test_var;
5458 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5459 PyInt_Type.tp_name, PyLong_Type.tp_name);
5466 static PyObject *py_lsa_DATA_BUF2_get_data(PyObject *obj, void *closure)
5468 struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(obj);
5470 if (object->data == NULL) {
5474 py_data = PyList_New(object->size);
5475 if (py_data == NULL) {
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);
5490 static int py_lsa_DATA_BUF2_set_data(PyObject *py_obj, PyObject *value, void *closure)
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;
5497 object->data = NULL;
5498 PY_CHECK_TYPE(&PyList_Type, value, return -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++) {
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) {
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);
5518 object->data[data_cntr_1] = test_var;
5519 } else if (PyInt_Check(PyList_GET_ITEM(value, data_cntr_1))) {
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);
5527 object->data[data_cntr_1] = test_var;
5529 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5530 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
5546 static PyObject *py_lsa_DATA_BUF2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5548 return pytalloc_new(struct lsa_DATA_BUF2, type);
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,
5557 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5558 .tp_basicsize = sizeof(pytalloc_Object),
5559 .tp_new = py_lsa_DATA_BUF2_new,
5563 static PyObject *py_lsa_TrustDomainInfoName_get_netbios_name(PyObject *obj, void *closure)
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;
5571 static int py_lsa_TrustDomainInfoName_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
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) {
5579 object->netbios_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
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 },
5588 static PyObject *py_lsa_TrustDomainInfoName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5590 return pytalloc_new(struct lsa_TrustDomainInfoName, type);
5594 static PyTypeObject lsa_TrustDomainInfoName_Type = {
5595 PyObject_HEAD_INIT(NULL) 0,
5596 .tp_name = "lsa.TrustDomainInfoName",
5597 .tp_getset = py_lsa_TrustDomainInfoName_getsetters,
5599 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5600 .tp_basicsize = sizeof(pytalloc_Object),
5601 .tp_new = py_lsa_TrustDomainInfoName_new,
5605 static PyObject *py_lsa_TrustDomainInfoControllers_get_entries(PyObject *obj, void *closure)
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);
5613 static int py_lsa_TrustDomainInfoControllers_set_entries(PyObject *py_obj, PyObject *value, void *closure)
5615 struct lsa_TrustDomainInfoControllers *object = (struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(py_obj);
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) {
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);
5629 object->entries = test_var;
5630 } else if (PyInt_Check(value)) {
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);
5638 object->entries = test_var;
5640 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5641 PyInt_Type.tp_name, PyLong_Type.tp_name);
5648 static PyObject *py_lsa_TrustDomainInfoControllers_get_netbios_names(PyObject *obj, void *closure)
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);
5656 py_netbios_names = PyList_New(object->entries);
5657 if (py_netbios_names == NULL) {
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);
5669 return py_netbios_names;
5672 static int py_lsa_TrustDomainInfoControllers_set_netbios_names(PyObject *py_obj, PyObject *value, void *closure)
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;
5679 object->netbios_names = NULL;
5680 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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) {
5692 object->netbios_names[netbios_names_cntr_1] = *(struct lsa_StringLarge *)pytalloc_get_ptr(PyList_GET_ITEM(value, netbios_names_cntr_1));
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 },
5705 static PyObject *py_lsa_TrustDomainInfoControllers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5707 return pytalloc_new(struct lsa_TrustDomainInfoControllers, type);
5711 static PyTypeObject lsa_TrustDomainInfoControllers_Type = {
5712 PyObject_HEAD_INIT(NULL) 0,
5713 .tp_name = "lsa.TrustDomainInfoControllers",
5714 .tp_getset = py_lsa_TrustDomainInfoControllers_getsetters,
5716 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5717 .tp_basicsize = sizeof(pytalloc_Object),
5718 .tp_new = py_lsa_TrustDomainInfoControllers_new,
5722 static PyObject *py_lsa_TrustDomainInfoPosixOffset_get_posix_offset(PyObject *obj, void *closure)
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;
5730 static int py_lsa_TrustDomainInfoPosixOffset_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
5732 struct lsa_TrustDomainInfoPosixOffset *object = (struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(py_obj);
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) {
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);
5746 object->posix_offset = test_var;
5747 } else if (PyInt_Check(value)) {
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);
5755 object->posix_offset = test_var;
5757 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5758 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
5770 static PyObject *py_lsa_TrustDomainInfoPosixOffset_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5772 return pytalloc_new(struct lsa_TrustDomainInfoPosixOffset, type);
5776 static PyTypeObject lsa_TrustDomainInfoPosixOffset_Type = {
5777 PyObject_HEAD_INIT(NULL) 0,
5778 .tp_name = "lsa.TrustDomainInfoPosixOffset",
5779 .tp_getset = py_lsa_TrustDomainInfoPosixOffset_getsetters,
5781 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5782 .tp_basicsize = sizeof(pytalloc_Object),
5783 .tp_new = py_lsa_TrustDomainInfoPosixOffset_new,
5787 static PyObject *py_lsa_TrustDomainInfoPassword_get_password(PyObject *obj, void *closure)
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);
5795 py_password = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->password, object->password);
5800 static int py_lsa_TrustDomainInfoPassword_set_password(PyObject *py_obj, PyObject *value, void *closure)
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;
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) {
5813 object->password = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
5818 static PyObject *py_lsa_TrustDomainInfoPassword_get_old_password(PyObject *obj, void *closure)
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);
5826 py_old_password = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->old_password, object->old_password);
5828 return py_old_password;
5831 static int py_lsa_TrustDomainInfoPassword_set_old_password(PyObject *py_obj, PyObject *value, void *closure)
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;
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) {
5844 object->old_password = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
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 },
5855 static PyObject *py_lsa_TrustDomainInfoPassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5857 return pytalloc_new(struct lsa_TrustDomainInfoPassword, type);
5861 static PyTypeObject lsa_TrustDomainInfoPassword_Type = {
5862 PyObject_HEAD_INIT(NULL) 0,
5863 .tp_name = "lsa.TrustDomainInfoPassword",
5864 .tp_getset = py_lsa_TrustDomainInfoPassword_getsetters,
5866 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5867 .tp_basicsize = sizeof(pytalloc_Object),
5868 .tp_new = py_lsa_TrustDomainInfoPassword_new,
5872 static PyObject *py_lsa_TrustDomainInfoBasic_get_netbios_name(PyObject *obj, void *closure)
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;
5880 static int py_lsa_TrustDomainInfoBasic_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
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) {
5888 object->netbios_name = *(struct lsa_String *)pytalloc_get_ptr(value);
5892 static PyObject *py_lsa_TrustDomainInfoBasic_get_sid(PyObject *obj, void *closure)
5894 struct lsa_TrustDomainInfoBasic *object = (struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(obj);
5896 if (object->sid == NULL) {
5900 py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
5905 static int py_lsa_TrustDomainInfoBasic_set_sid(PyObject *py_obj, PyObject *value, void *closure)
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) {
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) {
5918 object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
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 },
5929 static PyObject *py_lsa_TrustDomainInfoBasic_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5931 return pytalloc_new(struct lsa_TrustDomainInfoBasic, type);
5935 static PyTypeObject lsa_TrustDomainInfoBasic_Type = {
5936 PyObject_HEAD_INIT(NULL) 0,
5937 .tp_name = "lsa.TrustDomainInfoBasic",
5938 .tp_getset = py_lsa_TrustDomainInfoBasic_getsetters,
5940 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5941 .tp_basicsize = sizeof(pytalloc_Object),
5942 .tp_new = py_lsa_TrustDomainInfoBasic_new,
5946 static PyObject *py_lsa_TrustDomainInfoInfoEx_get_domain_name(PyObject *obj, void *closure)
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;
5954 static int py_lsa_TrustDomainInfoInfoEx_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
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) {
5962 object->domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
5966 static PyObject *py_lsa_TrustDomainInfoInfoEx_get_netbios_name(PyObject *obj, void *closure)
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;
5974 static int py_lsa_TrustDomainInfoInfoEx_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
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) {
5982 object->netbios_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
5986 static PyObject *py_lsa_TrustDomainInfoInfoEx_get_sid(PyObject *obj, void *closure)
5988 struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
5990 if (object->sid == NULL) {
5994 py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
5999 static int py_lsa_TrustDomainInfoInfoEx_set_sid(PyObject *py_obj, PyObject *value, void *closure)
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) {
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) {
6012 object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
6017 static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_direction(PyObject *obj, void *closure)
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;
6025 static int py_lsa_TrustDomainInfoInfoEx_set_trust_direction(PyObject *py_obj, PyObject *value, void *closure)
6027 struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
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) {
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);
6041 object->trust_direction = test_var;
6042 } else if (PyInt_Check(value)) {
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);
6050 object->trust_direction = test_var;
6052 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6053 PyInt_Type.tp_name, PyLong_Type.tp_name);
6060 static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_type(PyObject *obj, void *closure)
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;
6068 static int py_lsa_TrustDomainInfoInfoEx_set_trust_type(PyObject *py_obj, PyObject *value, void *closure)
6070 struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
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) {
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);
6084 object->trust_type = test_var;
6085 } else if (PyInt_Check(value)) {
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);
6093 object->trust_type = test_var;
6095 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6096 PyInt_Type.tp_name, PyLong_Type.tp_name);
6103 static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_attributes(PyObject *obj, void *closure)
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;
6111 static int py_lsa_TrustDomainInfoInfoEx_set_trust_attributes(PyObject *py_obj, PyObject *value, void *closure)
6113 struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
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) {
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);
6127 object->trust_attributes = test_var;
6128 } else if (PyInt_Check(value)) {
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);
6136 object->trust_attributes = test_var;
6138 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6139 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
6156 static PyObject *py_lsa_TrustDomainInfoInfoEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6158 return pytalloc_new(struct lsa_TrustDomainInfoInfoEx, type);
6161 static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_pack(PyObject *py_obj)
6163 struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
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);
6172 return PyString_FromStringAndSize((char *)blob.data, blob.length);
6175 static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6177 struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
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;
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)) {
6191 blob.length = blob_length;
6193 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6194 allow_remaining = true;
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);
6200 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoInfoEx);
6202 if (err != NDR_ERR_SUCCESS) {
6203 PyErr_SetNdrError(err);
6210 static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_print(PyObject *py_obj)
6212 struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
6242 static PyObject *py_lsa_TrustDomainInfoBuffer_get_last_update_time(PyObject *obj, void *closure)
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;
6250 static int py_lsa_TrustDomainInfoBuffer_set_last_update_time(PyObject *py_obj, PyObject *value, void *closure)
6252 struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(py_obj);
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) {
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);
6266 object->last_update_time = test_var;
6267 } else if (PyInt_Check(value)) {
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);
6275 object->last_update_time = test_var;
6277 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6278 PyInt_Type.tp_name, PyLong_Type.tp_name);
6285 static PyObject *py_lsa_TrustDomainInfoBuffer_get_AuthType(PyObject *obj, void *closure)
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);
6293 static int py_lsa_TrustDomainInfoBuffer_set_AuthType(PyObject *py_obj, PyObject *value, void *closure)
6295 struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(py_obj);
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) {
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);
6309 object->AuthType = test_var;
6310 } else if (PyInt_Check(value)) {
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);
6318 object->AuthType = test_var;
6320 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6321 PyInt_Type.tp_name, PyLong_Type.tp_name);
6328 static PyObject *py_lsa_TrustDomainInfoBuffer_get_data(PyObject *obj, void *closure)
6330 struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(obj);
6332 py_data = pytalloc_reference_ex(&lsa_DATA_BUF2_Type, pytalloc_get_mem_ctx(obj), &object->data);
6336 static int py_lsa_TrustDomainInfoBuffer_set_data(PyObject *py_obj, PyObject *value, void *closure)
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) {
6344 object->data = *(struct lsa_DATA_BUF2 *)pytalloc_get_ptr(value);
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 },
6355 static PyObject *py_lsa_TrustDomainInfoBuffer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6357 return pytalloc_new(struct lsa_TrustDomainInfoBuffer, type);
6361 static PyTypeObject lsa_TrustDomainInfoBuffer_Type = {
6362 PyObject_HEAD_INIT(NULL) 0,
6363 .tp_name = "lsa.TrustDomainInfoBuffer",
6364 .tp_getset = py_lsa_TrustDomainInfoBuffer_getsetters,
6366 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6367 .tp_basicsize = sizeof(pytalloc_Object),
6368 .tp_new = py_lsa_TrustDomainInfoBuffer_new,
6372 static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_count(PyObject *obj, void *closure)
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;
6380 static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_count(PyObject *py_obj, PyObject *value, void *closure)
6382 struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
6396 object->incoming_count = test_var;
6397 } else if (PyInt_Check(value)) {
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);
6405 object->incoming_count = test_var;
6407 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6408 PyInt_Type.tp_name, PyLong_Type.tp_name);
6415 static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_current_auth_info(PyObject *obj, void *closure)
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);
6423 py_incoming_current_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->incoming_current_auth_info, object->incoming_current_auth_info);
6425 return py_incoming_current_auth_info;
6428 static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_current_auth_info(PyObject *py_obj, PyObject *value, void *closure)
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;
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) {
6441 object->incoming_current_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
6446 static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_previous_auth_info(PyObject *obj, void *closure)
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);
6454 py_incoming_previous_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->incoming_previous_auth_info, object->incoming_previous_auth_info);
6456 return py_incoming_previous_auth_info;
6459 static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_previous_auth_info(PyObject *py_obj, PyObject *value, void *closure)
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;
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) {
6472 object->incoming_previous_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
6477 static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_count(PyObject *obj, void *closure)
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;
6485 static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_count(PyObject *py_obj, PyObject *value, void *closure)
6487 struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
6501 object->outgoing_count = test_var;
6502 } else if (PyInt_Check(value)) {
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);
6510 object->outgoing_count = test_var;
6512 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6513 PyInt_Type.tp_name, PyLong_Type.tp_name);
6520 static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_current_auth_info(PyObject *obj, void *closure)
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);
6528 py_outgoing_current_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->outgoing_current_auth_info, object->outgoing_current_auth_info);
6530 return py_outgoing_current_auth_info;
6533 static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_current_auth_info(PyObject *py_obj, PyObject *value, void *closure)
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;
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) {
6546 object->outgoing_current_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
6551 static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_previous_auth_info(PyObject *obj, void *closure)
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);
6559 py_outgoing_previous_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->outgoing_previous_auth_info, object->outgoing_previous_auth_info);
6561 return py_outgoing_previous_auth_info;
6564 static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_previous_auth_info(PyObject *py_obj, PyObject *value, void *closure)
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;
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) {
6577 object->outgoing_previous_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
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 },
6592 static PyObject *py_lsa_TrustDomainInfoAuthInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6594 return pytalloc_new(struct lsa_TrustDomainInfoAuthInfo, type);
6597 static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_pack(PyObject *py_obj)
6599 struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
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);
6608 return PyString_FromStringAndSize((char *)blob.data, blob.length);
6611 static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6613 struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
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;
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)) {
6627 blob.length = blob_length;
6629 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6630 allow_remaining = true;
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);
6636 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoAuthInfo);
6638 if (err != NDR_ERR_SUCCESS) {
6639 PyErr_SetNdrError(err);
6646 static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_print(PyObject *py_obj)
6648 struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
6678 static PyObject *py_lsa_TrustDomainInfoFullInfo_get_info_ex(PyObject *obj, void *closure)
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);
6686 static int py_lsa_TrustDomainInfoFullInfo_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
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) {
6694 object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
6698 static PyObject *py_lsa_TrustDomainInfoFullInfo_get_posix_offset(PyObject *obj, void *closure)
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;
6706 static int py_lsa_TrustDomainInfoFullInfo_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
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) {
6714 object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
6718 static PyObject *py_lsa_TrustDomainInfoFullInfo_get_auth_info(PyObject *obj, void *closure)
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;
6726 static int py_lsa_TrustDomainInfoFullInfo_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
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) {
6734 object->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(value);
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 },
6745 static PyObject *py_lsa_TrustDomainInfoFullInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6747 return pytalloc_new(struct lsa_TrustDomainInfoFullInfo, type);
6751 static PyTypeObject lsa_TrustDomainInfoFullInfo_Type = {
6752 PyObject_HEAD_INIT(NULL) 0,
6753 .tp_name = "lsa.TrustDomainInfoFullInfo",
6754 .tp_getset = py_lsa_TrustDomainInfoFullInfo_getsetters,
6756 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6757 .tp_basicsize = sizeof(pytalloc_Object),
6758 .tp_new = py_lsa_TrustDomainInfoFullInfo_new,
6762 static PyObject *py_lsa_TrustDomainInfoAuthInfoInternal_get_auth_blob(PyObject *obj, void *closure)
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;
6770 static int py_lsa_TrustDomainInfoAuthInfoInternal_set_auth_blob(PyObject *py_obj, PyObject *value, void *closure)
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) {
6778 object->auth_blob = *(struct lsa_DATA_BUF2 *)pytalloc_get_ptr(value);
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 },
6787 static PyObject *py_lsa_TrustDomainInfoAuthInfoInternal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6789 return pytalloc_new(struct lsa_TrustDomainInfoAuthInfoInternal, type);
6793 static PyTypeObject lsa_TrustDomainInfoAuthInfoInternal_Type = {
6794 PyObject_HEAD_INIT(NULL) 0,
6795 .tp_name = "lsa.TrustDomainInfoAuthInfoInternal",
6796 .tp_getset = py_lsa_TrustDomainInfoAuthInfoInternal_getsetters,
6798 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6799 .tp_basicsize = sizeof(pytalloc_Object),
6800 .tp_new = py_lsa_TrustDomainInfoAuthInfoInternal_new,
6804 static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_info_ex(PyObject *obj, void *closure)
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);
6812 static int py_lsa_TrustDomainInfoFullInfoInternal_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
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) {
6820 object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
6824 static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_posix_offset(PyObject *obj, void *closure)
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;
6832 static int py_lsa_TrustDomainInfoFullInfoInternal_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
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) {
6840 object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
6844 static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_auth_info(PyObject *obj, void *closure)
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;
6852 static int py_lsa_TrustDomainInfoFullInfoInternal_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
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) {
6860 object->auth_info = *(struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(value);
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 },
6871 static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6873 return pytalloc_new(struct lsa_TrustDomainInfoFullInfoInternal, type);
6877 static PyTypeObject lsa_TrustDomainInfoFullInfoInternal_Type = {
6878 PyObject_HEAD_INIT(NULL) 0,
6879 .tp_name = "lsa.TrustDomainInfoFullInfoInternal",
6880 .tp_getset = py_lsa_TrustDomainInfoFullInfoInternal_getsetters,
6882 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6883 .tp_basicsize = sizeof(pytalloc_Object),
6884 .tp_new = py_lsa_TrustDomainInfoFullInfoInternal_new,
6888 static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_info_ex(PyObject *obj, void *closure)
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);
6896 static int py_lsa_TrustDomainInfoInfoEx2Internal_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
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) {
6904 object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
6908 static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_length(PyObject *obj, void *closure)
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;
6916 static int py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_length(PyObject *py_obj, PyObject *value, void *closure)
6918 struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(py_obj);
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) {
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);
6932 object->forest_trust_length = test_var;
6933 } else if (PyInt_Check(value)) {
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);
6941 object->forest_trust_length = test_var;
6943 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6944 PyInt_Type.tp_name, PyLong_Type.tp_name);
6951 static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_data(PyObject *obj, void *closure)
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);
6959 py_forest_trust_data = PyList_New(object->forest_trust_length);
6960 if (py_forest_trust_data == NULL) {
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);
6972 return py_forest_trust_data;
6975 static int py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_data(PyObject *py_obj, PyObject *value, void *closure)
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;
6982 object->forest_trust_data = NULL;
6983 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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++) {
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) {
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);
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))) {
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);
7012 object->forest_trust_data[forest_trust_data_cntr_1] = test_var;
7014 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7015 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
7032 static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7034 return pytalloc_new(struct lsa_TrustDomainInfoInfoEx2Internal, type);
7038 static PyTypeObject lsa_TrustDomainInfoInfoEx2Internal_Type = {
7039 PyObject_HEAD_INIT(NULL) 0,
7040 .tp_name = "lsa.TrustDomainInfoInfoEx2Internal",
7041 .tp_getset = py_lsa_TrustDomainInfoInfoEx2Internal_getsetters,
7043 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7044 .tp_basicsize = sizeof(pytalloc_Object),
7045 .tp_new = py_lsa_TrustDomainInfoInfoEx2Internal_new,
7049 static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_info(PyObject *obj, void *closure)
7051 struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(obj);
7053 py_info = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx2Internal_Type, pytalloc_get_mem_ctx(obj), &object->info);
7057 static int py_lsa_TrustDomainInfoFullInfo2Internal_set_info(PyObject *py_obj, PyObject *value, void *closure)
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) {
7065 object->info = *(struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(value);
7069 static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_posix_offset(PyObject *obj, void *closure)
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;
7077 static int py_lsa_TrustDomainInfoFullInfo2Internal_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
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) {
7085 object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
7089 static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_auth_info(PyObject *obj, void *closure)
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;
7097 static int py_lsa_TrustDomainInfoFullInfo2Internal_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
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) {
7105 object->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(value);
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 },
7116 static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7118 return pytalloc_new(struct lsa_TrustDomainInfoFullInfo2Internal, type);
7122 static PyTypeObject lsa_TrustDomainInfoFullInfo2Internal_Type = {
7123 PyObject_HEAD_INIT(NULL) 0,
7124 .tp_name = "lsa.TrustDomainInfoFullInfo2Internal",
7125 .tp_getset = py_lsa_TrustDomainInfoFullInfo2Internal_getsetters,
7127 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7128 .tp_basicsize = sizeof(pytalloc_Object),
7129 .tp_new = py_lsa_TrustDomainInfoFullInfo2Internal_new,
7133 static PyObject *py_lsa_TrustDomainInfoSupportedEncTypes_get_enc_types(PyObject *obj, void *closure)
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;
7141 static int py_lsa_TrustDomainInfoSupportedEncTypes_set_enc_types(PyObject *py_obj, PyObject *value, void *closure)
7143 struct lsa_TrustDomainInfoSupportedEncTypes *object = (struct lsa_TrustDomainInfoSupportedEncTypes *)pytalloc_get_ptr(py_obj);
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) {
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);
7157 object->enc_types = test_var;
7158 } else if (PyInt_Check(value)) {
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);
7166 object->enc_types = test_var;
7168 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7169 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
7181 static PyObject *py_lsa_TrustDomainInfoSupportedEncTypes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7183 return pytalloc_new(struct lsa_TrustDomainInfoSupportedEncTypes, type);
7187 static PyTypeObject lsa_TrustDomainInfoSupportedEncTypes_Type = {
7188 PyObject_HEAD_INIT(NULL) 0,
7189 .tp_name = "lsa.TrustDomainInfoSupportedEncTypes",
7190 .tp_getset = py_lsa_TrustDomainInfoSupportedEncTypes_getsetters,
7192 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7193 .tp_basicsize = sizeof(pytalloc_Object),
7194 .tp_new = py_lsa_TrustDomainInfoSupportedEncTypes_new,
7197 PyObject *py_import_lsa_TrustedDomainInfo(TALLOC_CTX *mem_ctx, int level, union lsa_TrustedDomainInfo *in)
7202 case LSA_TRUSTED_DOMAIN_INFO_NAME:
7203 ret = pytalloc_reference_ex(&lsa_TrustDomainInfoName_Type, mem_ctx, &in->name);
7206 case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS:
7207 ret = pytalloc_reference_ex(&lsa_TrustDomainInfoControllers_Type, mem_ctx, &in->controllers);
7210 case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET:
7211 ret = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, mem_ctx, &in->posix_offset);
7214 case LSA_TRUSTED_DOMAIN_INFO_PASSWORD:
7215 ret = pytalloc_reference_ex(&lsa_TrustDomainInfoPassword_Type, mem_ctx, &in->password);
7218 case LSA_TRUSTED_DOMAIN_INFO_BASIC:
7219 ret = pytalloc_reference_ex(&lsa_TrustDomainInfoBasic_Type, mem_ctx, &in->info_basic);
7222 case LSA_TRUSTED_DOMAIN_INFO_INFO_EX:
7223 ret = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, mem_ctx, &in->info_ex);
7226 case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO:
7227 ret = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, mem_ctx, &in->auth_info);
7230 case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO:
7231 ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfo_Type, mem_ctx, &in->full_info);
7234 case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL:
7235 ret = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternal_Type, mem_ctx, &in->auth_info_internal);
7238 case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL:
7239 ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfoInternal_Type, mem_ctx, &in->full_info_internal);
7242 case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL:
7243 ret = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx2Internal_Type, mem_ctx, &in->info_ex2_internal);
7246 case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL:
7247 ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfo2Internal_Type, mem_ctx, &in->full_info2_internal);
7250 case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES:
7251 ret = pytalloc_reference_ex(&lsa_TrustDomainInfoSupportedEncTypes_Type, mem_ctx, &in->enc_types);
7255 PyErr_SetString(PyExc_TypeError, "unknown union level");
7259 union lsa_TrustedDomainInfo *py_export_lsa_TrustedDomainInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
7261 union lsa_TrustedDomainInfo *ret = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
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) {
7267 talloc_free(ret); return NULL;
7269 ret->name = *(struct lsa_TrustDomainInfoName *)pytalloc_get_ptr(in);
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) {
7276 talloc_free(ret); return NULL;
7278 ret->controllers = *(struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(in);
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) {
7285 talloc_free(ret); return NULL;
7287 ret->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(in);
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) {
7294 talloc_free(ret); return NULL;
7296 ret->password = *(struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(in);
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) {
7303 talloc_free(ret); return NULL;
7305 ret->info_basic = *(struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(in);
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) {
7312 talloc_free(ret); return NULL;
7314 ret->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(in);
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) {
7321 talloc_free(ret); return NULL;
7323 ret->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(in);
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) {
7330 talloc_free(ret); return NULL;
7332 ret->full_info = *(struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(in);
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) {
7339 talloc_free(ret); return NULL;
7341 ret->auth_info_internal = *(struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(in);
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) {
7348 talloc_free(ret); return NULL;
7350 ret->full_info_internal = *(struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(in);
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) {
7357 talloc_free(ret); return NULL;
7359 ret->info_ex2_internal = *(struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(in);
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) {
7366 talloc_free(ret); return NULL;
7368 ret->full_info2_internal = *(struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(in);
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) {
7375 talloc_free(ret); return NULL;
7377 ret->enc_types = *(struct lsa_TrustDomainInfoSupportedEncTypes *)pytalloc_get_ptr(in);
7381 PyErr_SetString(PyExc_TypeError, "invalid union level value");
7390 static PyObject *py_lsa_DATA_BUF_PTR_get_buf(PyObject *obj, void *closure)
7392 struct lsa_DATA_BUF_PTR *object = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(obj);
7394 if (object->buf == NULL) {
7398 py_buf = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->buf, object->buf);
7403 static int py_lsa_DATA_BUF_PTR_set_buf(PyObject *py_obj, PyObject *value, void *closure)
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) {
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) {
7416 object->buf = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
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 },
7426 static PyObject *py_lsa_DATA_BUF_PTR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7428 return pytalloc_new(struct lsa_DATA_BUF_PTR, type);
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,
7437 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7438 .tp_basicsize = sizeof(pytalloc_Object),
7439 .tp_new = py_lsa_DATA_BUF_PTR_new,
7443 static PyObject *py_lsa_RightAttribute_get_name(PyObject *obj, void *closure)
7445 struct lsa_RightAttribute *object = (struct lsa_RightAttribute *)pytalloc_get_ptr(obj);
7447 if (object->name == NULL) {
7451 if (object->name == NULL) {
7455 py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
7461 static int py_lsa_RightAttribute_set_name(PyObject *py_obj, PyObject *value, void *closure)
7463 struct lsa_RightAttribute *object = (struct lsa_RightAttribute *)pytalloc_get_ptr(py_obj);
7464 if (value == Py_None) {
7465 object->name = NULL;
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);
7473 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7480 static PyGetSetDef py_lsa_RightAttribute_getsetters[] = {
7481 { discard_const_p(char, "name"), py_lsa_RightAttribute_get_name, py_lsa_RightAttribute_set_name },
7485 static PyObject *py_lsa_RightAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7487 return pytalloc_new(struct lsa_RightAttribute, type);
7491 static PyTypeObject lsa_RightAttribute_Type = {
7492 PyObject_HEAD_INIT(NULL) 0,
7493 .tp_name = "lsa.RightAttribute",
7494 .tp_getset = py_lsa_RightAttribute_getsetters,
7496 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7497 .tp_basicsize = sizeof(pytalloc_Object),
7498 .tp_new = py_lsa_RightAttribute_new,
7502 static PyObject *py_lsa_RightSet_get_count(PyObject *obj, void *closure)
7504 struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(obj);
7506 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
7510 static int py_lsa_RightSet_set_count(PyObject *py_obj, PyObject *value, void *closure)
7512 struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(py_obj);
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) {
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);
7526 object->count = test_var;
7527 } else if (PyInt_Check(value)) {
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);
7535 object->count = test_var;
7537 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7538 PyInt_Type.tp_name, PyLong_Type.tp_name);
7545 static PyObject *py_lsa_RightSet_get_names(PyObject *obj, void *closure)
7547 struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(obj);
7549 if (object->names == NULL) {
7551 Py_INCREF(py_names);
7553 py_names = PyList_New(object->count);
7554 if (py_names == NULL) {
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);
7569 static int py_lsa_RightSet_set_names(PyObject *py_obj, PyObject *value, void *closure)
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;
7576 object->names = NULL;
7577 PY_CHECK_TYPE(&PyList_Type, value, return -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) {
7589 object->names[names_cntr_1] = *(struct lsa_StringLarge *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
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 },
7602 static PyObject *py_lsa_RightSet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7604 return pytalloc_new(struct lsa_RightSet, type);
7608 static PyTypeObject lsa_RightSet_Type = {
7609 PyObject_HEAD_INIT(NULL) 0,
7610 .tp_name = "lsa.RightSet",
7611 .tp_getset = py_lsa_RightSet_getsetters,
7613 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7614 .tp_basicsize = sizeof(pytalloc_Object),
7615 .tp_new = py_lsa_RightSet_new,
7619 static PyObject *py_lsa_DomainListEx_get_count(PyObject *obj, void *closure)
7621 struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(obj);
7623 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
7627 static int py_lsa_DomainListEx_set_count(PyObject *py_obj, PyObject *value, void *closure)
7629 struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(py_obj);
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) {
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);
7643 object->count = test_var;
7644 } else if (PyInt_Check(value)) {
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);
7652 object->count = test_var;
7654 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7655 PyInt_Type.tp_name, PyLong_Type.tp_name);
7662 static PyObject *py_lsa_DomainListEx_get_domains(PyObject *obj, void *closure)
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);
7670 py_domains = PyList_New(object->count);
7671 if (py_domains == NULL) {
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);
7686 static int py_lsa_DomainListEx_set_domains(PyObject *py_obj, PyObject *value, void *closure)
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;
7693 object->domains = NULL;
7694 PY_CHECK_TYPE(&PyList_Type, value, return -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) {
7706 object->domains[domains_cntr_1] = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
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 },
7719 static PyObject *py_lsa_DomainListEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7721 return pytalloc_new(struct lsa_DomainListEx, type);
7725 static PyTypeObject lsa_DomainListEx_Type = {
7726 PyObject_HEAD_INIT(NULL) 0,
7727 .tp_name = "lsa.DomainListEx",
7728 .tp_getset = py_lsa_DomainListEx_getsetters,
7730 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7731 .tp_basicsize = sizeof(pytalloc_Object),
7732 .tp_new = py_lsa_DomainListEx_new,
7736 static PyObject *py_lsa_DomainInfoKerberos_get_authentication_options(PyObject *obj, void *closure)
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;
7744 static int py_lsa_DomainInfoKerberos_set_authentication_options(PyObject *py_obj, PyObject *value, void *closure)
7746 struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
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) {
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);
7760 object->authentication_options = test_var;
7761 } else if (PyInt_Check(value)) {
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);
7769 object->authentication_options = test_var;
7771 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7772 PyInt_Type.tp_name, PyLong_Type.tp_name);
7779 static PyObject *py_lsa_DomainInfoKerberos_get_service_tkt_lifetime(PyObject *obj, void *closure)
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;
7787 static int py_lsa_DomainInfoKerberos_set_service_tkt_lifetime(PyObject *py_obj, PyObject *value, void *closure)
7789 struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
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) {
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);
7803 object->service_tkt_lifetime = test_var;
7804 } else if (PyInt_Check(value)) {
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);
7812 object->service_tkt_lifetime = test_var;
7814 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7815 PyInt_Type.tp_name, PyLong_Type.tp_name);
7822 static PyObject *py_lsa_DomainInfoKerberos_get_user_tkt_lifetime(PyObject *obj, void *closure)
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;
7830 static int py_lsa_DomainInfoKerberos_set_user_tkt_lifetime(PyObject *py_obj, PyObject *value, void *closure)
7832 struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
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) {
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);
7846 object->user_tkt_lifetime = test_var;
7847 } else if (PyInt_Check(value)) {
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);
7855 object->user_tkt_lifetime = test_var;
7857 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7858 PyInt_Type.tp_name, PyLong_Type.tp_name);
7865 static PyObject *py_lsa_DomainInfoKerberos_get_user_tkt_renewaltime(PyObject *obj, void *closure)
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;
7873 static int py_lsa_DomainInfoKerberos_set_user_tkt_renewaltime(PyObject *py_obj, PyObject *value, void *closure)
7875 struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
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) {
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);
7889 object->user_tkt_renewaltime = test_var;
7890 } else if (PyInt_Check(value)) {
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);
7898 object->user_tkt_renewaltime = test_var;
7900 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7901 PyInt_Type.tp_name, PyLong_Type.tp_name);
7908 static PyObject *py_lsa_DomainInfoKerberos_get_clock_skew(PyObject *obj, void *closure)
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;
7916 static int py_lsa_DomainInfoKerberos_set_clock_skew(PyObject *py_obj, PyObject *value, void *closure)
7918 struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
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) {
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);
7932 object->clock_skew = test_var;
7933 } else if (PyInt_Check(value)) {
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);
7941 object->clock_skew = test_var;
7943 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7944 PyInt_Type.tp_name, PyLong_Type.tp_name);
7951 static PyObject *py_lsa_DomainInfoKerberos_get_reserved(PyObject *obj, void *closure)
7953 struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
7954 PyObject *py_reserved;
7955 py_reserved = ndr_PyLong_FromUnsignedLongLong(object->reserved);
7959 static int py_lsa_DomainInfoKerberos_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
7961 struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
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) {
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);
7975 object->reserved = test_var;
7976 } else if (PyInt_Check(value)) {
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);
7984 object->reserved = test_var;
7986 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7987 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
8004 static PyObject *py_lsa_DomainInfoKerberos_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8006 return pytalloc_new(struct lsa_DomainInfoKerberos, type);
8010 static PyTypeObject lsa_DomainInfoKerberos_Type = {
8011 PyObject_HEAD_INIT(NULL) 0,
8012 .tp_name = "lsa.DomainInfoKerberos",
8013 .tp_getset = py_lsa_DomainInfoKerberos_getsetters,
8015 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8016 .tp_basicsize = sizeof(pytalloc_Object),
8017 .tp_new = py_lsa_DomainInfoKerberos_new,
8021 static PyObject *py_lsa_DomainInfoEfs_get_blob_size(PyObject *obj, void *closure)
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;
8029 static int py_lsa_DomainInfoEfs_set_blob_size(PyObject *py_obj, PyObject *value, void *closure)
8031 struct lsa_DomainInfoEfs *object = (struct lsa_DomainInfoEfs *)pytalloc_get_ptr(py_obj);
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) {
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);
8045 object->blob_size = test_var;
8046 } else if (PyInt_Check(value)) {
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);
8054 object->blob_size = test_var;
8056 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8057 PyInt_Type.tp_name, PyLong_Type.tp_name);
8064 static PyObject *py_lsa_DomainInfoEfs_get_efs_blob(PyObject *obj, void *closure)
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);
8072 py_efs_blob = PyList_New(object->blob_size);
8073 if (py_efs_blob == NULL) {
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);
8088 static int py_lsa_DomainInfoEfs_set_efs_blob(PyObject *py_obj, PyObject *value, void *closure)
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;
8095 object->efs_blob = NULL;
8096 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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++) {
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) {
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);
8116 object->efs_blob[efs_blob_cntr_1] = test_var;
8117 } else if (PyInt_Check(PyList_GET_ITEM(value, efs_blob_cntr_1))) {
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);
8125 object->efs_blob[efs_blob_cntr_1] = test_var;
8127 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8128 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
8144 static PyObject *py_lsa_DomainInfoEfs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8146 return pytalloc_new(struct lsa_DomainInfoEfs, type);
8150 static PyTypeObject lsa_DomainInfoEfs_Type = {
8151 PyObject_HEAD_INIT(NULL) 0,
8152 .tp_name = "lsa.DomainInfoEfs",
8153 .tp_getset = py_lsa_DomainInfoEfs_getsetters,
8155 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8156 .tp_basicsize = sizeof(pytalloc_Object),
8157 .tp_new = py_lsa_DomainInfoEfs_new,
8160 PyObject *py_import_lsa_DomainInformationPolicy(TALLOC_CTX *mem_ctx, int level, union lsa_DomainInformationPolicy *in)
8165 case LSA_DOMAIN_INFO_POLICY_EFS:
8166 ret = pytalloc_reference_ex(&lsa_DomainInfoEfs_Type, mem_ctx, &in->efs_info);
8169 case LSA_DOMAIN_INFO_POLICY_KERBEROS:
8170 ret = pytalloc_reference_ex(&lsa_DomainInfoKerberos_Type, mem_ctx, &in->kerberos_info);
8174 PyErr_SetString(PyExc_TypeError, "unknown union level");
8178 union lsa_DomainInformationPolicy *py_export_lsa_DomainInformationPolicy(TALLOC_CTX *mem_ctx, int level, PyObject *in)
8180 union lsa_DomainInformationPolicy *ret = talloc_zero(mem_ctx, union lsa_DomainInformationPolicy);
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) {
8186 talloc_free(ret); return NULL;
8188 ret->efs_info = *(struct lsa_DomainInfoEfs *)pytalloc_get_ptr(in);
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) {
8195 talloc_free(ret); return NULL;
8197 ret->kerberos_info = *(struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(in);
8201 PyErr_SetString(PyExc_TypeError, "invalid union level value");
8210 static PyObject *py_lsa_TranslatedName2_get_sid_type(PyObject *obj, void *closure)
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);
8218 static int py_lsa_TranslatedName2_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
8220 struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
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) {
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);
8234 object->sid_type = test_var;
8235 } else if (PyInt_Check(value)) {
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);
8243 object->sid_type = test_var;
8245 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8246 PyInt_Type.tp_name, PyLong_Type.tp_name);
8253 static PyObject *py_lsa_TranslatedName2_get_name(PyObject *obj, void *closure)
8255 struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(obj);
8257 py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
8261 static int py_lsa_TranslatedName2_set_name(PyObject *py_obj, PyObject *value, void *closure)
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) {
8269 object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
8273 static PyObject *py_lsa_TranslatedName2_get_sid_index(PyObject *obj, void *closure)
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;
8281 static int py_lsa_TranslatedName2_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
8283 struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
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) {
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);
8297 object->sid_index = test_var;
8298 } else if (PyInt_Check(value)) {
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);
8306 object->sid_index = test_var;
8308 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8309 PyInt_Type.tp_name, PyLong_Type.tp_name);
8316 static PyObject *py_lsa_TranslatedName2_get_unknown(PyObject *obj, void *closure)
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);
8324 static int py_lsa_TranslatedName2_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
8326 struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
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) {
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);
8340 object->unknown = test_var;
8341 } else if (PyInt_Check(value)) {
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);
8349 object->unknown = test_var;
8351 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8352 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
8367 static PyObject *py_lsa_TranslatedName2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8369 return pytalloc_new(struct lsa_TranslatedName2, type);
8373 static PyTypeObject lsa_TranslatedName2_Type = {
8374 PyObject_HEAD_INIT(NULL) 0,
8375 .tp_name = "lsa.TranslatedName2",
8376 .tp_getset = py_lsa_TranslatedName2_getsetters,
8378 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8379 .tp_basicsize = sizeof(pytalloc_Object),
8380 .tp_new = py_lsa_TranslatedName2_new,
8384 static PyObject *py_lsa_TransNameArray2_get_count(PyObject *obj, void *closure)
8386 struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(obj);
8388 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
8392 static int py_lsa_TransNameArray2_set_count(PyObject *py_obj, PyObject *value, void *closure)
8394 struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_obj);
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) {
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);
8408 object->count = test_var;
8409 } else if (PyInt_Check(value)) {
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);
8417 object->count = test_var;
8419 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8420 PyInt_Type.tp_name, PyLong_Type.tp_name);
8427 static PyObject *py_lsa_TransNameArray2_get_names(PyObject *obj, void *closure)
8429 struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(obj);
8431 if (object->names == NULL) {
8433 Py_INCREF(py_names);
8435 py_names = PyList_New(object->count);
8436 if (py_names == NULL) {
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);
8451 static int py_lsa_TransNameArray2_set_names(PyObject *py_obj, PyObject *value, void *closure)
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;
8458 object->names = NULL;
8459 PY_CHECK_TYPE(&PyList_Type, value, return -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) {
8471 object->names[names_cntr_1] = *(struct lsa_TranslatedName2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
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 },
8484 static PyObject *py_lsa_TransNameArray2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8486 return pytalloc_new(struct lsa_TransNameArray2, type);
8490 static PyTypeObject lsa_TransNameArray2_Type = {
8491 PyObject_HEAD_INIT(NULL) 0,
8492 .tp_name = "lsa.TransNameArray2",
8493 .tp_getset = py_lsa_TransNameArray2_getsetters,
8495 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8496 .tp_basicsize = sizeof(pytalloc_Object),
8497 .tp_new = py_lsa_TransNameArray2_new,
8501 static PyObject *py_lsa_TranslatedSid2_get_sid_type(PyObject *obj, void *closure)
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);
8509 static int py_lsa_TranslatedSid2_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
8511 struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
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) {
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);
8525 object->sid_type = test_var;
8526 } else if (PyInt_Check(value)) {
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);
8534 object->sid_type = test_var;
8536 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8537 PyInt_Type.tp_name, PyLong_Type.tp_name);
8544 static PyObject *py_lsa_TranslatedSid2_get_rid(PyObject *obj, void *closure)
8546 struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(obj);
8548 py_rid = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->rid);
8552 static int py_lsa_TranslatedSid2_set_rid(PyObject *py_obj, PyObject *value, void *closure)
8554 struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
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) {
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);
8568 object->rid = test_var;
8569 } else if (PyInt_Check(value)) {
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);
8577 object->rid = test_var;
8579 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8580 PyInt_Type.tp_name, PyLong_Type.tp_name);
8587 static PyObject *py_lsa_TranslatedSid2_get_sid_index(PyObject *obj, void *closure)
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;
8595 static int py_lsa_TranslatedSid2_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
8597 struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
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) {
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);
8611 object->sid_index = test_var;
8612 } else if (PyInt_Check(value)) {
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);
8620 object->sid_index = test_var;
8622 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8623 PyInt_Type.tp_name, PyLong_Type.tp_name);
8630 static PyObject *py_lsa_TranslatedSid2_get_unknown(PyObject *obj, void *closure)
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);
8638 static int py_lsa_TranslatedSid2_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
8640 struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
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) {
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);
8654 object->unknown = test_var;
8655 } else if (PyInt_Check(value)) {
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);
8663 object->unknown = test_var;
8665 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8666 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
8681 static PyObject *py_lsa_TranslatedSid2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8683 return pytalloc_new(struct lsa_TranslatedSid2, type);
8687 static PyTypeObject lsa_TranslatedSid2_Type = {
8688 PyObject_HEAD_INIT(NULL) 0,
8689 .tp_name = "lsa.TranslatedSid2",
8690 .tp_getset = py_lsa_TranslatedSid2_getsetters,
8692 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8693 .tp_basicsize = sizeof(pytalloc_Object),
8694 .tp_new = py_lsa_TranslatedSid2_new,
8698 static PyObject *py_lsa_TransSidArray2_get_count(PyObject *obj, void *closure)
8700 struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(obj);
8702 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
8706 static int py_lsa_TransSidArray2_set_count(PyObject *py_obj, PyObject *value, void *closure)
8708 struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(py_obj);
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) {
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);
8722 object->count = test_var;
8723 } else if (PyInt_Check(value)) {
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);
8731 object->count = test_var;
8733 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8734 PyInt_Type.tp_name, PyLong_Type.tp_name);
8741 static PyObject *py_lsa_TransSidArray2_get_sids(PyObject *obj, void *closure)
8743 struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(obj);
8745 if (object->sids == NULL) {
8749 py_sids = PyList_New(object->count);
8750 if (py_sids == NULL) {
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);
8765 static int py_lsa_TransSidArray2_set_sids(PyObject *py_obj, PyObject *value, void *closure)
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;
8772 object->sids = NULL;
8773 PY_CHECK_TYPE(&PyList_Type, value, return -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) {
8785 object->sids[sids_cntr_1] = *(struct lsa_TranslatedSid2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
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 },
8798 static PyObject *py_lsa_TransSidArray2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8800 return pytalloc_new(struct lsa_TransSidArray2, type);
8804 static PyTypeObject lsa_TransSidArray2_Type = {
8805 PyObject_HEAD_INIT(NULL) 0,
8806 .tp_name = "lsa.TransSidArray2",
8807 .tp_getset = py_lsa_TransSidArray2_getsetters,
8809 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8810 .tp_basicsize = sizeof(pytalloc_Object),
8811 .tp_new = py_lsa_TransSidArray2_new,
8815 static PyObject *py_lsa_TranslatedSid3_get_sid_type(PyObject *obj, void *closure)
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);
8823 static int py_lsa_TranslatedSid3_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
8825 struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
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) {
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);
8839 object->sid_type = test_var;
8840 } else if (PyInt_Check(value)) {
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);
8848 object->sid_type = test_var;
8850 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8851 PyInt_Type.tp_name, PyLong_Type.tp_name);
8858 static PyObject *py_lsa_TranslatedSid3_get_sid(PyObject *obj, void *closure)
8860 struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
8862 if (object->sid == NULL) {
8866 py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
8871 static int py_lsa_TranslatedSid3_set_sid(PyObject *py_obj, PyObject *value, void *closure)
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) {
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) {
8884 object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
8889 static PyObject *py_lsa_TranslatedSid3_get_sid_index(PyObject *obj, void *closure)
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;
8897 static int py_lsa_TranslatedSid3_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
8899 struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
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) {
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);
8913 object->sid_index = test_var;
8914 } else if (PyInt_Check(value)) {
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);
8922 object->sid_index = test_var;
8924 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8925 PyInt_Type.tp_name, PyLong_Type.tp_name);
8932 static PyObject *py_lsa_TranslatedSid3_get_flags(PyObject *obj, void *closure)
8934 struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
8936 py_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->flags);
8940 static int py_lsa_TranslatedSid3_set_flags(PyObject *py_obj, PyObject *value, void *closure)
8942 struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
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) {
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);
8956 object->flags = test_var;
8957 } else if (PyInt_Check(value)) {
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);
8965 object->flags = test_var;
8967 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8968 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
8983 static PyObject *py_lsa_TranslatedSid3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8985 return pytalloc_new(struct lsa_TranslatedSid3, type);
8989 static PyTypeObject lsa_TranslatedSid3_Type = {
8990 PyObject_HEAD_INIT(NULL) 0,
8991 .tp_name = "lsa.TranslatedSid3",
8992 .tp_getset = py_lsa_TranslatedSid3_getsetters,
8994 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8995 .tp_basicsize = sizeof(pytalloc_Object),
8996 .tp_new = py_lsa_TranslatedSid3_new,
9000 static PyObject *py_lsa_TransSidArray3_get_count(PyObject *obj, void *closure)
9002 struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(obj);
9004 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
9008 static int py_lsa_TransSidArray3_set_count(PyObject *py_obj, PyObject *value, void *closure)
9010 struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_obj);
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) {
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);
9024 object->count = test_var;
9025 } else if (PyInt_Check(value)) {
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);
9033 object->count = test_var;
9035 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9036 PyInt_Type.tp_name, PyLong_Type.tp_name);
9043 static PyObject *py_lsa_TransSidArray3_get_sids(PyObject *obj, void *closure)
9045 struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(obj);
9047 if (object->sids == NULL) {
9051 py_sids = PyList_New(object->count);
9052 if (py_sids == NULL) {
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);
9067 static int py_lsa_TransSidArray3_set_sids(PyObject *py_obj, PyObject *value, void *closure)
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;
9074 object->sids = NULL;
9075 PY_CHECK_TYPE(&PyList_Type, value, return -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) {
9087 object->sids[sids_cntr_1] = *(struct lsa_TranslatedSid3 *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
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 },
9100 static PyObject *py_lsa_TransSidArray3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9102 return pytalloc_new(struct lsa_TransSidArray3, type);
9106 static PyTypeObject lsa_TransSidArray3_Type = {
9107 PyObject_HEAD_INIT(NULL) 0,
9108 .tp_name = "lsa.TransSidArray3",
9109 .tp_getset = py_lsa_TransSidArray3_getsetters,
9111 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9112 .tp_basicsize = sizeof(pytalloc_Object),
9113 .tp_new = py_lsa_TransSidArray3_new,
9117 static PyObject *py_lsa_ForestTrustBinaryData_get_length(PyObject *obj, void *closure)
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);
9125 static int py_lsa_ForestTrustBinaryData_set_length(PyObject *py_obj, PyObject *value, void *closure)
9127 struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(py_obj);
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) {
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);
9141 object->length = test_var;
9142 } else if (PyInt_Check(value)) {
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);
9150 object->length = test_var;
9152 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9153 PyInt_Type.tp_name, PyLong_Type.tp_name);
9160 static PyObject *py_lsa_ForestTrustBinaryData_get_data(PyObject *obj, void *closure)
9162 struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(obj);
9164 if (object->data == NULL) {
9168 py_data = PyList_New(object->length);
9169 if (py_data == NULL) {
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);
9184 static int py_lsa_ForestTrustBinaryData_set_data(PyObject *py_obj, PyObject *value, void *closure)
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;
9191 object->data = NULL;
9192 PY_CHECK_TYPE(&PyList_Type, value, return -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++) {
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) {
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);
9212 object->data[data_cntr_1] = test_var;
9213 } else if (PyInt_Check(PyList_GET_ITEM(value, data_cntr_1))) {
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);
9221 object->data[data_cntr_1] = test_var;
9223 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9224 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
9240 static PyObject *py_lsa_ForestTrustBinaryData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9242 return pytalloc_new(struct lsa_ForestTrustBinaryData, type);
9246 static PyTypeObject lsa_ForestTrustBinaryData_Type = {
9247 PyObject_HEAD_INIT(NULL) 0,
9248 .tp_name = "lsa.ForestTrustBinaryData",
9249 .tp_getset = py_lsa_ForestTrustBinaryData_getsetters,
9251 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9252 .tp_basicsize = sizeof(pytalloc_Object),
9253 .tp_new = py_lsa_ForestTrustBinaryData_new,
9257 static PyObject *py_lsa_ForestTrustDomainInfo_get_domain_sid(PyObject *obj, void *closure)
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);
9265 py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->domain_sid, object->domain_sid);
9267 return py_domain_sid;
9270 static int py_lsa_ForestTrustDomainInfo_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
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;
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) {
9283 object->domain_sid = (struct dom_sid *)pytalloc_get_ptr(value);
9288 static PyObject *py_lsa_ForestTrustDomainInfo_get_dns_domain_name(PyObject *obj, void *closure)
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;
9296 static int py_lsa_ForestTrustDomainInfo_set_dns_domain_name(PyObject *py_obj, PyObject *value, void *closure)
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) {
9304 object->dns_domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
9308 static PyObject *py_lsa_ForestTrustDomainInfo_get_netbios_domain_name(PyObject *obj, void *closure)
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;
9316 static int py_lsa_ForestTrustDomainInfo_set_netbios_domain_name(PyObject *py_obj, PyObject *value, void *closure)
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) {
9324 object->netbios_domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
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 },
9335 static PyObject *py_lsa_ForestTrustDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9337 return pytalloc_new(struct lsa_ForestTrustDomainInfo, type);
9341 static PyTypeObject lsa_ForestTrustDomainInfo_Type = {
9342 PyObject_HEAD_INIT(NULL) 0,
9343 .tp_name = "lsa.ForestTrustDomainInfo",
9344 .tp_getset = py_lsa_ForestTrustDomainInfo_getsetters,
9346 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9347 .tp_basicsize = sizeof(pytalloc_Object),
9348 .tp_new = py_lsa_ForestTrustDomainInfo_new,
9351 PyObject *py_import_lsa_ForestTrustData(TALLOC_CTX *mem_ctx, int level, union lsa_ForestTrustData *in)
9356 case LSA_FOREST_TRUST_TOP_LEVEL_NAME:
9357 ret = pytalloc_reference_ex(&lsa_StringLarge_Type, mem_ctx, &in->top_level_name);
9360 case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX:
9361 ret = pytalloc_reference_ex(&lsa_StringLarge_Type, mem_ctx, &in->top_level_name_ex);
9364 case LSA_FOREST_TRUST_DOMAIN_INFO:
9365 ret = pytalloc_reference_ex(&lsa_ForestTrustDomainInfo_Type, mem_ctx, &in->domain_info);
9369 ret = pytalloc_reference_ex(&lsa_ForestTrustBinaryData_Type, mem_ctx, &in->data);
9373 PyErr_SetString(PyExc_TypeError, "unknown union level");
9377 union lsa_ForestTrustData *py_export_lsa_ForestTrustData(TALLOC_CTX *mem_ctx, int level, PyObject *in)
9379 union lsa_ForestTrustData *ret = talloc_zero(mem_ctx, union lsa_ForestTrustData);
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) {
9385 talloc_free(ret); return NULL;
9387 ret->top_level_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(in);
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) {
9394 talloc_free(ret); return NULL;
9396 ret->top_level_name_ex = *(struct lsa_StringLarge *)pytalloc_get_ptr(in);
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) {
9403 talloc_free(ret); return NULL;
9405 ret->domain_info = *(struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(in);
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) {
9412 talloc_free(ret); return NULL;
9414 ret->data = *(struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(in);
9423 static PyObject *py_lsa_ForestTrustRecord_get_flags(PyObject *obj, void *closure)
9425 struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
9427 py_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->flags);
9431 static int py_lsa_ForestTrustRecord_set_flags(PyObject *py_obj, PyObject *value, void *closure)
9433 struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
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) {
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);
9447 object->flags = test_var;
9448 } else if (PyInt_Check(value)) {
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);
9456 object->flags = test_var;
9458 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9459 PyInt_Type.tp_name, PyLong_Type.tp_name);
9466 static PyObject *py_lsa_ForestTrustRecord_get_type(PyObject *obj, void *closure)
9468 struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
9470 py_type = PyInt_FromLong((uint16_t)object->type);
9474 static int py_lsa_ForestTrustRecord_set_type(PyObject *py_obj, PyObject *value, void *closure)
9476 struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
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) {
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);
9490 object->type = test_var;
9491 } else if (PyInt_Check(value)) {
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);
9499 object->type = test_var;
9501 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9502 PyInt_Type.tp_name, PyLong_Type.tp_name);
9509 static PyObject *py_lsa_ForestTrustRecord_get_time(PyObject *obj, void *closure)
9511 struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
9513 py_time = ndr_PyLong_FromUnsignedLongLong(object->time);
9517 static int py_lsa_ForestTrustRecord_set_time(PyObject *py_obj, PyObject *value, void *closure)
9519 struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
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) {
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);
9533 object->time = test_var;
9534 } else if (PyInt_Check(value)) {
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);
9542 object->time = test_var;
9544 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9545 PyInt_Type.tp_name, PyLong_Type.tp_name);
9552 static PyObject *py_lsa_ForestTrustRecord_get_forest_trust_data(PyObject *obj, void *closure)
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) {
9560 return py_forest_trust_data;
9563 static int py_lsa_ForestTrustRecord_set_forest_trust_data(PyObject *py_obj, PyObject *value, void *closure)
9565 struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
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) {
9572 object->forest_trust_data = *forest_trust_data_switch_0;
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 },
9585 static PyObject *py_lsa_ForestTrustRecord_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9587 return pytalloc_new(struct lsa_ForestTrustRecord, type);
9591 static PyTypeObject lsa_ForestTrustRecord_Type = {
9592 PyObject_HEAD_INIT(NULL) 0,
9593 .tp_name = "lsa.ForestTrustRecord",
9594 .tp_getset = py_lsa_ForestTrustRecord_getsetters,
9596 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9597 .tp_basicsize = sizeof(pytalloc_Object),
9598 .tp_new = py_lsa_ForestTrustRecord_new,
9602 static PyObject *py_lsa_ForestTrustInformation_get_count(PyObject *obj, void *closure)
9604 struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(obj);
9606 py_count = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->count);
9610 static int py_lsa_ForestTrustInformation_set_count(PyObject *py_obj, PyObject *value, void *closure)
9612 struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
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) {
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);
9626 object->count = test_var;
9627 } else if (PyInt_Check(value)) {
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);
9635 object->count = test_var;
9637 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9638 PyInt_Type.tp_name, PyLong_Type.tp_name);
9645 static PyObject *py_lsa_ForestTrustInformation_get_entries(PyObject *obj, void *closure)
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);
9653 py_entries = PyList_New(object->count);
9654 if (py_entries == NULL) {
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);
9665 py_entries_1 = pytalloc_reference_ex(&lsa_ForestTrustRecord_Type, object->entries[entries_cntr_1], object->entries[entries_cntr_1]);
9667 PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
9674 static int py_lsa_ForestTrustInformation_set_entries(PyObject *py_obj, PyObject *value, void *closure)
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;
9681 object->entries = NULL;
9682 PY_CHECK_TYPE(&PyList_Type, value, return -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;
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) {
9698 object->entries[entries_cntr_1] = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
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 },
9712 static PyObject *py_lsa_ForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9714 return pytalloc_new(struct lsa_ForestTrustInformation, type);
9717 static PyObject *py_lsa_ForestTrustInformation_ndr_pack(PyObject *py_obj)
9719 struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
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);
9728 return PyString_FromStringAndSize((char *)blob.data, blob.length);
9731 static PyObject *py_lsa_ForestTrustInformation_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9733 struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
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;
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)) {
9747 blob.length = blob_length;
9749 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9750 allow_remaining = true;
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);
9756 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustInformation);
9758 if (err != NDR_ERR_SUCCESS) {
9759 PyErr_SetNdrError(err);
9766 static PyObject *py_lsa_ForestTrustInformation_ndr_print(PyObject *py_obj)
9768 struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
9798 static PyObject *py_lsa_ForestTrustCollisionRecord_get_index(PyObject *obj, void *closure)
9800 struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
9802 py_index = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->index);
9806 static int py_lsa_ForestTrustCollisionRecord_set_index(PyObject *py_obj, PyObject *value, void *closure)
9808 struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
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) {
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);
9822 object->index = test_var;
9823 } else if (PyInt_Check(value)) {
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);
9831 object->index = test_var;
9833 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9834 PyInt_Type.tp_name, PyLong_Type.tp_name);
9841 static PyObject *py_lsa_ForestTrustCollisionRecord_get_type(PyObject *obj, void *closure)
9843 struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
9845 py_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->type);
9849 static int py_lsa_ForestTrustCollisionRecord_set_type(PyObject *py_obj, PyObject *value, void *closure)
9851 struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
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) {
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);
9865 object->type = test_var;
9866 } else if (PyInt_Check(value)) {
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);
9874 object->type = test_var;
9876 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9877 PyInt_Type.tp_name, PyLong_Type.tp_name);
9884 static PyObject *py_lsa_ForestTrustCollisionRecord_get_flags(PyObject *obj, void *closure)
9886 struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
9888 py_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->flags);
9892 static int py_lsa_ForestTrustCollisionRecord_set_flags(PyObject *py_obj, PyObject *value, void *closure)
9894 struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
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) {
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);
9908 object->flags = test_var;
9909 } else if (PyInt_Check(value)) {
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);
9917 object->flags = test_var;
9919 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9920 PyInt_Type.tp_name, PyLong_Type.tp_name);
9927 static PyObject *py_lsa_ForestTrustCollisionRecord_get_name(PyObject *obj, void *closure)
9929 struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
9931 py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
9935 static int py_lsa_ForestTrustCollisionRecord_set_name(PyObject *py_obj, PyObject *value, void *closure)
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) {
9943 object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
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 },
9955 static PyObject *py_lsa_ForestTrustCollisionRecord_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9957 return pytalloc_new(struct lsa_ForestTrustCollisionRecord, type);
9960 static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_pack(PyObject *py_obj)
9962 struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
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);
9971 return PyString_FromStringAndSize((char *)blob.data, blob.length);
9974 static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9976 struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
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;
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)) {
9990 blob.length = blob_length;
9992 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9993 allow_remaining = true;
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);
9999 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionRecord);
10001 if (err != NDR_ERR_SUCCESS) {
10002 PyErr_SetNdrError(err);
10009 static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_print(PyObject *py_obj)
10011 struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
10041 static PyObject *py_lsa_ForestTrustCollisionInfo_get_count(PyObject *obj, void *closure)
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);
10049 static int py_lsa_ForestTrustCollisionInfo_set_count(PyObject *py_obj, PyObject *value, void *closure)
10051 struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
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) {
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);
10065 object->count = test_var;
10066 } else if (PyInt_Check(value)) {
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);
10074 object->count = test_var;
10076 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10077 PyInt_Type.tp_name, PyLong_Type.tp_name);
10084 static PyObject *py_lsa_ForestTrustCollisionInfo_get_entries(PyObject *obj, void *closure)
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);
10092 py_entries = PyList_New(object->count);
10093 if (py_entries == NULL) {
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);
10104 py_entries_1 = pytalloc_reference_ex(&lsa_ForestTrustCollisionRecord_Type, object->entries[entries_cntr_1], object->entries[entries_cntr_1]);
10106 PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
10113 static int py_lsa_ForestTrustCollisionInfo_set_entries(PyObject *py_obj, PyObject *value, void *closure)
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;
10120 object->entries = NULL;
10121 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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;
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) {
10137 object->entries[entries_cntr_1] = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
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 },
10151 static PyObject *py_lsa_ForestTrustCollisionInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10153 return pytalloc_new(struct lsa_ForestTrustCollisionInfo, type);
10156 static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_pack(PyObject *py_obj)
10158 struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
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);
10167 return PyString_FromStringAndSize((char *)blob.data, blob.length);
10170 static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10172 struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
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;
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)) {
10186 blob.length = blob_length;
10188 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10189 allow_remaining = true;
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);
10195 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionInfo);
10197 if (err != NDR_ERR_SUCCESS) {
10198 PyErr_SetNdrError(err);
10205 static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_print(PyObject *py_obj)
10207 struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
10237 static bool pack_py_lsa_Close_args_in(PyObject *args, PyObject *kwargs, struct lsa_Close *r)
10239 PyObject *py_handle;
10240 const char *kwnames[] = {
10244 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_Close", discard_const_p(char *, kwnames), &py_handle)) {
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) {
10254 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10258 static PyObject *unpack_py_lsa_Close_args_out(struct lsa_Close *r)
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);
10272 static bool pack_py_lsa_Delete_args_in(PyObject *args, PyObject *kwargs, struct lsa_Delete *r)
10274 PyObject *py_handle;
10275 const char *kwnames[] = {
10279 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_Delete", discard_const_p(char *, kwnames), &py_handle)) {
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) {
10289 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10293 static PyObject *unpack_py_lsa_Delete_args_out(struct lsa_Delete *r)
10298 if (NT_STATUS_IS_ERR(r->out.result)) {
10299 PyErr_SetNTSTATUS(r->out.result);
10306 static bool pack_py_lsa_EnumPrivs_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumPrivs *r)
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
10315 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumPrivs", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_count)) {
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) {
10325 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10326 r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
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) {
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);
10340 *r->in.resume_handle = test_var;
10341 } else if (PyInt_Check(py_resume_handle)) {
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);
10349 *r->in.resume_handle = test_var;
10351 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10352 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
10369 r->in.max_count = test_var;
10370 } else if (PyInt_Check(py_max_count)) {
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);
10378 r->in.max_count = test_var;
10380 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10381 PyInt_Type.tp_name, PyLong_Type.tp_name);
10388 static PyObject *unpack_py_lsa_EnumPrivs_args_out(struct lsa_EnumPrivs *r)
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);
10406 static bool pack_py_lsa_QuerySecurity_args_in(PyObject *args, PyObject *kwargs, struct lsa_QuerySecurity *r)
10408 PyObject *py_handle;
10409 PyObject *py_sec_info;
10410 const char *kwnames[] = {
10411 "handle", "sec_info", NULL
10414 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QuerySecurity", discard_const_p(char *, kwnames), &py_handle, &py_sec_info)) {
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) {
10424 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
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) {
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);
10438 r->in.sec_info = test_var;
10439 } else if (PyInt_Check(py_sec_info)) {
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);
10447 r->in.sec_info = test_var;
10449 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10450 PyInt_Type.tp_name, PyLong_Type.tp_name);
10457 static PyObject *unpack_py_lsa_QuerySecurity_args_out(struct lsa_QuerySecurity *r)
10460 PyObject *py_sdbuf;
10461 if (*r->out.sdbuf == NULL) {
10462 py_sdbuf = Py_None;
10463 Py_INCREF(py_sdbuf);
10465 py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *r->out.sdbuf, *r->out.sdbuf);
10468 if (NT_STATUS_IS_ERR(r->out.result)) {
10469 PyErr_SetNTSTATUS(r->out.result);
10476 static bool pack_py_lsa_SetSecObj_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSecObj *r)
10478 PyObject *py_handle;
10479 PyObject *py_sec_info;
10480 PyObject *py_sdbuf;
10481 const char *kwnames[] = {
10482 "handle", "sec_info", "sdbuf", NULL
10485 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetSecObj", discard_const_p(char *, kwnames), &py_handle, &py_sec_info, &py_sdbuf)) {
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) {
10495 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
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) {
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);
10509 r->in.sec_info = test_var;
10510 } else if (PyInt_Check(py_sec_info)) {
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);
10518 r->in.sec_info = test_var;
10520 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10521 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
10531 r->in.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(py_sdbuf);
10535 static PyObject *unpack_py_lsa_SetSecObj_args_out(struct lsa_SetSecObj *r)
10540 if (NT_STATUS_IS_ERR(r->out.result)) {
10541 PyErr_SetNTSTATUS(r->out.result);
10548 static bool pack_py_lsa_OpenPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenPolicy *r)
10550 PyObject *py_system_name;
10552 PyObject *py_access_mask;
10553 const char *kwnames[] = {
10554 "system_name", "attr", "access_mask", NULL
10557 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenPolicy", discard_const_p(char *, kwnames), &py_system_name, &py_attr, &py_access_mask)) {
10561 if (py_system_name == Py_None) {
10562 r->in.system_name = NULL;
10564 r->in.system_name = talloc_ptrtype(r, r->in.system_name);
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) {
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);
10578 *r->in.system_name = test_var;
10579 } else if (PyInt_Check(py_system_name)) {
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);
10587 *r->in.system_name = test_var;
10589 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10590 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
10601 r->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_attr);
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) {
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);
10615 r->in.access_mask = test_var;
10616 } else if (PyInt_Check(py_access_mask)) {
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);
10624 r->in.access_mask = test_var;
10626 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10627 PyInt_Type.tp_name, PyLong_Type.tp_name);
10634 static PyObject *unpack_py_lsa_OpenPolicy_args_out(struct lsa_OpenPolicy *r)
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);
10648 static bool pack_py_lsa_QueryInfoPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryInfoPolicy *r)
10650 PyObject *py_handle;
10651 PyObject *py_level;
10652 const char *kwnames[] = {
10653 "handle", "level", NULL
10656 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryInfoPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
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) {
10666 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
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) {
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);
10680 r->in.level = test_var;
10681 } else if (PyInt_Check(py_level)) {
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);
10689 r->in.level = test_var;
10691 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10692 PyInt_Type.tp_name, PyLong_Type.tp_name);
10699 static PyObject *unpack_py_lsa_QueryInfoPolicy_args_out(struct lsa_QueryInfoPolicy *r)
10703 if (*r->out.info == NULL) {
10705 Py_INCREF(py_info);
10707 py_info = py_import_lsa_PolicyInformation(*r->out.info, r->in.level, *r->out.info);
10708 if (py_info == NULL) {
10713 if (NT_STATUS_IS_ERR(r->out.result)) {
10714 PyErr_SetNTSTATUS(r->out.result);
10721 static bool pack_py_lsa_SetInfoPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInfoPolicy *r)
10723 PyObject *py_handle;
10724 PyObject *py_level;
10726 const char *kwnames[] = {
10727 "handle", "level", "info", NULL
10730 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInfoPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
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) {
10740 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
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) {
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);
10754 r->in.level = test_var;
10755 } else if (PyInt_Check(py_level)) {
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);
10763 r->in.level = test_var;
10765 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10766 PyInt_Type.tp_name, PyLong_Type.tp_name);
10770 r->in.info = talloc_ptrtype(r, r->in.info);
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) {
10777 r->in.info = info_switch_1;
10782 static PyObject *unpack_py_lsa_SetInfoPolicy_args_out(struct lsa_SetInfoPolicy *r)
10787 if (NT_STATUS_IS_ERR(r->out.result)) {
10788 PyErr_SetNTSTATUS(r->out.result);
10795 static bool pack_py_lsa_CreateAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateAccount *r)
10797 PyObject *py_handle;
10799 PyObject *py_access_mask;
10800 const char *kwnames[] = {
10801 "handle", "sid", "access_mask", NULL
10804 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateAccount", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
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) {
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) {
10821 r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
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) {
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);
10835 r->in.access_mask = test_var;
10836 } else if (PyInt_Check(py_access_mask)) {
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);
10844 r->in.access_mask = test_var;
10846 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10847 PyInt_Type.tp_name, PyLong_Type.tp_name);
10854 static PyObject *unpack_py_lsa_CreateAccount_args_out(struct lsa_CreateAccount *r)
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);
10868 static bool pack_py_lsa_EnumAccounts_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccounts *r)
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
10877 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumAccounts", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_num_entries)) {
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) {
10887 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
10888 r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
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) {
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);
10902 *r->in.resume_handle = test_var;
10903 } else if (PyInt_Check(py_resume_handle)) {
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);
10911 *r->in.resume_handle = test_var;
10913 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10914 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
10931 r->in.num_entries = test_var;
10932 } else if (PyInt_Check(py_num_entries)) {
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);
10940 r->in.num_entries = test_var;
10942 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10943 PyInt_Type.tp_name, PyLong_Type.tp_name);
10950 static PyObject *unpack_py_lsa_EnumAccounts_args_out(struct lsa_EnumAccounts *r)
10953 PyObject *py_resume_handle;
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);
10968 static bool pack_py_lsa_CreateTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomain *r)
10970 PyObject *py_policy_handle;
10972 PyObject *py_access_mask;
10973 const char *kwnames[] = {
10974 "policy_handle", "info", "access_mask", NULL
10977 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateTrustedDomain", discard_const_p(char *, kwnames), &py_policy_handle, &py_info, &py_access_mask)) {
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) {
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) {
10994 r->in.info = (struct lsa_DomainInfo *)pytalloc_get_ptr(py_info);
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) {
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);
11008 r->in.access_mask = test_var;
11009 } else if (PyInt_Check(py_access_mask)) {
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);
11017 r->in.access_mask = test_var;
11019 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11020 PyInt_Type.tp_name, PyLong_Type.tp_name);
11027 static PyObject *unpack_py_lsa_CreateTrustedDomain_args_out(struct lsa_CreateTrustedDomain *r)
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);
11041 static bool pack_py_lsa_EnumTrustDom_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumTrustDom *r)
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
11050 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumTrustDom", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_size)) {
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) {
11060 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11061 r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
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) {
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);
11075 *r->in.resume_handle = test_var;
11076 } else if (PyInt_Check(py_resume_handle)) {
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);
11084 *r->in.resume_handle = test_var;
11086 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11087 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
11104 r->in.max_size = test_var;
11105 } else if (PyInt_Check(py_max_size)) {
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);
11113 r->in.max_size = test_var;
11115 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11116 PyInt_Type.tp_name, PyLong_Type.tp_name);
11123 static PyObject *unpack_py_lsa_EnumTrustDom_args_out(struct lsa_EnumTrustDom *r)
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);
11141 static bool pack_py_lsa_LookupNames_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames *r)
11143 PyObject *py_handle;
11144 PyObject *py_names;
11146 PyObject *py_level;
11147 PyObject *py_count;
11148 const char *kwnames[] = {
11149 "handle", "names", "sids", "level", "count", NULL
11152 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_LookupNames", discard_const_p(char *, kwnames), &py_handle, &py_names, &py_sids, &py_level, &py_count)) {
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) {
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;);
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) {
11177 r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
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) {
11186 r->in.sids = (struct lsa_TransSidArray *)pytalloc_get_ptr(py_sids);
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) {
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);
11200 r->in.level = test_var;
11201 } else if (PyInt_Check(py_level)) {
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);
11209 r->in.level = test_var;
11211 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11212 PyInt_Type.tp_name, PyLong_Type.tp_name);
11216 r->in.count = talloc_ptrtype(r, r->in.count);
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) {
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);
11230 *r->in.count = test_var;
11231 } else if (PyInt_Check(py_count)) {
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);
11239 *r->in.count = test_var;
11241 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11242 PyInt_Type.tp_name, PyLong_Type.tp_name);
11249 static PyObject *unpack_py_lsa_LookupNames_args_out(struct lsa_LookupNames *r)
11252 PyObject *py_domains;
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);
11260 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
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);
11275 static bool pack_py_lsa_LookupSids_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids *r)
11277 PyObject *py_handle;
11279 PyObject *py_names;
11280 PyObject *py_level;
11281 PyObject *py_count;
11282 const char *kwnames[] = {
11283 "handle", "sids", "names", "level", "count", NULL
11286 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_LookupSids", discard_const_p(char *, kwnames), &py_handle, &py_sids, &py_names, &py_level, &py_count)) {
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) {
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) {
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) {
11310 r->in.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_names);
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) {
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);
11324 r->in.level = test_var;
11325 } else if (PyInt_Check(py_level)) {
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);
11333 r->in.level = test_var;
11335 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11336 PyInt_Type.tp_name, PyLong_Type.tp_name);
11340 r->in.count = talloc_ptrtype(r, r->in.count);
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) {
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);
11354 *r->in.count = test_var;
11355 } else if (PyInt_Check(py_count)) {
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);
11363 *r->in.count = test_var;
11365 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11366 PyInt_Type.tp_name, PyLong_Type.tp_name);
11373 static PyObject *unpack_py_lsa_LookupSids_args_out(struct lsa_LookupSids *r)
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);
11384 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
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);
11399 static bool pack_py_lsa_CreateSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateSecret *r)
11401 PyObject *py_handle;
11403 PyObject *py_access_mask;
11404 const char *kwnames[] = {
11405 "handle", "name", "access_mask", NULL
11408 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateSecret", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
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) {
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) {
11424 r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
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) {
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);
11438 r->in.access_mask = test_var;
11439 } else if (PyInt_Check(py_access_mask)) {
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);
11447 r->in.access_mask = test_var;
11449 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11450 PyInt_Type.tp_name, PyLong_Type.tp_name);
11457 static PyObject *unpack_py_lsa_CreateSecret_args_out(struct lsa_CreateSecret *r)
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);
11471 static bool pack_py_lsa_OpenAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenAccount *r)
11473 PyObject *py_handle;
11475 PyObject *py_access_mask;
11476 const char *kwnames[] = {
11477 "handle", "sid", "access_mask", NULL
11480 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenAccount", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
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) {
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) {
11497 r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
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) {
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);
11511 r->in.access_mask = test_var;
11512 } else if (PyInt_Check(py_access_mask)) {
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);
11520 r->in.access_mask = test_var;
11522 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11523 PyInt_Type.tp_name, PyLong_Type.tp_name);
11530 static PyObject *unpack_py_lsa_OpenAccount_args_out(struct lsa_OpenAccount *r)
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);
11544 static bool pack_py_lsa_EnumPrivsAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumPrivsAccount *r)
11546 PyObject *py_handle;
11547 const char *kwnames[] = {
11551 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_EnumPrivsAccount", discard_const_p(char *, kwnames), &py_handle)) {
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) {
11561 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11565 static PyObject *unpack_py_lsa_EnumPrivsAccount_args_out(struct lsa_EnumPrivsAccount *r)
11568 PyObject *py_privs;
11569 if (*r->out.privs == NULL) {
11570 py_privs = Py_None;
11571 Py_INCREF(py_privs);
11573 py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, *r->out.privs, *r->out.privs);
11576 if (NT_STATUS_IS_ERR(r->out.result)) {
11577 PyErr_SetNTSTATUS(r->out.result);
11584 static bool pack_py_lsa_AddPrivilegesToAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_AddPrivilegesToAccount *r)
11586 PyObject *py_handle;
11587 PyObject *py_privs;
11588 const char *kwnames[] = {
11589 "handle", "privs", NULL
11592 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_AddPrivilegesToAccount", discard_const_p(char *, kwnames), &py_handle, &py_privs)) {
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) {
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) {
11609 r->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_privs);
11613 static PyObject *unpack_py_lsa_AddPrivilegesToAccount_args_out(struct lsa_AddPrivilegesToAccount *r)
11618 if (NT_STATUS_IS_ERR(r->out.result)) {
11619 PyErr_SetNTSTATUS(r->out.result);
11626 static bool pack_py_lsa_RemovePrivilegesFromAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_RemovePrivilegesFromAccount *r)
11628 PyObject *py_handle;
11629 PyObject *py_remove_all;
11630 PyObject *py_privs;
11631 const char *kwnames[] = {
11632 "handle", "remove_all", "privs", NULL
11635 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_RemovePrivilegesFromAccount", discard_const_p(char *, kwnames), &py_handle, &py_remove_all, &py_privs)) {
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) {
11645 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
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) {
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);
11659 r->in.remove_all = test_var;
11660 } else if (PyInt_Check(py_remove_all)) {
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);
11668 r->in.remove_all = test_var;
11670 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11671 PyInt_Type.tp_name, PyLong_Type.tp_name);
11675 if (py_privs == Py_None) {
11676 r->in.privs = NULL;
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) {
11684 r->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_privs);
11689 static PyObject *unpack_py_lsa_RemovePrivilegesFromAccount_args_out(struct lsa_RemovePrivilegesFromAccount *r)
11694 if (NT_STATUS_IS_ERR(r->out.result)) {
11695 PyErr_SetNTSTATUS(r->out.result);
11702 static bool pack_py_lsa_GetSystemAccessAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_GetSystemAccessAccount *r)
11704 PyObject *py_handle;
11705 const char *kwnames[] = {
11709 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_GetSystemAccessAccount", discard_const_p(char *, kwnames), &py_handle)) {
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) {
11719 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
11723 static PyObject *unpack_py_lsa_GetSystemAccessAccount_args_out(struct lsa_GetSystemAccessAccount *r)
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);
11737 static bool pack_py_lsa_SetSystemAccessAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSystemAccessAccount *r)
11739 PyObject *py_handle;
11740 PyObject *py_access_mask;
11741 const char *kwnames[] = {
11742 "handle", "access_mask", NULL
11745 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_SetSystemAccessAccount", discard_const_p(char *, kwnames), &py_handle, &py_access_mask)) {
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) {
11755 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
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) {
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);
11769 r->in.access_mask = test_var;
11770 } else if (PyInt_Check(py_access_mask)) {
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);
11778 r->in.access_mask = test_var;
11780 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11781 PyInt_Type.tp_name, PyLong_Type.tp_name);
11788 static PyObject *unpack_py_lsa_SetSystemAccessAccount_args_out(struct lsa_SetSystemAccessAccount *r)
11793 if (NT_STATUS_IS_ERR(r->out.result)) {
11794 PyErr_SetNTSTATUS(r->out.result);
11801 static bool pack_py_lsa_OpenTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenTrustedDomain *r)
11803 PyObject *py_handle;
11805 PyObject *py_access_mask;
11806 const char *kwnames[] = {
11807 "handle", "sid", "access_mask", NULL
11810 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenTrustedDomain", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
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) {
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) {
11827 r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
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) {
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);
11841 r->in.access_mask = test_var;
11842 } else if (PyInt_Check(py_access_mask)) {
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);
11850 r->in.access_mask = test_var;
11852 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11853 PyInt_Type.tp_name, PyLong_Type.tp_name);
11860 static PyObject *unpack_py_lsa_OpenTrustedDomain_args_out(struct lsa_OpenTrustedDomain *r)
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);
11874 static bool pack_py_lsa_QueryTrustedDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfo *r)
11876 PyObject *py_trustdom_handle;
11877 PyObject *py_level;
11878 const char *kwnames[] = {
11879 "trustdom_handle", "level", NULL
11882 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryTrustedDomainInfo", discard_const_p(char *, kwnames), &py_trustdom_handle, &py_level)) {
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) {
11892 r->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(py_trustdom_handle);
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) {
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);
11906 r->in.level = test_var;
11907 } else if (PyInt_Check(py_level)) {
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);
11915 r->in.level = test_var;
11917 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11918 PyInt_Type.tp_name, PyLong_Type.tp_name);
11925 static PyObject *unpack_py_lsa_QueryTrustedDomainInfo_args_out(struct lsa_QueryTrustedDomainInfo *r)
11929 if (*r->out.info == NULL) {
11931 Py_INCREF(py_info);
11933 py_info = py_import_lsa_TrustedDomainInfo(*r->out.info, r->in.level, *r->out.info);
11934 if (py_info == NULL) {
11939 if (NT_STATUS_IS_ERR(r->out.result)) {
11940 PyErr_SetNTSTATUS(r->out.result);
11947 static bool pack_py_lsa_SetInformationTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInformationTrustedDomain *r)
11949 PyObject *py_trustdom_handle;
11950 PyObject *py_level;
11952 const char *kwnames[] = {
11953 "trustdom_handle", "level", "info", NULL
11956 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInformationTrustedDomain", discard_const_p(char *, kwnames), &py_trustdom_handle, &py_level, &py_info)) {
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) {
11966 r->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(py_trustdom_handle);
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) {
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);
11980 r->in.level = test_var;
11981 } else if (PyInt_Check(py_level)) {
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);
11989 r->in.level = test_var;
11991 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11992 PyInt_Type.tp_name, PyLong_Type.tp_name);
11996 r->in.info = talloc_ptrtype(r, r->in.info);
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) {
12003 r->in.info = info_switch_1;
12008 static PyObject *unpack_py_lsa_SetInformationTrustedDomain_args_out(struct lsa_SetInformationTrustedDomain *r)
12013 if (NT_STATUS_IS_ERR(r->out.result)) {
12014 PyErr_SetNTSTATUS(r->out.result);
12021 static bool pack_py_lsa_OpenSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenSecret *r)
12023 PyObject *py_handle;
12025 PyObject *py_access_mask;
12026 const char *kwnames[] = {
12027 "handle", "name", "access_mask", NULL
12030 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenSecret", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
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) {
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) {
12046 r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
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) {
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);
12060 r->in.access_mask = test_var;
12061 } else if (PyInt_Check(py_access_mask)) {
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);
12069 r->in.access_mask = test_var;
12071 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12072 PyInt_Type.tp_name, PyLong_Type.tp_name);
12079 static PyObject *unpack_py_lsa_OpenSecret_args_out(struct lsa_OpenSecret *r)
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);
12093 static bool pack_py_lsa_SetSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSecret *r)
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
12102 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetSecret", discard_const_p(char *, kwnames), &py_sec_handle, &py_new_val, &py_old_val)) {
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) {
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;
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) {
12122 r->in.new_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_new_val);
12124 if (py_old_val == Py_None) {
12125 r->in.old_val = NULL;
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) {
12133 r->in.old_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_old_val);
12138 static PyObject *unpack_py_lsa_SetSecret_args_out(struct lsa_SetSecret *r)
12143 if (NT_STATUS_IS_ERR(r->out.result)) {
12144 PyErr_SetNTSTATUS(r->out.result);
12151 static bool pack_py_lsa_QuerySecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_QuerySecret *r)
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
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)) {
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) {
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;
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) {
12182 r->in.new_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(py_new_val);
12184 if (py_new_mtime == Py_None) {
12185 r->in.new_mtime = NULL;
12187 r->in.new_mtime = talloc_ptrtype(r, r->in.new_mtime);
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) {
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);
12201 *r->in.new_mtime = test_var;
12202 } else if (PyInt_Check(py_new_mtime)) {
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);
12210 *r->in.new_mtime = test_var;
12212 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12213 PyInt_Type.tp_name, PyLong_Type.tp_name);
12218 if (py_old_val == Py_None) {
12219 r->in.old_val = NULL;
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) {
12227 r->in.old_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(py_old_val);
12229 if (py_old_mtime == Py_None) {
12230 r->in.old_mtime = NULL;
12232 r->in.old_mtime = talloc_ptrtype(r, r->in.old_mtime);
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) {
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);
12246 *r->in.old_mtime = test_var;
12247 } else if (PyInt_Check(py_old_mtime)) {
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);
12255 *r->in.old_mtime = test_var;
12257 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12258 PyInt_Type.tp_name, PyLong_Type.tp_name);
12266 static PyObject *unpack_py_lsa_QuerySecret_args_out(struct lsa_QuerySecret *r)
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);
12278 py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, r->out.new_val, r->out.new_val);
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);
12285 py_new_mtime = ndr_PyLong_FromUnsignedLongLong(*r->out.new_mtime);
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);
12292 py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, r->out.old_val, r->out.old_val);
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);
12299 py_old_mtime = ndr_PyLong_FromUnsignedLongLong(*r->out.old_mtime);
12301 PyTuple_SetItem(result, 3, py_old_mtime);
12302 if (NT_STATUS_IS_ERR(r->out.result)) {
12303 PyErr_SetNTSTATUS(r->out.result);
12310 static bool pack_py_lsa_LookupPrivValue_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivValue *r)
12312 PyObject *py_handle;
12314 const char *kwnames[] = {
12315 "handle", "name", NULL
12318 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_LookupPrivValue", discard_const_p(char *, kwnames), &py_handle, &py_name)) {
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) {
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) {
12335 r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
12339 static PyObject *unpack_py_lsa_LookupPrivValue_args_out(struct lsa_LookupPrivValue *r)
12343 py_luid = pytalloc_reference_ex(&lsa_LUID_Type, r->out.luid, r->out.luid);
12345 if (NT_STATUS_IS_ERR(r->out.result)) {
12346 PyErr_SetNTSTATUS(r->out.result);
12353 static bool pack_py_lsa_LookupPrivName_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivName *r)
12355 PyObject *py_handle;
12357 const char *kwnames[] = {
12358 "handle", "luid", NULL
12361 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_LookupPrivName", discard_const_p(char *, kwnames), &py_handle, &py_luid)) {
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) {
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) {
12378 r->in.luid = (struct lsa_LUID *)pytalloc_get_ptr(py_luid);
12382 static PyObject *unpack_py_lsa_LookupPrivName_args_out(struct lsa_LookupPrivName *r)
12386 if (*r->out.name == NULL) {
12388 Py_INCREF(py_name);
12390 py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *r->out.name, *r->out.name);
12393 if (NT_STATUS_IS_ERR(r->out.result)) {
12394 PyErr_SetNTSTATUS(r->out.result);
12401 static bool pack_py_lsa_LookupPrivDisplayName_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivDisplayName *r)
12403 PyObject *py_handle;
12405 PyObject *py_language_id;
12406 PyObject *py_language_id_sys;
12407 const char *kwnames[] = {
12408 "handle", "name", "language_id", "language_id_sys", NULL
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)) {
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) {
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) {
12428 r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
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) {
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);
12442 r->in.language_id = test_var;
12443 } else if (PyInt_Check(py_language_id)) {
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);
12451 r->in.language_id = test_var;
12453 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12454 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
12471 r->in.language_id_sys = test_var;
12472 } else if (PyInt_Check(py_language_id_sys)) {
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);
12480 r->in.language_id_sys = test_var;
12482 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12483 PyInt_Type.tp_name, PyLong_Type.tp_name);
12490 static PyObject *unpack_py_lsa_LookupPrivDisplayName_args_out(struct lsa_LookupPrivDisplayName *r)
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);
12500 py_disp_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *r->out.disp_name, *r->out.disp_name);
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);
12513 static bool pack_py_lsa_DeleteObject_args_in(PyObject *args, PyObject *kwargs, struct lsa_DeleteObject *r)
12515 PyObject *py_handle;
12516 const char *kwnames[] = {
12520 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_DeleteObject", discard_const_p(char *, kwnames), &py_handle)) {
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) {
12530 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12534 static PyObject *unpack_py_lsa_DeleteObject_args_out(struct lsa_DeleteObject *r)
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);
12548 static bool pack_py_lsa_EnumAccountsWithUserRight_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccountsWithUserRight *r)
12550 PyObject *py_handle;
12552 const char *kwnames[] = {
12553 "handle", "name", NULL
12556 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_EnumAccountsWithUserRight", discard_const_p(char *, kwnames), &py_handle, &py_name)) {
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) {
12566 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12567 if (py_name == Py_None) {
12571 PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
12572 if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
12576 r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
12581 static PyObject *unpack_py_lsa_EnumAccountsWithUserRight_args_out(struct lsa_EnumAccountsWithUserRight *r)
12585 py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, r->out.sids, r->out.sids);
12587 if (NT_STATUS_IS_ERR(r->out.result)) {
12588 PyErr_SetNTSTATUS(r->out.result);
12595 static bool pack_py_lsa_EnumAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccountRights *r)
12597 PyObject *py_handle;
12599 const char *kwnames[] = {
12600 "handle", "sid", NULL
12603 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_EnumAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid)) {
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) {
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) {
12620 r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
12624 static PyObject *unpack_py_lsa_EnumAccountRights_args_out(struct lsa_EnumAccountRights *r)
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);
12638 static bool pack_py_lsa_AddAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_AddAccountRights *r)
12640 PyObject *py_handle;
12642 PyObject *py_rights;
12643 const char *kwnames[] = {
12644 "handle", "sid", "rights", NULL
12647 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_AddAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_rights)) {
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) {
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) {
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) {
12671 r->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(py_rights);
12675 static PyObject *unpack_py_lsa_AddAccountRights_args_out(struct lsa_AddAccountRights *r)
12680 if (NT_STATUS_IS_ERR(r->out.result)) {
12681 PyErr_SetNTSTATUS(r->out.result);
12688 static bool pack_py_lsa_RemoveAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_RemoveAccountRights *r)
12690 PyObject *py_handle;
12692 PyObject *py_remove_all;
12693 PyObject *py_rights;
12694 const char *kwnames[] = {
12695 "handle", "sid", "remove_all", "rights", NULL
12698 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_RemoveAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_remove_all, &py_rights)) {
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) {
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) {
12715 r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
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) {
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);
12729 r->in.remove_all = test_var;
12730 } else if (PyInt_Check(py_remove_all)) {
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);
12738 r->in.remove_all = test_var;
12740 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12741 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
12751 r->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(py_rights);
12755 static PyObject *unpack_py_lsa_RemoveAccountRights_args_out(struct lsa_RemoveAccountRights *r)
12760 if (NT_STATUS_IS_ERR(r->out.result)) {
12761 PyErr_SetNTSTATUS(r->out.result);
12768 static bool pack_py_lsa_QueryTrustedDomainInfoBySid_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfoBySid *r)
12770 PyObject *py_handle;
12771 PyObject *py_dom_sid;
12772 PyObject *py_level;
12773 const char *kwnames[] = {
12774 "handle", "dom_sid", "level", NULL
12777 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_QueryTrustedDomainInfoBySid", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid, &py_level)) {
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) {
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) {
12794 r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
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) {
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);
12808 r->in.level = test_var;
12809 } else if (PyInt_Check(py_level)) {
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);
12817 r->in.level = test_var;
12819 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12820 PyInt_Type.tp_name, PyLong_Type.tp_name);
12827 static PyObject *unpack_py_lsa_QueryTrustedDomainInfoBySid_args_out(struct lsa_QueryTrustedDomainInfoBySid *r)
12831 if (*r->out.info == NULL) {
12833 Py_INCREF(py_info);
12835 py_info = py_import_lsa_TrustedDomainInfo(*r->out.info, r->in.level, *r->out.info);
12836 if (py_info == NULL) {
12841 if (NT_STATUS_IS_ERR(r->out.result)) {
12842 PyErr_SetNTSTATUS(r->out.result);
12849 static bool pack_py_lsa_SetTrustedDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetTrustedDomainInfo *r)
12851 PyObject *py_handle;
12852 PyObject *py_dom_sid;
12853 PyObject *py_level;
12855 const char *kwnames[] = {
12856 "handle", "dom_sid", "level", "info", NULL
12859 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_SetTrustedDomainInfo", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid, &py_level, &py_info)) {
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) {
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) {
12876 r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
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) {
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);
12890 r->in.level = test_var;
12891 } else if (PyInt_Check(py_level)) {
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);
12899 r->in.level = test_var;
12901 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
12902 PyInt_Type.tp_name, PyLong_Type.tp_name);
12906 r->in.info = talloc_ptrtype(r, r->in.info);
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) {
12913 r->in.info = info_switch_1;
12918 static PyObject *unpack_py_lsa_SetTrustedDomainInfo_args_out(struct lsa_SetTrustedDomainInfo *r)
12923 if (NT_STATUS_IS_ERR(r->out.result)) {
12924 PyErr_SetNTSTATUS(r->out.result);
12931 static bool pack_py_lsa_DeleteTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_DeleteTrustedDomain *r)
12933 PyObject *py_handle;
12934 PyObject *py_dom_sid;
12935 const char *kwnames[] = {
12936 "handle", "dom_sid", NULL
12939 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_DeleteTrustedDomain", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid)) {
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) {
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) {
12956 r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
12960 static PyObject *unpack_py_lsa_DeleteTrustedDomain_args_out(struct lsa_DeleteTrustedDomain *r)
12965 if (NT_STATUS_IS_ERR(r->out.result)) {
12966 PyErr_SetNTSTATUS(r->out.result);
12973 static bool pack_py_lsa_StorePrivateData_args_in(PyObject *args, PyObject *kwargs, struct lsa_StorePrivateData *r)
12975 PyObject *py_handle;
12978 const char *kwnames[] = {
12979 "handle", "name", "val", NULL
12982 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_StorePrivateData", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_val)) {
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) {
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) {
12999 r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
13000 if (py_val == Py_None) {
13004 PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_val, return false;);
13005 if (talloc_reference(r, pytalloc_get_mem_ctx(py_val)) == NULL) {
13009 r->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_val);
13014 static PyObject *unpack_py_lsa_StorePrivateData_args_out(struct lsa_StorePrivateData *r)
13019 if (NT_STATUS_IS_ERR(r->out.result)) {
13020 PyErr_SetNTSTATUS(r->out.result);
13027 static bool pack_py_lsa_RetrievePrivateData_args_in(PyObject *args, PyObject *kwargs, struct lsa_RetrievePrivateData *r)
13029 PyObject *py_handle;
13032 const char *kwnames[] = {
13033 "handle", "name", "val", NULL
13036 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_RetrievePrivateData", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_val)) {
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) {
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) {
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) {
13059 PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_val, return false;);
13060 if (talloc_reference(r, pytalloc_get_mem_ctx(py_val)) == NULL) {
13064 *r->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_val);
13069 static PyObject *unpack_py_lsa_RetrievePrivateData_args_out(struct lsa_RetrievePrivateData *r)
13073 if (*r->out.val == NULL) {
13077 py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, *r->out.val, *r->out.val);
13080 if (NT_STATUS_IS_ERR(r->out.result)) {
13081 PyErr_SetNTSTATUS(r->out.result);
13088 static bool pack_py_lsa_OpenPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenPolicy2 *r)
13090 PyObject *py_system_name;
13092 PyObject *py_access_mask;
13093 const char *kwnames[] = {
13094 "system_name", "attr", "access_mask", NULL
13097 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenPolicy2", discard_const_p(char *, kwnames), &py_system_name, &py_attr, &py_access_mask)) {
13101 if (py_system_name == Py_None) {
13102 r->in.system_name = NULL;
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);
13110 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
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) {
13120 r->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_attr);
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) {
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);
13134 r->in.access_mask = test_var;
13135 } else if (PyInt_Check(py_access_mask)) {
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);
13143 r->in.access_mask = test_var;
13145 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13146 PyInt_Type.tp_name, PyLong_Type.tp_name);
13153 static PyObject *unpack_py_lsa_OpenPolicy2_args_out(struct lsa_OpenPolicy2 *r)
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);
13167 static bool pack_py_lsa_GetUserName_args_in(PyObject *args, PyObject *kwargs, struct lsa_GetUserName *r)
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
13176 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_GetUserName", discard_const_p(char *, kwnames), &py_system_name, &py_account_name, &py_authority_name)) {
13180 if (py_system_name == Py_None) {
13181 r->in.system_name = NULL;
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);
13189 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
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;
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) {
13203 *r->in.account_name = (struct lsa_String *)pytalloc_get_ptr(py_account_name);
13205 if (py_authority_name == Py_None) {
13206 r->in.authority_name = NULL;
13208 r->in.authority_name = NULL;
13209 if (py_authority_name == Py_None) {
13210 *r->in.authority_name = NULL;
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) {
13218 *r->in.authority_name = (struct lsa_String *)pytalloc_get_ptr(py_authority_name);
13224 static PyObject *unpack_py_lsa_GetUserName_args_out(struct lsa_GetUserName *r)
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);
13234 py_account_name = pytalloc_reference_ex(&lsa_String_Type, *r->out.account_name, *r->out.account_name);
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);
13241 if (*r->out.authority_name == NULL) {
13242 py_authority_name = Py_None;
13243 Py_INCREF(py_authority_name);
13245 py_authority_name = pytalloc_reference_ex(&lsa_String_Type, *r->out.authority_name, *r->out.authority_name);
13248 PyTuple_SetItem(result, 1, py_authority_name);
13249 if (NT_STATUS_IS_ERR(r->out.result)) {
13250 PyErr_SetNTSTATUS(r->out.result);
13257 static bool pack_py_lsa_QueryInfoPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryInfoPolicy2 *r)
13259 PyObject *py_handle;
13260 PyObject *py_level;
13261 const char *kwnames[] = {
13262 "handle", "level", NULL
13265 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryInfoPolicy2", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
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) {
13275 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
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) {
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);
13289 r->in.level = test_var;
13290 } else if (PyInt_Check(py_level)) {
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);
13298 r->in.level = test_var;
13300 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13301 PyInt_Type.tp_name, PyLong_Type.tp_name);
13308 static PyObject *unpack_py_lsa_QueryInfoPolicy2_args_out(struct lsa_QueryInfoPolicy2 *r)
13312 if (*r->out.info == NULL) {
13314 Py_INCREF(py_info);
13316 py_info = py_import_lsa_PolicyInformation(*r->out.info, r->in.level, *r->out.info);
13317 if (py_info == NULL) {
13322 if (NT_STATUS_IS_ERR(r->out.result)) {
13323 PyErr_SetNTSTATUS(r->out.result);
13330 static bool pack_py_lsa_SetInfoPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInfoPolicy2 *r)
13332 PyObject *py_handle;
13333 PyObject *py_level;
13335 const char *kwnames[] = {
13336 "handle", "level", "info", NULL
13339 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInfoPolicy2", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
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) {
13349 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
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) {
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);
13363 r->in.level = test_var;
13364 } else if (PyInt_Check(py_level)) {
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);
13372 r->in.level = test_var;
13374 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13375 PyInt_Type.tp_name, PyLong_Type.tp_name);
13379 r->in.info = talloc_ptrtype(r, r->in.info);
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) {
13386 r->in.info = info_switch_1;
13391 static PyObject *unpack_py_lsa_SetInfoPolicy2_args_out(struct lsa_SetInfoPolicy2 *r)
13396 if (NT_STATUS_IS_ERR(r->out.result)) {
13397 PyErr_SetNTSTATUS(r->out.result);
13404 static bool pack_py_lsa_QueryTrustedDomainInfoByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfoByName *r)
13406 PyObject *py_handle;
13407 PyObject *py_trusted_domain;
13408 PyObject *py_level;
13409 const char *kwnames[] = {
13410 "handle", "trusted_domain", "level", NULL
13413 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_QueryTrustedDomainInfoByName", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain, &py_level)) {
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) {
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) {
13430 r->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain);
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) {
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);
13444 r->in.level = test_var;
13445 } else if (PyInt_Check(py_level)) {
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);
13453 r->in.level = test_var;
13455 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13456 PyInt_Type.tp_name, PyLong_Type.tp_name);
13463 static PyObject *unpack_py_lsa_QueryTrustedDomainInfoByName_args_out(struct lsa_QueryTrustedDomainInfoByName *r)
13467 if (*r->out.info == NULL) {
13469 Py_INCREF(py_info);
13471 py_info = py_import_lsa_TrustedDomainInfo(*r->out.info, r->in.level, *r->out.info);
13472 if (py_info == NULL) {
13477 if (NT_STATUS_IS_ERR(r->out.result)) {
13478 PyErr_SetNTSTATUS(r->out.result);
13485 static bool pack_py_lsa_SetTrustedDomainInfoByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetTrustedDomainInfoByName *r)
13487 PyObject *py_handle;
13488 PyObject *py_trusted_domain;
13489 PyObject *py_level;
13491 const char *kwnames[] = {
13492 "handle", "trusted_domain", "level", "info", NULL
13495 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_SetTrustedDomainInfoByName", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain, &py_level, &py_info)) {
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) {
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) {
13512 r->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain);
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) {
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);
13526 r->in.level = test_var;
13527 } else if (PyInt_Check(py_level)) {
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);
13535 r->in.level = test_var;
13537 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13538 PyInt_Type.tp_name, PyLong_Type.tp_name);
13542 r->in.info = talloc_ptrtype(r, r->in.info);
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) {
13549 r->in.info = info_switch_1;
13554 static PyObject *unpack_py_lsa_SetTrustedDomainInfoByName_args_out(struct lsa_SetTrustedDomainInfoByName *r)
13559 if (NT_STATUS_IS_ERR(r->out.result)) {
13560 PyErr_SetNTSTATUS(r->out.result);
13567 static bool pack_py_lsa_EnumTrustedDomainsEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumTrustedDomainsEx *r)
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
13576 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumTrustedDomainsEx", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_size)) {
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) {
13586 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13587 r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
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) {
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);
13601 *r->in.resume_handle = test_var;
13602 } else if (PyInt_Check(py_resume_handle)) {
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);
13610 *r->in.resume_handle = test_var;
13612 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13613 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
13630 r->in.max_size = test_var;
13631 } else if (PyInt_Check(py_max_size)) {
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);
13639 r->in.max_size = test_var;
13641 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13642 PyInt_Type.tp_name, PyLong_Type.tp_name);
13649 static PyObject *unpack_py_lsa_EnumTrustedDomainsEx_args_out(struct lsa_EnumTrustedDomainsEx *r)
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);
13667 static bool pack_py_lsa_CreateTrustedDomainEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomainEx *r)
13669 PyObject *py_policy_handle;
13671 PyObject *py_auth_info;
13672 PyObject *py_access_mask;
13673 const char *kwnames[] = {
13674 "policy_handle", "info", "auth_info", "access_mask", NULL
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)) {
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) {
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) {
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) {
13701 r->in.auth_info = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_auth_info);
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) {
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);
13715 r->in.access_mask = test_var;
13716 } else if (PyInt_Check(py_access_mask)) {
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);
13724 r->in.access_mask = test_var;
13726 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13727 PyInt_Type.tp_name, PyLong_Type.tp_name);
13734 static PyObject *unpack_py_lsa_CreateTrustedDomainEx_args_out(struct lsa_CreateTrustedDomainEx *r)
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);
13748 static bool pack_py_lsa_CloseTrustedDomainEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_CloseTrustedDomainEx *r)
13750 PyObject *py_handle;
13751 const char *kwnames[] = {
13755 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_CloseTrustedDomainEx", discard_const_p(char *, kwnames), &py_handle)) {
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) {
13765 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13769 static PyObject *unpack_py_lsa_CloseTrustedDomainEx_args_out(struct lsa_CloseTrustedDomainEx *r)
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);
13783 static bool pack_py_lsa_QueryDomainInformationPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryDomainInformationPolicy *r)
13785 PyObject *py_handle;
13786 PyObject *py_level;
13787 const char *kwnames[] = {
13788 "handle", "level", NULL
13791 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryDomainInformationPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
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) {
13801 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
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) {
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);
13815 r->in.level = test_var;
13816 } else if (PyInt_Check(py_level)) {
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);
13824 r->in.level = test_var;
13826 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13827 PyInt_Type.tp_name, PyLong_Type.tp_name);
13834 static PyObject *unpack_py_lsa_QueryDomainInformationPolicy_args_out(struct lsa_QueryDomainInformationPolicy *r)
13838 if (*r->out.info == NULL) {
13840 Py_INCREF(py_info);
13842 py_info = py_import_lsa_DomainInformationPolicy(*r->out.info, r->in.level, *r->out.info);
13843 if (py_info == NULL) {
13848 if (NT_STATUS_IS_ERR(r->out.result)) {
13849 PyErr_SetNTSTATUS(r->out.result);
13856 static bool pack_py_lsa_SetDomainInformationPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetDomainInformationPolicy *r)
13858 PyObject *py_handle;
13859 PyObject *py_level;
13861 const char *kwnames[] = {
13862 "handle", "level", "info", NULL
13865 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetDomainInformationPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
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) {
13875 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
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) {
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);
13889 r->in.level = test_var;
13890 } else if (PyInt_Check(py_level)) {
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);
13898 r->in.level = test_var;
13900 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13901 PyInt_Type.tp_name, PyLong_Type.tp_name);
13905 if (py_info == Py_None) {
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) {
13915 r->in.info = info_switch_1;
13921 static PyObject *unpack_py_lsa_SetDomainInformationPolicy_args_out(struct lsa_SetDomainInformationPolicy *r)
13926 if (NT_STATUS_IS_ERR(r->out.result)) {
13927 PyErr_SetNTSTATUS(r->out.result);
13934 static bool pack_py_lsa_OpenTrustedDomainByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenTrustedDomainByName *r)
13936 PyObject *py_handle;
13938 PyObject *py_access_mask;
13939 const char *kwnames[] = {
13940 "handle", "name", "access_mask", NULL
13943 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenTrustedDomainByName", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
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) {
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) {
13959 r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
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) {
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);
13973 r->in.access_mask = test_var;
13974 } else if (PyInt_Check(py_access_mask)) {
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);
13982 r->in.access_mask = test_var;
13984 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
13985 PyInt_Type.tp_name, PyLong_Type.tp_name);
13992 static PyObject *unpack_py_lsa_OpenTrustedDomainByName_args_out(struct lsa_OpenTrustedDomainByName *r)
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);
14006 static bool pack_py_lsa_LookupSids2_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids2 *r)
14008 PyObject *py_handle;
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
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)) {
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) {
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) {
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) {
14043 r->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_names);
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) {
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);
14057 r->in.level = test_var;
14058 } else if (PyInt_Check(py_level)) {
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);
14066 r->in.level = test_var;
14068 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14069 PyInt_Type.tp_name, PyLong_Type.tp_name);
14073 r->in.count = talloc_ptrtype(r, r->in.count);
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) {
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);
14087 *r->in.count = test_var;
14088 } else if (PyInt_Check(py_count)) {
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);
14096 *r->in.count = test_var;
14098 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14099 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
14116 r->in.lookup_options = test_var;
14117 } else if (PyInt_Check(py_lookup_options)) {
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);
14125 r->in.lookup_options = test_var;
14127 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14128 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
14145 r->in.client_revision = test_var;
14146 } else if (PyInt_Check(py_client_revision)) {
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);
14154 r->in.client_revision = test_var;
14156 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14157 PyInt_Type.tp_name, PyLong_Type.tp_name);
14164 static PyObject *unpack_py_lsa_LookupSids2_args_out(struct lsa_LookupSids2 *r)
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);
14175 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
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);
14190 static bool pack_py_lsa_LookupNames2_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames2 *r)
14192 PyObject *py_handle;
14193 PyObject *py_names;
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
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)) {
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) {
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;);
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) {
14228 r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
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) {
14237 r->in.sids = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(py_sids);
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) {
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);
14251 r->in.level = test_var;
14252 } else if (PyInt_Check(py_level)) {
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);
14260 r->in.level = test_var;
14262 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14263 PyInt_Type.tp_name, PyLong_Type.tp_name);
14267 r->in.count = talloc_ptrtype(r, r->in.count);
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) {
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);
14281 *r->in.count = test_var;
14282 } else if (PyInt_Check(py_count)) {
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);
14290 *r->in.count = test_var;
14292 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14293 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
14310 r->in.lookup_options = test_var;
14311 } else if (PyInt_Check(py_lookup_options)) {
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);
14319 r->in.lookup_options = test_var;
14321 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14322 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
14339 r->in.client_revision = test_var;
14340 } else if (PyInt_Check(py_client_revision)) {
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);
14348 r->in.client_revision = test_var;
14350 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14351 PyInt_Type.tp_name, PyLong_Type.tp_name);
14358 static PyObject *unpack_py_lsa_LookupNames2_args_out(struct lsa_LookupNames2 *r)
14361 PyObject *py_domains;
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);
14369 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
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);
14384 static bool pack_py_lsa_CreateTrustedDomainEx2_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomainEx2 *r)
14386 PyObject *py_policy_handle;
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
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)) {
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) {
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) {
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) {
14418 r->in.auth_info_internal = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(py_auth_info_internal);
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) {
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);
14432 r->in.access_mask = test_var;
14433 } else if (PyInt_Check(py_access_mask)) {
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);
14441 r->in.access_mask = test_var;
14443 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14444 PyInt_Type.tp_name, PyLong_Type.tp_name);
14451 static PyObject *unpack_py_lsa_CreateTrustedDomainEx2_args_out(struct lsa_CreateTrustedDomainEx2 *r)
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);
14465 static bool pack_py_lsa_LookupNames3_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames3 *r)
14467 PyObject *py_handle;
14468 PyObject *py_names;
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
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)) {
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) {
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;);
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) {
14503 r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
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) {
14512 r->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_sids);
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) {
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);
14526 r->in.level = test_var;
14527 } else if (PyInt_Check(py_level)) {
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);
14535 r->in.level = test_var;
14537 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14538 PyInt_Type.tp_name, PyLong_Type.tp_name);
14542 r->in.count = talloc_ptrtype(r, r->in.count);
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) {
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);
14556 *r->in.count = test_var;
14557 } else if (PyInt_Check(py_count)) {
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);
14565 *r->in.count = test_var;
14567 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14568 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
14585 r->in.lookup_options = test_var;
14586 } else if (PyInt_Check(py_lookup_options)) {
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);
14594 r->in.lookup_options = test_var;
14596 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14597 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
14614 r->in.client_revision = test_var;
14615 } else if (PyInt_Check(py_client_revision)) {
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);
14623 r->in.client_revision = test_var;
14625 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14626 PyInt_Type.tp_name, PyLong_Type.tp_name);
14633 static PyObject *unpack_py_lsa_LookupNames3_args_out(struct lsa_LookupNames3 *r)
14636 PyObject *py_domains;
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);
14644 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
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);
14659 static bool pack_py_lsa_lsaRQueryForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct lsa_lsaRQueryForestTrustInformation *r)
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
14668 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_lsaRQueryForestTrustInformation", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain_name, &py_highest_record_type)) {
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) {
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) {
14685 r->in.trusted_domain_name = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain_name);
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) {
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);
14699 r->in.highest_record_type = test_var;
14700 } else if (PyInt_Check(py_highest_record_type)) {
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);
14708 r->in.highest_record_type = test_var;
14710 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14711 PyInt_Type.tp_name, PyLong_Type.tp_name);
14718 static PyObject *unpack_py_lsa_lsaRQueryForestTrustInformation_args_out(struct lsa_lsaRQueryForestTrustInformation *r)
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);
14726 py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation_Type, *r->out.forest_trust_info, *r->out.forest_trust_info);
14728 result = py_forest_trust_info;
14729 if (NT_STATUS_IS_ERR(r->out.result)) {
14730 PyErr_SetNTSTATUS(r->out.result);
14737 static bool pack_py_lsa_lsaRSetForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct lsa_lsaRSetForestTrustInformation *r)
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
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)) {
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) {
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) {
14765 r->in.trusted_domain_name = (struct lsa_StringLarge *)pytalloc_get_ptr(py_trusted_domain_name);
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) {
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);
14779 r->in.highest_record_type = test_var;
14780 } else if (PyInt_Check(py_highest_record_type)) {
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);
14788 r->in.highest_record_type = test_var;
14790 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14791 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
14801 r->in.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_forest_trust_info);
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) {
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);
14815 r->in.check_only = test_var;
14816 } else if (PyInt_Check(py_check_only)) {
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);
14824 r->in.check_only = test_var;
14826 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14827 PyInt_Type.tp_name, PyLong_Type.tp_name);
14834 static PyObject *unpack_py_lsa_lsaRSetForestTrustInformation_args_out(struct lsa_lsaRSetForestTrustInformation *r)
14837 PyObject *py_collision_info;
14838 if (*r->out.collision_info == NULL) {
14839 py_collision_info = Py_None;
14840 Py_INCREF(py_collision_info);
14842 py_collision_info = pytalloc_reference_ex(&lsa_ForestTrustCollisionInfo_Type, *r->out.collision_info, *r->out.collision_info);
14844 result = py_collision_info;
14845 if (NT_STATUS_IS_ERR(r->out.result)) {
14846 PyErr_SetNTSTATUS(r->out.result);
14853 static bool pack_py_lsa_LookupSids3_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids3 *r)
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
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)) {
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) {
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) {
14882 r->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_names);
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) {
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);
14896 r->in.level = test_var;
14897 } else if (PyInt_Check(py_level)) {
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);
14905 r->in.level = test_var;
14907 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14908 PyInt_Type.tp_name, PyLong_Type.tp_name);
14912 r->in.count = talloc_ptrtype(r, r->in.count);
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) {
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);
14926 *r->in.count = test_var;
14927 } else if (PyInt_Check(py_count)) {
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);
14935 *r->in.count = test_var;
14937 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14938 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
14955 r->in.lookup_options = test_var;
14956 } else if (PyInt_Check(py_lookup_options)) {
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);
14964 r->in.lookup_options = test_var;
14966 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14967 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
14984 r->in.client_revision = test_var;
14985 } else if (PyInt_Check(py_client_revision)) {
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);
14993 r->in.client_revision = test_var;
14995 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
14996 PyInt_Type.tp_name, PyLong_Type.tp_name);
15003 static PyObject *unpack_py_lsa_LookupSids3_args_out(struct lsa_LookupSids3 *r)
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);
15014 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
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);
15029 static bool pack_py_lsa_LookupNames4_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames4 *r)
15031 PyObject *py_names;
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
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)) {
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;);
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) {
15059 r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
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) {
15068 r->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_sids);
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) {
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);
15082 r->in.level = test_var;
15083 } else if (PyInt_Check(py_level)) {
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);
15091 r->in.level = test_var;
15093 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
15094 PyInt_Type.tp_name, PyLong_Type.tp_name);
15098 r->in.count = talloc_ptrtype(r, r->in.count);
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) {
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);
15112 *r->in.count = test_var;
15113 } else if (PyInt_Check(py_count)) {
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);
15121 *r->in.count = test_var;
15123 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
15124 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
15141 r->in.lookup_options = test_var;
15142 } else if (PyInt_Check(py_lookup_options)) {
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);
15150 r->in.lookup_options = test_var;
15152 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
15153 PyInt_Type.tp_name, PyLong_Type.tp_name);
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) {
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);
15170 r->in.client_revision = test_var;
15171 } else if (PyInt_Check(py_client_revision)) {
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);
15179 r->in.client_revision = test_var;
15181 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
15182 PyInt_Type.tp_name, PyLong_Type.tp_name);
15189 static PyObject *unpack_py_lsa_LookupNames4_args_out(struct lsa_LookupNames4 *r)
15192 PyObject *py_domains;
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);
15200 py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
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);
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 },
15279 static PyObject *interface_lsarpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15281 return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_lsarpc);
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"
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,
15298 static PyObject *syntax_lsarpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15300 return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_lsarpc.syntax_id);
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,
15313 static PyMethodDef lsa_methods[] = {
15314 { NULL, NULL, 0, NULL }
15320 PyObject *dep_samba_dcerpc_misc;
15321 PyObject *dep_samba_dcerpc_security;
15322 PyObject *dep_talloc;
15323 PyObject *dep_samba_dcerpc_base;
15325 dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
15326 if (dep_samba_dcerpc_misc == NULL)
15329 dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
15330 if (dep_samba_dcerpc_security == NULL)
15333 dep_talloc = PyImport_ImportModule("talloc");
15334 if (dep_talloc == NULL)
15337 dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
15338 if (dep_samba_dcerpc_base == NULL)
15341 Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
15342 if (Object_Type == NULL)
15345 security_descriptor_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "descriptor");
15346 if (security_descriptor_Type == NULL)
15349 dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
15350 if (dom_sid_Type == NULL)
15353 GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
15354 if (GUID_Type == NULL)
15357 policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
15358 if (policy_handle_Type == NULL)
15361 sec_desc_buf_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "sec_desc_buf");
15362 if (sec_desc_buf_Type == NULL)
15365 ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
15366 if (ClientConnection_Type == NULL)
15369 ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
15370 if (ndr_syntax_id_Type == NULL)
15373 lsa_String_Type.tp_base = Object_Type;
15375 lsa_StringLarge_Type.tp_base = Object_Type;
15377 lsa_Strings_Type.tp_base = Object_Type;
15379 lsa_AsciiString_Type.tp_base = Object_Type;
15381 lsa_AsciiStringLarge_Type.tp_base = Object_Type;
15383 lsa_BinaryString_Type.tp_base = Object_Type;
15385 lsa_LUID_Type.tp_base = Object_Type;
15387 lsa_PrivEntry_Type.tp_base = Object_Type;
15389 lsa_PrivArray_Type.tp_base = Object_Type;
15391 lsa_QosInfo_Type.tp_base = Object_Type;
15393 lsa_ObjectAttribute_Type.tp_base = Object_Type;
15395 lsa_AuditLogInfo_Type.tp_base = Object_Type;
15397 lsa_AuditEventsInfo_Type.tp_base = Object_Type;
15399 lsa_DomainInfo_Type.tp_base = Object_Type;
15401 lsa_PDAccountInfo_Type.tp_base = Object_Type;
15403 lsa_ServerRole_Type.tp_base = Object_Type;
15405 lsa_ReplicaSourceInfo_Type.tp_base = Object_Type;
15407 lsa_DefaultQuotaInfo_Type.tp_base = Object_Type;
15409 lsa_ModificationInfo_Type.tp_base = Object_Type;
15411 lsa_AuditFullSetInfo_Type.tp_base = Object_Type;
15413 lsa_AuditFullQueryInfo_Type.tp_base = Object_Type;
15415 lsa_DnsDomainInfo_Type.tp_base = Object_Type;
15417 lsa_SidPtr_Type.tp_base = Object_Type;
15419 lsa_SidArray_Type.tp_base = Object_Type;
15421 lsa_DomainList_Type.tp_base = Object_Type;
15423 lsa_TranslatedSid_Type.tp_base = Object_Type;
15425 lsa_TransSidArray_Type.tp_base = Object_Type;
15427 lsa_RefDomainList_Type.tp_base = Object_Type;
15429 lsa_TranslatedName_Type.tp_base = Object_Type;
15431 lsa_TransNameArray_Type.tp_base = Object_Type;
15433 lsa_LUIDAttribute_Type.tp_base = Object_Type;
15435 lsa_PrivilegeSet_Type.tp_base = Object_Type;
15437 lsa_DATA_BUF_Type.tp_base = Object_Type;
15439 lsa_DATA_BUF2_Type.tp_base = Object_Type;
15441 lsa_TrustDomainInfoName_Type.tp_base = Object_Type;
15443 lsa_TrustDomainInfoControllers_Type.tp_base = Object_Type;
15445 lsa_TrustDomainInfoPosixOffset_Type.tp_base = Object_Type;
15447 lsa_TrustDomainInfoPassword_Type.tp_base = Object_Type;
15449 lsa_TrustDomainInfoBasic_Type.tp_base = Object_Type;
15451 lsa_TrustDomainInfoInfoEx_Type.tp_base = Object_Type;
15453 lsa_TrustDomainInfoBuffer_Type.tp_base = Object_Type;
15455 lsa_TrustDomainInfoAuthInfo_Type.tp_base = Object_Type;
15457 lsa_TrustDomainInfoFullInfo_Type.tp_base = Object_Type;
15459 lsa_TrustDomainInfoAuthInfoInternal_Type.tp_base = Object_Type;
15461 lsa_TrustDomainInfoFullInfoInternal_Type.tp_base = Object_Type;
15463 lsa_TrustDomainInfoInfoEx2Internal_Type.tp_base = Object_Type;
15465 lsa_TrustDomainInfoFullInfo2Internal_Type.tp_base = Object_Type;
15467 lsa_TrustDomainInfoSupportedEncTypes_Type.tp_base = Object_Type;
15469 lsa_DATA_BUF_PTR_Type.tp_base = Object_Type;
15471 lsa_RightAttribute_Type.tp_base = Object_Type;
15473 lsa_RightSet_Type.tp_base = Object_Type;
15475 lsa_DomainListEx_Type.tp_base = Object_Type;
15477 lsa_DomainInfoKerberos_Type.tp_base = Object_Type;
15479 lsa_DomainInfoEfs_Type.tp_base = Object_Type;
15481 lsa_TranslatedName2_Type.tp_base = Object_Type;
15483 lsa_TransNameArray2_Type.tp_base = Object_Type;
15485 lsa_TranslatedSid2_Type.tp_base = Object_Type;
15487 lsa_TransSidArray2_Type.tp_base = Object_Type;
15489 lsa_TranslatedSid3_Type.tp_base = Object_Type;
15491 lsa_TransSidArray3_Type.tp_base = Object_Type;
15493 lsa_ForestTrustBinaryData_Type.tp_base = Object_Type;
15495 lsa_ForestTrustDomainInfo_Type.tp_base = Object_Type;
15497 lsa_ForestTrustRecord_Type.tp_base = Object_Type;
15499 lsa_ForestTrustInformation_Type.tp_base = Object_Type;
15501 lsa_ForestTrustCollisionRecord_Type.tp_base = Object_Type;
15503 lsa_ForestTrustCollisionInfo_Type.tp_base = Object_Type;
15505 lsarpc_InterfaceType.tp_base = ClientConnection_Type;
15507 lsarpc_SyntaxType.tp_base = ndr_syntax_id_Type;
15509 if (PyType_Ready(&lsa_String_Type) < 0)
15511 if (PyType_Ready(&lsa_StringLarge_Type) < 0)
15513 if (PyType_Ready(&lsa_Strings_Type) < 0)
15515 if (PyType_Ready(&lsa_AsciiString_Type) < 0)
15517 if (PyType_Ready(&lsa_AsciiStringLarge_Type) < 0)
15519 if (PyType_Ready(&lsa_BinaryString_Type) < 0)
15521 if (PyType_Ready(&lsa_LUID_Type) < 0)
15523 if (PyType_Ready(&lsa_PrivEntry_Type) < 0)
15525 if (PyType_Ready(&lsa_PrivArray_Type) < 0)
15527 if (PyType_Ready(&lsa_QosInfo_Type) < 0)
15529 if (PyType_Ready(&lsa_ObjectAttribute_Type) < 0)
15531 if (PyType_Ready(&lsa_AuditLogInfo_Type) < 0)
15533 if (PyType_Ready(&lsa_AuditEventsInfo_Type) < 0)
15535 if (PyType_Ready(&lsa_DomainInfo_Type) < 0)
15537 if (PyType_Ready(&lsa_PDAccountInfo_Type) < 0)
15539 if (PyType_Ready(&lsa_ServerRole_Type) < 0)
15541 if (PyType_Ready(&lsa_ReplicaSourceInfo_Type) < 0)
15543 if (PyType_Ready(&lsa_DefaultQuotaInfo_Type) < 0)
15545 if (PyType_Ready(&lsa_ModificationInfo_Type) < 0)
15547 if (PyType_Ready(&lsa_AuditFullSetInfo_Type) < 0)
15549 if (PyType_Ready(&lsa_AuditFullQueryInfo_Type) < 0)
15551 if (PyType_Ready(&lsa_DnsDomainInfo_Type) < 0)
15553 if (PyType_Ready(&lsa_SidPtr_Type) < 0)
15555 if (PyType_Ready(&lsa_SidArray_Type) < 0)
15557 if (PyType_Ready(&lsa_DomainList_Type) < 0)
15559 if (PyType_Ready(&lsa_TranslatedSid_Type) < 0)
15561 if (PyType_Ready(&lsa_TransSidArray_Type) < 0)
15563 if (PyType_Ready(&lsa_RefDomainList_Type) < 0)
15565 if (PyType_Ready(&lsa_TranslatedName_Type) < 0)
15567 if (PyType_Ready(&lsa_TransNameArray_Type) < 0)
15569 if (PyType_Ready(&lsa_LUIDAttribute_Type) < 0)
15571 if (PyType_Ready(&lsa_PrivilegeSet_Type) < 0)
15573 if (PyType_Ready(&lsa_DATA_BUF_Type) < 0)
15575 if (PyType_Ready(&lsa_DATA_BUF2_Type) < 0)
15577 if (PyType_Ready(&lsa_TrustDomainInfoName_Type) < 0)
15579 if (PyType_Ready(&lsa_TrustDomainInfoControllers_Type) < 0)
15581 if (PyType_Ready(&lsa_TrustDomainInfoPosixOffset_Type) < 0)
15583 if (PyType_Ready(&lsa_TrustDomainInfoPassword_Type) < 0)
15585 if (PyType_Ready(&lsa_TrustDomainInfoBasic_Type) < 0)
15587 if (PyType_Ready(&lsa_TrustDomainInfoInfoEx_Type) < 0)
15589 if (PyType_Ready(&lsa_TrustDomainInfoBuffer_Type) < 0)
15591 if (PyType_Ready(&lsa_TrustDomainInfoAuthInfo_Type) < 0)
15593 if (PyType_Ready(&lsa_TrustDomainInfoFullInfo_Type) < 0)
15595 if (PyType_Ready(&lsa_TrustDomainInfoAuthInfoInternal_Type) < 0)
15597 if (PyType_Ready(&lsa_TrustDomainInfoFullInfoInternal_Type) < 0)
15599 if (PyType_Ready(&lsa_TrustDomainInfoInfoEx2Internal_Type) < 0)
15601 if (PyType_Ready(&lsa_TrustDomainInfoFullInfo2Internal_Type) < 0)
15603 if (PyType_Ready(&lsa_TrustDomainInfoSupportedEncTypes_Type) < 0)
15605 if (PyType_Ready(&lsa_DATA_BUF_PTR_Type) < 0)
15607 if (PyType_Ready(&lsa_RightAttribute_Type) < 0)
15609 if (PyType_Ready(&lsa_RightSet_Type) < 0)
15611 if (PyType_Ready(&lsa_DomainListEx_Type) < 0)
15613 if (PyType_Ready(&lsa_DomainInfoKerberos_Type) < 0)
15615 if (PyType_Ready(&lsa_DomainInfoEfs_Type) < 0)
15617 if (PyType_Ready(&lsa_TranslatedName2_Type) < 0)
15619 if (PyType_Ready(&lsa_TransNameArray2_Type) < 0)
15621 if (PyType_Ready(&lsa_TranslatedSid2_Type) < 0)
15623 if (PyType_Ready(&lsa_TransSidArray2_Type) < 0)
15625 if (PyType_Ready(&lsa_TranslatedSid3_Type) < 0)
15627 if (PyType_Ready(&lsa_TransSidArray3_Type) < 0)
15629 if (PyType_Ready(&lsa_ForestTrustBinaryData_Type) < 0)
15631 if (PyType_Ready(&lsa_ForestTrustDomainInfo_Type) < 0)
15633 if (PyType_Ready(&lsa_ForestTrustRecord_Type) < 0)
15635 if (PyType_Ready(&lsa_ForestTrustInformation_Type) < 0)
15637 if (PyType_Ready(&lsa_ForestTrustCollisionRecord_Type) < 0)
15639 if (PyType_Ready(&lsa_ForestTrustCollisionInfo_Type) < 0)
15641 if (PyType_Ready(&lsarpc_InterfaceType) < 0)
15643 if (PyType_Ready(&lsarpc_SyntaxType) < 0)
15645 if (!PyInterface_AddNdrRpcMethods(&lsarpc_InterfaceType, py_ndr_lsarpc_methods))
15648 #ifdef PY_STRING_PATCH
15649 PY_STRING_PATCH(&lsa_String_Type);
15651 #ifdef PY_STRINGLARGE_PATCH
15652 PY_STRINGLARGE_PATCH(&lsa_StringLarge_Type);
15654 #ifdef PY_STRINGS_PATCH
15655 PY_STRINGS_PATCH(&lsa_Strings_Type);
15657 #ifdef PY_ASCIISTRING_PATCH
15658 PY_ASCIISTRING_PATCH(&lsa_AsciiString_Type);
15660 #ifdef PY_ASCIISTRINGLARGE_PATCH
15661 PY_ASCIISTRINGLARGE_PATCH(&lsa_AsciiStringLarge_Type);
15663 #ifdef PY_BINARYSTRING_PATCH
15664 PY_BINARYSTRING_PATCH(&lsa_BinaryString_Type);
15666 #ifdef PY_LUID_PATCH
15667 PY_LUID_PATCH(&lsa_LUID_Type);
15669 #ifdef PY_PRIVENTRY_PATCH
15670 PY_PRIVENTRY_PATCH(&lsa_PrivEntry_Type);
15672 #ifdef PY_PRIVARRAY_PATCH
15673 PY_PRIVARRAY_PATCH(&lsa_PrivArray_Type);
15675 #ifdef PY_QOSINFO_PATCH
15676 PY_QOSINFO_PATCH(&lsa_QosInfo_Type);
15678 #ifdef PY_OBJECTATTRIBUTE_PATCH
15679 PY_OBJECTATTRIBUTE_PATCH(&lsa_ObjectAttribute_Type);
15681 #ifdef PY_AUDITLOGINFO_PATCH
15682 PY_AUDITLOGINFO_PATCH(&lsa_AuditLogInfo_Type);
15684 #ifdef PY_AUDITEVENTSINFO_PATCH
15685 PY_AUDITEVENTSINFO_PATCH(&lsa_AuditEventsInfo_Type);
15687 #ifdef PY_DOMAININFO_PATCH
15688 PY_DOMAININFO_PATCH(&lsa_DomainInfo_Type);
15690 #ifdef PY_PDACCOUNTINFO_PATCH
15691 PY_PDACCOUNTINFO_PATCH(&lsa_PDAccountInfo_Type);
15693 #ifdef PY_SERVERROLE_PATCH
15694 PY_SERVERROLE_PATCH(&lsa_ServerRole_Type);
15696 #ifdef PY_REPLICASOURCEINFO_PATCH
15697 PY_REPLICASOURCEINFO_PATCH(&lsa_ReplicaSourceInfo_Type);
15699 #ifdef PY_DEFAULTQUOTAINFO_PATCH
15700 PY_DEFAULTQUOTAINFO_PATCH(&lsa_DefaultQuotaInfo_Type);
15702 #ifdef PY_MODIFICATIONINFO_PATCH
15703 PY_MODIFICATIONINFO_PATCH(&lsa_ModificationInfo_Type);
15705 #ifdef PY_AUDITFULLSETINFO_PATCH
15706 PY_AUDITFULLSETINFO_PATCH(&lsa_AuditFullSetInfo_Type);
15708 #ifdef PY_AUDITFULLQUERYINFO_PATCH
15709 PY_AUDITFULLQUERYINFO_PATCH(&lsa_AuditFullQueryInfo_Type);
15711 #ifdef PY_DNSDOMAININFO_PATCH
15712 PY_DNSDOMAININFO_PATCH(&lsa_DnsDomainInfo_Type);
15714 #ifdef PY_SIDPTR_PATCH
15715 PY_SIDPTR_PATCH(&lsa_SidPtr_Type);
15717 #ifdef PY_SIDARRAY_PATCH
15718 PY_SIDARRAY_PATCH(&lsa_SidArray_Type);
15720 #ifdef PY_DOMAINLIST_PATCH
15721 PY_DOMAINLIST_PATCH(&lsa_DomainList_Type);
15723 #ifdef PY_TRANSLATEDSID_PATCH
15724 PY_TRANSLATEDSID_PATCH(&lsa_TranslatedSid_Type);
15726 #ifdef PY_TRANSSIDARRAY_PATCH
15727 PY_TRANSSIDARRAY_PATCH(&lsa_TransSidArray_Type);
15729 #ifdef PY_REFDOMAINLIST_PATCH
15730 PY_REFDOMAINLIST_PATCH(&lsa_RefDomainList_Type);
15732 #ifdef PY_TRANSLATEDNAME_PATCH
15733 PY_TRANSLATEDNAME_PATCH(&lsa_TranslatedName_Type);
15735 #ifdef PY_TRANSNAMEARRAY_PATCH
15736 PY_TRANSNAMEARRAY_PATCH(&lsa_TransNameArray_Type);
15738 #ifdef PY_LUIDATTRIBUTE_PATCH
15739 PY_LUIDATTRIBUTE_PATCH(&lsa_LUIDAttribute_Type);
15741 #ifdef PY_PRIVILEGESET_PATCH
15742 PY_PRIVILEGESET_PATCH(&lsa_PrivilegeSet_Type);
15744 #ifdef PY_DATA_BUF_PATCH
15745 PY_DATA_BUF_PATCH(&lsa_DATA_BUF_Type);
15747 #ifdef PY_DATA_BUF2_PATCH
15748 PY_DATA_BUF2_PATCH(&lsa_DATA_BUF2_Type);
15750 #ifdef PY_TRUSTDOMAININFONAME_PATCH
15751 PY_TRUSTDOMAININFONAME_PATCH(&lsa_TrustDomainInfoName_Type);
15753 #ifdef PY_TRUSTDOMAININFOCONTROLLERS_PATCH
15754 PY_TRUSTDOMAININFOCONTROLLERS_PATCH(&lsa_TrustDomainInfoControllers_Type);
15756 #ifdef PY_TRUSTDOMAININFOPOSIXOFFSET_PATCH
15757 PY_TRUSTDOMAININFOPOSIXOFFSET_PATCH(&lsa_TrustDomainInfoPosixOffset_Type);
15759 #ifdef PY_TRUSTDOMAININFOPASSWORD_PATCH
15760 PY_TRUSTDOMAININFOPASSWORD_PATCH(&lsa_TrustDomainInfoPassword_Type);
15762 #ifdef PY_TRUSTDOMAININFOBASIC_PATCH
15763 PY_TRUSTDOMAININFOBASIC_PATCH(&lsa_TrustDomainInfoBasic_Type);
15765 #ifdef PY_TRUSTDOMAININFOINFOEX_PATCH
15766 PY_TRUSTDOMAININFOINFOEX_PATCH(&lsa_TrustDomainInfoInfoEx_Type);
15768 #ifdef PY_TRUSTDOMAININFOBUFFER_PATCH
15769 PY_TRUSTDOMAININFOBUFFER_PATCH(&lsa_TrustDomainInfoBuffer_Type);
15771 #ifdef PY_TRUSTDOMAININFOAUTHINFO_PATCH
15772 PY_TRUSTDOMAININFOAUTHINFO_PATCH(&lsa_TrustDomainInfoAuthInfo_Type);
15774 #ifdef PY_TRUSTDOMAININFOFULLINFO_PATCH
15775 PY_TRUSTDOMAININFOFULLINFO_PATCH(&lsa_TrustDomainInfoFullInfo_Type);
15777 #ifdef PY_TRUSTDOMAININFOAUTHINFOINTERNAL_PATCH
15778 PY_TRUSTDOMAININFOAUTHINFOINTERNAL_PATCH(&lsa_TrustDomainInfoAuthInfoInternal_Type);
15780 #ifdef PY_TRUSTDOMAININFOFULLINFOINTERNAL_PATCH
15781 PY_TRUSTDOMAININFOFULLINFOINTERNAL_PATCH(&lsa_TrustDomainInfoFullInfoInternal_Type);
15783 #ifdef PY_TRUSTDOMAININFOINFOEX2INTERNAL_PATCH
15784 PY_TRUSTDOMAININFOINFOEX2INTERNAL_PATCH(&lsa_TrustDomainInfoInfoEx2Internal_Type);
15786 #ifdef PY_TRUSTDOMAININFOFULLINFO2INTERNAL_PATCH
15787 PY_TRUSTDOMAININFOFULLINFO2INTERNAL_PATCH(&lsa_TrustDomainInfoFullInfo2Internal_Type);
15789 #ifdef PY_TRUSTDOMAININFOSUPPORTEDENCTYPES_PATCH
15790 PY_TRUSTDOMAININFOSUPPORTEDENCTYPES_PATCH(&lsa_TrustDomainInfoSupportedEncTypes_Type);
15792 #ifdef PY_DATA_BUF_PTR_PATCH
15793 PY_DATA_BUF_PTR_PATCH(&lsa_DATA_BUF_PTR_Type);
15795 #ifdef PY_RIGHTATTRIBUTE_PATCH
15796 PY_RIGHTATTRIBUTE_PATCH(&lsa_RightAttribute_Type);
15798 #ifdef PY_RIGHTSET_PATCH
15799 PY_RIGHTSET_PATCH(&lsa_RightSet_Type);
15801 #ifdef PY_DOMAINLISTEX_PATCH
15802 PY_DOMAINLISTEX_PATCH(&lsa_DomainListEx_Type);
15804 #ifdef PY_DOMAININFOKERBEROS_PATCH
15805 PY_DOMAININFOKERBEROS_PATCH(&lsa_DomainInfoKerberos_Type);
15807 #ifdef PY_DOMAININFOEFS_PATCH
15808 PY_DOMAININFOEFS_PATCH(&lsa_DomainInfoEfs_Type);
15810 #ifdef PY_TRANSLATEDNAME2_PATCH
15811 PY_TRANSLATEDNAME2_PATCH(&lsa_TranslatedName2_Type);
15813 #ifdef PY_TRANSNAMEARRAY2_PATCH
15814 PY_TRANSNAMEARRAY2_PATCH(&lsa_TransNameArray2_Type);
15816 #ifdef PY_TRANSLATEDSID2_PATCH
15817 PY_TRANSLATEDSID2_PATCH(&lsa_TranslatedSid2_Type);
15819 #ifdef PY_TRANSSIDARRAY2_PATCH
15820 PY_TRANSSIDARRAY2_PATCH(&lsa_TransSidArray2_Type);
15822 #ifdef PY_TRANSLATEDSID3_PATCH
15823 PY_TRANSLATEDSID3_PATCH(&lsa_TranslatedSid3_Type);
15825 #ifdef PY_TRANSSIDARRAY3_PATCH
15826 PY_TRANSSIDARRAY3_PATCH(&lsa_TransSidArray3_Type);
15828 #ifdef PY_FORESTTRUSTBINARYDATA_PATCH
15829 PY_FORESTTRUSTBINARYDATA_PATCH(&lsa_ForestTrustBinaryData_Type);
15831 #ifdef PY_FORESTTRUSTDOMAININFO_PATCH
15832 PY_FORESTTRUSTDOMAININFO_PATCH(&lsa_ForestTrustDomainInfo_Type);
15834 #ifdef PY_FORESTTRUSTRECORD_PATCH
15835 PY_FORESTTRUSTRECORD_PATCH(&lsa_ForestTrustRecord_Type);
15837 #ifdef PY_FORESTTRUSTINFORMATION_PATCH
15838 PY_FORESTTRUSTINFORMATION_PATCH(&lsa_ForestTrustInformation_Type);
15840 #ifdef PY_FORESTTRUSTCOLLISIONRECORD_PATCH
15841 PY_FORESTTRUSTCOLLISIONRECORD_PATCH(&lsa_ForestTrustCollisionRecord_Type);
15843 #ifdef PY_FORESTTRUSTCOLLISIONINFO_PATCH
15844 PY_FORESTTRUSTCOLLISIONINFO_PATCH(&lsa_ForestTrustCollisionInfo_Type);
15846 #ifdef PY_LSARPC_PATCH
15847 PY_LSARPC_PATCH(&lsarpc_InterfaceType);
15849 #ifdef PY_ABSTRACT_SYNTAX_PATCH
15850 PY_ABSTRACT_SYNTAX_PATCH(&lsarpc_SyntaxType);
15853 m = Py_InitModule3("lsa", lsa_methods, "lsa DCE/RPC");
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);