Line data Source code
1 :
2 : /* Python wrapper functions auto-generated by pidl */
3 : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
4 : #include <Python.h>
5 : #include "python/py3compat.h"
6 : #include "includes.h"
7 : #include "python/modules.h"
8 : #include <pytalloc.h>
9 : #include "librpc/rpc/pyrpc.h"
10 : #include "librpc/rpc/pyrpc_util.h"
11 : #include "bin/default/librpc/gen_ndr/ndr_lsa.h"
12 : #include "bin/default/librpc/gen_ndr/ndr_lsa_c.h"
13 :
14 : /*
15 : * Suppress compiler warnings if the generated code does not call these
16 : * functions
17 : */
18 : #ifndef _MAYBE_UNUSED_
19 : #ifdef __has_attribute
20 : #if __has_attribute(unused)
21 : #define _MAYBE_UNUSED_ __attribute__ ((unused))
22 : #else
23 : #define _MAYBE_UNUSED_
24 : #endif
25 : #endif
26 : #endif
27 : /*
28 : * These functions are here to ensure they can be optimized out by
29 : * the compiler based on the constant input values
30 : */
31 :
32 23021 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 23021 : switch (var_size) {
35 40 : case 8:
36 40 : return UINT64_MAX;
37 1217 : case 4:
38 1217 : return UINT32_MAX;
39 0 : case 2:
40 0 : return UINT16_MAX;
41 21764 : case 1:
42 21764 : return UINT8_MAX;
43 : }
44 :
45 0 : return 0;
46 : }
47 :
48 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
49 : {
50 : switch (var_size) {
51 : case 8:
52 : return INT64_MAX;
53 : case 4:
54 : return INT32_MAX;
55 : case 2:
56 : return INT16_MAX;
57 : case 1:
58 : return INT8_MAX;
59 : }
60 :
61 : return 0;
62 : }
63 :
64 : #include "librpc/gen_ndr/misc.h"
65 : #include "librpc/gen_ndr/security.h"
66 : static PyTypeObject lsa_String_Type;
67 : static PyTypeObject lsa_StringLarge_Type;
68 : static PyTypeObject lsa_Strings_Type;
69 : static PyTypeObject lsa_AsciiString_Type;
70 : static PyTypeObject lsa_AsciiStringLarge_Type;
71 : static PyTypeObject lsa_BinaryString_Type;
72 : static PyTypeObject lsa_LUID_Type;
73 : static PyTypeObject lsa_PrivEntry_Type;
74 : static PyTypeObject lsa_PrivArray_Type;
75 : static PyTypeObject lsa_QosInfo_Type;
76 : static PyTypeObject lsa_ObjectAttribute_Type;
77 : static PyTypeObject lsa_AuditLogInfo_Type;
78 : static PyTypeObject lsa_AuditEventsInfo_Type;
79 : static PyTypeObject lsa_DomainInfo_Type;
80 : static PyTypeObject lsa_PDAccountInfo_Type;
81 : static PyTypeObject lsa_ServerRole_Type;
82 : static PyTypeObject lsa_ReplicaSourceInfo_Type;
83 : static PyTypeObject lsa_DefaultQuotaInfo_Type;
84 : static PyTypeObject lsa_ModificationInfo_Type;
85 : static PyTypeObject lsa_AuditFullSetInfo_Type;
86 : static PyTypeObject lsa_AuditFullQueryInfo_Type;
87 : static PyTypeObject lsa_DnsDomainInfo_Type;
88 : static PyTypeObject lsa_PolicyInformation_Type;
89 : static PyTypeObject lsa_SidPtr_Type;
90 : static PyTypeObject lsa_SidArray_Type;
91 : static PyTypeObject lsa_DomainList_Type;
92 : static PyTypeObject lsa_TranslatedSid_Type;
93 : static PyTypeObject lsa_TransSidArray_Type;
94 : static PyTypeObject lsa_RefDomainList_Type;
95 : static PyTypeObject lsa_TranslatedName_Type;
96 : static PyTypeObject lsa_TransNameArray_Type;
97 : static PyTypeObject lsa_LUIDAttribute_Type;
98 : static PyTypeObject lsa_PrivilegeSet_Type;
99 : static PyTypeObject lsa_DATA_BUF_Type;
100 : static PyTypeObject lsa_DATA_BUF2_Type;
101 : static PyTypeObject lsa_TrustDomainInfoName_Type;
102 : static PyTypeObject lsa_TrustDomainInfoControllers_Type;
103 : static PyTypeObject lsa_TrustDomainInfoPosixOffset_Type;
104 : static PyTypeObject lsa_TrustDomainInfoPassword_Type;
105 : static PyTypeObject lsa_TrustDomainInfoBasic_Type;
106 : static PyTypeObject lsa_TrustDomainInfoInfoEx_Type;
107 : static PyTypeObject lsa_TrustDomainInfoBuffer_Type;
108 : static PyTypeObject lsa_TrustDomainInfoAuthInfo_Type;
109 : static PyTypeObject lsa_TrustDomainInfoFullInfo_Type;
110 : static PyTypeObject lsa_TrustDomainInfoAuthInfoInternal_Type;
111 : static PyTypeObject lsa_TrustDomainInfoFullInfoInternal_Type;
112 : static PyTypeObject lsa_TrustDomainInfoInfoEx2Internal_Type;
113 : static PyTypeObject lsa_TrustDomainInfoFullInfo2Internal_Type;
114 : static PyTypeObject lsa_TrustDomainInfoSupportedEncTypes_Type;
115 : static PyTypeObject lsa_TrustedDomainInfo_Type;
116 : static PyTypeObject lsa_DATA_BUF_PTR_Type;
117 : static PyTypeObject lsa_RightAttribute_Type;
118 : static PyTypeObject lsa_RightSet_Type;
119 : static PyTypeObject lsa_DomainListEx_Type;
120 : static PyTypeObject lsa_DomainInfoKerberos_Type;
121 : static PyTypeObject lsa_DomainInfoEfs_Type;
122 : static PyTypeObject lsa_DomainInformationPolicy_Type;
123 : static PyTypeObject lsa_TranslatedName2_Type;
124 : static PyTypeObject lsa_TransNameArray2_Type;
125 : static PyTypeObject lsa_TranslatedSid2_Type;
126 : static PyTypeObject lsa_TransSidArray2_Type;
127 : static PyTypeObject lsa_TranslatedSid3_Type;
128 : static PyTypeObject lsa_TransSidArray3_Type;
129 : static PyTypeObject lsa_ForestTrustBinaryData_Type;
130 : static PyTypeObject lsa_ForestTrustDomainInfo_Type;
131 : static PyTypeObject lsa_ForestTrustData_Type;
132 : static PyTypeObject lsa_ForestTrustRecord_Type;
133 : static PyTypeObject lsa_ForestTrustInformation_Type;
134 : static PyTypeObject lsa_ForestTrustCollisionRecord_Type;
135 : static PyTypeObject lsa_ForestTrustCollisionInfo_Type;
136 : static PyTypeObject lsarpc_InterfaceType;
137 : static PyTypeObject lsa_Close_Type;
138 : static PyTypeObject lsa_Delete_Type;
139 : static PyTypeObject lsa_EnumPrivs_Type;
140 : static PyTypeObject lsa_QuerySecurity_Type;
141 : static PyTypeObject lsa_SetSecObj_Type;
142 : static PyTypeObject lsa_OpenPolicy_Type;
143 : static PyTypeObject lsa_QueryInfoPolicy_Type;
144 : static PyTypeObject lsa_SetInfoPolicy_Type;
145 : static PyTypeObject lsa_CreateAccount_Type;
146 : static PyTypeObject lsa_EnumAccounts_Type;
147 : static PyTypeObject lsa_CreateTrustedDomain_Type;
148 : static PyTypeObject lsa_EnumTrustDom_Type;
149 : static PyTypeObject lsa_LookupNames_Type;
150 : static PyTypeObject lsa_LookupSids_Type;
151 : static PyTypeObject lsa_CreateSecret_Type;
152 : static PyTypeObject lsa_OpenAccount_Type;
153 : static PyTypeObject lsa_EnumPrivsAccount_Type;
154 : static PyTypeObject lsa_AddPrivilegesToAccount_Type;
155 : static PyTypeObject lsa_RemovePrivilegesFromAccount_Type;
156 : static PyTypeObject lsa_GetSystemAccessAccount_Type;
157 : static PyTypeObject lsa_SetSystemAccessAccount_Type;
158 : static PyTypeObject lsa_OpenTrustedDomain_Type;
159 : static PyTypeObject lsa_QueryTrustedDomainInfo_Type;
160 : static PyTypeObject lsa_SetInformationTrustedDomain_Type;
161 : static PyTypeObject lsa_OpenSecret_Type;
162 : static PyTypeObject lsa_SetSecret_Type;
163 : static PyTypeObject lsa_QuerySecret_Type;
164 : static PyTypeObject lsa_LookupPrivValue_Type;
165 : static PyTypeObject lsa_LookupPrivName_Type;
166 : static PyTypeObject lsa_LookupPrivDisplayName_Type;
167 : static PyTypeObject lsa_DeleteObject_Type;
168 : static PyTypeObject lsa_EnumAccountsWithUserRight_Type;
169 : static PyTypeObject lsa_EnumAccountRights_Type;
170 : static PyTypeObject lsa_AddAccountRights_Type;
171 : static PyTypeObject lsa_RemoveAccountRights_Type;
172 : static PyTypeObject lsa_QueryTrustedDomainInfoBySid_Type;
173 : static PyTypeObject lsa_SetTrustedDomainInfo_Type;
174 : static PyTypeObject lsa_DeleteTrustedDomain_Type;
175 : static PyTypeObject lsa_StorePrivateData_Type;
176 : static PyTypeObject lsa_RetrievePrivateData_Type;
177 : static PyTypeObject lsa_OpenPolicy2_Type;
178 : static PyTypeObject lsa_GetUserName_Type;
179 : static PyTypeObject lsa_QueryInfoPolicy2_Type;
180 : static PyTypeObject lsa_SetInfoPolicy2_Type;
181 : static PyTypeObject lsa_QueryTrustedDomainInfoByName_Type;
182 : static PyTypeObject lsa_SetTrustedDomainInfoByName_Type;
183 : static PyTypeObject lsa_EnumTrustedDomainsEx_Type;
184 : static PyTypeObject lsa_CreateTrustedDomainEx_Type;
185 : static PyTypeObject lsa_CloseTrustedDomainEx_Type;
186 : static PyTypeObject lsa_QueryDomainInformationPolicy_Type;
187 : static PyTypeObject lsa_SetDomainInformationPolicy_Type;
188 : static PyTypeObject lsa_OpenTrustedDomainByName_Type;
189 : static PyTypeObject lsa_LookupSids2_Type;
190 : static PyTypeObject lsa_LookupNames2_Type;
191 : static PyTypeObject lsa_CreateTrustedDomainEx2_Type;
192 : static PyTypeObject lsa_LookupNames3_Type;
193 : static PyTypeObject lsa_lsaRQueryForestTrustInformation_Type;
194 : static PyTypeObject lsa_lsaRSetForestTrustInformation_Type;
195 : static PyTypeObject lsa_LookupSids3_Type;
196 : static PyTypeObject lsa_LookupNames4_Type;
197 :
198 : static PyTypeObject *BaseObject_Type;
199 : static PyTypeObject *security_descriptor_Type;
200 : static PyTypeObject *dom_sid_Type;
201 : static PyTypeObject *GUID_Type;
202 : static PyTypeObject *policy_handle_Type;
203 : static PyTypeObject *sec_desc_buf_Type;
204 : static PyTypeObject *ndr_pointer_Type;
205 : static PyTypeObject *ClientConnection_Type;
206 : static PyTypeObject *ndr_syntax_id_Type;
207 : #include "librpc/ndr/py_lsa.c"
208 :
209 :
210 300 : static PyObject *py_lsa_String_get_length(PyObject *obj, void *closure)
211 : {
212 300 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(obj);
213 : PyObject *py_length;
214 300 : py_length = PyLong_FromLong((uint16_t)object->length);
215 300 : return py_length;
216 : }
217 :
218 0 : static int py_lsa_String_set_length(PyObject *py_obj, PyObject *value, void *closure)
219 : {
220 0 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
221 0 : if (value == NULL) {
222 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
223 0 : return -1;
224 : }
225 : {
226 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
227 0 : if (PyLong_Check(value)) {
228 : unsigned long long test_var;
229 0 : test_var = PyLong_AsUnsignedLongLong(value);
230 0 : if (PyErr_Occurred() != NULL) {
231 0 : return -1;
232 : }
233 0 : if (test_var > uint_max) {
234 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
235 : PyLong_Type.tp_name, uint_max, test_var);
236 0 : return -1;
237 : }
238 0 : object->length = test_var;
239 : } else {
240 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
241 : PyLong_Type.tp_name);
242 0 : return -1;
243 : }
244 : }
245 0 : return 0;
246 : }
247 :
248 0 : static PyObject *py_lsa_String_get_size(PyObject *obj, void *closure)
249 : {
250 0 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(obj);
251 : PyObject *py_size;
252 0 : py_size = PyLong_FromLong((uint16_t)object->size);
253 0 : return py_size;
254 : }
255 :
256 0 : static int py_lsa_String_set_size(PyObject *py_obj, PyObject *value, void *closure)
257 : {
258 0 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
259 0 : if (value == NULL) {
260 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
261 0 : return -1;
262 : }
263 : {
264 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
265 0 : if (PyLong_Check(value)) {
266 : unsigned long long test_var;
267 0 : test_var = PyLong_AsUnsignedLongLong(value);
268 0 : if (PyErr_Occurred() != NULL) {
269 0 : return -1;
270 : }
271 0 : if (test_var > uint_max) {
272 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
273 : PyLong_Type.tp_name, uint_max, test_var);
274 0 : return -1;
275 : }
276 0 : object->size = test_var;
277 : } else {
278 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
279 : PyLong_Type.tp_name);
280 0 : return -1;
281 : }
282 : }
283 0 : return 0;
284 : }
285 :
286 199 : static PyObject *py_lsa_String_get_string(PyObject *obj, void *closure)
287 : {
288 199 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(obj);
289 : PyObject *py_string;
290 199 : if (object->string == NULL) {
291 0 : Py_RETURN_NONE;
292 : }
293 199 : if (object->string == NULL) {
294 0 : py_string = Py_None;
295 0 : Py_INCREF(py_string);
296 : } else {
297 199 : if (object->string == NULL) {
298 0 : py_string = Py_None;
299 0 : Py_INCREF(py_string);
300 : } else {
301 199 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
302 : }
303 : }
304 199 : return py_string;
305 : }
306 :
307 356 : static int py_lsa_String_set_string(PyObject *py_obj, PyObject *value, void *closure)
308 : {
309 356 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
310 356 : if (value == NULL) {
311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
312 0 : return -1;
313 : }
314 356 : if (value == Py_None) {
315 0 : object->string = NULL;
316 : } else {
317 356 : object->string = NULL;
318 : {
319 : const char *test_str;
320 : const char *talloc_str;
321 356 : PyObject *unicode = NULL;
322 356 : if (PyUnicode_Check(value)) {
323 356 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
324 356 : if (unicode == NULL) {
325 0 : PyErr_NoMemory();
326 0 : return -1;
327 : }
328 356 : test_str = PyBytes_AS_STRING(unicode);
329 0 : } else if (PyBytes_Check(value)) {
330 0 : test_str = PyBytes_AS_STRING(value);
331 : } else {
332 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
333 0 : return -1;
334 : }
335 356 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
336 356 : if (unicode != NULL) {
337 356 : Py_DECREF(unicode);
338 : }
339 356 : if (talloc_str == NULL) {
340 0 : PyErr_NoMemory();
341 0 : return -1;
342 : }
343 356 : object->string = talloc_str;
344 : }
345 : }
346 356 : return 0;
347 : }
348 :
349 : static PyGetSetDef py_lsa_String_getsetters[] = {
350 : {
351 : .name = discard_const_p(char, "length"),
352 : .get = py_lsa_String_get_length,
353 : .set = py_lsa_String_set_length,
354 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
355 : },
356 : {
357 : .name = discard_const_p(char, "size"),
358 : .get = py_lsa_String_get_size,
359 : .set = py_lsa_String_set_size,
360 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
361 : },
362 : {
363 : .name = discard_const_p(char, "string"),
364 : .get = py_lsa_String_get_string,
365 : .set = py_lsa_String_set_string,
366 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
367 : },
368 : { .name = NULL }
369 : };
370 :
371 329 : static PyObject *py_lsa_String_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
372 : {
373 329 : return pytalloc_new(struct lsa_String, type);
374 : }
375 :
376 0 : static PyObject *py_lsa_String_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
377 : {
378 0 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
379 0 : PyObject *ret = NULL;
380 : DATA_BLOB blob;
381 : enum ndr_err_code err;
382 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
383 0 : if (tmp_ctx == NULL) {
384 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
385 0 : return NULL;
386 : }
387 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_String);
388 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
389 0 : TALLOC_FREE(tmp_ctx);
390 0 : PyErr_SetNdrError(err);
391 0 : return NULL;
392 : }
393 :
394 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
395 0 : TALLOC_FREE(tmp_ctx);
396 0 : return ret;
397 : }
398 :
399 0 : static PyObject *py_lsa_String_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
400 : {
401 0 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
402 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
403 0 : Py_ssize_t blob_length = 0;
404 : enum ndr_err_code err;
405 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
406 0 : PyObject *allow_remaining_obj = NULL;
407 0 : bool allow_remaining = false;
408 :
409 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
410 : discard_const_p(char *, kwnames),
411 : &blob.data, &blob_length,
412 : &allow_remaining_obj)) {
413 0 : return NULL;
414 : }
415 0 : blob.length = blob_length;
416 :
417 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
418 0 : allow_remaining = true;
419 : }
420 :
421 0 : if (allow_remaining) {
422 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_String);
423 : } else {
424 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_String);
425 : }
426 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
427 0 : PyErr_SetNdrError(err);
428 0 : return NULL;
429 : }
430 :
431 0 : Py_RETURN_NONE;
432 : }
433 :
434 0 : static PyObject *py_lsa_String_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
435 : {
436 0 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
437 : PyObject *ret;
438 : char *retstr;
439 :
440 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_String, "lsa_String", object);
441 0 : ret = PyUnicode_FromString(retstr);
442 0 : talloc_free(retstr);
443 :
444 0 : return ret;
445 : }
446 :
447 : static PyMethodDef py_lsa_String_methods[] = {
448 : { "__ndr_pack__", (PyCFunction)py_lsa_String_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
449 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_String_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
450 : { "__ndr_print__", (PyCFunction)py_lsa_String_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
451 : { NULL, NULL, 0, NULL }
452 : };
453 :
454 :
455 : static PyTypeObject lsa_String_Type = {
456 : PyVarObject_HEAD_INIT(NULL, 0)
457 : .tp_name = "lsa.String",
458 : .tp_getset = py_lsa_String_getsetters,
459 : .tp_methods = py_lsa_String_methods,
460 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
461 : .tp_new = py_lsa_String_new,
462 : };
463 :
464 :
465 0 : static PyObject *py_lsa_StringLarge_get_length(PyObject *obj, void *closure)
466 : {
467 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(obj);
468 : PyObject *py_length;
469 0 : py_length = PyLong_FromLong((uint16_t)object->length);
470 0 : return py_length;
471 : }
472 :
473 0 : static int py_lsa_StringLarge_set_length(PyObject *py_obj, PyObject *value, void *closure)
474 : {
475 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
476 0 : if (value == NULL) {
477 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
478 0 : return -1;
479 : }
480 : {
481 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
482 0 : if (PyLong_Check(value)) {
483 : unsigned long long test_var;
484 0 : test_var = PyLong_AsUnsignedLongLong(value);
485 0 : if (PyErr_Occurred() != NULL) {
486 0 : return -1;
487 : }
488 0 : if (test_var > uint_max) {
489 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
490 : PyLong_Type.tp_name, uint_max, test_var);
491 0 : return -1;
492 : }
493 0 : object->length = test_var;
494 : } else {
495 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
496 : PyLong_Type.tp_name);
497 0 : return -1;
498 : }
499 : }
500 0 : return 0;
501 : }
502 :
503 0 : static PyObject *py_lsa_StringLarge_get_size(PyObject *obj, void *closure)
504 : {
505 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(obj);
506 : PyObject *py_size;
507 0 : py_size = PyLong_FromLong((uint16_t)object->size);
508 0 : return py_size;
509 : }
510 :
511 0 : static int py_lsa_StringLarge_set_size(PyObject *py_obj, PyObject *value, void *closure)
512 : {
513 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
514 0 : if (value == NULL) {
515 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
516 0 : return -1;
517 : }
518 : {
519 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
520 0 : if (PyLong_Check(value)) {
521 : unsigned long long test_var;
522 0 : test_var = PyLong_AsUnsignedLongLong(value);
523 0 : if (PyErr_Occurred() != NULL) {
524 0 : return -1;
525 : }
526 0 : if (test_var > uint_max) {
527 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
528 : PyLong_Type.tp_name, uint_max, test_var);
529 0 : return -1;
530 : }
531 0 : object->size = test_var;
532 : } else {
533 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
534 : PyLong_Type.tp_name);
535 0 : return -1;
536 : }
537 : }
538 0 : return 0;
539 : }
540 :
541 3537 : static PyObject *py_lsa_StringLarge_get_string(PyObject *obj, void *closure)
542 : {
543 3537 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(obj);
544 : PyObject *py_string;
545 3537 : if (object->string == NULL) {
546 0 : Py_RETURN_NONE;
547 : }
548 3537 : if (object->string == NULL) {
549 0 : py_string = Py_None;
550 0 : Py_INCREF(py_string);
551 : } else {
552 3537 : if (object->string == NULL) {
553 0 : py_string = Py_None;
554 0 : Py_INCREF(py_string);
555 : } else {
556 3537 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
557 : }
558 : }
559 3537 : return py_string;
560 : }
561 :
562 52 : static int py_lsa_StringLarge_set_string(PyObject *py_obj, PyObject *value, void *closure)
563 : {
564 52 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
565 52 : if (value == NULL) {
566 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
567 0 : return -1;
568 : }
569 52 : if (value == Py_None) {
570 0 : object->string = NULL;
571 : } else {
572 52 : object->string = NULL;
573 : {
574 : const char *test_str;
575 : const char *talloc_str;
576 52 : PyObject *unicode = NULL;
577 52 : if (PyUnicode_Check(value)) {
578 52 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
579 52 : if (unicode == NULL) {
580 0 : PyErr_NoMemory();
581 0 : return -1;
582 : }
583 52 : test_str = PyBytes_AS_STRING(unicode);
584 0 : } else if (PyBytes_Check(value)) {
585 0 : test_str = PyBytes_AS_STRING(value);
586 : } else {
587 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
588 0 : return -1;
589 : }
590 52 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
591 52 : if (unicode != NULL) {
592 52 : Py_DECREF(unicode);
593 : }
594 52 : if (talloc_str == NULL) {
595 0 : PyErr_NoMemory();
596 0 : return -1;
597 : }
598 52 : object->string = talloc_str;
599 : }
600 : }
601 52 : return 0;
602 : }
603 :
604 : static PyGetSetDef py_lsa_StringLarge_getsetters[] = {
605 : {
606 : .name = discard_const_p(char, "length"),
607 : .get = py_lsa_StringLarge_get_length,
608 : .set = py_lsa_StringLarge_set_length,
609 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
610 : },
611 : {
612 : .name = discard_const_p(char, "size"),
613 : .get = py_lsa_StringLarge_get_size,
614 : .set = py_lsa_StringLarge_set_size,
615 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
616 : },
617 : {
618 : .name = discard_const_p(char, "string"),
619 : .get = py_lsa_StringLarge_get_string,
620 : .set = py_lsa_StringLarge_set_string,
621 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
622 : },
623 : { .name = NULL }
624 : };
625 :
626 0 : static PyObject *py_lsa_StringLarge_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
627 : {
628 0 : return pytalloc_new(struct lsa_StringLarge, type);
629 : }
630 :
631 0 : static PyObject *py_lsa_StringLarge_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
632 : {
633 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
634 0 : PyObject *ret = NULL;
635 : DATA_BLOB blob;
636 : enum ndr_err_code err;
637 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
638 0 : if (tmp_ctx == NULL) {
639 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
640 0 : return NULL;
641 : }
642 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_StringLarge);
643 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
644 0 : TALLOC_FREE(tmp_ctx);
645 0 : PyErr_SetNdrError(err);
646 0 : return NULL;
647 : }
648 :
649 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
650 0 : TALLOC_FREE(tmp_ctx);
651 0 : return ret;
652 : }
653 :
654 0 : static PyObject *py_lsa_StringLarge_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
655 : {
656 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
657 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
658 0 : Py_ssize_t blob_length = 0;
659 : enum ndr_err_code err;
660 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
661 0 : PyObject *allow_remaining_obj = NULL;
662 0 : bool allow_remaining = false;
663 :
664 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
665 : discard_const_p(char *, kwnames),
666 : &blob.data, &blob_length,
667 : &allow_remaining_obj)) {
668 0 : return NULL;
669 : }
670 0 : blob.length = blob_length;
671 :
672 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
673 0 : allow_remaining = true;
674 : }
675 :
676 0 : if (allow_remaining) {
677 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_StringLarge);
678 : } else {
679 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_StringLarge);
680 : }
681 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
682 0 : PyErr_SetNdrError(err);
683 0 : return NULL;
684 : }
685 :
686 0 : Py_RETURN_NONE;
687 : }
688 :
689 0 : static PyObject *py_lsa_StringLarge_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
690 : {
691 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
692 : PyObject *ret;
693 : char *retstr;
694 :
695 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_StringLarge, "lsa_StringLarge", object);
696 0 : ret = PyUnicode_FromString(retstr);
697 0 : talloc_free(retstr);
698 :
699 0 : return ret;
700 : }
701 :
702 : static PyMethodDef py_lsa_StringLarge_methods[] = {
703 : { "__ndr_pack__", (PyCFunction)py_lsa_StringLarge_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
704 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_StringLarge_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
705 : { "__ndr_print__", (PyCFunction)py_lsa_StringLarge_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
706 : { NULL, NULL, 0, NULL }
707 : };
708 :
709 :
710 : static PyTypeObject lsa_StringLarge_Type = {
711 : PyVarObject_HEAD_INIT(NULL, 0)
712 : .tp_name = "lsa.StringLarge",
713 : .tp_getset = py_lsa_StringLarge_getsetters,
714 : .tp_methods = py_lsa_StringLarge_methods,
715 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
716 : .tp_new = py_lsa_StringLarge_new,
717 : };
718 :
719 :
720 0 : static PyObject *py_lsa_Strings_get_count(PyObject *obj, void *closure)
721 : {
722 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(obj);
723 : PyObject *py_count;
724 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
725 0 : return py_count;
726 : }
727 :
728 0 : static int py_lsa_Strings_set_count(PyObject *py_obj, PyObject *value, void *closure)
729 : {
730 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
731 0 : if (value == NULL) {
732 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
733 0 : return -1;
734 : }
735 : {
736 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
737 0 : if (PyLong_Check(value)) {
738 : unsigned long long test_var;
739 0 : test_var = PyLong_AsUnsignedLongLong(value);
740 0 : if (PyErr_Occurred() != NULL) {
741 0 : return -1;
742 : }
743 0 : if (test_var > uint_max) {
744 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
745 : PyLong_Type.tp_name, uint_max, test_var);
746 0 : return -1;
747 : }
748 0 : object->count = test_var;
749 : } else {
750 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
751 : PyLong_Type.tp_name);
752 0 : return -1;
753 : }
754 : }
755 0 : return 0;
756 : }
757 :
758 0 : static PyObject *py_lsa_Strings_get_names(PyObject *obj, void *closure)
759 : {
760 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(obj);
761 : PyObject *py_names;
762 0 : if (object->names == NULL) {
763 0 : Py_RETURN_NONE;
764 : }
765 0 : if (object->names == NULL) {
766 0 : py_names = Py_None;
767 0 : Py_INCREF(py_names);
768 : } else {
769 0 : py_names = PyList_New(object->count);
770 0 : if (py_names == NULL) {
771 0 : return NULL;
772 : }
773 : {
774 : int names_cntr_1;
775 0 : for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
776 : PyObject *py_names_1;
777 0 : py_names_1 = pytalloc_reference_ex(&lsa_String_Type, object->names, &object->names[names_cntr_1]);
778 0 : PyList_SetItem(py_names, names_cntr_1, py_names_1);
779 : }
780 : }
781 : }
782 0 : return py_names;
783 : }
784 :
785 0 : static int py_lsa_Strings_set_names(PyObject *py_obj, PyObject *value, void *closure)
786 : {
787 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
788 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
789 0 : if (value == NULL) {
790 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names");
791 0 : return -1;
792 : }
793 0 : if (value == Py_None) {
794 0 : object->names = NULL;
795 : } else {
796 0 : object->names = NULL;
797 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
798 : {
799 : int names_cntr_1;
800 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
801 0 : if (!object->names) { return -1;; }
802 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
803 0 : for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
804 0 : if (PyList_GET_ITEM(value, names_cntr_1) == NULL) {
805 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names[names_cntr_1]");
806 0 : return -1;
807 : }
808 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
809 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
810 0 : PyErr_NoMemory();
811 0 : return -1;
812 : }
813 0 : object->names[names_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
814 : }
815 : }
816 : }
817 0 : return 0;
818 : }
819 :
820 : static PyGetSetDef py_lsa_Strings_getsetters[] = {
821 : {
822 : .name = discard_const_p(char, "count"),
823 : .get = py_lsa_Strings_get_count,
824 : .set = py_lsa_Strings_set_count,
825 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
826 : },
827 : {
828 : .name = discard_const_p(char, "names"),
829 : .get = py_lsa_Strings_get_names,
830 : .set = py_lsa_Strings_set_names,
831 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
832 : },
833 : { .name = NULL }
834 : };
835 :
836 0 : static PyObject *py_lsa_Strings_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
837 : {
838 0 : return pytalloc_new(struct lsa_Strings, type);
839 : }
840 :
841 0 : static PyObject *py_lsa_Strings_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
842 : {
843 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
844 0 : PyObject *ret = NULL;
845 : DATA_BLOB blob;
846 : enum ndr_err_code err;
847 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
848 0 : if (tmp_ctx == NULL) {
849 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
850 0 : return NULL;
851 : }
852 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_Strings);
853 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
854 0 : TALLOC_FREE(tmp_ctx);
855 0 : PyErr_SetNdrError(err);
856 0 : return NULL;
857 : }
858 :
859 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
860 0 : TALLOC_FREE(tmp_ctx);
861 0 : return ret;
862 : }
863 :
864 0 : static PyObject *py_lsa_Strings_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
865 : {
866 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
867 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
868 0 : Py_ssize_t blob_length = 0;
869 : enum ndr_err_code err;
870 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
871 0 : PyObject *allow_remaining_obj = NULL;
872 0 : bool allow_remaining = false;
873 :
874 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
875 : discard_const_p(char *, kwnames),
876 : &blob.data, &blob_length,
877 : &allow_remaining_obj)) {
878 0 : return NULL;
879 : }
880 0 : blob.length = blob_length;
881 :
882 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
883 0 : allow_remaining = true;
884 : }
885 :
886 0 : if (allow_remaining) {
887 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_Strings);
888 : } else {
889 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_Strings);
890 : }
891 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
892 0 : PyErr_SetNdrError(err);
893 0 : return NULL;
894 : }
895 :
896 0 : Py_RETURN_NONE;
897 : }
898 :
899 0 : static PyObject *py_lsa_Strings_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
900 : {
901 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
902 : PyObject *ret;
903 : char *retstr;
904 :
905 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_Strings, "lsa_Strings", object);
906 0 : ret = PyUnicode_FromString(retstr);
907 0 : talloc_free(retstr);
908 :
909 0 : return ret;
910 : }
911 :
912 : static PyMethodDef py_lsa_Strings_methods[] = {
913 : { "__ndr_pack__", (PyCFunction)py_lsa_Strings_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
914 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Strings_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
915 : { "__ndr_print__", (PyCFunction)py_lsa_Strings_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
916 : { NULL, NULL, 0, NULL }
917 : };
918 :
919 :
920 : static PyTypeObject lsa_Strings_Type = {
921 : PyVarObject_HEAD_INIT(NULL, 0)
922 : .tp_name = "lsa.Strings",
923 : .tp_getset = py_lsa_Strings_getsetters,
924 : .tp_methods = py_lsa_Strings_methods,
925 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
926 : .tp_new = py_lsa_Strings_new,
927 : };
928 :
929 :
930 0 : static PyObject *py_lsa_AsciiString_get_length(PyObject *obj, void *closure)
931 : {
932 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(obj);
933 : PyObject *py_length;
934 0 : py_length = PyLong_FromLong((uint16_t)object->length);
935 0 : return py_length;
936 : }
937 :
938 0 : static int py_lsa_AsciiString_set_length(PyObject *py_obj, PyObject *value, void *closure)
939 : {
940 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
941 0 : if (value == NULL) {
942 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
943 0 : return -1;
944 : }
945 : {
946 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
947 0 : if (PyLong_Check(value)) {
948 : unsigned long long test_var;
949 0 : test_var = PyLong_AsUnsignedLongLong(value);
950 0 : if (PyErr_Occurred() != NULL) {
951 0 : return -1;
952 : }
953 0 : if (test_var > uint_max) {
954 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
955 : PyLong_Type.tp_name, uint_max, test_var);
956 0 : return -1;
957 : }
958 0 : object->length = test_var;
959 : } else {
960 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
961 : PyLong_Type.tp_name);
962 0 : return -1;
963 : }
964 : }
965 0 : return 0;
966 : }
967 :
968 0 : static PyObject *py_lsa_AsciiString_get_size(PyObject *obj, void *closure)
969 : {
970 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(obj);
971 : PyObject *py_size;
972 0 : py_size = PyLong_FromLong((uint16_t)object->size);
973 0 : return py_size;
974 : }
975 :
976 0 : static int py_lsa_AsciiString_set_size(PyObject *py_obj, PyObject *value, void *closure)
977 : {
978 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
979 0 : if (value == NULL) {
980 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
981 0 : return -1;
982 : }
983 : {
984 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
985 0 : if (PyLong_Check(value)) {
986 : unsigned long long test_var;
987 0 : test_var = PyLong_AsUnsignedLongLong(value);
988 0 : if (PyErr_Occurred() != NULL) {
989 0 : return -1;
990 : }
991 0 : if (test_var > uint_max) {
992 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
993 : PyLong_Type.tp_name, uint_max, test_var);
994 0 : return -1;
995 : }
996 0 : object->size = test_var;
997 : } else {
998 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
999 : PyLong_Type.tp_name);
1000 0 : return -1;
1001 : }
1002 : }
1003 0 : return 0;
1004 : }
1005 :
1006 0 : static PyObject *py_lsa_AsciiString_get_string(PyObject *obj, void *closure)
1007 : {
1008 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(obj);
1009 : PyObject *py_string;
1010 0 : if (object->string == NULL) {
1011 0 : Py_RETURN_NONE;
1012 : }
1013 0 : if (object->string == NULL) {
1014 0 : py_string = Py_None;
1015 0 : Py_INCREF(py_string);
1016 : } else {
1017 0 : if (object->string == NULL) {
1018 0 : py_string = Py_None;
1019 0 : Py_INCREF(py_string);
1020 : } else {
1021 0 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
1022 : }
1023 : }
1024 0 : return py_string;
1025 : }
1026 :
1027 0 : static int py_lsa_AsciiString_set_string(PyObject *py_obj, PyObject *value, void *closure)
1028 : {
1029 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
1030 0 : if (value == NULL) {
1031 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
1032 0 : return -1;
1033 : }
1034 0 : if (value == Py_None) {
1035 0 : object->string = NULL;
1036 : } else {
1037 0 : object->string = NULL;
1038 : {
1039 : const char *test_str;
1040 : const char *talloc_str;
1041 0 : PyObject *unicode = NULL;
1042 0 : if (PyUnicode_Check(value)) {
1043 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1044 0 : if (unicode == NULL) {
1045 0 : PyErr_NoMemory();
1046 0 : return -1;
1047 : }
1048 0 : test_str = PyBytes_AS_STRING(unicode);
1049 0 : } else if (PyBytes_Check(value)) {
1050 0 : test_str = PyBytes_AS_STRING(value);
1051 : } else {
1052 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1053 0 : return -1;
1054 : }
1055 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1056 0 : if (unicode != NULL) {
1057 0 : Py_DECREF(unicode);
1058 : }
1059 0 : if (talloc_str == NULL) {
1060 0 : PyErr_NoMemory();
1061 0 : return -1;
1062 : }
1063 0 : object->string = talloc_str;
1064 : }
1065 : }
1066 0 : return 0;
1067 : }
1068 :
1069 : static PyGetSetDef py_lsa_AsciiString_getsetters[] = {
1070 : {
1071 : .name = discard_const_p(char, "length"),
1072 : .get = py_lsa_AsciiString_get_length,
1073 : .set = py_lsa_AsciiString_set_length,
1074 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1075 : },
1076 : {
1077 : .name = discard_const_p(char, "size"),
1078 : .get = py_lsa_AsciiString_get_size,
1079 : .set = py_lsa_AsciiString_set_size,
1080 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1081 : },
1082 : {
1083 : .name = discard_const_p(char, "string"),
1084 : .get = py_lsa_AsciiString_get_string,
1085 : .set = py_lsa_AsciiString_set_string,
1086 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1087 : },
1088 : { .name = NULL }
1089 : };
1090 :
1091 0 : static PyObject *py_lsa_AsciiString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1092 : {
1093 0 : return pytalloc_new(struct lsa_AsciiString, type);
1094 : }
1095 :
1096 0 : static PyObject *py_lsa_AsciiString_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1097 : {
1098 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
1099 0 : PyObject *ret = NULL;
1100 : DATA_BLOB blob;
1101 : enum ndr_err_code err;
1102 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1103 0 : if (tmp_ctx == NULL) {
1104 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1105 0 : return NULL;
1106 : }
1107 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_AsciiString);
1108 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1109 0 : TALLOC_FREE(tmp_ctx);
1110 0 : PyErr_SetNdrError(err);
1111 0 : return NULL;
1112 : }
1113 :
1114 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1115 0 : TALLOC_FREE(tmp_ctx);
1116 0 : return ret;
1117 : }
1118 :
1119 0 : static PyObject *py_lsa_AsciiString_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1120 : {
1121 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
1122 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1123 0 : Py_ssize_t blob_length = 0;
1124 : enum ndr_err_code err;
1125 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1126 0 : PyObject *allow_remaining_obj = NULL;
1127 0 : bool allow_remaining = false;
1128 :
1129 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1130 : discard_const_p(char *, kwnames),
1131 : &blob.data, &blob_length,
1132 : &allow_remaining_obj)) {
1133 0 : return NULL;
1134 : }
1135 0 : blob.length = blob_length;
1136 :
1137 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1138 0 : allow_remaining = true;
1139 : }
1140 :
1141 0 : if (allow_remaining) {
1142 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiString);
1143 : } else {
1144 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiString);
1145 : }
1146 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1147 0 : PyErr_SetNdrError(err);
1148 0 : return NULL;
1149 : }
1150 :
1151 0 : Py_RETURN_NONE;
1152 : }
1153 :
1154 0 : static PyObject *py_lsa_AsciiString_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1155 : {
1156 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
1157 : PyObject *ret;
1158 : char *retstr;
1159 :
1160 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_AsciiString, "lsa_AsciiString", object);
1161 0 : ret = PyUnicode_FromString(retstr);
1162 0 : talloc_free(retstr);
1163 :
1164 0 : return ret;
1165 : }
1166 :
1167 : static PyMethodDef py_lsa_AsciiString_methods[] = {
1168 : { "__ndr_pack__", (PyCFunction)py_lsa_AsciiString_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1169 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AsciiString_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1170 : { "__ndr_print__", (PyCFunction)py_lsa_AsciiString_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1171 : { NULL, NULL, 0, NULL }
1172 : };
1173 :
1174 :
1175 : static PyTypeObject lsa_AsciiString_Type = {
1176 : PyVarObject_HEAD_INIT(NULL, 0)
1177 : .tp_name = "lsa.AsciiString",
1178 : .tp_getset = py_lsa_AsciiString_getsetters,
1179 : .tp_methods = py_lsa_AsciiString_methods,
1180 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1181 : .tp_new = py_lsa_AsciiString_new,
1182 : };
1183 :
1184 :
1185 0 : static PyObject *py_lsa_AsciiStringLarge_get_length(PyObject *obj, void *closure)
1186 : {
1187 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(obj);
1188 : PyObject *py_length;
1189 0 : py_length = PyLong_FromLong((uint16_t)object->length);
1190 0 : return py_length;
1191 : }
1192 :
1193 0 : static int py_lsa_AsciiStringLarge_set_length(PyObject *py_obj, PyObject *value, void *closure)
1194 : {
1195 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1196 0 : if (value == NULL) {
1197 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
1198 0 : return -1;
1199 : }
1200 : {
1201 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
1202 0 : if (PyLong_Check(value)) {
1203 : unsigned long long test_var;
1204 0 : test_var = PyLong_AsUnsignedLongLong(value);
1205 0 : if (PyErr_Occurred() != NULL) {
1206 0 : return -1;
1207 : }
1208 0 : if (test_var > uint_max) {
1209 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1210 : PyLong_Type.tp_name, uint_max, test_var);
1211 0 : return -1;
1212 : }
1213 0 : object->length = test_var;
1214 : } else {
1215 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1216 : PyLong_Type.tp_name);
1217 0 : return -1;
1218 : }
1219 : }
1220 0 : return 0;
1221 : }
1222 :
1223 0 : static PyObject *py_lsa_AsciiStringLarge_get_size(PyObject *obj, void *closure)
1224 : {
1225 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(obj);
1226 : PyObject *py_size;
1227 0 : py_size = PyLong_FromLong((uint16_t)object->size);
1228 0 : return py_size;
1229 : }
1230 :
1231 0 : static int py_lsa_AsciiStringLarge_set_size(PyObject *py_obj, PyObject *value, void *closure)
1232 : {
1233 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1234 0 : if (value == NULL) {
1235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
1236 0 : return -1;
1237 : }
1238 : {
1239 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
1240 0 : if (PyLong_Check(value)) {
1241 : unsigned long long test_var;
1242 0 : test_var = PyLong_AsUnsignedLongLong(value);
1243 0 : if (PyErr_Occurred() != NULL) {
1244 0 : return -1;
1245 : }
1246 0 : if (test_var > uint_max) {
1247 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1248 : PyLong_Type.tp_name, uint_max, test_var);
1249 0 : return -1;
1250 : }
1251 0 : object->size = test_var;
1252 : } else {
1253 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1254 : PyLong_Type.tp_name);
1255 0 : return -1;
1256 : }
1257 : }
1258 0 : return 0;
1259 : }
1260 :
1261 179 : static PyObject *py_lsa_AsciiStringLarge_get_string(PyObject *obj, void *closure)
1262 : {
1263 179 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(obj);
1264 : PyObject *py_string;
1265 179 : if (object->string == NULL) {
1266 0 : Py_RETURN_NONE;
1267 : }
1268 179 : if (object->string == NULL) {
1269 0 : py_string = Py_None;
1270 0 : Py_INCREF(py_string);
1271 : } else {
1272 179 : if (object->string == NULL) {
1273 0 : py_string = Py_None;
1274 0 : Py_INCREF(py_string);
1275 : } else {
1276 179 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
1277 : }
1278 : }
1279 179 : return py_string;
1280 : }
1281 :
1282 0 : static int py_lsa_AsciiStringLarge_set_string(PyObject *py_obj, PyObject *value, void *closure)
1283 : {
1284 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1285 0 : if (value == NULL) {
1286 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
1287 0 : return -1;
1288 : }
1289 0 : if (value == Py_None) {
1290 0 : object->string = NULL;
1291 : } else {
1292 0 : object->string = NULL;
1293 : {
1294 : const char *test_str;
1295 : const char *talloc_str;
1296 0 : PyObject *unicode = NULL;
1297 0 : if (PyUnicode_Check(value)) {
1298 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1299 0 : if (unicode == NULL) {
1300 0 : PyErr_NoMemory();
1301 0 : return -1;
1302 : }
1303 0 : test_str = PyBytes_AS_STRING(unicode);
1304 0 : } else if (PyBytes_Check(value)) {
1305 0 : test_str = PyBytes_AS_STRING(value);
1306 : } else {
1307 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1308 0 : return -1;
1309 : }
1310 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1311 0 : if (unicode != NULL) {
1312 0 : Py_DECREF(unicode);
1313 : }
1314 0 : if (talloc_str == NULL) {
1315 0 : PyErr_NoMemory();
1316 0 : return -1;
1317 : }
1318 0 : object->string = talloc_str;
1319 : }
1320 : }
1321 0 : return 0;
1322 : }
1323 :
1324 : static PyGetSetDef py_lsa_AsciiStringLarge_getsetters[] = {
1325 : {
1326 : .name = discard_const_p(char, "length"),
1327 : .get = py_lsa_AsciiStringLarge_get_length,
1328 : .set = py_lsa_AsciiStringLarge_set_length,
1329 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1330 : },
1331 : {
1332 : .name = discard_const_p(char, "size"),
1333 : .get = py_lsa_AsciiStringLarge_get_size,
1334 : .set = py_lsa_AsciiStringLarge_set_size,
1335 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1336 : },
1337 : {
1338 : .name = discard_const_p(char, "string"),
1339 : .get = py_lsa_AsciiStringLarge_get_string,
1340 : .set = py_lsa_AsciiStringLarge_set_string,
1341 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1342 : },
1343 : { .name = NULL }
1344 : };
1345 :
1346 0 : static PyObject *py_lsa_AsciiStringLarge_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1347 : {
1348 0 : return pytalloc_new(struct lsa_AsciiStringLarge, type);
1349 : }
1350 :
1351 0 : static PyObject *py_lsa_AsciiStringLarge_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1352 : {
1353 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1354 0 : PyObject *ret = NULL;
1355 : DATA_BLOB blob;
1356 : enum ndr_err_code err;
1357 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1358 0 : if (tmp_ctx == NULL) {
1359 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1360 0 : return NULL;
1361 : }
1362 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_AsciiStringLarge);
1363 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1364 0 : TALLOC_FREE(tmp_ctx);
1365 0 : PyErr_SetNdrError(err);
1366 0 : return NULL;
1367 : }
1368 :
1369 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1370 0 : TALLOC_FREE(tmp_ctx);
1371 0 : return ret;
1372 : }
1373 :
1374 0 : static PyObject *py_lsa_AsciiStringLarge_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1375 : {
1376 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1377 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1378 0 : Py_ssize_t blob_length = 0;
1379 : enum ndr_err_code err;
1380 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1381 0 : PyObject *allow_remaining_obj = NULL;
1382 0 : bool allow_remaining = false;
1383 :
1384 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1385 : discard_const_p(char *, kwnames),
1386 : &blob.data, &blob_length,
1387 : &allow_remaining_obj)) {
1388 0 : return NULL;
1389 : }
1390 0 : blob.length = blob_length;
1391 :
1392 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1393 0 : allow_remaining = true;
1394 : }
1395 :
1396 0 : if (allow_remaining) {
1397 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiStringLarge);
1398 : } else {
1399 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiStringLarge);
1400 : }
1401 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1402 0 : PyErr_SetNdrError(err);
1403 0 : return NULL;
1404 : }
1405 :
1406 0 : Py_RETURN_NONE;
1407 : }
1408 :
1409 0 : static PyObject *py_lsa_AsciiStringLarge_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1410 : {
1411 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1412 : PyObject *ret;
1413 : char *retstr;
1414 :
1415 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_AsciiStringLarge, "lsa_AsciiStringLarge", object);
1416 0 : ret = PyUnicode_FromString(retstr);
1417 0 : talloc_free(retstr);
1418 :
1419 0 : return ret;
1420 : }
1421 :
1422 : static PyMethodDef py_lsa_AsciiStringLarge_methods[] = {
1423 : { "__ndr_pack__", (PyCFunction)py_lsa_AsciiStringLarge_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1424 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AsciiStringLarge_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1425 : { "__ndr_print__", (PyCFunction)py_lsa_AsciiStringLarge_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1426 : { NULL, NULL, 0, NULL }
1427 : };
1428 :
1429 :
1430 : static PyTypeObject lsa_AsciiStringLarge_Type = {
1431 : PyVarObject_HEAD_INIT(NULL, 0)
1432 : .tp_name = "lsa.AsciiStringLarge",
1433 : .tp_getset = py_lsa_AsciiStringLarge_getsetters,
1434 : .tp_methods = py_lsa_AsciiStringLarge_methods,
1435 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1436 : .tp_new = py_lsa_AsciiStringLarge_new,
1437 : };
1438 :
1439 :
1440 0 : static PyObject *py_lsa_BinaryString_get_length(PyObject *obj, void *closure)
1441 : {
1442 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(obj);
1443 : PyObject *py_length;
1444 0 : py_length = PyLong_FromLong((uint16_t)object->length);
1445 0 : return py_length;
1446 : }
1447 :
1448 0 : static int py_lsa_BinaryString_set_length(PyObject *py_obj, PyObject *value, void *closure)
1449 : {
1450 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1451 0 : if (value == NULL) {
1452 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
1453 0 : return -1;
1454 : }
1455 : {
1456 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
1457 0 : if (PyLong_Check(value)) {
1458 : unsigned long long test_var;
1459 0 : test_var = PyLong_AsUnsignedLongLong(value);
1460 0 : if (PyErr_Occurred() != NULL) {
1461 0 : return -1;
1462 : }
1463 0 : if (test_var > uint_max) {
1464 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1465 : PyLong_Type.tp_name, uint_max, test_var);
1466 0 : return -1;
1467 : }
1468 0 : object->length = test_var;
1469 : } else {
1470 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1471 : PyLong_Type.tp_name);
1472 0 : return -1;
1473 : }
1474 : }
1475 0 : return 0;
1476 : }
1477 :
1478 0 : static PyObject *py_lsa_BinaryString_get_size(PyObject *obj, void *closure)
1479 : {
1480 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(obj);
1481 : PyObject *py_size;
1482 0 : py_size = PyLong_FromLong((uint16_t)object->size);
1483 0 : return py_size;
1484 : }
1485 :
1486 0 : static int py_lsa_BinaryString_set_size(PyObject *py_obj, PyObject *value, void *closure)
1487 : {
1488 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1489 0 : if (value == NULL) {
1490 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
1491 0 : return -1;
1492 : }
1493 : {
1494 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
1495 0 : if (PyLong_Check(value)) {
1496 : unsigned long long test_var;
1497 0 : test_var = PyLong_AsUnsignedLongLong(value);
1498 0 : if (PyErr_Occurred() != NULL) {
1499 0 : return -1;
1500 : }
1501 0 : if (test_var > uint_max) {
1502 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1503 : PyLong_Type.tp_name, uint_max, test_var);
1504 0 : return -1;
1505 : }
1506 0 : object->size = test_var;
1507 : } else {
1508 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1509 : PyLong_Type.tp_name);
1510 0 : return -1;
1511 : }
1512 : }
1513 0 : return 0;
1514 : }
1515 :
1516 0 : static PyObject *py_lsa_BinaryString_get_array(PyObject *obj, void *closure)
1517 : {
1518 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(obj);
1519 : PyObject *py_array;
1520 0 : if (object->array == NULL) {
1521 0 : Py_RETURN_NONE;
1522 : }
1523 0 : if (object->array == NULL) {
1524 0 : py_array = Py_None;
1525 0 : Py_INCREF(py_array);
1526 : } else {
1527 0 : py_array = PyList_New(object->length / 2);
1528 0 : if (py_array == NULL) {
1529 0 : return NULL;
1530 : }
1531 : {
1532 : int array_cntr_1;
1533 0 : for (array_cntr_1 = 0; array_cntr_1 < (object->length / 2); array_cntr_1++) {
1534 : PyObject *py_array_1;
1535 0 : py_array_1 = PyLong_FromLong((uint16_t)object->array[array_cntr_1]);
1536 0 : PyList_SetItem(py_array, array_cntr_1, py_array_1);
1537 : }
1538 : }
1539 : }
1540 0 : return py_array;
1541 : }
1542 :
1543 0 : static int py_lsa_BinaryString_set_array(PyObject *py_obj, PyObject *value, void *closure)
1544 : {
1545 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1546 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
1547 0 : if (value == NULL) {
1548 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
1549 0 : return -1;
1550 : }
1551 0 : if (value == Py_None) {
1552 0 : object->array = NULL;
1553 : } else {
1554 0 : object->array = NULL;
1555 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1556 : {
1557 : int array_cntr_1;
1558 0 : object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
1559 0 : if (!object->array) { return -1;; }
1560 0 : talloc_set_name_const(object->array, "ARRAY: object->array");
1561 0 : for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
1562 0 : if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
1563 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
1564 0 : return -1;
1565 : }
1566 : {
1567 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->array[array_cntr_1]));
1568 0 : if (PyLong_Check(PyList_GET_ITEM(value, array_cntr_1))) {
1569 : unsigned long long test_var;
1570 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, array_cntr_1));
1571 0 : if (PyErr_Occurred() != NULL) {
1572 0 : return -1;
1573 : }
1574 0 : if (test_var > uint_max) {
1575 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1576 : PyLong_Type.tp_name, uint_max, test_var);
1577 0 : return -1;
1578 : }
1579 0 : object->array[array_cntr_1] = test_var;
1580 : } else {
1581 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1582 : PyLong_Type.tp_name);
1583 0 : return -1;
1584 : }
1585 : }
1586 : }
1587 : }
1588 : }
1589 0 : return 0;
1590 : }
1591 :
1592 : static PyGetSetDef py_lsa_BinaryString_getsetters[] = {
1593 : {
1594 : .name = discard_const_p(char, "length"),
1595 : .get = py_lsa_BinaryString_get_length,
1596 : .set = py_lsa_BinaryString_set_length,
1597 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1598 : },
1599 : {
1600 : .name = discard_const_p(char, "size"),
1601 : .get = py_lsa_BinaryString_get_size,
1602 : .set = py_lsa_BinaryString_set_size,
1603 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1604 : },
1605 : {
1606 : .name = discard_const_p(char, "array"),
1607 : .get = py_lsa_BinaryString_get_array,
1608 : .set = py_lsa_BinaryString_set_array,
1609 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1610 : },
1611 : { .name = NULL }
1612 : };
1613 :
1614 0 : static PyObject *py_lsa_BinaryString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1615 : {
1616 0 : return pytalloc_new(struct lsa_BinaryString, type);
1617 : }
1618 :
1619 0 : static PyObject *py_lsa_BinaryString_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1620 : {
1621 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1622 0 : PyObject *ret = NULL;
1623 : DATA_BLOB blob;
1624 : enum ndr_err_code err;
1625 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1626 0 : if (tmp_ctx == NULL) {
1627 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1628 0 : return NULL;
1629 : }
1630 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_BinaryString);
1631 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1632 0 : TALLOC_FREE(tmp_ctx);
1633 0 : PyErr_SetNdrError(err);
1634 0 : return NULL;
1635 : }
1636 :
1637 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1638 0 : TALLOC_FREE(tmp_ctx);
1639 0 : return ret;
1640 : }
1641 :
1642 0 : static PyObject *py_lsa_BinaryString_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1643 : {
1644 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1645 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1646 0 : Py_ssize_t blob_length = 0;
1647 : enum ndr_err_code err;
1648 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1649 0 : PyObject *allow_remaining_obj = NULL;
1650 0 : bool allow_remaining = false;
1651 :
1652 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1653 : discard_const_p(char *, kwnames),
1654 : &blob.data, &blob_length,
1655 : &allow_remaining_obj)) {
1656 0 : return NULL;
1657 : }
1658 0 : blob.length = blob_length;
1659 :
1660 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1661 0 : allow_remaining = true;
1662 : }
1663 :
1664 0 : if (allow_remaining) {
1665 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_BinaryString);
1666 : } else {
1667 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_BinaryString);
1668 : }
1669 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1670 0 : PyErr_SetNdrError(err);
1671 0 : return NULL;
1672 : }
1673 :
1674 0 : Py_RETURN_NONE;
1675 : }
1676 :
1677 0 : static PyObject *py_lsa_BinaryString_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1678 : {
1679 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1680 : PyObject *ret;
1681 : char *retstr;
1682 :
1683 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_BinaryString, "lsa_BinaryString", object);
1684 0 : ret = PyUnicode_FromString(retstr);
1685 0 : talloc_free(retstr);
1686 :
1687 0 : return ret;
1688 : }
1689 :
1690 : static PyMethodDef py_lsa_BinaryString_methods[] = {
1691 : { "__ndr_pack__", (PyCFunction)py_lsa_BinaryString_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1692 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_BinaryString_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1693 : { "__ndr_print__", (PyCFunction)py_lsa_BinaryString_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1694 : { NULL, NULL, 0, NULL }
1695 : };
1696 :
1697 :
1698 : static PyTypeObject lsa_BinaryString_Type = {
1699 : PyVarObject_HEAD_INIT(NULL, 0)
1700 : .tp_name = "lsa.BinaryString",
1701 : .tp_getset = py_lsa_BinaryString_getsetters,
1702 : .tp_methods = py_lsa_BinaryString_methods,
1703 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1704 : .tp_new = py_lsa_BinaryString_new,
1705 : };
1706 :
1707 :
1708 0 : static PyObject *py_lsa_LUID_get_low(PyObject *obj, void *closure)
1709 : {
1710 0 : struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(obj);
1711 : PyObject *py_low;
1712 0 : py_low = PyLong_FromUnsignedLongLong((uint32_t)object->low);
1713 0 : return py_low;
1714 : }
1715 :
1716 0 : static int py_lsa_LUID_set_low(PyObject *py_obj, PyObject *value, void *closure)
1717 : {
1718 0 : struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(py_obj);
1719 0 : if (value == NULL) {
1720 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->low");
1721 0 : return -1;
1722 : }
1723 : {
1724 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->low));
1725 0 : if (PyLong_Check(value)) {
1726 : unsigned long long test_var;
1727 0 : test_var = PyLong_AsUnsignedLongLong(value);
1728 0 : if (PyErr_Occurred() != NULL) {
1729 0 : return -1;
1730 : }
1731 0 : if (test_var > uint_max) {
1732 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1733 : PyLong_Type.tp_name, uint_max, test_var);
1734 0 : return -1;
1735 : }
1736 0 : object->low = test_var;
1737 : } else {
1738 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1739 : PyLong_Type.tp_name);
1740 0 : return -1;
1741 : }
1742 : }
1743 0 : return 0;
1744 : }
1745 :
1746 0 : static PyObject *py_lsa_LUID_get_high(PyObject *obj, void *closure)
1747 : {
1748 0 : struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(obj);
1749 : PyObject *py_high;
1750 0 : py_high = PyLong_FromUnsignedLongLong((uint32_t)object->high);
1751 0 : return py_high;
1752 : }
1753 :
1754 0 : static int py_lsa_LUID_set_high(PyObject *py_obj, PyObject *value, void *closure)
1755 : {
1756 0 : struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(py_obj);
1757 0 : if (value == NULL) {
1758 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->high");
1759 0 : return -1;
1760 : }
1761 : {
1762 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->high));
1763 0 : if (PyLong_Check(value)) {
1764 : unsigned long long test_var;
1765 0 : test_var = PyLong_AsUnsignedLongLong(value);
1766 0 : if (PyErr_Occurred() != NULL) {
1767 0 : return -1;
1768 : }
1769 0 : if (test_var > uint_max) {
1770 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1771 : PyLong_Type.tp_name, uint_max, test_var);
1772 0 : return -1;
1773 : }
1774 0 : object->high = test_var;
1775 : } else {
1776 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1777 : PyLong_Type.tp_name);
1778 0 : return -1;
1779 : }
1780 : }
1781 0 : return 0;
1782 : }
1783 :
1784 : static PyGetSetDef py_lsa_LUID_getsetters[] = {
1785 : {
1786 : .name = discard_const_p(char, "low"),
1787 : .get = py_lsa_LUID_get_low,
1788 : .set = py_lsa_LUID_set_low,
1789 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1790 : },
1791 : {
1792 : .name = discard_const_p(char, "high"),
1793 : .get = py_lsa_LUID_get_high,
1794 : .set = py_lsa_LUID_set_high,
1795 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1796 : },
1797 : { .name = NULL }
1798 : };
1799 :
1800 0 : static PyObject *py_lsa_LUID_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1801 : {
1802 0 : return pytalloc_new(struct lsa_LUID, type);
1803 : }
1804 :
1805 :
1806 : static PyTypeObject lsa_LUID_Type = {
1807 : PyVarObject_HEAD_INIT(NULL, 0)
1808 : .tp_name = "lsa.LUID",
1809 : .tp_getset = py_lsa_LUID_getsetters,
1810 : .tp_methods = NULL,
1811 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1812 : .tp_new = py_lsa_LUID_new,
1813 : };
1814 :
1815 :
1816 0 : static PyObject *py_lsa_PrivEntry_get_name(PyObject *obj, void *closure)
1817 : {
1818 0 : struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(obj);
1819 : PyObject *py_name;
1820 0 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
1821 0 : return py_name;
1822 : }
1823 :
1824 0 : static int py_lsa_PrivEntry_set_name(PyObject *py_obj, PyObject *value, void *closure)
1825 : {
1826 0 : struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(py_obj);
1827 0 : if (value == NULL) {
1828 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
1829 0 : return -1;
1830 : }
1831 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
1832 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1833 0 : PyErr_NoMemory();
1834 0 : return -1;
1835 : }
1836 0 : object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
1837 0 : return 0;
1838 : }
1839 :
1840 0 : static PyObject *py_lsa_PrivEntry_get_luid(PyObject *obj, void *closure)
1841 : {
1842 0 : struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(obj);
1843 : PyObject *py_luid;
1844 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, pytalloc_get_mem_ctx(obj), &object->luid);
1845 0 : return py_luid;
1846 : }
1847 :
1848 0 : static int py_lsa_PrivEntry_set_luid(PyObject *py_obj, PyObject *value, void *closure)
1849 : {
1850 0 : struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(py_obj);
1851 0 : if (value == NULL) {
1852 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->luid");
1853 0 : return -1;
1854 : }
1855 0 : PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
1856 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1857 0 : PyErr_NoMemory();
1858 0 : return -1;
1859 : }
1860 0 : object->luid = *(struct lsa_LUID *)pytalloc_get_ptr(value);
1861 0 : return 0;
1862 : }
1863 :
1864 : static PyGetSetDef py_lsa_PrivEntry_getsetters[] = {
1865 : {
1866 : .name = discard_const_p(char, "name"),
1867 : .get = py_lsa_PrivEntry_get_name,
1868 : .set = py_lsa_PrivEntry_set_name,
1869 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
1870 : },
1871 : {
1872 : .name = discard_const_p(char, "luid"),
1873 : .get = py_lsa_PrivEntry_get_luid,
1874 : .set = py_lsa_PrivEntry_set_luid,
1875 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUID")
1876 : },
1877 : { .name = NULL }
1878 : };
1879 :
1880 0 : static PyObject *py_lsa_PrivEntry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1881 : {
1882 0 : return pytalloc_new(struct lsa_PrivEntry, type);
1883 : }
1884 :
1885 :
1886 : static PyTypeObject lsa_PrivEntry_Type = {
1887 : PyVarObject_HEAD_INIT(NULL, 0)
1888 : .tp_name = "lsa.PrivEntry",
1889 : .tp_getset = py_lsa_PrivEntry_getsetters,
1890 : .tp_methods = NULL,
1891 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1892 : .tp_new = py_lsa_PrivEntry_new,
1893 : };
1894 :
1895 :
1896 0 : static PyObject *py_lsa_PrivArray_get_count(PyObject *obj, void *closure)
1897 : {
1898 0 : struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(obj);
1899 : PyObject *py_count;
1900 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
1901 0 : return py_count;
1902 : }
1903 :
1904 0 : static int py_lsa_PrivArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
1905 : {
1906 0 : struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(py_obj);
1907 0 : if (value == NULL) {
1908 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
1909 0 : return -1;
1910 : }
1911 : {
1912 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
1913 0 : if (PyLong_Check(value)) {
1914 : unsigned long long test_var;
1915 0 : test_var = PyLong_AsUnsignedLongLong(value);
1916 0 : if (PyErr_Occurred() != NULL) {
1917 0 : return -1;
1918 : }
1919 0 : if (test_var > uint_max) {
1920 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1921 : PyLong_Type.tp_name, uint_max, test_var);
1922 0 : return -1;
1923 : }
1924 0 : object->count = test_var;
1925 : } else {
1926 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1927 : PyLong_Type.tp_name);
1928 0 : return -1;
1929 : }
1930 : }
1931 0 : return 0;
1932 : }
1933 :
1934 0 : static PyObject *py_lsa_PrivArray_get_privs(PyObject *obj, void *closure)
1935 : {
1936 0 : struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(obj);
1937 : PyObject *py_privs;
1938 0 : if (object->privs == NULL) {
1939 0 : Py_RETURN_NONE;
1940 : }
1941 0 : if (object->privs == NULL) {
1942 0 : py_privs = Py_None;
1943 0 : Py_INCREF(py_privs);
1944 : } else {
1945 0 : py_privs = PyList_New(object->count);
1946 0 : if (py_privs == NULL) {
1947 0 : return NULL;
1948 : }
1949 : {
1950 : int privs_cntr_1;
1951 0 : for (privs_cntr_1 = 0; privs_cntr_1 < (object->count); privs_cntr_1++) {
1952 : PyObject *py_privs_1;
1953 0 : py_privs_1 = pytalloc_reference_ex(&lsa_PrivEntry_Type, object->privs, &object->privs[privs_cntr_1]);
1954 0 : PyList_SetItem(py_privs, privs_cntr_1, py_privs_1);
1955 : }
1956 : }
1957 : }
1958 0 : return py_privs;
1959 : }
1960 :
1961 0 : static int py_lsa_PrivArray_set_privs(PyObject *py_obj, PyObject *value, void *closure)
1962 : {
1963 0 : struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(py_obj);
1964 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->privs));
1965 0 : if (value == NULL) {
1966 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privs");
1967 0 : return -1;
1968 : }
1969 0 : if (value == Py_None) {
1970 0 : object->privs = NULL;
1971 : } else {
1972 0 : object->privs = NULL;
1973 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1974 : {
1975 : int privs_cntr_1;
1976 0 : object->privs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->privs, PyList_GET_SIZE(value));
1977 0 : if (!object->privs) { return -1;; }
1978 0 : talloc_set_name_const(object->privs, "ARRAY: object->privs");
1979 0 : for (privs_cntr_1 = 0; privs_cntr_1 < PyList_GET_SIZE(value); privs_cntr_1++) {
1980 0 : if (PyList_GET_ITEM(value, privs_cntr_1) == NULL) {
1981 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privs[privs_cntr_1]");
1982 0 : return -1;
1983 : }
1984 0 : PY_CHECK_TYPE(&lsa_PrivEntry_Type, PyList_GET_ITEM(value, privs_cntr_1), return -1;);
1985 0 : if (talloc_reference(object->privs, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, privs_cntr_1))) == NULL) {
1986 0 : PyErr_NoMemory();
1987 0 : return -1;
1988 : }
1989 0 : object->privs[privs_cntr_1] = *(struct lsa_PrivEntry *)pytalloc_get_ptr(PyList_GET_ITEM(value, privs_cntr_1));
1990 : }
1991 : }
1992 : }
1993 0 : return 0;
1994 : }
1995 :
1996 : static PyGetSetDef py_lsa_PrivArray_getsetters[] = {
1997 : {
1998 : .name = discard_const_p(char, "count"),
1999 : .get = py_lsa_PrivArray_get_count,
2000 : .set = py_lsa_PrivArray_set_count,
2001 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2002 : },
2003 : {
2004 : .name = discard_const_p(char, "privs"),
2005 : .get = py_lsa_PrivArray_get_privs,
2006 : .set = py_lsa_PrivArray_set_privs,
2007 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivEntry")
2008 : },
2009 : { .name = NULL }
2010 : };
2011 :
2012 0 : static PyObject *py_lsa_PrivArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2013 : {
2014 0 : return pytalloc_new(struct lsa_PrivArray, type);
2015 : }
2016 :
2017 :
2018 : static PyTypeObject lsa_PrivArray_Type = {
2019 : PyVarObject_HEAD_INIT(NULL, 0)
2020 : .tp_name = "lsa.PrivArray",
2021 : .tp_getset = py_lsa_PrivArray_getsetters,
2022 : .tp_methods = NULL,
2023 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2024 : .tp_new = py_lsa_PrivArray_new,
2025 : };
2026 :
2027 :
2028 0 : static PyObject *py_lsa_QosInfo_get_len(PyObject *obj, void *closure)
2029 : {
2030 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(obj);
2031 : PyObject *py_len;
2032 0 : py_len = PyLong_FromUnsignedLongLong((uint32_t)object->len);
2033 0 : return py_len;
2034 : }
2035 :
2036 0 : static int py_lsa_QosInfo_set_len(PyObject *py_obj, PyObject *value, void *closure)
2037 : {
2038 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
2039 0 : if (value == NULL) {
2040 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->len");
2041 0 : return -1;
2042 : }
2043 : {
2044 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->len));
2045 0 : if (PyLong_Check(value)) {
2046 : unsigned long long test_var;
2047 0 : test_var = PyLong_AsUnsignedLongLong(value);
2048 0 : if (PyErr_Occurred() != NULL) {
2049 0 : return -1;
2050 : }
2051 0 : if (test_var > uint_max) {
2052 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2053 : PyLong_Type.tp_name, uint_max, test_var);
2054 0 : return -1;
2055 : }
2056 0 : object->len = test_var;
2057 : } else {
2058 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2059 : PyLong_Type.tp_name);
2060 0 : return -1;
2061 : }
2062 : }
2063 0 : return 0;
2064 : }
2065 :
2066 0 : static PyObject *py_lsa_QosInfo_get_impersonation_level(PyObject *obj, void *closure)
2067 : {
2068 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(obj);
2069 : PyObject *py_impersonation_level;
2070 0 : py_impersonation_level = PyLong_FromLong((uint16_t)object->impersonation_level);
2071 0 : return py_impersonation_level;
2072 : }
2073 :
2074 0 : static int py_lsa_QosInfo_set_impersonation_level(PyObject *py_obj, PyObject *value, void *closure)
2075 : {
2076 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
2077 0 : if (value == NULL) {
2078 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->impersonation_level");
2079 0 : return -1;
2080 : }
2081 : {
2082 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->impersonation_level));
2083 0 : if (PyLong_Check(value)) {
2084 : unsigned long long test_var;
2085 0 : test_var = PyLong_AsUnsignedLongLong(value);
2086 0 : if (PyErr_Occurred() != NULL) {
2087 0 : return -1;
2088 : }
2089 0 : if (test_var > uint_max) {
2090 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2091 : PyLong_Type.tp_name, uint_max, test_var);
2092 0 : return -1;
2093 : }
2094 0 : object->impersonation_level = test_var;
2095 : } else {
2096 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2097 : PyLong_Type.tp_name);
2098 0 : return -1;
2099 : }
2100 : }
2101 0 : return 0;
2102 : }
2103 :
2104 0 : static PyObject *py_lsa_QosInfo_get_context_mode(PyObject *obj, void *closure)
2105 : {
2106 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(obj);
2107 : PyObject *py_context_mode;
2108 0 : py_context_mode = PyLong_FromLong((uint16_t)object->context_mode);
2109 0 : return py_context_mode;
2110 : }
2111 :
2112 0 : static int py_lsa_QosInfo_set_context_mode(PyObject *py_obj, PyObject *value, void *closure)
2113 : {
2114 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
2115 0 : if (value == NULL) {
2116 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->context_mode");
2117 0 : return -1;
2118 : }
2119 : {
2120 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_mode));
2121 0 : if (PyLong_Check(value)) {
2122 : unsigned long long test_var;
2123 0 : test_var = PyLong_AsUnsignedLongLong(value);
2124 0 : if (PyErr_Occurred() != NULL) {
2125 0 : return -1;
2126 : }
2127 0 : if (test_var > uint_max) {
2128 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2129 : PyLong_Type.tp_name, uint_max, test_var);
2130 0 : return -1;
2131 : }
2132 0 : object->context_mode = test_var;
2133 : } else {
2134 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2135 : PyLong_Type.tp_name);
2136 0 : return -1;
2137 : }
2138 : }
2139 0 : return 0;
2140 : }
2141 :
2142 0 : static PyObject *py_lsa_QosInfo_get_effective_only(PyObject *obj, void *closure)
2143 : {
2144 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(obj);
2145 : PyObject *py_effective_only;
2146 0 : py_effective_only = PyLong_FromLong((uint16_t)object->effective_only);
2147 0 : return py_effective_only;
2148 : }
2149 :
2150 0 : static int py_lsa_QosInfo_set_effective_only(PyObject *py_obj, PyObject *value, void *closure)
2151 : {
2152 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
2153 0 : if (value == NULL) {
2154 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->effective_only");
2155 0 : return -1;
2156 : }
2157 : {
2158 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->effective_only));
2159 0 : if (PyLong_Check(value)) {
2160 : unsigned long long test_var;
2161 0 : test_var = PyLong_AsUnsignedLongLong(value);
2162 0 : if (PyErr_Occurred() != NULL) {
2163 0 : return -1;
2164 : }
2165 0 : if (test_var > uint_max) {
2166 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2167 : PyLong_Type.tp_name, uint_max, test_var);
2168 0 : return -1;
2169 : }
2170 0 : object->effective_only = test_var;
2171 : } else {
2172 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2173 : PyLong_Type.tp_name);
2174 0 : return -1;
2175 : }
2176 : }
2177 0 : return 0;
2178 : }
2179 :
2180 : static PyGetSetDef py_lsa_QosInfo_getsetters[] = {
2181 : {
2182 : .name = discard_const_p(char, "len"),
2183 : .get = py_lsa_QosInfo_get_len,
2184 : .set = py_lsa_QosInfo_set_len,
2185 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
2186 : },
2187 : {
2188 : .name = discard_const_p(char, "impersonation_level"),
2189 : .get = py_lsa_QosInfo_get_impersonation_level,
2190 : .set = py_lsa_QosInfo_set_impersonation_level,
2191 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2192 : },
2193 : {
2194 : .name = discard_const_p(char, "context_mode"),
2195 : .get = py_lsa_QosInfo_get_context_mode,
2196 : .set = py_lsa_QosInfo_set_context_mode,
2197 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2198 : },
2199 : {
2200 : .name = discard_const_p(char, "effective_only"),
2201 : .get = py_lsa_QosInfo_get_effective_only,
2202 : .set = py_lsa_QosInfo_set_effective_only,
2203 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2204 : },
2205 : { .name = NULL }
2206 : };
2207 :
2208 213 : static PyObject *py_lsa_QosInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2209 : {
2210 213 : return pytalloc_new(struct lsa_QosInfo, type);
2211 : }
2212 :
2213 :
2214 : static PyTypeObject lsa_QosInfo_Type = {
2215 : PyVarObject_HEAD_INIT(NULL, 0)
2216 : .tp_name = "lsa.QosInfo",
2217 : .tp_getset = py_lsa_QosInfo_getsetters,
2218 : .tp_methods = NULL,
2219 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2220 : .tp_new = py_lsa_QosInfo_new,
2221 : };
2222 :
2223 :
2224 0 : static PyObject *py_lsa_ObjectAttribute_get_len(PyObject *obj, void *closure)
2225 : {
2226 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2227 : PyObject *py_len;
2228 0 : py_len = PyLong_FromUnsignedLongLong((uint32_t)object->len);
2229 0 : return py_len;
2230 : }
2231 :
2232 0 : static int py_lsa_ObjectAttribute_set_len(PyObject *py_obj, PyObject *value, void *closure)
2233 : {
2234 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2235 0 : if (value == NULL) {
2236 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->len");
2237 0 : return -1;
2238 : }
2239 : {
2240 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->len));
2241 0 : if (PyLong_Check(value)) {
2242 : unsigned long long test_var;
2243 0 : test_var = PyLong_AsUnsignedLongLong(value);
2244 0 : if (PyErr_Occurred() != NULL) {
2245 0 : return -1;
2246 : }
2247 0 : if (test_var > uint_max) {
2248 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2249 : PyLong_Type.tp_name, uint_max, test_var);
2250 0 : return -1;
2251 : }
2252 0 : object->len = test_var;
2253 : } else {
2254 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2255 : PyLong_Type.tp_name);
2256 0 : return -1;
2257 : }
2258 : }
2259 0 : return 0;
2260 : }
2261 :
2262 0 : static PyObject *py_lsa_ObjectAttribute_get_root_dir(PyObject *obj, void *closure)
2263 : {
2264 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2265 : PyObject *py_root_dir;
2266 0 : if (object->root_dir == NULL) {
2267 0 : Py_RETURN_NONE;
2268 : }
2269 0 : if (object->root_dir == NULL) {
2270 0 : py_root_dir = Py_None;
2271 0 : Py_INCREF(py_root_dir);
2272 : } else {
2273 0 : py_root_dir = PyLong_FromLong((uint16_t)*object->root_dir);
2274 : }
2275 0 : return py_root_dir;
2276 : }
2277 :
2278 0 : static int py_lsa_ObjectAttribute_set_root_dir(PyObject *py_obj, PyObject *value, void *closure)
2279 : {
2280 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2281 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->root_dir));
2282 0 : if (value == NULL) {
2283 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->root_dir");
2284 0 : return -1;
2285 : }
2286 0 : if (value == Py_None) {
2287 0 : object->root_dir = NULL;
2288 : } else {
2289 0 : object->root_dir = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->root_dir);
2290 0 : if (object->root_dir == NULL) {
2291 0 : PyErr_NoMemory();
2292 0 : return -1;
2293 : }
2294 : {
2295 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->root_dir));
2296 0 : if (PyLong_Check(value)) {
2297 : unsigned long long test_var;
2298 0 : test_var = PyLong_AsUnsignedLongLong(value);
2299 0 : if (PyErr_Occurred() != NULL) {
2300 0 : return -1;
2301 : }
2302 0 : if (test_var > uint_max) {
2303 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2304 : PyLong_Type.tp_name, uint_max, test_var);
2305 0 : return -1;
2306 : }
2307 0 : *object->root_dir = test_var;
2308 : } else {
2309 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2310 : PyLong_Type.tp_name);
2311 0 : return -1;
2312 : }
2313 : }
2314 : }
2315 0 : return 0;
2316 : }
2317 :
2318 0 : static PyObject *py_lsa_ObjectAttribute_get_object_name(PyObject *obj, void *closure)
2319 : {
2320 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2321 : PyObject *py_object_name;
2322 0 : if (object->object_name == NULL) {
2323 0 : Py_RETURN_NONE;
2324 : }
2325 0 : if (object->object_name == NULL) {
2326 0 : py_object_name = Py_None;
2327 0 : Py_INCREF(py_object_name);
2328 : } else {
2329 0 : if (object->object_name == NULL) {
2330 0 : py_object_name = Py_None;
2331 0 : Py_INCREF(py_object_name);
2332 : } else {
2333 0 : py_object_name = PyUnicode_Decode(object->object_name, strlen(object->object_name), "utf-8", "ignore");
2334 : }
2335 : }
2336 0 : return py_object_name;
2337 : }
2338 :
2339 0 : static int py_lsa_ObjectAttribute_set_object_name(PyObject *py_obj, PyObject *value, void *closure)
2340 : {
2341 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2342 0 : if (value == NULL) {
2343 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->object_name");
2344 0 : return -1;
2345 : }
2346 0 : if (value == Py_None) {
2347 0 : object->object_name = NULL;
2348 : } else {
2349 0 : object->object_name = NULL;
2350 : {
2351 : const char *test_str;
2352 : const char *talloc_str;
2353 0 : PyObject *unicode = NULL;
2354 0 : if (PyUnicode_Check(value)) {
2355 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2356 0 : if (unicode == NULL) {
2357 0 : PyErr_NoMemory();
2358 0 : return -1;
2359 : }
2360 0 : test_str = PyBytes_AS_STRING(unicode);
2361 0 : } else if (PyBytes_Check(value)) {
2362 0 : test_str = PyBytes_AS_STRING(value);
2363 : } else {
2364 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2365 0 : return -1;
2366 : }
2367 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2368 0 : if (unicode != NULL) {
2369 0 : Py_DECREF(unicode);
2370 : }
2371 0 : if (talloc_str == NULL) {
2372 0 : PyErr_NoMemory();
2373 0 : return -1;
2374 : }
2375 0 : object->object_name = talloc_str;
2376 : }
2377 : }
2378 0 : return 0;
2379 : }
2380 :
2381 0 : static PyObject *py_lsa_ObjectAttribute_get_attributes(PyObject *obj, void *closure)
2382 : {
2383 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2384 : PyObject *py_attributes;
2385 0 : py_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->attributes);
2386 0 : return py_attributes;
2387 : }
2388 :
2389 0 : static int py_lsa_ObjectAttribute_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
2390 : {
2391 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2392 0 : if (value == NULL) {
2393 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes");
2394 0 : return -1;
2395 : }
2396 : {
2397 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
2398 0 : if (PyLong_Check(value)) {
2399 : unsigned long long test_var;
2400 0 : test_var = PyLong_AsUnsignedLongLong(value);
2401 0 : if (PyErr_Occurred() != NULL) {
2402 0 : return -1;
2403 : }
2404 0 : if (test_var > uint_max) {
2405 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2406 : PyLong_Type.tp_name, uint_max, test_var);
2407 0 : return -1;
2408 : }
2409 0 : object->attributes = test_var;
2410 : } else {
2411 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2412 : PyLong_Type.tp_name);
2413 0 : return -1;
2414 : }
2415 : }
2416 0 : return 0;
2417 : }
2418 :
2419 0 : static PyObject *py_lsa_ObjectAttribute_get_sec_desc(PyObject *obj, void *closure)
2420 : {
2421 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2422 : PyObject *py_sec_desc;
2423 0 : if (object->sec_desc == NULL) {
2424 0 : Py_RETURN_NONE;
2425 : }
2426 0 : if (object->sec_desc == NULL) {
2427 0 : py_sec_desc = Py_None;
2428 0 : Py_INCREF(py_sec_desc);
2429 : } else {
2430 0 : py_sec_desc = pytalloc_reference_ex(security_descriptor_Type, object->sec_desc, object->sec_desc);
2431 : }
2432 0 : return py_sec_desc;
2433 : }
2434 :
2435 0 : static int py_lsa_ObjectAttribute_set_sec_desc(PyObject *py_obj, PyObject *value, void *closure)
2436 : {
2437 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2438 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sec_desc));
2439 0 : if (value == NULL) {
2440 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sec_desc");
2441 0 : return -1;
2442 : }
2443 0 : if (value == Py_None) {
2444 0 : object->sec_desc = NULL;
2445 : } else {
2446 0 : object->sec_desc = NULL;
2447 0 : PY_CHECK_TYPE(security_descriptor_Type, value, return -1;);
2448 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2449 0 : PyErr_NoMemory();
2450 0 : return -1;
2451 : }
2452 0 : object->sec_desc = (struct security_descriptor *)pytalloc_get_ptr(value);
2453 : }
2454 0 : return 0;
2455 : }
2456 :
2457 0 : static PyObject *py_lsa_ObjectAttribute_get_sec_qos(PyObject *obj, void *closure)
2458 : {
2459 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2460 : PyObject *py_sec_qos;
2461 0 : if (object->sec_qos == NULL) {
2462 0 : Py_RETURN_NONE;
2463 : }
2464 0 : if (object->sec_qos == NULL) {
2465 0 : py_sec_qos = Py_None;
2466 0 : Py_INCREF(py_sec_qos);
2467 : } else {
2468 0 : py_sec_qos = pytalloc_reference_ex(&lsa_QosInfo_Type, object->sec_qos, object->sec_qos);
2469 : }
2470 0 : return py_sec_qos;
2471 : }
2472 :
2473 213 : static int py_lsa_ObjectAttribute_set_sec_qos(PyObject *py_obj, PyObject *value, void *closure)
2474 : {
2475 213 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2476 213 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sec_qos));
2477 213 : if (value == NULL) {
2478 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sec_qos");
2479 0 : return -1;
2480 : }
2481 213 : if (value == Py_None) {
2482 0 : object->sec_qos = NULL;
2483 : } else {
2484 213 : object->sec_qos = NULL;
2485 213 : PY_CHECK_TYPE(&lsa_QosInfo_Type, value, return -1;);
2486 213 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2487 0 : PyErr_NoMemory();
2488 0 : return -1;
2489 : }
2490 213 : object->sec_qos = (struct lsa_QosInfo *)pytalloc_get_ptr(value);
2491 : }
2492 213 : return 0;
2493 : }
2494 :
2495 : static PyGetSetDef py_lsa_ObjectAttribute_getsetters[] = {
2496 : {
2497 : .name = discard_const_p(char, "len"),
2498 : .get = py_lsa_ObjectAttribute_get_len,
2499 : .set = py_lsa_ObjectAttribute_set_len,
2500 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
2501 : },
2502 : {
2503 : .name = discard_const_p(char, "root_dir"),
2504 : .get = py_lsa_ObjectAttribute_get_root_dir,
2505 : .set = py_lsa_ObjectAttribute_set_root_dir,
2506 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2507 : },
2508 : {
2509 : .name = discard_const_p(char, "object_name"),
2510 : .get = py_lsa_ObjectAttribute_get_object_name,
2511 : .set = py_lsa_ObjectAttribute_set_object_name,
2512 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2513 : },
2514 : {
2515 : .name = discard_const_p(char, "attributes"),
2516 : .get = py_lsa_ObjectAttribute_get_attributes,
2517 : .set = py_lsa_ObjectAttribute_set_attributes,
2518 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2519 : },
2520 : {
2521 : .name = discard_const_p(char, "sec_desc"),
2522 : .get = py_lsa_ObjectAttribute_get_sec_desc,
2523 : .set = py_lsa_ObjectAttribute_set_sec_desc,
2524 : .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor")
2525 : },
2526 : {
2527 : .name = discard_const_p(char, "sec_qos"),
2528 : .get = py_lsa_ObjectAttribute_get_sec_qos,
2529 : .set = py_lsa_ObjectAttribute_set_sec_qos,
2530 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_QosInfo")
2531 : },
2532 : { .name = NULL }
2533 : };
2534 :
2535 217 : static PyObject *py_lsa_ObjectAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2536 : {
2537 217 : return pytalloc_new(struct lsa_ObjectAttribute, type);
2538 : }
2539 :
2540 :
2541 : static PyTypeObject lsa_ObjectAttribute_Type = {
2542 : PyVarObject_HEAD_INIT(NULL, 0)
2543 : .tp_name = "lsa.ObjectAttribute",
2544 : .tp_getset = py_lsa_ObjectAttribute_getsetters,
2545 : .tp_methods = NULL,
2546 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2547 : .tp_new = py_lsa_ObjectAttribute_new,
2548 : };
2549 :
2550 :
2551 0 : static PyObject *py_lsa_AuditLogInfo_get_percent_full(PyObject *obj, void *closure)
2552 : {
2553 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2554 : PyObject *py_percent_full;
2555 0 : py_percent_full = PyLong_FromUnsignedLongLong((uint32_t)object->percent_full);
2556 0 : return py_percent_full;
2557 : }
2558 :
2559 0 : static int py_lsa_AuditLogInfo_set_percent_full(PyObject *py_obj, PyObject *value, void *closure)
2560 : {
2561 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2562 0 : if (value == NULL) {
2563 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->percent_full");
2564 0 : return -1;
2565 : }
2566 : {
2567 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->percent_full));
2568 0 : if (PyLong_Check(value)) {
2569 : unsigned long long test_var;
2570 0 : test_var = PyLong_AsUnsignedLongLong(value);
2571 0 : if (PyErr_Occurred() != NULL) {
2572 0 : return -1;
2573 : }
2574 0 : if (test_var > uint_max) {
2575 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2576 : PyLong_Type.tp_name, uint_max, test_var);
2577 0 : return -1;
2578 : }
2579 0 : object->percent_full = test_var;
2580 : } else {
2581 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2582 : PyLong_Type.tp_name);
2583 0 : return -1;
2584 : }
2585 : }
2586 0 : return 0;
2587 : }
2588 :
2589 0 : static PyObject *py_lsa_AuditLogInfo_get_maximum_log_size(PyObject *obj, void *closure)
2590 : {
2591 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2592 : PyObject *py_maximum_log_size;
2593 0 : py_maximum_log_size = PyLong_FromUnsignedLongLong((uint32_t)object->maximum_log_size);
2594 0 : return py_maximum_log_size;
2595 : }
2596 :
2597 0 : static int py_lsa_AuditLogInfo_set_maximum_log_size(PyObject *py_obj, PyObject *value, void *closure)
2598 : {
2599 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2600 0 : if (value == NULL) {
2601 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->maximum_log_size");
2602 0 : return -1;
2603 : }
2604 : {
2605 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maximum_log_size));
2606 0 : if (PyLong_Check(value)) {
2607 : unsigned long long test_var;
2608 0 : test_var = PyLong_AsUnsignedLongLong(value);
2609 0 : if (PyErr_Occurred() != NULL) {
2610 0 : return -1;
2611 : }
2612 0 : if (test_var > uint_max) {
2613 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2614 : PyLong_Type.tp_name, uint_max, test_var);
2615 0 : return -1;
2616 : }
2617 0 : object->maximum_log_size = test_var;
2618 : } else {
2619 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2620 : PyLong_Type.tp_name);
2621 0 : return -1;
2622 : }
2623 : }
2624 0 : return 0;
2625 : }
2626 :
2627 0 : static PyObject *py_lsa_AuditLogInfo_get_retention_time(PyObject *obj, void *closure)
2628 : {
2629 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2630 : PyObject *py_retention_time;
2631 0 : py_retention_time = PyLong_FromUnsignedLongLong(object->retention_time);
2632 0 : return py_retention_time;
2633 : }
2634 :
2635 0 : static int py_lsa_AuditLogInfo_set_retention_time(PyObject *py_obj, PyObject *value, void *closure)
2636 : {
2637 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2638 0 : if (value == NULL) {
2639 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->retention_time");
2640 0 : return -1;
2641 : }
2642 : {
2643 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->retention_time));
2644 0 : if (PyLong_Check(value)) {
2645 : unsigned long long test_var;
2646 0 : test_var = PyLong_AsUnsignedLongLong(value);
2647 0 : if (PyErr_Occurred() != NULL) {
2648 0 : return -1;
2649 : }
2650 0 : if (test_var > uint_max) {
2651 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2652 : PyLong_Type.tp_name, uint_max, test_var);
2653 0 : return -1;
2654 : }
2655 0 : object->retention_time = test_var;
2656 : } else {
2657 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2658 : PyLong_Type.tp_name);
2659 0 : return -1;
2660 : }
2661 : }
2662 0 : return 0;
2663 : }
2664 :
2665 0 : static PyObject *py_lsa_AuditLogInfo_get_shutdown_in_progress(PyObject *obj, void *closure)
2666 : {
2667 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2668 : PyObject *py_shutdown_in_progress;
2669 0 : py_shutdown_in_progress = PyLong_FromLong((uint16_t)object->shutdown_in_progress);
2670 0 : return py_shutdown_in_progress;
2671 : }
2672 :
2673 0 : static int py_lsa_AuditLogInfo_set_shutdown_in_progress(PyObject *py_obj, PyObject *value, void *closure)
2674 : {
2675 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2676 0 : if (value == NULL) {
2677 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->shutdown_in_progress");
2678 0 : return -1;
2679 : }
2680 : {
2681 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shutdown_in_progress));
2682 0 : if (PyLong_Check(value)) {
2683 : unsigned long long test_var;
2684 0 : test_var = PyLong_AsUnsignedLongLong(value);
2685 0 : if (PyErr_Occurred() != NULL) {
2686 0 : return -1;
2687 : }
2688 0 : if (test_var > uint_max) {
2689 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2690 : PyLong_Type.tp_name, uint_max, test_var);
2691 0 : return -1;
2692 : }
2693 0 : object->shutdown_in_progress = test_var;
2694 : } else {
2695 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2696 : PyLong_Type.tp_name);
2697 0 : return -1;
2698 : }
2699 : }
2700 0 : return 0;
2701 : }
2702 :
2703 0 : static PyObject *py_lsa_AuditLogInfo_get_time_to_shutdown(PyObject *obj, void *closure)
2704 : {
2705 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2706 : PyObject *py_time_to_shutdown;
2707 0 : py_time_to_shutdown = PyLong_FromUnsignedLongLong(object->time_to_shutdown);
2708 0 : return py_time_to_shutdown;
2709 : }
2710 :
2711 0 : static int py_lsa_AuditLogInfo_set_time_to_shutdown(PyObject *py_obj, PyObject *value, void *closure)
2712 : {
2713 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2714 0 : if (value == NULL) {
2715 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->time_to_shutdown");
2716 0 : return -1;
2717 : }
2718 : {
2719 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time_to_shutdown));
2720 0 : if (PyLong_Check(value)) {
2721 : unsigned long long test_var;
2722 0 : test_var = PyLong_AsUnsignedLongLong(value);
2723 0 : if (PyErr_Occurred() != NULL) {
2724 0 : return -1;
2725 : }
2726 0 : if (test_var > uint_max) {
2727 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2728 : PyLong_Type.tp_name, uint_max, test_var);
2729 0 : return -1;
2730 : }
2731 0 : object->time_to_shutdown = test_var;
2732 : } else {
2733 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2734 : PyLong_Type.tp_name);
2735 0 : return -1;
2736 : }
2737 : }
2738 0 : return 0;
2739 : }
2740 :
2741 0 : static PyObject *py_lsa_AuditLogInfo_get_next_audit_record(PyObject *obj, void *closure)
2742 : {
2743 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2744 : PyObject *py_next_audit_record;
2745 0 : py_next_audit_record = PyLong_FromUnsignedLongLong((uint32_t)object->next_audit_record);
2746 0 : return py_next_audit_record;
2747 : }
2748 :
2749 0 : static int py_lsa_AuditLogInfo_set_next_audit_record(PyObject *py_obj, PyObject *value, void *closure)
2750 : {
2751 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2752 0 : if (value == NULL) {
2753 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->next_audit_record");
2754 0 : return -1;
2755 : }
2756 : {
2757 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->next_audit_record));
2758 0 : if (PyLong_Check(value)) {
2759 : unsigned long long test_var;
2760 0 : test_var = PyLong_AsUnsignedLongLong(value);
2761 0 : if (PyErr_Occurred() != NULL) {
2762 0 : return -1;
2763 : }
2764 0 : if (test_var > uint_max) {
2765 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2766 : PyLong_Type.tp_name, uint_max, test_var);
2767 0 : return -1;
2768 : }
2769 0 : object->next_audit_record = test_var;
2770 : } else {
2771 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2772 : PyLong_Type.tp_name);
2773 0 : return -1;
2774 : }
2775 : }
2776 0 : return 0;
2777 : }
2778 :
2779 : static PyGetSetDef py_lsa_AuditLogInfo_getsetters[] = {
2780 : {
2781 : .name = discard_const_p(char, "percent_full"),
2782 : .get = py_lsa_AuditLogInfo_get_percent_full,
2783 : .set = py_lsa_AuditLogInfo_set_percent_full,
2784 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2785 : },
2786 : {
2787 : .name = discard_const_p(char, "maximum_log_size"),
2788 : .get = py_lsa_AuditLogInfo_get_maximum_log_size,
2789 : .set = py_lsa_AuditLogInfo_set_maximum_log_size,
2790 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2791 : },
2792 : {
2793 : .name = discard_const_p(char, "retention_time"),
2794 : .get = py_lsa_AuditLogInfo_get_retention_time,
2795 : .set = py_lsa_AuditLogInfo_set_retention_time,
2796 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
2797 : },
2798 : {
2799 : .name = discard_const_p(char, "shutdown_in_progress"),
2800 : .get = py_lsa_AuditLogInfo_get_shutdown_in_progress,
2801 : .set = py_lsa_AuditLogInfo_set_shutdown_in_progress,
2802 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2803 : },
2804 : {
2805 : .name = discard_const_p(char, "time_to_shutdown"),
2806 : .get = py_lsa_AuditLogInfo_get_time_to_shutdown,
2807 : .set = py_lsa_AuditLogInfo_set_time_to_shutdown,
2808 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
2809 : },
2810 : {
2811 : .name = discard_const_p(char, "next_audit_record"),
2812 : .get = py_lsa_AuditLogInfo_get_next_audit_record,
2813 : .set = py_lsa_AuditLogInfo_set_next_audit_record,
2814 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2815 : },
2816 : { .name = NULL }
2817 : };
2818 :
2819 0 : static PyObject *py_lsa_AuditLogInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2820 : {
2821 0 : return pytalloc_new(struct lsa_AuditLogInfo, type);
2822 : }
2823 :
2824 :
2825 : static PyTypeObject lsa_AuditLogInfo_Type = {
2826 : PyVarObject_HEAD_INIT(NULL, 0)
2827 : .tp_name = "lsa.AuditLogInfo",
2828 : .tp_getset = py_lsa_AuditLogInfo_getsetters,
2829 : .tp_methods = NULL,
2830 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2831 : .tp_new = py_lsa_AuditLogInfo_new,
2832 : };
2833 :
2834 :
2835 0 : static PyObject *py_lsa_AuditEventsInfo_get_auditing_mode(PyObject *obj, void *closure)
2836 : {
2837 0 : struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(obj);
2838 : PyObject *py_auditing_mode;
2839 0 : py_auditing_mode = PyLong_FromUnsignedLongLong((uint32_t)object->auditing_mode);
2840 0 : return py_auditing_mode;
2841 : }
2842 :
2843 0 : static int py_lsa_AuditEventsInfo_set_auditing_mode(PyObject *py_obj, PyObject *value, void *closure)
2844 : {
2845 0 : struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(py_obj);
2846 0 : if (value == NULL) {
2847 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auditing_mode");
2848 0 : return -1;
2849 : }
2850 : {
2851 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auditing_mode));
2852 0 : if (PyLong_Check(value)) {
2853 : unsigned long long test_var;
2854 0 : test_var = PyLong_AsUnsignedLongLong(value);
2855 0 : if (PyErr_Occurred() != NULL) {
2856 0 : return -1;
2857 : }
2858 0 : if (test_var > uint_max) {
2859 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2860 : PyLong_Type.tp_name, uint_max, test_var);
2861 0 : return -1;
2862 : }
2863 0 : object->auditing_mode = test_var;
2864 : } else {
2865 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2866 : PyLong_Type.tp_name);
2867 0 : return -1;
2868 : }
2869 : }
2870 0 : return 0;
2871 : }
2872 :
2873 0 : static PyObject *py_lsa_AuditEventsInfo_get_settings(PyObject *obj, void *closure)
2874 : {
2875 0 : struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(obj);
2876 : PyObject *py_settings;
2877 0 : if (object->settings == NULL) {
2878 0 : Py_RETURN_NONE;
2879 : }
2880 0 : if (object->settings == NULL) {
2881 0 : py_settings = Py_None;
2882 0 : Py_INCREF(py_settings);
2883 : } else {
2884 0 : py_settings = PyList_New(object->count);
2885 0 : if (py_settings == NULL) {
2886 0 : return NULL;
2887 : }
2888 : {
2889 : int settings_cntr_1;
2890 0 : for (settings_cntr_1 = 0; settings_cntr_1 < (object->count); settings_cntr_1++) {
2891 : PyObject *py_settings_1;
2892 0 : py_settings_1 = PyLong_FromUnsignedLongLong((uint32_t)object->settings[settings_cntr_1]);
2893 0 : PyList_SetItem(py_settings, settings_cntr_1, py_settings_1);
2894 : }
2895 : }
2896 : }
2897 0 : return py_settings;
2898 : }
2899 :
2900 0 : static int py_lsa_AuditEventsInfo_set_settings(PyObject *py_obj, PyObject *value, void *closure)
2901 : {
2902 0 : struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(py_obj);
2903 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->settings));
2904 0 : if (value == NULL) {
2905 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->settings");
2906 0 : return -1;
2907 : }
2908 0 : if (value == Py_None) {
2909 0 : object->settings = NULL;
2910 : } else {
2911 0 : object->settings = NULL;
2912 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2913 : {
2914 : int settings_cntr_1;
2915 0 : object->settings = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->settings, PyList_GET_SIZE(value));
2916 0 : if (!object->settings) { return -1;; }
2917 0 : talloc_set_name_const(object->settings, "ARRAY: object->settings");
2918 0 : for (settings_cntr_1 = 0; settings_cntr_1 < PyList_GET_SIZE(value); settings_cntr_1++) {
2919 0 : if (PyList_GET_ITEM(value, settings_cntr_1) == NULL) {
2920 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->settings[settings_cntr_1]");
2921 0 : return -1;
2922 : }
2923 : {
2924 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->settings[settings_cntr_1]));
2925 0 : if (PyLong_Check(PyList_GET_ITEM(value, settings_cntr_1))) {
2926 : unsigned long long test_var;
2927 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, settings_cntr_1));
2928 0 : if (PyErr_Occurred() != NULL) {
2929 0 : return -1;
2930 : }
2931 0 : if (test_var > uint_max) {
2932 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2933 : PyLong_Type.tp_name, uint_max, test_var);
2934 0 : return -1;
2935 : }
2936 0 : object->settings[settings_cntr_1] = test_var;
2937 : } else {
2938 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2939 : PyLong_Type.tp_name);
2940 0 : return -1;
2941 : }
2942 : }
2943 : }
2944 : }
2945 : }
2946 0 : return 0;
2947 : }
2948 :
2949 0 : static PyObject *py_lsa_AuditEventsInfo_get_count(PyObject *obj, void *closure)
2950 : {
2951 0 : struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(obj);
2952 : PyObject *py_count;
2953 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
2954 0 : return py_count;
2955 : }
2956 :
2957 0 : static int py_lsa_AuditEventsInfo_set_count(PyObject *py_obj, PyObject *value, void *closure)
2958 : {
2959 0 : struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(py_obj);
2960 0 : if (value == NULL) {
2961 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
2962 0 : return -1;
2963 : }
2964 : {
2965 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
2966 0 : if (PyLong_Check(value)) {
2967 : unsigned long long test_var;
2968 0 : test_var = PyLong_AsUnsignedLongLong(value);
2969 0 : if (PyErr_Occurred() != NULL) {
2970 0 : return -1;
2971 : }
2972 0 : if (test_var > uint_max) {
2973 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2974 : PyLong_Type.tp_name, uint_max, test_var);
2975 0 : return -1;
2976 : }
2977 0 : object->count = test_var;
2978 : } else {
2979 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2980 : PyLong_Type.tp_name);
2981 0 : return -1;
2982 : }
2983 : }
2984 0 : return 0;
2985 : }
2986 :
2987 : static PyGetSetDef py_lsa_AuditEventsInfo_getsetters[] = {
2988 : {
2989 : .name = discard_const_p(char, "auditing_mode"),
2990 : .get = py_lsa_AuditEventsInfo_get_auditing_mode,
2991 : .set = py_lsa_AuditEventsInfo_set_auditing_mode,
2992 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2993 : },
2994 : {
2995 : .name = discard_const_p(char, "settings"),
2996 : .get = py_lsa_AuditEventsInfo_get_settings,
2997 : .set = py_lsa_AuditEventsInfo_set_settings,
2998 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyAuditPolicy")
2999 : },
3000 : {
3001 : .name = discard_const_p(char, "count"),
3002 : .get = py_lsa_AuditEventsInfo_get_count,
3003 : .set = py_lsa_AuditEventsInfo_set_count,
3004 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3005 : },
3006 : { .name = NULL }
3007 : };
3008 :
3009 0 : static PyObject *py_lsa_AuditEventsInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3010 : {
3011 0 : return pytalloc_new(struct lsa_AuditEventsInfo, type);
3012 : }
3013 :
3014 :
3015 : static PyTypeObject lsa_AuditEventsInfo_Type = {
3016 : PyVarObject_HEAD_INIT(NULL, 0)
3017 : .tp_name = "lsa.AuditEventsInfo",
3018 : .tp_getset = py_lsa_AuditEventsInfo_getsetters,
3019 : .tp_methods = NULL,
3020 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3021 : .tp_new = py_lsa_AuditEventsInfo_new,
3022 : };
3023 :
3024 :
3025 0 : static PyObject *py_lsa_DomainInfo_get_name(PyObject *obj, void *closure)
3026 : {
3027 0 : struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(obj);
3028 : PyObject *py_name;
3029 0 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
3030 0 : return py_name;
3031 : }
3032 :
3033 0 : static int py_lsa_DomainInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
3034 : {
3035 0 : struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(py_obj);
3036 0 : if (value == NULL) {
3037 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
3038 0 : return -1;
3039 : }
3040 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3041 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3042 0 : PyErr_NoMemory();
3043 0 : return -1;
3044 : }
3045 0 : object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3046 0 : return 0;
3047 : }
3048 :
3049 0 : static PyObject *py_lsa_DomainInfo_get_sid(PyObject *obj, void *closure)
3050 : {
3051 0 : struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(obj);
3052 : PyObject *py_sid;
3053 0 : if (object->sid == NULL) {
3054 0 : Py_RETURN_NONE;
3055 : }
3056 0 : if (object->sid == NULL) {
3057 0 : py_sid = Py_None;
3058 0 : Py_INCREF(py_sid);
3059 : } else {
3060 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
3061 : }
3062 0 : return py_sid;
3063 : }
3064 :
3065 0 : static int py_lsa_DomainInfo_set_sid(PyObject *py_obj, PyObject *value, void *closure)
3066 : {
3067 0 : struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(py_obj);
3068 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
3069 0 : if (value == NULL) {
3070 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
3071 0 : return -1;
3072 : }
3073 0 : if (value == Py_None) {
3074 0 : object->sid = NULL;
3075 : } else {
3076 0 : object->sid = NULL;
3077 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
3078 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3079 0 : PyErr_NoMemory();
3080 0 : return -1;
3081 : }
3082 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
3083 : }
3084 0 : return 0;
3085 : }
3086 :
3087 : static PyGetSetDef py_lsa_DomainInfo_getsetters[] = {
3088 : {
3089 : .name = discard_const_p(char, "name"),
3090 : .get = py_lsa_DomainInfo_get_name,
3091 : .set = py_lsa_DomainInfo_set_name,
3092 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
3093 : },
3094 : {
3095 : .name = discard_const_p(char, "sid"),
3096 : .get = py_lsa_DomainInfo_get_sid,
3097 : .set = py_lsa_DomainInfo_set_sid,
3098 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
3099 : },
3100 : { .name = NULL }
3101 : };
3102 :
3103 0 : static PyObject *py_lsa_DomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3104 : {
3105 0 : return pytalloc_new(struct lsa_DomainInfo, type);
3106 : }
3107 :
3108 :
3109 : static PyTypeObject lsa_DomainInfo_Type = {
3110 : PyVarObject_HEAD_INIT(NULL, 0)
3111 : .tp_name = "lsa.DomainInfo",
3112 : .tp_getset = py_lsa_DomainInfo_getsetters,
3113 : .tp_methods = NULL,
3114 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3115 : .tp_new = py_lsa_DomainInfo_new,
3116 : };
3117 :
3118 :
3119 0 : static PyObject *py_lsa_PDAccountInfo_get_name(PyObject *obj, void *closure)
3120 : {
3121 0 : struct lsa_PDAccountInfo *object = (struct lsa_PDAccountInfo *)pytalloc_get_ptr(obj);
3122 : PyObject *py_name;
3123 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
3124 0 : return py_name;
3125 : }
3126 :
3127 0 : static int py_lsa_PDAccountInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
3128 : {
3129 0 : struct lsa_PDAccountInfo *object = (struct lsa_PDAccountInfo *)pytalloc_get_ptr(py_obj);
3130 0 : if (value == NULL) {
3131 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
3132 0 : return -1;
3133 : }
3134 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
3135 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3136 0 : PyErr_NoMemory();
3137 0 : return -1;
3138 : }
3139 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
3140 0 : return 0;
3141 : }
3142 :
3143 : static PyGetSetDef py_lsa_PDAccountInfo_getsetters[] = {
3144 : {
3145 : .name = discard_const_p(char, "name"),
3146 : .get = py_lsa_PDAccountInfo_get_name,
3147 : .set = py_lsa_PDAccountInfo_set_name,
3148 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3149 : },
3150 : { .name = NULL }
3151 : };
3152 :
3153 0 : static PyObject *py_lsa_PDAccountInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3154 : {
3155 0 : return pytalloc_new(struct lsa_PDAccountInfo, type);
3156 : }
3157 :
3158 :
3159 : static PyTypeObject lsa_PDAccountInfo_Type = {
3160 : PyVarObject_HEAD_INIT(NULL, 0)
3161 : .tp_name = "lsa.PDAccountInfo",
3162 : .tp_getset = py_lsa_PDAccountInfo_getsetters,
3163 : .tp_methods = NULL,
3164 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3165 : .tp_new = py_lsa_PDAccountInfo_new,
3166 : };
3167 :
3168 :
3169 0 : static PyObject *py_lsa_ServerRole_get_role(PyObject *obj, void *closure)
3170 : {
3171 0 : struct lsa_ServerRole *object = (struct lsa_ServerRole *)pytalloc_get_ptr(obj);
3172 : PyObject *py_role;
3173 0 : py_role = PyLong_FromUnsignedLongLong((uint32_t)object->role);
3174 0 : return py_role;
3175 : }
3176 :
3177 0 : static int py_lsa_ServerRole_set_role(PyObject *py_obj, PyObject *value, void *closure)
3178 : {
3179 0 : struct lsa_ServerRole *object = (struct lsa_ServerRole *)pytalloc_get_ptr(py_obj);
3180 0 : if (value == NULL) {
3181 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->role");
3182 0 : return -1;
3183 : }
3184 : {
3185 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->role));
3186 0 : if (PyLong_Check(value)) {
3187 : unsigned long long test_var;
3188 0 : test_var = PyLong_AsUnsignedLongLong(value);
3189 0 : if (PyErr_Occurred() != NULL) {
3190 0 : return -1;
3191 : }
3192 0 : if (test_var > uint_max) {
3193 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3194 : PyLong_Type.tp_name, uint_max, test_var);
3195 0 : return -1;
3196 : }
3197 0 : object->role = test_var;
3198 : } else {
3199 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3200 : PyLong_Type.tp_name);
3201 0 : return -1;
3202 : }
3203 : }
3204 0 : return 0;
3205 : }
3206 :
3207 : static PyGetSetDef py_lsa_ServerRole_getsetters[] = {
3208 : {
3209 : .name = discard_const_p(char, "role"),
3210 : .get = py_lsa_ServerRole_get_role,
3211 : .set = py_lsa_ServerRole_set_role,
3212 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_Role")
3213 : },
3214 : { .name = NULL }
3215 : };
3216 :
3217 0 : static PyObject *py_lsa_ServerRole_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3218 : {
3219 0 : return pytalloc_new(struct lsa_ServerRole, type);
3220 : }
3221 :
3222 :
3223 : static PyTypeObject lsa_ServerRole_Type = {
3224 : PyVarObject_HEAD_INIT(NULL, 0)
3225 : .tp_name = "lsa.ServerRole",
3226 : .tp_getset = py_lsa_ServerRole_getsetters,
3227 : .tp_methods = NULL,
3228 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3229 : .tp_new = py_lsa_ServerRole_new,
3230 : };
3231 :
3232 :
3233 0 : static PyObject *py_lsa_ReplicaSourceInfo_get_source(PyObject *obj, void *closure)
3234 : {
3235 0 : struct lsa_ReplicaSourceInfo *object = (struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(obj);
3236 : PyObject *py_source;
3237 0 : py_source = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->source);
3238 0 : return py_source;
3239 : }
3240 :
3241 0 : static int py_lsa_ReplicaSourceInfo_set_source(PyObject *py_obj, PyObject *value, void *closure)
3242 : {
3243 0 : struct lsa_ReplicaSourceInfo *object = (struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(py_obj);
3244 0 : if (value == NULL) {
3245 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->source");
3246 0 : return -1;
3247 : }
3248 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
3249 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3250 0 : PyErr_NoMemory();
3251 0 : return -1;
3252 : }
3253 0 : object->source = *(struct lsa_String *)pytalloc_get_ptr(value);
3254 0 : return 0;
3255 : }
3256 :
3257 0 : static PyObject *py_lsa_ReplicaSourceInfo_get_account(PyObject *obj, void *closure)
3258 : {
3259 0 : struct lsa_ReplicaSourceInfo *object = (struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(obj);
3260 : PyObject *py_account;
3261 0 : py_account = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account);
3262 0 : return py_account;
3263 : }
3264 :
3265 0 : static int py_lsa_ReplicaSourceInfo_set_account(PyObject *py_obj, PyObject *value, void *closure)
3266 : {
3267 0 : struct lsa_ReplicaSourceInfo *object = (struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(py_obj);
3268 0 : if (value == NULL) {
3269 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account");
3270 0 : return -1;
3271 : }
3272 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
3273 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3274 0 : PyErr_NoMemory();
3275 0 : return -1;
3276 : }
3277 0 : object->account = *(struct lsa_String *)pytalloc_get_ptr(value);
3278 0 : return 0;
3279 : }
3280 :
3281 : static PyGetSetDef py_lsa_ReplicaSourceInfo_getsetters[] = {
3282 : {
3283 : .name = discard_const_p(char, "source"),
3284 : .get = py_lsa_ReplicaSourceInfo_get_source,
3285 : .set = py_lsa_ReplicaSourceInfo_set_source,
3286 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3287 : },
3288 : {
3289 : .name = discard_const_p(char, "account"),
3290 : .get = py_lsa_ReplicaSourceInfo_get_account,
3291 : .set = py_lsa_ReplicaSourceInfo_set_account,
3292 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3293 : },
3294 : { .name = NULL }
3295 : };
3296 :
3297 0 : static PyObject *py_lsa_ReplicaSourceInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3298 : {
3299 0 : return pytalloc_new(struct lsa_ReplicaSourceInfo, type);
3300 : }
3301 :
3302 :
3303 : static PyTypeObject lsa_ReplicaSourceInfo_Type = {
3304 : PyVarObject_HEAD_INIT(NULL, 0)
3305 : .tp_name = "lsa.ReplicaSourceInfo",
3306 : .tp_getset = py_lsa_ReplicaSourceInfo_getsetters,
3307 : .tp_methods = NULL,
3308 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3309 : .tp_new = py_lsa_ReplicaSourceInfo_new,
3310 : };
3311 :
3312 :
3313 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_paged_pool(PyObject *obj, void *closure)
3314 : {
3315 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3316 : PyObject *py_paged_pool;
3317 0 : py_paged_pool = PyLong_FromUnsignedLongLong((uint32_t)object->paged_pool);
3318 0 : return py_paged_pool;
3319 : }
3320 :
3321 0 : static int py_lsa_DefaultQuotaInfo_set_paged_pool(PyObject *py_obj, PyObject *value, void *closure)
3322 : {
3323 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3324 0 : if (value == NULL) {
3325 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->paged_pool");
3326 0 : return -1;
3327 : }
3328 : {
3329 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->paged_pool));
3330 0 : if (PyLong_Check(value)) {
3331 : unsigned long long test_var;
3332 0 : test_var = PyLong_AsUnsignedLongLong(value);
3333 0 : if (PyErr_Occurred() != NULL) {
3334 0 : return -1;
3335 : }
3336 0 : if (test_var > uint_max) {
3337 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3338 : PyLong_Type.tp_name, uint_max, test_var);
3339 0 : return -1;
3340 : }
3341 0 : object->paged_pool = test_var;
3342 : } else {
3343 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3344 : PyLong_Type.tp_name);
3345 0 : return -1;
3346 : }
3347 : }
3348 0 : return 0;
3349 : }
3350 :
3351 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_non_paged_pool(PyObject *obj, void *closure)
3352 : {
3353 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3354 : PyObject *py_non_paged_pool;
3355 0 : py_non_paged_pool = PyLong_FromUnsignedLongLong((uint32_t)object->non_paged_pool);
3356 0 : return py_non_paged_pool;
3357 : }
3358 :
3359 0 : static int py_lsa_DefaultQuotaInfo_set_non_paged_pool(PyObject *py_obj, PyObject *value, void *closure)
3360 : {
3361 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3362 0 : if (value == NULL) {
3363 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->non_paged_pool");
3364 0 : return -1;
3365 : }
3366 : {
3367 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->non_paged_pool));
3368 0 : if (PyLong_Check(value)) {
3369 : unsigned long long test_var;
3370 0 : test_var = PyLong_AsUnsignedLongLong(value);
3371 0 : if (PyErr_Occurred() != NULL) {
3372 0 : return -1;
3373 : }
3374 0 : if (test_var > uint_max) {
3375 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3376 : PyLong_Type.tp_name, uint_max, test_var);
3377 0 : return -1;
3378 : }
3379 0 : object->non_paged_pool = test_var;
3380 : } else {
3381 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3382 : PyLong_Type.tp_name);
3383 0 : return -1;
3384 : }
3385 : }
3386 0 : return 0;
3387 : }
3388 :
3389 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_min_wss(PyObject *obj, void *closure)
3390 : {
3391 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3392 : PyObject *py_min_wss;
3393 0 : py_min_wss = PyLong_FromUnsignedLongLong((uint32_t)object->min_wss);
3394 0 : return py_min_wss;
3395 : }
3396 :
3397 0 : static int py_lsa_DefaultQuotaInfo_set_min_wss(PyObject *py_obj, PyObject *value, void *closure)
3398 : {
3399 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3400 0 : if (value == NULL) {
3401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->min_wss");
3402 0 : return -1;
3403 : }
3404 : {
3405 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_wss));
3406 0 : if (PyLong_Check(value)) {
3407 : unsigned long long test_var;
3408 0 : test_var = PyLong_AsUnsignedLongLong(value);
3409 0 : if (PyErr_Occurred() != NULL) {
3410 0 : return -1;
3411 : }
3412 0 : if (test_var > uint_max) {
3413 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3414 : PyLong_Type.tp_name, uint_max, test_var);
3415 0 : return -1;
3416 : }
3417 0 : object->min_wss = test_var;
3418 : } else {
3419 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3420 : PyLong_Type.tp_name);
3421 0 : return -1;
3422 : }
3423 : }
3424 0 : return 0;
3425 : }
3426 :
3427 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_max_wss(PyObject *obj, void *closure)
3428 : {
3429 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3430 : PyObject *py_max_wss;
3431 0 : py_max_wss = PyLong_FromUnsignedLongLong((uint32_t)object->max_wss);
3432 0 : return py_max_wss;
3433 : }
3434 :
3435 0 : static int py_lsa_DefaultQuotaInfo_set_max_wss(PyObject *py_obj, PyObject *value, void *closure)
3436 : {
3437 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3438 0 : if (value == NULL) {
3439 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_wss");
3440 0 : return -1;
3441 : }
3442 : {
3443 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_wss));
3444 0 : if (PyLong_Check(value)) {
3445 : unsigned long long test_var;
3446 0 : test_var = PyLong_AsUnsignedLongLong(value);
3447 0 : if (PyErr_Occurred() != NULL) {
3448 0 : return -1;
3449 : }
3450 0 : if (test_var > uint_max) {
3451 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3452 : PyLong_Type.tp_name, uint_max, test_var);
3453 0 : return -1;
3454 : }
3455 0 : object->max_wss = test_var;
3456 : } else {
3457 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3458 : PyLong_Type.tp_name);
3459 0 : return -1;
3460 : }
3461 : }
3462 0 : return 0;
3463 : }
3464 :
3465 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_pagefile(PyObject *obj, void *closure)
3466 : {
3467 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3468 : PyObject *py_pagefile;
3469 0 : py_pagefile = PyLong_FromUnsignedLongLong((uint32_t)object->pagefile);
3470 0 : return py_pagefile;
3471 : }
3472 :
3473 0 : static int py_lsa_DefaultQuotaInfo_set_pagefile(PyObject *py_obj, PyObject *value, void *closure)
3474 : {
3475 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3476 0 : if (value == NULL) {
3477 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pagefile");
3478 0 : return -1;
3479 : }
3480 : {
3481 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pagefile));
3482 0 : if (PyLong_Check(value)) {
3483 : unsigned long long test_var;
3484 0 : test_var = PyLong_AsUnsignedLongLong(value);
3485 0 : if (PyErr_Occurred() != NULL) {
3486 0 : return -1;
3487 : }
3488 0 : if (test_var > uint_max) {
3489 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3490 : PyLong_Type.tp_name, uint_max, test_var);
3491 0 : return -1;
3492 : }
3493 0 : object->pagefile = test_var;
3494 : } else {
3495 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3496 : PyLong_Type.tp_name);
3497 0 : return -1;
3498 : }
3499 : }
3500 0 : return 0;
3501 : }
3502 :
3503 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_unknown(PyObject *obj, void *closure)
3504 : {
3505 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3506 : PyObject *py_unknown;
3507 0 : py_unknown = PyLong_FromUnsignedLongLong(object->unknown);
3508 0 : return py_unknown;
3509 : }
3510 :
3511 0 : static int py_lsa_DefaultQuotaInfo_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
3512 : {
3513 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3514 0 : if (value == NULL) {
3515 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown");
3516 0 : return -1;
3517 : }
3518 : {
3519 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
3520 0 : if (PyLong_Check(value)) {
3521 : unsigned long long test_var;
3522 0 : test_var = PyLong_AsUnsignedLongLong(value);
3523 0 : if (PyErr_Occurred() != NULL) {
3524 0 : return -1;
3525 : }
3526 0 : if (test_var > uint_max) {
3527 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3528 : PyLong_Type.tp_name, uint_max, test_var);
3529 0 : return -1;
3530 : }
3531 0 : object->unknown = test_var;
3532 : } else {
3533 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3534 : PyLong_Type.tp_name);
3535 0 : return -1;
3536 : }
3537 : }
3538 0 : return 0;
3539 : }
3540 :
3541 : static PyGetSetDef py_lsa_DefaultQuotaInfo_getsetters[] = {
3542 : {
3543 : .name = discard_const_p(char, "paged_pool"),
3544 : .get = py_lsa_DefaultQuotaInfo_get_paged_pool,
3545 : .set = py_lsa_DefaultQuotaInfo_set_paged_pool,
3546 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3547 : },
3548 : {
3549 : .name = discard_const_p(char, "non_paged_pool"),
3550 : .get = py_lsa_DefaultQuotaInfo_get_non_paged_pool,
3551 : .set = py_lsa_DefaultQuotaInfo_set_non_paged_pool,
3552 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3553 : },
3554 : {
3555 : .name = discard_const_p(char, "min_wss"),
3556 : .get = py_lsa_DefaultQuotaInfo_get_min_wss,
3557 : .set = py_lsa_DefaultQuotaInfo_set_min_wss,
3558 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3559 : },
3560 : {
3561 : .name = discard_const_p(char, "max_wss"),
3562 : .get = py_lsa_DefaultQuotaInfo_get_max_wss,
3563 : .set = py_lsa_DefaultQuotaInfo_set_max_wss,
3564 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3565 : },
3566 : {
3567 : .name = discard_const_p(char, "pagefile"),
3568 : .get = py_lsa_DefaultQuotaInfo_get_pagefile,
3569 : .set = py_lsa_DefaultQuotaInfo_set_pagefile,
3570 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3571 : },
3572 : {
3573 : .name = discard_const_p(char, "unknown"),
3574 : .get = py_lsa_DefaultQuotaInfo_get_unknown,
3575 : .set = py_lsa_DefaultQuotaInfo_set_unknown,
3576 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
3577 : },
3578 : { .name = NULL }
3579 : };
3580 :
3581 0 : static PyObject *py_lsa_DefaultQuotaInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3582 : {
3583 0 : return pytalloc_new(struct lsa_DefaultQuotaInfo, type);
3584 : }
3585 :
3586 :
3587 : static PyTypeObject lsa_DefaultQuotaInfo_Type = {
3588 : PyVarObject_HEAD_INIT(NULL, 0)
3589 : .tp_name = "lsa.DefaultQuotaInfo",
3590 : .tp_getset = py_lsa_DefaultQuotaInfo_getsetters,
3591 : .tp_methods = NULL,
3592 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3593 : .tp_new = py_lsa_DefaultQuotaInfo_new,
3594 : };
3595 :
3596 :
3597 0 : static PyObject *py_lsa_ModificationInfo_get_modified_id(PyObject *obj, void *closure)
3598 : {
3599 0 : struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(obj);
3600 : PyObject *py_modified_id;
3601 0 : py_modified_id = PyLong_FromUnsignedLongLong(object->modified_id);
3602 0 : return py_modified_id;
3603 : }
3604 :
3605 0 : static int py_lsa_ModificationInfo_set_modified_id(PyObject *py_obj, PyObject *value, void *closure)
3606 : {
3607 0 : struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(py_obj);
3608 0 : if (value == NULL) {
3609 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->modified_id");
3610 0 : return -1;
3611 : }
3612 : {
3613 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->modified_id));
3614 0 : if (PyLong_Check(value)) {
3615 : unsigned long long test_var;
3616 0 : test_var = PyLong_AsUnsignedLongLong(value);
3617 0 : if (PyErr_Occurred() != NULL) {
3618 0 : return -1;
3619 : }
3620 0 : if (test_var > uint_max) {
3621 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3622 : PyLong_Type.tp_name, uint_max, test_var);
3623 0 : return -1;
3624 : }
3625 0 : object->modified_id = test_var;
3626 : } else {
3627 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3628 : PyLong_Type.tp_name);
3629 0 : return -1;
3630 : }
3631 : }
3632 0 : return 0;
3633 : }
3634 :
3635 0 : static PyObject *py_lsa_ModificationInfo_get_db_create_time(PyObject *obj, void *closure)
3636 : {
3637 0 : struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(obj);
3638 : PyObject *py_db_create_time;
3639 0 : py_db_create_time = PyLong_FromUnsignedLongLong(object->db_create_time);
3640 0 : return py_db_create_time;
3641 : }
3642 :
3643 0 : static int py_lsa_ModificationInfo_set_db_create_time(PyObject *py_obj, PyObject *value, void *closure)
3644 : {
3645 0 : struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(py_obj);
3646 0 : if (value == NULL) {
3647 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->db_create_time");
3648 0 : return -1;
3649 : }
3650 : {
3651 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_create_time));
3652 0 : if (PyLong_Check(value)) {
3653 : unsigned long long test_var;
3654 0 : test_var = PyLong_AsUnsignedLongLong(value);
3655 0 : if (PyErr_Occurred() != NULL) {
3656 0 : return -1;
3657 : }
3658 0 : if (test_var > uint_max) {
3659 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3660 : PyLong_Type.tp_name, uint_max, test_var);
3661 0 : return -1;
3662 : }
3663 0 : object->db_create_time = test_var;
3664 : } else {
3665 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3666 : PyLong_Type.tp_name);
3667 0 : return -1;
3668 : }
3669 : }
3670 0 : return 0;
3671 : }
3672 :
3673 : static PyGetSetDef py_lsa_ModificationInfo_getsetters[] = {
3674 : {
3675 : .name = discard_const_p(char, "modified_id"),
3676 : .get = py_lsa_ModificationInfo_get_modified_id,
3677 : .set = py_lsa_ModificationInfo_set_modified_id,
3678 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
3679 : },
3680 : {
3681 : .name = discard_const_p(char, "db_create_time"),
3682 : .get = py_lsa_ModificationInfo_get_db_create_time,
3683 : .set = py_lsa_ModificationInfo_set_db_create_time,
3684 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
3685 : },
3686 : { .name = NULL }
3687 : };
3688 :
3689 0 : static PyObject *py_lsa_ModificationInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3690 : {
3691 0 : return pytalloc_new(struct lsa_ModificationInfo, type);
3692 : }
3693 :
3694 :
3695 : static PyTypeObject lsa_ModificationInfo_Type = {
3696 : PyVarObject_HEAD_INIT(NULL, 0)
3697 : .tp_name = "lsa.ModificationInfo",
3698 : .tp_getset = py_lsa_ModificationInfo_getsetters,
3699 : .tp_methods = NULL,
3700 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3701 : .tp_new = py_lsa_ModificationInfo_new,
3702 : };
3703 :
3704 :
3705 0 : static PyObject *py_lsa_AuditFullSetInfo_get_shutdown_on_full(PyObject *obj, void *closure)
3706 : {
3707 0 : struct lsa_AuditFullSetInfo *object = (struct lsa_AuditFullSetInfo *)pytalloc_get_ptr(obj);
3708 : PyObject *py_shutdown_on_full;
3709 0 : py_shutdown_on_full = PyLong_FromLong((uint16_t)object->shutdown_on_full);
3710 0 : return py_shutdown_on_full;
3711 : }
3712 :
3713 0 : static int py_lsa_AuditFullSetInfo_set_shutdown_on_full(PyObject *py_obj, PyObject *value, void *closure)
3714 : {
3715 0 : struct lsa_AuditFullSetInfo *object = (struct lsa_AuditFullSetInfo *)pytalloc_get_ptr(py_obj);
3716 0 : if (value == NULL) {
3717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->shutdown_on_full");
3718 0 : return -1;
3719 : }
3720 : {
3721 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shutdown_on_full));
3722 0 : if (PyLong_Check(value)) {
3723 : unsigned long long test_var;
3724 0 : test_var = PyLong_AsUnsignedLongLong(value);
3725 0 : if (PyErr_Occurred() != NULL) {
3726 0 : return -1;
3727 : }
3728 0 : if (test_var > uint_max) {
3729 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3730 : PyLong_Type.tp_name, uint_max, test_var);
3731 0 : return -1;
3732 : }
3733 0 : object->shutdown_on_full = test_var;
3734 : } else {
3735 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3736 : PyLong_Type.tp_name);
3737 0 : return -1;
3738 : }
3739 : }
3740 0 : return 0;
3741 : }
3742 :
3743 : static PyGetSetDef py_lsa_AuditFullSetInfo_getsetters[] = {
3744 : {
3745 : .name = discard_const_p(char, "shutdown_on_full"),
3746 : .get = py_lsa_AuditFullSetInfo_get_shutdown_on_full,
3747 : .set = py_lsa_AuditFullSetInfo_set_shutdown_on_full,
3748 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3749 : },
3750 : { .name = NULL }
3751 : };
3752 :
3753 0 : static PyObject *py_lsa_AuditFullSetInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3754 : {
3755 0 : return pytalloc_new(struct lsa_AuditFullSetInfo, type);
3756 : }
3757 :
3758 :
3759 : static PyTypeObject lsa_AuditFullSetInfo_Type = {
3760 : PyVarObject_HEAD_INIT(NULL, 0)
3761 : .tp_name = "lsa.AuditFullSetInfo",
3762 : .tp_getset = py_lsa_AuditFullSetInfo_getsetters,
3763 : .tp_methods = NULL,
3764 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3765 : .tp_new = py_lsa_AuditFullSetInfo_new,
3766 : };
3767 :
3768 :
3769 0 : static PyObject *py_lsa_AuditFullQueryInfo_get_shutdown_on_full(PyObject *obj, void *closure)
3770 : {
3771 0 : struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(obj);
3772 : PyObject *py_shutdown_on_full;
3773 0 : py_shutdown_on_full = PyLong_FromLong((uint16_t)object->shutdown_on_full);
3774 0 : return py_shutdown_on_full;
3775 : }
3776 :
3777 0 : static int py_lsa_AuditFullQueryInfo_set_shutdown_on_full(PyObject *py_obj, PyObject *value, void *closure)
3778 : {
3779 0 : struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(py_obj);
3780 0 : if (value == NULL) {
3781 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->shutdown_on_full");
3782 0 : return -1;
3783 : }
3784 : {
3785 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shutdown_on_full));
3786 0 : if (PyLong_Check(value)) {
3787 : unsigned long long test_var;
3788 0 : test_var = PyLong_AsUnsignedLongLong(value);
3789 0 : if (PyErr_Occurred() != NULL) {
3790 0 : return -1;
3791 : }
3792 0 : if (test_var > uint_max) {
3793 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3794 : PyLong_Type.tp_name, uint_max, test_var);
3795 0 : return -1;
3796 : }
3797 0 : object->shutdown_on_full = test_var;
3798 : } else {
3799 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3800 : PyLong_Type.tp_name);
3801 0 : return -1;
3802 : }
3803 : }
3804 0 : return 0;
3805 : }
3806 :
3807 0 : static PyObject *py_lsa_AuditFullQueryInfo_get_log_is_full(PyObject *obj, void *closure)
3808 : {
3809 0 : struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(obj);
3810 : PyObject *py_log_is_full;
3811 0 : py_log_is_full = PyLong_FromLong((uint16_t)object->log_is_full);
3812 0 : return py_log_is_full;
3813 : }
3814 :
3815 0 : static int py_lsa_AuditFullQueryInfo_set_log_is_full(PyObject *py_obj, PyObject *value, void *closure)
3816 : {
3817 0 : struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(py_obj);
3818 0 : if (value == NULL) {
3819 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->log_is_full");
3820 0 : return -1;
3821 : }
3822 : {
3823 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->log_is_full));
3824 0 : if (PyLong_Check(value)) {
3825 : unsigned long long test_var;
3826 0 : test_var = PyLong_AsUnsignedLongLong(value);
3827 0 : if (PyErr_Occurred() != NULL) {
3828 0 : return -1;
3829 : }
3830 0 : if (test_var > uint_max) {
3831 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3832 : PyLong_Type.tp_name, uint_max, test_var);
3833 0 : return -1;
3834 : }
3835 0 : object->log_is_full = test_var;
3836 : } else {
3837 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3838 : PyLong_Type.tp_name);
3839 0 : return -1;
3840 : }
3841 : }
3842 0 : return 0;
3843 : }
3844 :
3845 : static PyGetSetDef py_lsa_AuditFullQueryInfo_getsetters[] = {
3846 : {
3847 : .name = discard_const_p(char, "shutdown_on_full"),
3848 : .get = py_lsa_AuditFullQueryInfo_get_shutdown_on_full,
3849 : .set = py_lsa_AuditFullQueryInfo_set_shutdown_on_full,
3850 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3851 : },
3852 : {
3853 : .name = discard_const_p(char, "log_is_full"),
3854 : .get = py_lsa_AuditFullQueryInfo_get_log_is_full,
3855 : .set = py_lsa_AuditFullQueryInfo_set_log_is_full,
3856 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3857 : },
3858 : { .name = NULL }
3859 : };
3860 :
3861 0 : static PyObject *py_lsa_AuditFullQueryInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3862 : {
3863 0 : return pytalloc_new(struct lsa_AuditFullQueryInfo, type);
3864 : }
3865 :
3866 :
3867 : static PyTypeObject lsa_AuditFullQueryInfo_Type = {
3868 : PyVarObject_HEAD_INIT(NULL, 0)
3869 : .tp_name = "lsa.AuditFullQueryInfo",
3870 : .tp_getset = py_lsa_AuditFullQueryInfo_getsetters,
3871 : .tp_methods = NULL,
3872 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3873 : .tp_new = py_lsa_AuditFullQueryInfo_new,
3874 : };
3875 :
3876 :
3877 235 : static PyObject *py_lsa_DnsDomainInfo_get_name(PyObject *obj, void *closure)
3878 : {
3879 235 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3880 : PyObject *py_name;
3881 235 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
3882 235 : return py_name;
3883 : }
3884 :
3885 0 : static int py_lsa_DnsDomainInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
3886 : {
3887 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3888 0 : if (value == NULL) {
3889 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
3890 0 : return -1;
3891 : }
3892 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3893 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3894 0 : PyErr_NoMemory();
3895 0 : return -1;
3896 : }
3897 0 : object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3898 0 : return 0;
3899 : }
3900 :
3901 410 : static PyObject *py_lsa_DnsDomainInfo_get_dns_domain(PyObject *obj, void *closure)
3902 : {
3903 410 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3904 : PyObject *py_dns_domain;
3905 410 : py_dns_domain = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_domain);
3906 410 : return py_dns_domain;
3907 : }
3908 :
3909 0 : static int py_lsa_DnsDomainInfo_set_dns_domain(PyObject *py_obj, PyObject *value, void *closure)
3910 : {
3911 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3912 0 : if (value == NULL) {
3913 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain");
3914 0 : return -1;
3915 : }
3916 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3917 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3918 0 : PyErr_NoMemory();
3919 0 : return -1;
3920 : }
3921 0 : object->dns_domain = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3922 0 : return 0;
3923 : }
3924 :
3925 0 : static PyObject *py_lsa_DnsDomainInfo_get_dns_forest(PyObject *obj, void *closure)
3926 : {
3927 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3928 : PyObject *py_dns_forest;
3929 0 : py_dns_forest = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_forest);
3930 0 : return py_dns_forest;
3931 : }
3932 :
3933 0 : static int py_lsa_DnsDomainInfo_set_dns_forest(PyObject *py_obj, PyObject *value, void *closure)
3934 : {
3935 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3936 0 : if (value == NULL) {
3937 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_forest");
3938 0 : return -1;
3939 : }
3940 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3941 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3942 0 : PyErr_NoMemory();
3943 0 : return -1;
3944 : }
3945 0 : object->dns_forest = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3946 0 : return 0;
3947 : }
3948 :
3949 0 : static PyObject *py_lsa_DnsDomainInfo_get_domain_guid(PyObject *obj, void *closure)
3950 : {
3951 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3952 : PyObject *py_domain_guid;
3953 0 : py_domain_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_guid);
3954 0 : return py_domain_guid;
3955 : }
3956 :
3957 0 : static int py_lsa_DnsDomainInfo_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
3958 : {
3959 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3960 0 : if (value == NULL) {
3961 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_guid");
3962 0 : return -1;
3963 : }
3964 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
3965 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3966 0 : PyErr_NoMemory();
3967 0 : return -1;
3968 : }
3969 0 : object->domain_guid = *(struct GUID *)pytalloc_get_ptr(value);
3970 0 : return 0;
3971 : }
3972 :
3973 235 : static PyObject *py_lsa_DnsDomainInfo_get_sid(PyObject *obj, void *closure)
3974 : {
3975 235 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3976 : PyObject *py_sid;
3977 235 : if (object->sid == NULL) {
3978 0 : Py_RETURN_NONE;
3979 : }
3980 235 : if (object->sid == NULL) {
3981 0 : py_sid = Py_None;
3982 0 : Py_INCREF(py_sid);
3983 : } else {
3984 235 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
3985 : }
3986 235 : return py_sid;
3987 : }
3988 :
3989 0 : static int py_lsa_DnsDomainInfo_set_sid(PyObject *py_obj, PyObject *value, void *closure)
3990 : {
3991 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3992 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
3993 0 : if (value == NULL) {
3994 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
3995 0 : return -1;
3996 : }
3997 0 : if (value == Py_None) {
3998 0 : object->sid = NULL;
3999 : } else {
4000 0 : object->sid = NULL;
4001 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
4002 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4003 0 : PyErr_NoMemory();
4004 0 : return -1;
4005 : }
4006 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
4007 : }
4008 0 : return 0;
4009 : }
4010 :
4011 : static PyGetSetDef py_lsa_DnsDomainInfo_getsetters[] = {
4012 : {
4013 : .name = discard_const_p(char, "name"),
4014 : .get = py_lsa_DnsDomainInfo_get_name,
4015 : .set = py_lsa_DnsDomainInfo_set_name,
4016 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
4017 : },
4018 : {
4019 : .name = discard_const_p(char, "dns_domain"),
4020 : .get = py_lsa_DnsDomainInfo_get_dns_domain,
4021 : .set = py_lsa_DnsDomainInfo_set_dns_domain,
4022 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
4023 : },
4024 : {
4025 : .name = discard_const_p(char, "dns_forest"),
4026 : .get = py_lsa_DnsDomainInfo_get_dns_forest,
4027 : .set = py_lsa_DnsDomainInfo_set_dns_forest,
4028 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
4029 : },
4030 : {
4031 : .name = discard_const_p(char, "domain_guid"),
4032 : .get = py_lsa_DnsDomainInfo_get_domain_guid,
4033 : .set = py_lsa_DnsDomainInfo_set_domain_guid,
4034 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
4035 : },
4036 : {
4037 : .name = discard_const_p(char, "sid"),
4038 : .get = py_lsa_DnsDomainInfo_get_sid,
4039 : .set = py_lsa_DnsDomainInfo_set_sid,
4040 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
4041 : },
4042 : { .name = NULL }
4043 : };
4044 :
4045 0 : static PyObject *py_lsa_DnsDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4046 : {
4047 0 : return pytalloc_new(struct lsa_DnsDomainInfo, type);
4048 : }
4049 :
4050 0 : static PyObject *py_lsa_DnsDomainInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4051 : {
4052 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
4053 0 : PyObject *ret = NULL;
4054 : DATA_BLOB blob;
4055 : enum ndr_err_code err;
4056 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4057 0 : if (tmp_ctx == NULL) {
4058 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4059 0 : return NULL;
4060 : }
4061 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_DnsDomainInfo);
4062 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4063 0 : TALLOC_FREE(tmp_ctx);
4064 0 : PyErr_SetNdrError(err);
4065 0 : return NULL;
4066 : }
4067 :
4068 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4069 0 : TALLOC_FREE(tmp_ctx);
4070 0 : return ret;
4071 : }
4072 :
4073 0 : static PyObject *py_lsa_DnsDomainInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4074 : {
4075 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
4076 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4077 0 : Py_ssize_t blob_length = 0;
4078 : enum ndr_err_code err;
4079 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4080 0 : PyObject *allow_remaining_obj = NULL;
4081 0 : bool allow_remaining = false;
4082 :
4083 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4084 : discard_const_p(char *, kwnames),
4085 : &blob.data, &blob_length,
4086 : &allow_remaining_obj)) {
4087 0 : return NULL;
4088 : }
4089 0 : blob.length = blob_length;
4090 :
4091 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4092 0 : allow_remaining = true;
4093 : }
4094 :
4095 0 : if (allow_remaining) {
4096 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_DnsDomainInfo);
4097 : } else {
4098 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_DnsDomainInfo);
4099 : }
4100 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4101 0 : PyErr_SetNdrError(err);
4102 0 : return NULL;
4103 : }
4104 :
4105 0 : Py_RETURN_NONE;
4106 : }
4107 :
4108 0 : static PyObject *py_lsa_DnsDomainInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4109 : {
4110 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
4111 : PyObject *ret;
4112 : char *retstr;
4113 :
4114 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_DnsDomainInfo, "lsa_DnsDomainInfo", object);
4115 0 : ret = PyUnicode_FromString(retstr);
4116 0 : talloc_free(retstr);
4117 :
4118 0 : return ret;
4119 : }
4120 :
4121 : static PyMethodDef py_lsa_DnsDomainInfo_methods[] = {
4122 : { "__ndr_pack__", (PyCFunction)py_lsa_DnsDomainInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4123 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DnsDomainInfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4124 : { "__ndr_print__", (PyCFunction)py_lsa_DnsDomainInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4125 : { NULL, NULL, 0, NULL }
4126 : };
4127 :
4128 :
4129 : static PyTypeObject lsa_DnsDomainInfo_Type = {
4130 : PyVarObject_HEAD_INIT(NULL, 0)
4131 : .tp_name = "lsa.DnsDomainInfo",
4132 : .tp_getset = py_lsa_DnsDomainInfo_getsetters,
4133 : .tp_methods = py_lsa_DnsDomainInfo_methods,
4134 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4135 : .tp_new = py_lsa_DnsDomainInfo_new,
4136 : };
4137 :
4138 213 : static PyObject *py_import_lsa_PolicyInformation(TALLOC_CTX *mem_ctx, int level, union lsa_PolicyInformation *in)
4139 : {
4140 : PyObject *ret;
4141 :
4142 213 : switch (level) {
4143 0 : case LSA_POLICY_INFO_AUDIT_LOG:
4144 0 : ret = pytalloc_reference_ex(&lsa_AuditLogInfo_Type, mem_ctx, &in->audit_log);
4145 0 : return ret;
4146 :
4147 0 : case LSA_POLICY_INFO_AUDIT_EVENTS:
4148 0 : ret = pytalloc_reference_ex(&lsa_AuditEventsInfo_Type, mem_ctx, &in->audit_events);
4149 0 : return ret;
4150 :
4151 0 : case LSA_POLICY_INFO_DOMAIN:
4152 0 : ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->domain);
4153 0 : return ret;
4154 :
4155 0 : case LSA_POLICY_INFO_PD:
4156 0 : ret = pytalloc_reference_ex(&lsa_PDAccountInfo_Type, mem_ctx, &in->pd);
4157 0 : return ret;
4158 :
4159 0 : case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
4160 0 : ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->account_domain);
4161 0 : return ret;
4162 :
4163 0 : case LSA_POLICY_INFO_ROLE:
4164 0 : ret = pytalloc_reference_ex(&lsa_ServerRole_Type, mem_ctx, &in->role);
4165 0 : return ret;
4166 :
4167 0 : case LSA_POLICY_INFO_REPLICA:
4168 0 : ret = pytalloc_reference_ex(&lsa_ReplicaSourceInfo_Type, mem_ctx, &in->replica);
4169 0 : return ret;
4170 :
4171 0 : case LSA_POLICY_INFO_QUOTA:
4172 0 : ret = pytalloc_reference_ex(&lsa_DefaultQuotaInfo_Type, mem_ctx, &in->quota);
4173 0 : return ret;
4174 :
4175 0 : case LSA_POLICY_INFO_MOD:
4176 0 : ret = pytalloc_reference_ex(&lsa_ModificationInfo_Type, mem_ctx, &in->mod);
4177 0 : return ret;
4178 :
4179 0 : case LSA_POLICY_INFO_AUDIT_FULL_SET:
4180 0 : ret = pytalloc_reference_ex(&lsa_AuditFullSetInfo_Type, mem_ctx, &in->auditfullset);
4181 0 : return ret;
4182 :
4183 0 : case LSA_POLICY_INFO_AUDIT_FULL_QUERY:
4184 0 : ret = pytalloc_reference_ex(&lsa_AuditFullQueryInfo_Type, mem_ctx, &in->auditfullquery);
4185 0 : return ret;
4186 :
4187 213 : case LSA_POLICY_INFO_DNS:
4188 213 : ret = pytalloc_reference_ex(&lsa_DnsDomainInfo_Type, mem_ctx, &in->dns);
4189 213 : return ret;
4190 :
4191 0 : case LSA_POLICY_INFO_DNS_INT:
4192 0 : ret = pytalloc_reference_ex(&lsa_DnsDomainInfo_Type, mem_ctx, &in->dns);
4193 0 : return ret;
4194 :
4195 0 : case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN:
4196 0 : ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->l_account_domain);
4197 0 : return ret;
4198 :
4199 : }
4200 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4201 0 : return NULL;
4202 : }
4203 :
4204 0 : static union lsa_PolicyInformation *py_export_lsa_PolicyInformation(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4205 : {
4206 0 : union lsa_PolicyInformation *ret = talloc_zero(mem_ctx, union lsa_PolicyInformation);
4207 0 : switch (level) {
4208 0 : case LSA_POLICY_INFO_AUDIT_LOG:
4209 0 : if (in == NULL) {
4210 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->audit_log");
4211 0 : talloc_free(ret); return NULL;
4212 : }
4213 0 : PY_CHECK_TYPE(&lsa_AuditLogInfo_Type, in, talloc_free(ret); return NULL;);
4214 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4215 0 : PyErr_NoMemory();
4216 0 : talloc_free(ret); return NULL;
4217 : }
4218 0 : ret->audit_log = *(struct lsa_AuditLogInfo *)pytalloc_get_ptr(in);
4219 0 : break;
4220 :
4221 0 : case LSA_POLICY_INFO_AUDIT_EVENTS:
4222 0 : if (in == NULL) {
4223 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->audit_events");
4224 0 : talloc_free(ret); return NULL;
4225 : }
4226 0 : PY_CHECK_TYPE(&lsa_AuditEventsInfo_Type, in, talloc_free(ret); return NULL;);
4227 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4228 0 : PyErr_NoMemory();
4229 0 : talloc_free(ret); return NULL;
4230 : }
4231 0 : ret->audit_events = *(struct lsa_AuditEventsInfo *)pytalloc_get_ptr(in);
4232 0 : break;
4233 :
4234 0 : case LSA_POLICY_INFO_DOMAIN:
4235 0 : if (in == NULL) {
4236 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain");
4237 0 : talloc_free(ret); return NULL;
4238 : }
4239 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, in, talloc_free(ret); return NULL;);
4240 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4241 0 : PyErr_NoMemory();
4242 0 : talloc_free(ret); return NULL;
4243 : }
4244 0 : ret->domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
4245 0 : break;
4246 :
4247 0 : case LSA_POLICY_INFO_PD:
4248 0 : if (in == NULL) {
4249 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->pd");
4250 0 : talloc_free(ret); return NULL;
4251 : }
4252 0 : PY_CHECK_TYPE(&lsa_PDAccountInfo_Type, in, talloc_free(ret); return NULL;);
4253 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4254 0 : PyErr_NoMemory();
4255 0 : talloc_free(ret); return NULL;
4256 : }
4257 0 : ret->pd = *(struct lsa_PDAccountInfo *)pytalloc_get_ptr(in);
4258 0 : break;
4259 :
4260 0 : case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
4261 0 : if (in == NULL) {
4262 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->account_domain");
4263 0 : talloc_free(ret); return NULL;
4264 : }
4265 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, in, talloc_free(ret); return NULL;);
4266 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4267 0 : PyErr_NoMemory();
4268 0 : talloc_free(ret); return NULL;
4269 : }
4270 0 : ret->account_domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
4271 0 : break;
4272 :
4273 0 : case LSA_POLICY_INFO_ROLE:
4274 0 : if (in == NULL) {
4275 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->role");
4276 0 : talloc_free(ret); return NULL;
4277 : }
4278 0 : PY_CHECK_TYPE(&lsa_ServerRole_Type, in, talloc_free(ret); return NULL;);
4279 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4280 0 : PyErr_NoMemory();
4281 0 : talloc_free(ret); return NULL;
4282 : }
4283 0 : ret->role = *(struct lsa_ServerRole *)pytalloc_get_ptr(in);
4284 0 : break;
4285 :
4286 0 : case LSA_POLICY_INFO_REPLICA:
4287 0 : if (in == NULL) {
4288 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->replica");
4289 0 : talloc_free(ret); return NULL;
4290 : }
4291 0 : PY_CHECK_TYPE(&lsa_ReplicaSourceInfo_Type, in, talloc_free(ret); return NULL;);
4292 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4293 0 : PyErr_NoMemory();
4294 0 : talloc_free(ret); return NULL;
4295 : }
4296 0 : ret->replica = *(struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(in);
4297 0 : break;
4298 :
4299 0 : case LSA_POLICY_INFO_QUOTA:
4300 0 : if (in == NULL) {
4301 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->quota");
4302 0 : talloc_free(ret); return NULL;
4303 : }
4304 0 : PY_CHECK_TYPE(&lsa_DefaultQuotaInfo_Type, in, talloc_free(ret); return NULL;);
4305 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4306 0 : PyErr_NoMemory();
4307 0 : talloc_free(ret); return NULL;
4308 : }
4309 0 : ret->quota = *(struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(in);
4310 0 : break;
4311 :
4312 0 : case LSA_POLICY_INFO_MOD:
4313 0 : if (in == NULL) {
4314 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->mod");
4315 0 : talloc_free(ret); return NULL;
4316 : }
4317 0 : PY_CHECK_TYPE(&lsa_ModificationInfo_Type, in, talloc_free(ret); return NULL;);
4318 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4319 0 : PyErr_NoMemory();
4320 0 : talloc_free(ret); return NULL;
4321 : }
4322 0 : ret->mod = *(struct lsa_ModificationInfo *)pytalloc_get_ptr(in);
4323 0 : break;
4324 :
4325 0 : case LSA_POLICY_INFO_AUDIT_FULL_SET:
4326 0 : if (in == NULL) {
4327 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->auditfullset");
4328 0 : talloc_free(ret); return NULL;
4329 : }
4330 0 : PY_CHECK_TYPE(&lsa_AuditFullSetInfo_Type, in, talloc_free(ret); return NULL;);
4331 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4332 0 : PyErr_NoMemory();
4333 0 : talloc_free(ret); return NULL;
4334 : }
4335 0 : ret->auditfullset = *(struct lsa_AuditFullSetInfo *)pytalloc_get_ptr(in);
4336 0 : break;
4337 :
4338 0 : case LSA_POLICY_INFO_AUDIT_FULL_QUERY:
4339 0 : if (in == NULL) {
4340 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->auditfullquery");
4341 0 : talloc_free(ret); return NULL;
4342 : }
4343 0 : PY_CHECK_TYPE(&lsa_AuditFullQueryInfo_Type, in, talloc_free(ret); return NULL;);
4344 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4345 0 : PyErr_NoMemory();
4346 0 : talloc_free(ret); return NULL;
4347 : }
4348 0 : ret->auditfullquery = *(struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(in);
4349 0 : break;
4350 :
4351 0 : case LSA_POLICY_INFO_DNS:
4352 0 : if (in == NULL) {
4353 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dns");
4354 0 : talloc_free(ret); return NULL;
4355 : }
4356 0 : PY_CHECK_TYPE(&lsa_DnsDomainInfo_Type, in, talloc_free(ret); return NULL;);
4357 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4358 0 : PyErr_NoMemory();
4359 0 : talloc_free(ret); return NULL;
4360 : }
4361 0 : ret->dns = *(struct lsa_DnsDomainInfo *)pytalloc_get_ptr(in);
4362 0 : break;
4363 :
4364 0 : case LSA_POLICY_INFO_DNS_INT:
4365 0 : if (in == NULL) {
4366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dns");
4367 0 : talloc_free(ret); return NULL;
4368 : }
4369 0 : PY_CHECK_TYPE(&lsa_DnsDomainInfo_Type, in, talloc_free(ret); return NULL;);
4370 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4371 0 : PyErr_NoMemory();
4372 0 : talloc_free(ret); return NULL;
4373 : }
4374 0 : ret->dns = *(struct lsa_DnsDomainInfo *)pytalloc_get_ptr(in);
4375 0 : break;
4376 :
4377 0 : case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN:
4378 0 : if (in == NULL) {
4379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->l_account_domain");
4380 0 : talloc_free(ret); return NULL;
4381 : }
4382 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, in, talloc_free(ret); return NULL;);
4383 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4384 0 : PyErr_NoMemory();
4385 0 : talloc_free(ret); return NULL;
4386 : }
4387 0 : ret->l_account_domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
4388 0 : break;
4389 :
4390 0 : default:
4391 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4392 0 : talloc_free(ret);
4393 0 : ret = NULL;
4394 : }
4395 :
4396 0 : return ret;
4397 : }
4398 :
4399 213 : static PyObject *py_lsa_PolicyInformation_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4400 : {
4401 213 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4402 213 : PyObject *mem_ctx_obj = NULL;
4403 213 : TALLOC_CTX *mem_ctx = NULL;
4404 213 : int level = 0;
4405 213 : PyObject *in_obj = NULL;
4406 213 : union lsa_PolicyInformation *in = NULL;
4407 :
4408 213 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4409 : discard_const_p(char *, kwnames),
4410 : &mem_ctx_obj,
4411 : &level,
4412 : &in_obj)) {
4413 0 : return NULL;
4414 : }
4415 213 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4416 213 : if (mem_ctx == NULL) {
4417 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4418 0 : return NULL;
4419 : }
4420 213 : in = (union lsa_PolicyInformation *)pytalloc_get_ptr(in_obj);
4421 213 : if (in == NULL) {
4422 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_PolicyInformation!");
4423 0 : return NULL;
4424 : }
4425 :
4426 213 : return py_import_lsa_PolicyInformation(mem_ctx, level, in);
4427 : }
4428 :
4429 0 : static PyObject *py_lsa_PolicyInformation_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4430 : {
4431 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4432 0 : PyObject *mem_ctx_obj = NULL;
4433 0 : TALLOC_CTX *mem_ctx = NULL;
4434 0 : int level = 0;
4435 0 : PyObject *in = NULL;
4436 0 : union lsa_PolicyInformation *out = NULL;
4437 :
4438 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
4439 : discard_const_p(char *, kwnames),
4440 : &mem_ctx_obj,
4441 : &level,
4442 : &in)) {
4443 0 : return NULL;
4444 : }
4445 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4446 0 : if (mem_ctx == NULL) {
4447 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4448 0 : return NULL;
4449 : }
4450 :
4451 0 : out = py_export_lsa_PolicyInformation(mem_ctx, level, in);
4452 0 : if (out == NULL) {
4453 0 : return NULL;
4454 : }
4455 :
4456 0 : return pytalloc_GenericObject_reference(out);
4457 : }
4458 :
4459 : static PyMethodDef py_lsa_PolicyInformation_methods[] = {
4460 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_PolicyInformation_import),
4461 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4462 : "T.__import__(mem_ctx, level, in) => ret." },
4463 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_PolicyInformation_export),
4464 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4465 : "T.__export__(mem_ctx, level, in) => ret." },
4466 : { NULL, NULL, 0, NULL }
4467 : };
4468 :
4469 0 : static PyObject *py_lsa_PolicyInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4470 : {
4471 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
4472 0 : return NULL;
4473 : }
4474 :
4475 :
4476 : static PyTypeObject lsa_PolicyInformation_Type = {
4477 : PyVarObject_HEAD_INIT(NULL, 0)
4478 : .tp_name = "lsa.PolicyInformation",
4479 : .tp_getset = NULL,
4480 : .tp_methods = py_lsa_PolicyInformation_methods,
4481 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4482 : .tp_new = py_lsa_PolicyInformation_new,
4483 : };
4484 :
4485 :
4486 0 : static PyObject *py_lsa_SidPtr_get_sid(PyObject *obj, void *closure)
4487 : {
4488 0 : struct lsa_SidPtr *object = (struct lsa_SidPtr *)pytalloc_get_ptr(obj);
4489 : PyObject *py_sid;
4490 0 : if (object->sid == NULL) {
4491 0 : Py_RETURN_NONE;
4492 : }
4493 0 : if (object->sid == NULL) {
4494 0 : py_sid = Py_None;
4495 0 : Py_INCREF(py_sid);
4496 : } else {
4497 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
4498 : }
4499 0 : return py_sid;
4500 : }
4501 :
4502 7 : static int py_lsa_SidPtr_set_sid(PyObject *py_obj, PyObject *value, void *closure)
4503 : {
4504 7 : struct lsa_SidPtr *object = (struct lsa_SidPtr *)pytalloc_get_ptr(py_obj);
4505 7 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
4506 7 : if (value == NULL) {
4507 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
4508 0 : return -1;
4509 : }
4510 7 : if (value == Py_None) {
4511 0 : object->sid = NULL;
4512 : } else {
4513 7 : object->sid = NULL;
4514 7 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
4515 7 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4516 0 : PyErr_NoMemory();
4517 0 : return -1;
4518 : }
4519 7 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
4520 : }
4521 7 : return 0;
4522 : }
4523 :
4524 : static PyGetSetDef py_lsa_SidPtr_getsetters[] = {
4525 : {
4526 : .name = discard_const_p(char, "sid"),
4527 : .get = py_lsa_SidPtr_get_sid,
4528 : .set = py_lsa_SidPtr_set_sid,
4529 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
4530 : },
4531 : { .name = NULL }
4532 : };
4533 :
4534 7 : static PyObject *py_lsa_SidPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4535 : {
4536 7 : return pytalloc_new(struct lsa_SidPtr, type);
4537 : }
4538 :
4539 :
4540 : static PyTypeObject lsa_SidPtr_Type = {
4541 : PyVarObject_HEAD_INIT(NULL, 0)
4542 : .tp_name = "lsa.SidPtr",
4543 : .tp_getset = py_lsa_SidPtr_getsetters,
4544 : .tp_methods = NULL,
4545 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4546 : .tp_new = py_lsa_SidPtr_new,
4547 : };
4548 :
4549 :
4550 0 : static PyObject *py_lsa_SidArray_get_num_sids(PyObject *obj, void *closure)
4551 : {
4552 0 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(obj);
4553 : PyObject *py_num_sids;
4554 0 : py_num_sids = PyLong_FromUnsignedLongLong((uint32_t)object->num_sids);
4555 0 : return py_num_sids;
4556 : }
4557 :
4558 6 : static int py_lsa_SidArray_set_num_sids(PyObject *py_obj, PyObject *value, void *closure)
4559 : {
4560 6 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
4561 6 : if (value == NULL) {
4562 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_sids");
4563 0 : return -1;
4564 : }
4565 : {
4566 6 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sids));
4567 6 : if (PyLong_Check(value)) {
4568 : unsigned long long test_var;
4569 6 : test_var = PyLong_AsUnsignedLongLong(value);
4570 6 : if (PyErr_Occurred() != NULL) {
4571 0 : return -1;
4572 : }
4573 6 : if (test_var > uint_max) {
4574 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4575 : PyLong_Type.tp_name, uint_max, test_var);
4576 0 : return -1;
4577 : }
4578 6 : object->num_sids = test_var;
4579 : } else {
4580 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4581 : PyLong_Type.tp_name);
4582 0 : return -1;
4583 : }
4584 : }
4585 6 : return 0;
4586 : }
4587 :
4588 0 : static PyObject *py_lsa_SidArray_get_sids(PyObject *obj, void *closure)
4589 : {
4590 0 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(obj);
4591 : PyObject *py_sids;
4592 0 : if (object->sids == NULL) {
4593 0 : Py_RETURN_NONE;
4594 : }
4595 0 : if (object->sids == NULL) {
4596 0 : py_sids = Py_None;
4597 0 : Py_INCREF(py_sids);
4598 : } else {
4599 0 : py_sids = PyList_New(object->num_sids);
4600 0 : if (py_sids == NULL) {
4601 0 : return NULL;
4602 : }
4603 : {
4604 : int sids_cntr_1;
4605 0 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->num_sids); sids_cntr_1++) {
4606 : PyObject *py_sids_1;
4607 0 : py_sids_1 = pytalloc_reference_ex(&lsa_SidPtr_Type, object->sids, &object->sids[sids_cntr_1]);
4608 0 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
4609 : }
4610 : }
4611 : }
4612 0 : return py_sids;
4613 : }
4614 :
4615 7 : static int py_lsa_SidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure)
4616 : {
4617 7 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
4618 7 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
4619 7 : if (value == NULL) {
4620 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
4621 0 : return -1;
4622 : }
4623 7 : if (value == Py_None) {
4624 0 : object->sids = NULL;
4625 : } else {
4626 7 : object->sids = NULL;
4627 7 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4628 : {
4629 : int sids_cntr_1;
4630 7 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
4631 7 : if (!object->sids) { return -1;; }
4632 7 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
4633 14 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
4634 7 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
4635 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_1]");
4636 0 : return -1;
4637 : }
4638 7 : PY_CHECK_TYPE(&lsa_SidPtr_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
4639 7 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
4640 0 : PyErr_NoMemory();
4641 0 : return -1;
4642 : }
4643 7 : object->sids[sids_cntr_1] = *(struct lsa_SidPtr *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
4644 : }
4645 : }
4646 : }
4647 7 : return 0;
4648 : }
4649 :
4650 : static PyGetSetDef py_lsa_SidArray_getsetters[] = {
4651 : {
4652 : .name = discard_const_p(char, "num_sids"),
4653 : .get = py_lsa_SidArray_get_num_sids,
4654 : .set = py_lsa_SidArray_set_num_sids,
4655 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4656 : },
4657 : {
4658 : .name = discard_const_p(char, "sids"),
4659 : .get = py_lsa_SidArray_get_sids,
4660 : .set = py_lsa_SidArray_set_sids,
4661 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidPtr")
4662 : },
4663 : { .name = NULL }
4664 : };
4665 :
4666 7 : static PyObject *py_lsa_SidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4667 : {
4668 7 : return pytalloc_new(struct lsa_SidArray, type);
4669 : }
4670 :
4671 0 : static PyObject *py_lsa_SidArray_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4672 : {
4673 0 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
4674 0 : PyObject *ret = NULL;
4675 : DATA_BLOB blob;
4676 : enum ndr_err_code err;
4677 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4678 0 : if (tmp_ctx == NULL) {
4679 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4680 0 : return NULL;
4681 : }
4682 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_SidArray);
4683 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4684 0 : TALLOC_FREE(tmp_ctx);
4685 0 : PyErr_SetNdrError(err);
4686 0 : return NULL;
4687 : }
4688 :
4689 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4690 0 : TALLOC_FREE(tmp_ctx);
4691 0 : return ret;
4692 : }
4693 :
4694 0 : static PyObject *py_lsa_SidArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4695 : {
4696 0 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
4697 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4698 0 : Py_ssize_t blob_length = 0;
4699 : enum ndr_err_code err;
4700 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4701 0 : PyObject *allow_remaining_obj = NULL;
4702 0 : bool allow_remaining = false;
4703 :
4704 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4705 : discard_const_p(char *, kwnames),
4706 : &blob.data, &blob_length,
4707 : &allow_remaining_obj)) {
4708 0 : return NULL;
4709 : }
4710 0 : blob.length = blob_length;
4711 :
4712 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4713 0 : allow_remaining = true;
4714 : }
4715 :
4716 0 : if (allow_remaining) {
4717 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_SidArray);
4718 : } else {
4719 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_SidArray);
4720 : }
4721 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4722 0 : PyErr_SetNdrError(err);
4723 0 : return NULL;
4724 : }
4725 :
4726 0 : Py_RETURN_NONE;
4727 : }
4728 :
4729 0 : static PyObject *py_lsa_SidArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4730 : {
4731 0 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
4732 : PyObject *ret;
4733 : char *retstr;
4734 :
4735 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_SidArray, "lsa_SidArray", object);
4736 0 : ret = PyUnicode_FromString(retstr);
4737 0 : talloc_free(retstr);
4738 :
4739 0 : return ret;
4740 : }
4741 :
4742 : static PyMethodDef py_lsa_SidArray_methods[] = {
4743 : { "__ndr_pack__", (PyCFunction)py_lsa_SidArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4744 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SidArray_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4745 : { "__ndr_print__", (PyCFunction)py_lsa_SidArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4746 : { NULL, NULL, 0, NULL }
4747 : };
4748 :
4749 :
4750 : static PyTypeObject lsa_SidArray_Type = {
4751 : PyVarObject_HEAD_INIT(NULL, 0)
4752 : .tp_name = "lsa.SidArray",
4753 : .tp_getset = py_lsa_SidArray_getsetters,
4754 : .tp_methods = py_lsa_SidArray_methods,
4755 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4756 : .tp_new = py_lsa_SidArray_new,
4757 : };
4758 :
4759 :
4760 0 : static PyObject *py_lsa_DomainList_get_count(PyObject *obj, void *closure)
4761 : {
4762 0 : struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(obj);
4763 : PyObject *py_count;
4764 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
4765 0 : return py_count;
4766 : }
4767 :
4768 0 : static int py_lsa_DomainList_set_count(PyObject *py_obj, PyObject *value, void *closure)
4769 : {
4770 0 : struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(py_obj);
4771 0 : if (value == NULL) {
4772 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
4773 0 : return -1;
4774 : }
4775 : {
4776 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
4777 0 : if (PyLong_Check(value)) {
4778 : unsigned long long test_var;
4779 0 : test_var = PyLong_AsUnsignedLongLong(value);
4780 0 : if (PyErr_Occurred() != NULL) {
4781 0 : return -1;
4782 : }
4783 0 : if (test_var > uint_max) {
4784 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4785 : PyLong_Type.tp_name, uint_max, test_var);
4786 0 : return -1;
4787 : }
4788 0 : object->count = test_var;
4789 : } else {
4790 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4791 : PyLong_Type.tp_name);
4792 0 : return -1;
4793 : }
4794 : }
4795 0 : return 0;
4796 : }
4797 :
4798 0 : static PyObject *py_lsa_DomainList_get_domains(PyObject *obj, void *closure)
4799 : {
4800 0 : struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(obj);
4801 : PyObject *py_domains;
4802 0 : if (object->domains == NULL) {
4803 0 : Py_RETURN_NONE;
4804 : }
4805 0 : if (object->domains == NULL) {
4806 0 : py_domains = Py_None;
4807 0 : Py_INCREF(py_domains);
4808 : } else {
4809 0 : py_domains = PyList_New(object->count);
4810 0 : if (py_domains == NULL) {
4811 0 : return NULL;
4812 : }
4813 : {
4814 : int domains_cntr_1;
4815 0 : for (domains_cntr_1 = 0; domains_cntr_1 < (object->count); domains_cntr_1++) {
4816 : PyObject *py_domains_1;
4817 0 : py_domains_1 = pytalloc_reference_ex(&lsa_DomainInfo_Type, object->domains, &object->domains[domains_cntr_1]);
4818 0 : PyList_SetItem(py_domains, domains_cntr_1, py_domains_1);
4819 : }
4820 : }
4821 : }
4822 0 : return py_domains;
4823 : }
4824 :
4825 0 : static int py_lsa_DomainList_set_domains(PyObject *py_obj, PyObject *value, void *closure)
4826 : {
4827 0 : struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(py_obj);
4828 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domains));
4829 0 : if (value == NULL) {
4830 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domains");
4831 0 : return -1;
4832 : }
4833 0 : if (value == Py_None) {
4834 0 : object->domains = NULL;
4835 : } else {
4836 0 : object->domains = NULL;
4837 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4838 : {
4839 : int domains_cntr_1;
4840 0 : object->domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->domains, PyList_GET_SIZE(value));
4841 0 : if (!object->domains) { return -1;; }
4842 0 : talloc_set_name_const(object->domains, "ARRAY: object->domains");
4843 0 : for (domains_cntr_1 = 0; domains_cntr_1 < PyList_GET_SIZE(value); domains_cntr_1++) {
4844 0 : if (PyList_GET_ITEM(value, domains_cntr_1) == NULL) {
4845 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domains[domains_cntr_1]");
4846 0 : return -1;
4847 : }
4848 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, PyList_GET_ITEM(value, domains_cntr_1), return -1;);
4849 0 : if (talloc_reference(object->domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, domains_cntr_1))) == NULL) {
4850 0 : PyErr_NoMemory();
4851 0 : return -1;
4852 : }
4853 0 : object->domains[domains_cntr_1] = *(struct lsa_DomainInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
4854 : }
4855 : }
4856 : }
4857 0 : return 0;
4858 : }
4859 :
4860 : static PyGetSetDef py_lsa_DomainList_getsetters[] = {
4861 : {
4862 : .name = discard_const_p(char, "count"),
4863 : .get = py_lsa_DomainList_get_count,
4864 : .set = py_lsa_DomainList_set_count,
4865 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4866 : },
4867 : {
4868 : .name = discard_const_p(char, "domains"),
4869 : .get = py_lsa_DomainList_get_domains,
4870 : .set = py_lsa_DomainList_set_domains,
4871 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInfo")
4872 : },
4873 : { .name = NULL }
4874 : };
4875 :
4876 0 : static PyObject *py_lsa_DomainList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4877 : {
4878 0 : return pytalloc_new(struct lsa_DomainList, type);
4879 : }
4880 :
4881 :
4882 : static PyTypeObject lsa_DomainList_Type = {
4883 : PyVarObject_HEAD_INIT(NULL, 0)
4884 : .tp_name = "lsa.DomainList",
4885 : .tp_getset = py_lsa_DomainList_getsetters,
4886 : .tp_methods = NULL,
4887 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4888 : .tp_new = py_lsa_DomainList_new,
4889 : };
4890 :
4891 :
4892 0 : static PyObject *py_lsa_TranslatedSid_get_sid_type(PyObject *obj, void *closure)
4893 : {
4894 0 : struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(obj);
4895 : PyObject *py_sid_type;
4896 0 : py_sid_type = PyLong_FromLong((uint16_t)object->sid_type);
4897 0 : return py_sid_type;
4898 : }
4899 :
4900 0 : static int py_lsa_TranslatedSid_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
4901 : {
4902 0 : struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(py_obj);
4903 0 : if (value == NULL) {
4904 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_type");
4905 0 : return -1;
4906 : }
4907 : {
4908 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
4909 0 : if (PyLong_Check(value)) {
4910 : unsigned long long test_var;
4911 0 : test_var = PyLong_AsUnsignedLongLong(value);
4912 0 : if (PyErr_Occurred() != NULL) {
4913 0 : return -1;
4914 : }
4915 0 : if (test_var > uint_max) {
4916 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4917 : PyLong_Type.tp_name, uint_max, test_var);
4918 0 : return -1;
4919 : }
4920 0 : object->sid_type = test_var;
4921 : } else {
4922 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4923 : PyLong_Type.tp_name);
4924 0 : return -1;
4925 : }
4926 : }
4927 0 : return 0;
4928 : }
4929 :
4930 0 : static PyObject *py_lsa_TranslatedSid_get_rid(PyObject *obj, void *closure)
4931 : {
4932 0 : struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(obj);
4933 : PyObject *py_rid;
4934 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
4935 0 : return py_rid;
4936 : }
4937 :
4938 0 : static int py_lsa_TranslatedSid_set_rid(PyObject *py_obj, PyObject *value, void *closure)
4939 : {
4940 0 : struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(py_obj);
4941 0 : if (value == NULL) {
4942 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
4943 0 : return -1;
4944 : }
4945 : {
4946 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
4947 0 : if (PyLong_Check(value)) {
4948 : unsigned long long test_var;
4949 0 : test_var = PyLong_AsUnsignedLongLong(value);
4950 0 : if (PyErr_Occurred() != NULL) {
4951 0 : return -1;
4952 : }
4953 0 : if (test_var > uint_max) {
4954 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4955 : PyLong_Type.tp_name, uint_max, test_var);
4956 0 : return -1;
4957 : }
4958 0 : object->rid = test_var;
4959 : } else {
4960 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4961 : PyLong_Type.tp_name);
4962 0 : return -1;
4963 : }
4964 : }
4965 0 : return 0;
4966 : }
4967 :
4968 0 : static PyObject *py_lsa_TranslatedSid_get_sid_index(PyObject *obj, void *closure)
4969 : {
4970 0 : struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(obj);
4971 : PyObject *py_sid_index;
4972 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
4973 0 : return py_sid_index;
4974 : }
4975 :
4976 0 : static int py_lsa_TranslatedSid_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
4977 : {
4978 0 : struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(py_obj);
4979 0 : if (value == NULL) {
4980 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_index");
4981 0 : return -1;
4982 : }
4983 : {
4984 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
4985 0 : if (PyLong_Check(value)) {
4986 : unsigned long long test_var;
4987 0 : test_var = PyLong_AsUnsignedLongLong(value);
4988 0 : if (PyErr_Occurred() != NULL) {
4989 0 : return -1;
4990 : }
4991 0 : if (test_var > uint_max) {
4992 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4993 : PyLong_Type.tp_name, uint_max, test_var);
4994 0 : return -1;
4995 : }
4996 0 : object->sid_index = test_var;
4997 : } else {
4998 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4999 : PyLong_Type.tp_name);
5000 0 : return -1;
5001 : }
5002 : }
5003 0 : return 0;
5004 : }
5005 :
5006 : static PyGetSetDef py_lsa_TranslatedSid_getsetters[] = {
5007 : {
5008 : .name = discard_const_p(char, "sid_type"),
5009 : .get = py_lsa_TranslatedSid_get_sid_type,
5010 : .set = py_lsa_TranslatedSid_set_sid_type,
5011 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
5012 : },
5013 : {
5014 : .name = discard_const_p(char, "rid"),
5015 : .get = py_lsa_TranslatedSid_get_rid,
5016 : .set = py_lsa_TranslatedSid_set_rid,
5017 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5018 : },
5019 : {
5020 : .name = discard_const_p(char, "sid_index"),
5021 : .get = py_lsa_TranslatedSid_get_sid_index,
5022 : .set = py_lsa_TranslatedSid_set_sid_index,
5023 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5024 : },
5025 : { .name = NULL }
5026 : };
5027 :
5028 0 : static PyObject *py_lsa_TranslatedSid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5029 : {
5030 0 : return pytalloc_new(struct lsa_TranslatedSid, type);
5031 : }
5032 :
5033 :
5034 : static PyTypeObject lsa_TranslatedSid_Type = {
5035 : PyVarObject_HEAD_INIT(NULL, 0)
5036 : .tp_name = "lsa.TranslatedSid",
5037 : .tp_getset = py_lsa_TranslatedSid_getsetters,
5038 : .tp_methods = NULL,
5039 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5040 : .tp_new = py_lsa_TranslatedSid_new,
5041 : };
5042 :
5043 :
5044 0 : static PyObject *py_lsa_TransSidArray_get_count(PyObject *obj, void *closure)
5045 : {
5046 0 : struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(obj);
5047 : PyObject *py_count;
5048 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
5049 0 : return py_count;
5050 : }
5051 :
5052 0 : static int py_lsa_TransSidArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
5053 : {
5054 0 : struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(py_obj);
5055 0 : if (value == NULL) {
5056 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
5057 0 : return -1;
5058 : }
5059 : {
5060 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
5061 0 : if (PyLong_Check(value)) {
5062 : unsigned long long test_var;
5063 0 : test_var = PyLong_AsUnsignedLongLong(value);
5064 0 : if (PyErr_Occurred() != NULL) {
5065 0 : return -1;
5066 : }
5067 0 : if (test_var > uint_max) {
5068 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5069 : PyLong_Type.tp_name, uint_max, test_var);
5070 0 : return -1;
5071 : }
5072 0 : object->count = test_var;
5073 : } else {
5074 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5075 : PyLong_Type.tp_name);
5076 0 : return -1;
5077 : }
5078 : }
5079 0 : return 0;
5080 : }
5081 :
5082 0 : static PyObject *py_lsa_TransSidArray_get_sids(PyObject *obj, void *closure)
5083 : {
5084 0 : struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(obj);
5085 : PyObject *py_sids;
5086 0 : if (object->sids == NULL) {
5087 0 : Py_RETURN_NONE;
5088 : }
5089 0 : if (object->sids == NULL) {
5090 0 : py_sids = Py_None;
5091 0 : Py_INCREF(py_sids);
5092 : } else {
5093 0 : py_sids = PyList_New(object->count);
5094 0 : if (py_sids == NULL) {
5095 0 : return NULL;
5096 : }
5097 : {
5098 : int sids_cntr_1;
5099 0 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->count); sids_cntr_1++) {
5100 : PyObject *py_sids_1;
5101 0 : py_sids_1 = pytalloc_reference_ex(&lsa_TranslatedSid_Type, object->sids, &object->sids[sids_cntr_1]);
5102 0 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
5103 : }
5104 : }
5105 : }
5106 0 : return py_sids;
5107 : }
5108 :
5109 0 : static int py_lsa_TransSidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure)
5110 : {
5111 0 : struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(py_obj);
5112 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
5113 0 : if (value == NULL) {
5114 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
5115 0 : return -1;
5116 : }
5117 0 : if (value == Py_None) {
5118 0 : object->sids = NULL;
5119 : } else {
5120 0 : object->sids = NULL;
5121 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5122 : {
5123 : int sids_cntr_1;
5124 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
5125 0 : if (!object->sids) { return -1;; }
5126 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
5127 0 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
5128 0 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
5129 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_1]");
5130 0 : return -1;
5131 : }
5132 0 : PY_CHECK_TYPE(&lsa_TranslatedSid_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
5133 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
5134 0 : PyErr_NoMemory();
5135 0 : return -1;
5136 : }
5137 0 : object->sids[sids_cntr_1] = *(struct lsa_TranslatedSid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
5138 : }
5139 : }
5140 : }
5141 0 : return 0;
5142 : }
5143 :
5144 : static PyGetSetDef py_lsa_TransSidArray_getsetters[] = {
5145 : {
5146 : .name = discard_const_p(char, "count"),
5147 : .get = py_lsa_TransSidArray_get_count,
5148 : .set = py_lsa_TransSidArray_set_count,
5149 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5150 : },
5151 : {
5152 : .name = discard_const_p(char, "sids"),
5153 : .get = py_lsa_TransSidArray_get_sids,
5154 : .set = py_lsa_TransSidArray_set_sids,
5155 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedSid")
5156 : },
5157 : { .name = NULL }
5158 : };
5159 :
5160 1 : static PyObject *py_lsa_TransSidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5161 : {
5162 1 : return pytalloc_new(struct lsa_TransSidArray, type);
5163 : }
5164 :
5165 :
5166 : static PyTypeObject lsa_TransSidArray_Type = {
5167 : PyVarObject_HEAD_INIT(NULL, 0)
5168 : .tp_name = "lsa.TransSidArray",
5169 : .tp_getset = py_lsa_TransSidArray_getsetters,
5170 : .tp_methods = NULL,
5171 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5172 : .tp_new = py_lsa_TransSidArray_new,
5173 : };
5174 :
5175 :
5176 0 : static PyObject *py_lsa_RefDomainList_get_count(PyObject *obj, void *closure)
5177 : {
5178 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(obj);
5179 : PyObject *py_count;
5180 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
5181 0 : return py_count;
5182 : }
5183 :
5184 0 : static int py_lsa_RefDomainList_set_count(PyObject *py_obj, PyObject *value, void *closure)
5185 : {
5186 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
5187 0 : if (value == NULL) {
5188 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
5189 0 : return -1;
5190 : }
5191 : {
5192 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
5193 0 : if (PyLong_Check(value)) {
5194 : unsigned long long test_var;
5195 0 : test_var = PyLong_AsUnsignedLongLong(value);
5196 0 : if (PyErr_Occurred() != NULL) {
5197 0 : return -1;
5198 : }
5199 0 : if (test_var > uint_max) {
5200 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5201 : PyLong_Type.tp_name, uint_max, test_var);
5202 0 : return -1;
5203 : }
5204 0 : object->count = test_var;
5205 : } else {
5206 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5207 : PyLong_Type.tp_name);
5208 0 : return -1;
5209 : }
5210 : }
5211 0 : return 0;
5212 : }
5213 :
5214 0 : static PyObject *py_lsa_RefDomainList_get_domains(PyObject *obj, void *closure)
5215 : {
5216 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(obj);
5217 : PyObject *py_domains;
5218 0 : if (object->domains == NULL) {
5219 0 : Py_RETURN_NONE;
5220 : }
5221 0 : if (object->domains == NULL) {
5222 0 : py_domains = Py_None;
5223 0 : Py_INCREF(py_domains);
5224 : } else {
5225 0 : py_domains = PyList_New(object->count);
5226 0 : if (py_domains == NULL) {
5227 0 : return NULL;
5228 : }
5229 : {
5230 : int domains_cntr_1;
5231 0 : for (domains_cntr_1 = 0; domains_cntr_1 < (object->count); domains_cntr_1++) {
5232 : PyObject *py_domains_1;
5233 0 : py_domains_1 = pytalloc_reference_ex(&lsa_DomainInfo_Type, object->domains, &object->domains[domains_cntr_1]);
5234 0 : PyList_SetItem(py_domains, domains_cntr_1, py_domains_1);
5235 : }
5236 : }
5237 : }
5238 0 : return py_domains;
5239 : }
5240 :
5241 0 : static int py_lsa_RefDomainList_set_domains(PyObject *py_obj, PyObject *value, void *closure)
5242 : {
5243 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
5244 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domains));
5245 0 : if (value == NULL) {
5246 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domains");
5247 0 : return -1;
5248 : }
5249 0 : if (value == Py_None) {
5250 0 : object->domains = NULL;
5251 : } else {
5252 0 : object->domains = NULL;
5253 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5254 : {
5255 : int domains_cntr_1;
5256 0 : object->domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->domains, PyList_GET_SIZE(value));
5257 0 : if (!object->domains) { return -1;; }
5258 0 : talloc_set_name_const(object->domains, "ARRAY: object->domains");
5259 0 : for (domains_cntr_1 = 0; domains_cntr_1 < PyList_GET_SIZE(value); domains_cntr_1++) {
5260 0 : if (PyList_GET_ITEM(value, domains_cntr_1) == NULL) {
5261 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domains[domains_cntr_1]");
5262 0 : return -1;
5263 : }
5264 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, PyList_GET_ITEM(value, domains_cntr_1), return -1;);
5265 0 : if (talloc_reference(object->domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, domains_cntr_1))) == NULL) {
5266 0 : PyErr_NoMemory();
5267 0 : return -1;
5268 : }
5269 0 : object->domains[domains_cntr_1] = *(struct lsa_DomainInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
5270 : }
5271 : }
5272 : }
5273 0 : return 0;
5274 : }
5275 :
5276 0 : static PyObject *py_lsa_RefDomainList_get_max_size(PyObject *obj, void *closure)
5277 : {
5278 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(obj);
5279 : PyObject *py_max_size;
5280 0 : py_max_size = PyLong_FromUnsignedLongLong((uint32_t)object->max_size);
5281 0 : return py_max_size;
5282 : }
5283 :
5284 0 : static int py_lsa_RefDomainList_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
5285 : {
5286 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
5287 0 : if (value == NULL) {
5288 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_size");
5289 0 : return -1;
5290 : }
5291 : {
5292 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_size));
5293 0 : if (PyLong_Check(value)) {
5294 : unsigned long long test_var;
5295 0 : test_var = PyLong_AsUnsignedLongLong(value);
5296 0 : if (PyErr_Occurred() != NULL) {
5297 0 : return -1;
5298 : }
5299 0 : if (test_var > uint_max) {
5300 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5301 : PyLong_Type.tp_name, uint_max, test_var);
5302 0 : return -1;
5303 : }
5304 0 : object->max_size = test_var;
5305 : } else {
5306 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5307 : PyLong_Type.tp_name);
5308 0 : return -1;
5309 : }
5310 : }
5311 0 : return 0;
5312 : }
5313 :
5314 : static PyGetSetDef py_lsa_RefDomainList_getsetters[] = {
5315 : {
5316 : .name = discard_const_p(char, "count"),
5317 : .get = py_lsa_RefDomainList_get_count,
5318 : .set = py_lsa_RefDomainList_set_count,
5319 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5320 : },
5321 : {
5322 : .name = discard_const_p(char, "domains"),
5323 : .get = py_lsa_RefDomainList_get_domains,
5324 : .set = py_lsa_RefDomainList_set_domains,
5325 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInfo")
5326 : },
5327 : {
5328 : .name = discard_const_p(char, "max_size"),
5329 : .get = py_lsa_RefDomainList_get_max_size,
5330 : .set = py_lsa_RefDomainList_set_max_size,
5331 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5332 : },
5333 : { .name = NULL }
5334 : };
5335 :
5336 0 : static PyObject *py_lsa_RefDomainList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5337 : {
5338 0 : return pytalloc_new(struct lsa_RefDomainList, type);
5339 : }
5340 :
5341 0 : static PyObject *py_lsa_RefDomainList_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5342 : {
5343 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
5344 0 : PyObject *ret = NULL;
5345 : DATA_BLOB blob;
5346 : enum ndr_err_code err;
5347 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5348 0 : if (tmp_ctx == NULL) {
5349 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5350 0 : return NULL;
5351 : }
5352 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_RefDomainList);
5353 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5354 0 : TALLOC_FREE(tmp_ctx);
5355 0 : PyErr_SetNdrError(err);
5356 0 : return NULL;
5357 : }
5358 :
5359 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5360 0 : TALLOC_FREE(tmp_ctx);
5361 0 : return ret;
5362 : }
5363 :
5364 0 : static PyObject *py_lsa_RefDomainList_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5365 : {
5366 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
5367 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5368 0 : Py_ssize_t blob_length = 0;
5369 : enum ndr_err_code err;
5370 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5371 0 : PyObject *allow_remaining_obj = NULL;
5372 0 : bool allow_remaining = false;
5373 :
5374 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5375 : discard_const_p(char *, kwnames),
5376 : &blob.data, &blob_length,
5377 : &allow_remaining_obj)) {
5378 0 : return NULL;
5379 : }
5380 0 : blob.length = blob_length;
5381 :
5382 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5383 0 : allow_remaining = true;
5384 : }
5385 :
5386 0 : if (allow_remaining) {
5387 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_RefDomainList);
5388 : } else {
5389 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_RefDomainList);
5390 : }
5391 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5392 0 : PyErr_SetNdrError(err);
5393 0 : return NULL;
5394 : }
5395 :
5396 0 : Py_RETURN_NONE;
5397 : }
5398 :
5399 0 : static PyObject *py_lsa_RefDomainList_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5400 : {
5401 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
5402 : PyObject *ret;
5403 : char *retstr;
5404 :
5405 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_RefDomainList, "lsa_RefDomainList", object);
5406 0 : ret = PyUnicode_FromString(retstr);
5407 0 : talloc_free(retstr);
5408 :
5409 0 : return ret;
5410 : }
5411 :
5412 : static PyMethodDef py_lsa_RefDomainList_methods[] = {
5413 : { "__ndr_pack__", (PyCFunction)py_lsa_RefDomainList_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5414 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RefDomainList_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5415 : { "__ndr_print__", (PyCFunction)py_lsa_RefDomainList_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5416 : { NULL, NULL, 0, NULL }
5417 : };
5418 :
5419 :
5420 : static PyTypeObject lsa_RefDomainList_Type = {
5421 : PyVarObject_HEAD_INIT(NULL, 0)
5422 : .tp_name = "lsa.RefDomainList",
5423 : .tp_getset = py_lsa_RefDomainList_getsetters,
5424 : .tp_methods = py_lsa_RefDomainList_methods,
5425 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5426 : .tp_new = py_lsa_RefDomainList_new,
5427 : };
5428 :
5429 :
5430 0 : static PyObject *py_lsa_TranslatedName_get_sid_type(PyObject *obj, void *closure)
5431 : {
5432 0 : struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(obj);
5433 : PyObject *py_sid_type;
5434 0 : py_sid_type = PyLong_FromLong((uint16_t)object->sid_type);
5435 0 : return py_sid_type;
5436 : }
5437 :
5438 0 : static int py_lsa_TranslatedName_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
5439 : {
5440 0 : struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(py_obj);
5441 0 : if (value == NULL) {
5442 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_type");
5443 0 : return -1;
5444 : }
5445 : {
5446 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
5447 0 : if (PyLong_Check(value)) {
5448 : unsigned long long test_var;
5449 0 : test_var = PyLong_AsUnsignedLongLong(value);
5450 0 : if (PyErr_Occurred() != NULL) {
5451 0 : return -1;
5452 : }
5453 0 : if (test_var > uint_max) {
5454 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5455 : PyLong_Type.tp_name, uint_max, test_var);
5456 0 : return -1;
5457 : }
5458 0 : object->sid_type = test_var;
5459 : } else {
5460 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5461 : PyLong_Type.tp_name);
5462 0 : return -1;
5463 : }
5464 : }
5465 0 : return 0;
5466 : }
5467 :
5468 0 : static PyObject *py_lsa_TranslatedName_get_name(PyObject *obj, void *closure)
5469 : {
5470 0 : struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(obj);
5471 : PyObject *py_name;
5472 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
5473 0 : return py_name;
5474 : }
5475 :
5476 0 : static int py_lsa_TranslatedName_set_name(PyObject *py_obj, PyObject *value, void *closure)
5477 : {
5478 0 : struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(py_obj);
5479 0 : if (value == NULL) {
5480 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
5481 0 : return -1;
5482 : }
5483 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
5484 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5485 0 : PyErr_NoMemory();
5486 0 : return -1;
5487 : }
5488 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
5489 0 : return 0;
5490 : }
5491 :
5492 0 : static PyObject *py_lsa_TranslatedName_get_sid_index(PyObject *obj, void *closure)
5493 : {
5494 0 : struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(obj);
5495 : PyObject *py_sid_index;
5496 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
5497 0 : return py_sid_index;
5498 : }
5499 :
5500 0 : static int py_lsa_TranslatedName_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
5501 : {
5502 0 : struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(py_obj);
5503 0 : if (value == NULL) {
5504 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_index");
5505 0 : return -1;
5506 : }
5507 : {
5508 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
5509 0 : if (PyLong_Check(value)) {
5510 : unsigned long long test_var;
5511 0 : test_var = PyLong_AsUnsignedLongLong(value);
5512 0 : if (PyErr_Occurred() != NULL) {
5513 0 : return -1;
5514 : }
5515 0 : if (test_var > uint_max) {
5516 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5517 : PyLong_Type.tp_name, uint_max, test_var);
5518 0 : return -1;
5519 : }
5520 0 : object->sid_index = test_var;
5521 : } else {
5522 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5523 : PyLong_Type.tp_name);
5524 0 : return -1;
5525 : }
5526 : }
5527 0 : return 0;
5528 : }
5529 :
5530 : static PyGetSetDef py_lsa_TranslatedName_getsetters[] = {
5531 : {
5532 : .name = discard_const_p(char, "sid_type"),
5533 : .get = py_lsa_TranslatedName_get_sid_type,
5534 : .set = py_lsa_TranslatedName_set_sid_type,
5535 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
5536 : },
5537 : {
5538 : .name = discard_const_p(char, "name"),
5539 : .get = py_lsa_TranslatedName_get_name,
5540 : .set = py_lsa_TranslatedName_set_name,
5541 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5542 : },
5543 : {
5544 : .name = discard_const_p(char, "sid_index"),
5545 : .get = py_lsa_TranslatedName_get_sid_index,
5546 : .set = py_lsa_TranslatedName_set_sid_index,
5547 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5548 : },
5549 : { .name = NULL }
5550 : };
5551 :
5552 0 : static PyObject *py_lsa_TranslatedName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5553 : {
5554 0 : return pytalloc_new(struct lsa_TranslatedName, type);
5555 : }
5556 :
5557 :
5558 : static PyTypeObject lsa_TranslatedName_Type = {
5559 : PyVarObject_HEAD_INIT(NULL, 0)
5560 : .tp_name = "lsa.TranslatedName",
5561 : .tp_getset = py_lsa_TranslatedName_getsetters,
5562 : .tp_methods = NULL,
5563 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5564 : .tp_new = py_lsa_TranslatedName_new,
5565 : };
5566 :
5567 :
5568 0 : static PyObject *py_lsa_TransNameArray_get_count(PyObject *obj, void *closure)
5569 : {
5570 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(obj);
5571 : PyObject *py_count;
5572 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
5573 0 : return py_count;
5574 : }
5575 :
5576 0 : static int py_lsa_TransNameArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
5577 : {
5578 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
5579 0 : if (value == NULL) {
5580 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
5581 0 : return -1;
5582 : }
5583 : {
5584 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
5585 0 : if (PyLong_Check(value)) {
5586 : unsigned long long test_var;
5587 0 : test_var = PyLong_AsUnsignedLongLong(value);
5588 0 : if (PyErr_Occurred() != NULL) {
5589 0 : return -1;
5590 : }
5591 0 : if (test_var > uint_max) {
5592 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5593 : PyLong_Type.tp_name, uint_max, test_var);
5594 0 : return -1;
5595 : }
5596 0 : object->count = test_var;
5597 : } else {
5598 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5599 : PyLong_Type.tp_name);
5600 0 : return -1;
5601 : }
5602 : }
5603 0 : return 0;
5604 : }
5605 :
5606 0 : static PyObject *py_lsa_TransNameArray_get_names(PyObject *obj, void *closure)
5607 : {
5608 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(obj);
5609 : PyObject *py_names;
5610 0 : if (object->names == NULL) {
5611 0 : Py_RETURN_NONE;
5612 : }
5613 0 : if (object->names == NULL) {
5614 0 : py_names = Py_None;
5615 0 : Py_INCREF(py_names);
5616 : } else {
5617 0 : py_names = PyList_New(object->count);
5618 0 : if (py_names == NULL) {
5619 0 : return NULL;
5620 : }
5621 : {
5622 : int names_cntr_1;
5623 0 : for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
5624 : PyObject *py_names_1;
5625 0 : py_names_1 = pytalloc_reference_ex(&lsa_TranslatedName_Type, object->names, &object->names[names_cntr_1]);
5626 0 : PyList_SetItem(py_names, names_cntr_1, py_names_1);
5627 : }
5628 : }
5629 : }
5630 0 : return py_names;
5631 : }
5632 :
5633 0 : static int py_lsa_TransNameArray_set_names(PyObject *py_obj, PyObject *value, void *closure)
5634 : {
5635 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
5636 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
5637 0 : if (value == NULL) {
5638 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names");
5639 0 : return -1;
5640 : }
5641 0 : if (value == Py_None) {
5642 0 : object->names = NULL;
5643 : } else {
5644 0 : object->names = NULL;
5645 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5646 : {
5647 : int names_cntr_1;
5648 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
5649 0 : if (!object->names) { return -1;; }
5650 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
5651 0 : for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
5652 0 : if (PyList_GET_ITEM(value, names_cntr_1) == NULL) {
5653 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names[names_cntr_1]");
5654 0 : return -1;
5655 : }
5656 0 : PY_CHECK_TYPE(&lsa_TranslatedName_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
5657 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
5658 0 : PyErr_NoMemory();
5659 0 : return -1;
5660 : }
5661 0 : object->names[names_cntr_1] = *(struct lsa_TranslatedName *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
5662 : }
5663 : }
5664 : }
5665 0 : return 0;
5666 : }
5667 :
5668 : static PyGetSetDef py_lsa_TransNameArray_getsetters[] = {
5669 : {
5670 : .name = discard_const_p(char, "count"),
5671 : .get = py_lsa_TransNameArray_get_count,
5672 : .set = py_lsa_TransNameArray_set_count,
5673 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5674 : },
5675 : {
5676 : .name = discard_const_p(char, "names"),
5677 : .get = py_lsa_TransNameArray_get_names,
5678 : .set = py_lsa_TransNameArray_set_names,
5679 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedName")
5680 : },
5681 : { .name = NULL }
5682 : };
5683 :
5684 1 : static PyObject *py_lsa_TransNameArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5685 : {
5686 1 : return pytalloc_new(struct lsa_TransNameArray, type);
5687 : }
5688 :
5689 0 : static PyObject *py_lsa_TransNameArray_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5690 : {
5691 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
5692 0 : PyObject *ret = NULL;
5693 : DATA_BLOB blob;
5694 : enum ndr_err_code err;
5695 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5696 0 : if (tmp_ctx == NULL) {
5697 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5698 0 : return NULL;
5699 : }
5700 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_TransNameArray);
5701 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5702 0 : TALLOC_FREE(tmp_ctx);
5703 0 : PyErr_SetNdrError(err);
5704 0 : return NULL;
5705 : }
5706 :
5707 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5708 0 : TALLOC_FREE(tmp_ctx);
5709 0 : return ret;
5710 : }
5711 :
5712 0 : static PyObject *py_lsa_TransNameArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5713 : {
5714 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
5715 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5716 0 : Py_ssize_t blob_length = 0;
5717 : enum ndr_err_code err;
5718 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5719 0 : PyObject *allow_remaining_obj = NULL;
5720 0 : bool allow_remaining = false;
5721 :
5722 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5723 : discard_const_p(char *, kwnames),
5724 : &blob.data, &blob_length,
5725 : &allow_remaining_obj)) {
5726 0 : return NULL;
5727 : }
5728 0 : blob.length = blob_length;
5729 :
5730 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5731 0 : allow_remaining = true;
5732 : }
5733 :
5734 0 : if (allow_remaining) {
5735 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TransNameArray);
5736 : } else {
5737 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TransNameArray);
5738 : }
5739 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5740 0 : PyErr_SetNdrError(err);
5741 0 : return NULL;
5742 : }
5743 :
5744 0 : Py_RETURN_NONE;
5745 : }
5746 :
5747 0 : static PyObject *py_lsa_TransNameArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5748 : {
5749 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
5750 : PyObject *ret;
5751 : char *retstr;
5752 :
5753 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_TransNameArray, "lsa_TransNameArray", object);
5754 0 : ret = PyUnicode_FromString(retstr);
5755 0 : talloc_free(retstr);
5756 :
5757 0 : return ret;
5758 : }
5759 :
5760 : static PyMethodDef py_lsa_TransNameArray_methods[] = {
5761 : { "__ndr_pack__", (PyCFunction)py_lsa_TransNameArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5762 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_TransNameArray_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5763 : { "__ndr_print__", (PyCFunction)py_lsa_TransNameArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5764 : { NULL, NULL, 0, NULL }
5765 : };
5766 :
5767 :
5768 : static PyTypeObject lsa_TransNameArray_Type = {
5769 : PyVarObject_HEAD_INIT(NULL, 0)
5770 : .tp_name = "lsa.TransNameArray",
5771 : .tp_getset = py_lsa_TransNameArray_getsetters,
5772 : .tp_methods = py_lsa_TransNameArray_methods,
5773 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5774 : .tp_new = py_lsa_TransNameArray_new,
5775 : };
5776 :
5777 :
5778 0 : static PyObject *py_lsa_LUIDAttribute_get_luid(PyObject *obj, void *closure)
5779 : {
5780 0 : struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(obj);
5781 : PyObject *py_luid;
5782 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, pytalloc_get_mem_ctx(obj), &object->luid);
5783 0 : return py_luid;
5784 : }
5785 :
5786 0 : static int py_lsa_LUIDAttribute_set_luid(PyObject *py_obj, PyObject *value, void *closure)
5787 : {
5788 0 : struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(py_obj);
5789 0 : if (value == NULL) {
5790 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->luid");
5791 0 : return -1;
5792 : }
5793 0 : PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
5794 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5795 0 : PyErr_NoMemory();
5796 0 : return -1;
5797 : }
5798 0 : object->luid = *(struct lsa_LUID *)pytalloc_get_ptr(value);
5799 0 : return 0;
5800 : }
5801 :
5802 0 : static PyObject *py_lsa_LUIDAttribute_get_attribute(PyObject *obj, void *closure)
5803 : {
5804 0 : struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(obj);
5805 : PyObject *py_attribute;
5806 0 : py_attribute = PyLong_FromUnsignedLongLong((uint32_t)object->attribute);
5807 0 : return py_attribute;
5808 : }
5809 :
5810 0 : static int py_lsa_LUIDAttribute_set_attribute(PyObject *py_obj, PyObject *value, void *closure)
5811 : {
5812 0 : struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(py_obj);
5813 0 : if (value == NULL) {
5814 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attribute");
5815 0 : return -1;
5816 : }
5817 : {
5818 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attribute));
5819 0 : if (PyLong_Check(value)) {
5820 : unsigned long long test_var;
5821 0 : test_var = PyLong_AsUnsignedLongLong(value);
5822 0 : if (PyErr_Occurred() != NULL) {
5823 0 : return -1;
5824 : }
5825 0 : if (test_var > uint_max) {
5826 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5827 : PyLong_Type.tp_name, uint_max, test_var);
5828 0 : return -1;
5829 : }
5830 0 : object->attribute = test_var;
5831 : } else {
5832 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5833 : PyLong_Type.tp_name);
5834 0 : return -1;
5835 : }
5836 : }
5837 0 : return 0;
5838 : }
5839 :
5840 : static PyGetSetDef py_lsa_LUIDAttribute_getsetters[] = {
5841 : {
5842 : .name = discard_const_p(char, "luid"),
5843 : .get = py_lsa_LUIDAttribute_get_luid,
5844 : .set = py_lsa_LUIDAttribute_set_luid,
5845 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUID")
5846 : },
5847 : {
5848 : .name = discard_const_p(char, "attribute"),
5849 : .get = py_lsa_LUIDAttribute_get_attribute,
5850 : .set = py_lsa_LUIDAttribute_set_attribute,
5851 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5852 : },
5853 : { .name = NULL }
5854 : };
5855 :
5856 0 : static PyObject *py_lsa_LUIDAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5857 : {
5858 0 : return pytalloc_new(struct lsa_LUIDAttribute, type);
5859 : }
5860 :
5861 :
5862 : static PyTypeObject lsa_LUIDAttribute_Type = {
5863 : PyVarObject_HEAD_INIT(NULL, 0)
5864 : .tp_name = "lsa.LUIDAttribute",
5865 : .tp_getset = py_lsa_LUIDAttribute_getsetters,
5866 : .tp_methods = NULL,
5867 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5868 : .tp_new = py_lsa_LUIDAttribute_new,
5869 : };
5870 :
5871 :
5872 0 : static PyObject *py_lsa_PrivilegeSet_get_count(PyObject *obj, void *closure)
5873 : {
5874 0 : struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(obj);
5875 : PyObject *py_count;
5876 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
5877 0 : return py_count;
5878 : }
5879 :
5880 0 : static int py_lsa_PrivilegeSet_set_count(PyObject *py_obj, PyObject *value, void *closure)
5881 : {
5882 0 : struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_obj);
5883 0 : if (value == NULL) {
5884 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
5885 0 : return -1;
5886 : }
5887 : {
5888 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
5889 0 : if (PyLong_Check(value)) {
5890 : unsigned long long test_var;
5891 0 : test_var = PyLong_AsUnsignedLongLong(value);
5892 0 : if (PyErr_Occurred() != NULL) {
5893 0 : return -1;
5894 : }
5895 0 : if (test_var > uint_max) {
5896 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5897 : PyLong_Type.tp_name, uint_max, test_var);
5898 0 : return -1;
5899 : }
5900 0 : object->count = test_var;
5901 : } else {
5902 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5903 : PyLong_Type.tp_name);
5904 0 : return -1;
5905 : }
5906 : }
5907 0 : return 0;
5908 : }
5909 :
5910 0 : static PyObject *py_lsa_PrivilegeSet_get_unknown(PyObject *obj, void *closure)
5911 : {
5912 0 : struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(obj);
5913 : PyObject *py_unknown;
5914 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)object->unknown);
5915 0 : return py_unknown;
5916 : }
5917 :
5918 0 : static int py_lsa_PrivilegeSet_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
5919 : {
5920 0 : struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_obj);
5921 0 : if (value == NULL) {
5922 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown");
5923 0 : return -1;
5924 : }
5925 : {
5926 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
5927 0 : if (PyLong_Check(value)) {
5928 : unsigned long long test_var;
5929 0 : test_var = PyLong_AsUnsignedLongLong(value);
5930 0 : if (PyErr_Occurred() != NULL) {
5931 0 : return -1;
5932 : }
5933 0 : if (test_var > uint_max) {
5934 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5935 : PyLong_Type.tp_name, uint_max, test_var);
5936 0 : return -1;
5937 : }
5938 0 : object->unknown = test_var;
5939 : } else {
5940 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5941 : PyLong_Type.tp_name);
5942 0 : return -1;
5943 : }
5944 : }
5945 0 : return 0;
5946 : }
5947 :
5948 0 : static PyObject *py_lsa_PrivilegeSet_get_set(PyObject *obj, void *closure)
5949 : {
5950 0 : struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(obj);
5951 : PyObject *py_set;
5952 0 : py_set = PyList_New(object->count);
5953 0 : if (py_set == NULL) {
5954 0 : return NULL;
5955 : }
5956 : {
5957 : int set_cntr_0;
5958 0 : for (set_cntr_0 = 0; set_cntr_0 < (object->count); set_cntr_0++) {
5959 : PyObject *py_set_0;
5960 0 : py_set_0 = pytalloc_reference_ex(&lsa_LUIDAttribute_Type, object->set, &object->set[set_cntr_0]);
5961 0 : PyList_SetItem(py_set, set_cntr_0, py_set_0);
5962 : }
5963 : }
5964 0 : return py_set;
5965 : }
5966 :
5967 0 : static int py_lsa_PrivilegeSet_set_set(PyObject *py_obj, PyObject *value, void *closure)
5968 : {
5969 0 : struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_obj);
5970 0 : if (value == NULL) {
5971 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->set");
5972 0 : return -1;
5973 : }
5974 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5975 : {
5976 : int set_cntr_0;
5977 0 : object->set = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->set, PyList_GET_SIZE(value));
5978 0 : if (!object->set) { return -1;; }
5979 0 : talloc_set_name_const(object->set, "ARRAY: object->set");
5980 0 : for (set_cntr_0 = 0; set_cntr_0 < PyList_GET_SIZE(value); set_cntr_0++) {
5981 0 : if (PyList_GET_ITEM(value, set_cntr_0) == NULL) {
5982 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->set[set_cntr_0]");
5983 0 : return -1;
5984 : }
5985 0 : PY_CHECK_TYPE(&lsa_LUIDAttribute_Type, PyList_GET_ITEM(value, set_cntr_0), return -1;);
5986 0 : if (talloc_reference(object->set, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, set_cntr_0))) == NULL) {
5987 0 : PyErr_NoMemory();
5988 0 : return -1;
5989 : }
5990 0 : object->set[set_cntr_0] = *(struct lsa_LUIDAttribute *)pytalloc_get_ptr(PyList_GET_ITEM(value, set_cntr_0));
5991 : }
5992 : }
5993 0 : return 0;
5994 : }
5995 :
5996 : static PyGetSetDef py_lsa_PrivilegeSet_getsetters[] = {
5997 : {
5998 : .name = discard_const_p(char, "count"),
5999 : .get = py_lsa_PrivilegeSet_get_count,
6000 : .set = py_lsa_PrivilegeSet_set_count,
6001 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6002 : },
6003 : {
6004 : .name = discard_const_p(char, "unknown"),
6005 : .get = py_lsa_PrivilegeSet_get_unknown,
6006 : .set = py_lsa_PrivilegeSet_set_unknown,
6007 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6008 : },
6009 : {
6010 : .name = discard_const_p(char, "set"),
6011 : .get = py_lsa_PrivilegeSet_get_set,
6012 : .set = py_lsa_PrivilegeSet_set_set,
6013 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUIDAttribute")
6014 : },
6015 : { .name = NULL }
6016 : };
6017 :
6018 0 : static PyObject *py_lsa_PrivilegeSet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6019 : {
6020 0 : return pytalloc_new(struct lsa_PrivilegeSet, type);
6021 : }
6022 :
6023 :
6024 : static PyTypeObject lsa_PrivilegeSet_Type = {
6025 : PyVarObject_HEAD_INIT(NULL, 0)
6026 : .tp_name = "lsa.PrivilegeSet",
6027 : .tp_getset = py_lsa_PrivilegeSet_getsetters,
6028 : .tp_methods = NULL,
6029 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6030 : .tp_new = py_lsa_PrivilegeSet_new,
6031 : };
6032 :
6033 :
6034 0 : static PyObject *py_lsa_DATA_BUF_get_length(PyObject *obj, void *closure)
6035 : {
6036 0 : struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(obj);
6037 : PyObject *py_length;
6038 0 : py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length);
6039 0 : return py_length;
6040 : }
6041 :
6042 0 : static int py_lsa_DATA_BUF_set_length(PyObject *py_obj, PyObject *value, void *closure)
6043 : {
6044 0 : struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_obj);
6045 0 : if (value == NULL) {
6046 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
6047 0 : return -1;
6048 : }
6049 : {
6050 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
6051 0 : if (PyLong_Check(value)) {
6052 : unsigned long long test_var;
6053 0 : test_var = PyLong_AsUnsignedLongLong(value);
6054 0 : if (PyErr_Occurred() != NULL) {
6055 0 : return -1;
6056 : }
6057 0 : if (test_var > uint_max) {
6058 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6059 : PyLong_Type.tp_name, uint_max, test_var);
6060 0 : return -1;
6061 : }
6062 0 : object->length = test_var;
6063 : } else {
6064 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6065 : PyLong_Type.tp_name);
6066 0 : return -1;
6067 : }
6068 : }
6069 0 : return 0;
6070 : }
6071 :
6072 0 : static PyObject *py_lsa_DATA_BUF_get_size(PyObject *obj, void *closure)
6073 : {
6074 0 : struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(obj);
6075 : PyObject *py_size;
6076 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
6077 0 : return py_size;
6078 : }
6079 :
6080 0 : static int py_lsa_DATA_BUF_set_size(PyObject *py_obj, PyObject *value, void *closure)
6081 : {
6082 0 : struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_obj);
6083 0 : if (value == NULL) {
6084 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
6085 0 : return -1;
6086 : }
6087 : {
6088 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
6089 0 : if (PyLong_Check(value)) {
6090 : unsigned long long test_var;
6091 0 : test_var = PyLong_AsUnsignedLongLong(value);
6092 0 : if (PyErr_Occurred() != NULL) {
6093 0 : return -1;
6094 : }
6095 0 : if (test_var > uint_max) {
6096 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6097 : PyLong_Type.tp_name, uint_max, test_var);
6098 0 : return -1;
6099 : }
6100 0 : object->size = test_var;
6101 : } else {
6102 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6103 : PyLong_Type.tp_name);
6104 0 : return -1;
6105 : }
6106 : }
6107 0 : return 0;
6108 : }
6109 :
6110 0 : static PyObject *py_lsa_DATA_BUF_get_data(PyObject *obj, void *closure)
6111 : {
6112 0 : struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(obj);
6113 : PyObject *py_data;
6114 0 : if (object->data == NULL) {
6115 0 : Py_RETURN_NONE;
6116 : }
6117 0 : if (object->data == NULL) {
6118 0 : py_data = Py_None;
6119 0 : Py_INCREF(py_data);
6120 : } else {
6121 0 : py_data = PyList_New(object->length);
6122 0 : if (py_data == NULL) {
6123 0 : return NULL;
6124 : }
6125 : {
6126 : int data_cntr_1;
6127 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
6128 : PyObject *py_data_1;
6129 0 : py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]);
6130 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
6131 : }
6132 : }
6133 : }
6134 0 : return py_data;
6135 : }
6136 :
6137 0 : static int py_lsa_DATA_BUF_set_data(PyObject *py_obj, PyObject *value, void *closure)
6138 : {
6139 0 : struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_obj);
6140 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
6141 0 : if (value == NULL) {
6142 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
6143 0 : return -1;
6144 : }
6145 0 : if (value == Py_None) {
6146 0 : object->data = NULL;
6147 : } else {
6148 0 : object->data = NULL;
6149 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6150 : {
6151 : int data_cntr_1;
6152 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
6153 0 : if (!object->data) { return -1;; }
6154 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
6155 0 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
6156 0 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
6157 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]");
6158 0 : return -1;
6159 : }
6160 : {
6161 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
6162 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
6163 : unsigned long long test_var;
6164 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
6165 0 : if (PyErr_Occurred() != NULL) {
6166 0 : return -1;
6167 : }
6168 0 : if (test_var > uint_max) {
6169 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6170 : PyLong_Type.tp_name, uint_max, test_var);
6171 0 : return -1;
6172 : }
6173 0 : object->data[data_cntr_1] = test_var;
6174 : } else {
6175 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6176 : PyLong_Type.tp_name);
6177 0 : return -1;
6178 : }
6179 : }
6180 : }
6181 : }
6182 : }
6183 0 : return 0;
6184 : }
6185 :
6186 : static PyGetSetDef py_lsa_DATA_BUF_getsetters[] = {
6187 : {
6188 : .name = discard_const_p(char, "length"),
6189 : .get = py_lsa_DATA_BUF_get_length,
6190 : .set = py_lsa_DATA_BUF_set_length,
6191 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
6192 : },
6193 : {
6194 : .name = discard_const_p(char, "size"),
6195 : .get = py_lsa_DATA_BUF_get_size,
6196 : .set = py_lsa_DATA_BUF_set_size,
6197 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
6198 : },
6199 : {
6200 : .name = discard_const_p(char, "data"),
6201 : .get = py_lsa_DATA_BUF_get_data,
6202 : .set = py_lsa_DATA_BUF_set_data,
6203 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6204 : },
6205 : { .name = NULL }
6206 : };
6207 :
6208 0 : static PyObject *py_lsa_DATA_BUF_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6209 : {
6210 0 : return pytalloc_new(struct lsa_DATA_BUF, type);
6211 : }
6212 :
6213 :
6214 : static PyTypeObject lsa_DATA_BUF_Type = {
6215 : PyVarObject_HEAD_INIT(NULL, 0)
6216 : .tp_name = "lsa.DATA_BUF",
6217 : .tp_getset = py_lsa_DATA_BUF_getsetters,
6218 : .tp_methods = NULL,
6219 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6220 : .tp_new = py_lsa_DATA_BUF_new,
6221 : };
6222 :
6223 :
6224 0 : static PyObject *py_lsa_DATA_BUF2_get_size(PyObject *obj, void *closure)
6225 : {
6226 0 : struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(obj);
6227 : PyObject *py_size;
6228 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
6229 0 : return py_size;
6230 : }
6231 :
6232 22 : static int py_lsa_DATA_BUF2_set_size(PyObject *py_obj, PyObject *value, void *closure)
6233 : {
6234 22 : struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(py_obj);
6235 22 : if (value == NULL) {
6236 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
6237 0 : return -1;
6238 : }
6239 : {
6240 22 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
6241 22 : if (PyLong_Check(value)) {
6242 : unsigned long long test_var;
6243 22 : test_var = PyLong_AsUnsignedLongLong(value);
6244 22 : if (PyErr_Occurred() != NULL) {
6245 0 : return -1;
6246 : }
6247 22 : if (test_var > uint_max) {
6248 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6249 : PyLong_Type.tp_name, uint_max, test_var);
6250 0 : return -1;
6251 : }
6252 22 : object->size = test_var;
6253 : } else {
6254 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6255 : PyLong_Type.tp_name);
6256 0 : return -1;
6257 : }
6258 : }
6259 22 : return 0;
6260 : }
6261 :
6262 0 : static PyObject *py_lsa_DATA_BUF2_get_data(PyObject *obj, void *closure)
6263 : {
6264 0 : struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(obj);
6265 : PyObject *py_data;
6266 0 : if (object->data == NULL) {
6267 0 : Py_RETURN_NONE;
6268 : }
6269 0 : if (object->data == NULL) {
6270 0 : py_data = Py_None;
6271 0 : Py_INCREF(py_data);
6272 : } else {
6273 0 : py_data = PyList_New(object->size);
6274 0 : if (py_data == NULL) {
6275 0 : return NULL;
6276 : }
6277 : {
6278 : int data_cntr_1;
6279 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->size); data_cntr_1++) {
6280 : PyObject *py_data_1;
6281 0 : py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]);
6282 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
6283 : }
6284 : }
6285 : }
6286 0 : return py_data;
6287 : }
6288 :
6289 22 : static int py_lsa_DATA_BUF2_set_data(PyObject *py_obj, PyObject *value, void *closure)
6290 : {
6291 22 : struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(py_obj);
6292 22 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
6293 22 : if (value == NULL) {
6294 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
6295 0 : return -1;
6296 : }
6297 22 : if (value == Py_None) {
6298 0 : object->data = NULL;
6299 : } else {
6300 22 : object->data = NULL;
6301 22 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6302 : {
6303 : int data_cntr_1;
6304 22 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
6305 22 : if (!object->data) { return -1;; }
6306 22 : talloc_set_name_const(object->data, "ARRAY: object->data");
6307 21718 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
6308 21696 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
6309 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]");
6310 0 : return -1;
6311 : }
6312 : {
6313 21696 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
6314 21696 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
6315 : unsigned long long test_var;
6316 21696 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
6317 21696 : if (PyErr_Occurred() != NULL) {
6318 0 : return -1;
6319 : }
6320 21696 : if (test_var > uint_max) {
6321 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6322 : PyLong_Type.tp_name, uint_max, test_var);
6323 0 : return -1;
6324 : }
6325 21696 : object->data[data_cntr_1] = test_var;
6326 : } else {
6327 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6328 : PyLong_Type.tp_name);
6329 0 : return -1;
6330 : }
6331 : }
6332 : }
6333 : }
6334 : }
6335 22 : return 0;
6336 : }
6337 :
6338 : static PyGetSetDef py_lsa_DATA_BUF2_getsetters[] = {
6339 : {
6340 : .name = discard_const_p(char, "size"),
6341 : .get = py_lsa_DATA_BUF2_get_size,
6342 : .set = py_lsa_DATA_BUF2_set_size,
6343 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6344 : },
6345 : {
6346 : .name = discard_const_p(char, "data"),
6347 : .get = py_lsa_DATA_BUF2_get_data,
6348 : .set = py_lsa_DATA_BUF2_set_data,
6349 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6350 : },
6351 : { .name = NULL }
6352 : };
6353 :
6354 22 : static PyObject *py_lsa_DATA_BUF2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6355 : {
6356 22 : return pytalloc_new(struct lsa_DATA_BUF2, type);
6357 : }
6358 :
6359 :
6360 : static PyTypeObject lsa_DATA_BUF2_Type = {
6361 : PyVarObject_HEAD_INIT(NULL, 0)
6362 : .tp_name = "lsa.DATA_BUF2",
6363 : .tp_getset = py_lsa_DATA_BUF2_getsetters,
6364 : .tp_methods = NULL,
6365 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6366 : .tp_new = py_lsa_DATA_BUF2_new,
6367 : };
6368 :
6369 :
6370 0 : static PyObject *py_lsa_TrustDomainInfoName_get_netbios_name(PyObject *obj, void *closure)
6371 : {
6372 0 : struct lsa_TrustDomainInfoName *object = (struct lsa_TrustDomainInfoName *)pytalloc_get_ptr(obj);
6373 : PyObject *py_netbios_name;
6374 0 : py_netbios_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->netbios_name);
6375 0 : return py_netbios_name;
6376 : }
6377 :
6378 0 : static int py_lsa_TrustDomainInfoName_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
6379 : {
6380 0 : struct lsa_TrustDomainInfoName *object = (struct lsa_TrustDomainInfoName *)pytalloc_get_ptr(py_obj);
6381 0 : if (value == NULL) {
6382 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_name");
6383 0 : return -1;
6384 : }
6385 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
6386 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6387 0 : PyErr_NoMemory();
6388 0 : return -1;
6389 : }
6390 0 : object->netbios_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
6391 0 : return 0;
6392 : }
6393 :
6394 : static PyGetSetDef py_lsa_TrustDomainInfoName_getsetters[] = {
6395 : {
6396 : .name = discard_const_p(char, "netbios_name"),
6397 : .get = py_lsa_TrustDomainInfoName_get_netbios_name,
6398 : .set = py_lsa_TrustDomainInfoName_set_netbios_name,
6399 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
6400 : },
6401 : { .name = NULL }
6402 : };
6403 :
6404 0 : static PyObject *py_lsa_TrustDomainInfoName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6405 : {
6406 0 : return pytalloc_new(struct lsa_TrustDomainInfoName, type);
6407 : }
6408 :
6409 :
6410 : static PyTypeObject lsa_TrustDomainInfoName_Type = {
6411 : PyVarObject_HEAD_INIT(NULL, 0)
6412 : .tp_name = "lsa.TrustDomainInfoName",
6413 : .tp_getset = py_lsa_TrustDomainInfoName_getsetters,
6414 : .tp_methods = NULL,
6415 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6416 : .tp_new = py_lsa_TrustDomainInfoName_new,
6417 : };
6418 :
6419 :
6420 0 : static PyObject *py_lsa_TrustDomainInfoControllers_get_entries(PyObject *obj, void *closure)
6421 : {
6422 0 : struct lsa_TrustDomainInfoControllers *object = (struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(obj);
6423 : PyObject *py_entries;
6424 0 : py_entries = PyLong_FromUnsignedLongLong((uint32_t)object->entries);
6425 0 : return py_entries;
6426 : }
6427 :
6428 0 : static int py_lsa_TrustDomainInfoControllers_set_entries(PyObject *py_obj, PyObject *value, void *closure)
6429 : {
6430 0 : struct lsa_TrustDomainInfoControllers *object = (struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(py_obj);
6431 0 : if (value == NULL) {
6432 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries");
6433 0 : return -1;
6434 : }
6435 : {
6436 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->entries));
6437 0 : if (PyLong_Check(value)) {
6438 : unsigned long long test_var;
6439 0 : test_var = PyLong_AsUnsignedLongLong(value);
6440 0 : if (PyErr_Occurred() != NULL) {
6441 0 : return -1;
6442 : }
6443 0 : if (test_var > uint_max) {
6444 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6445 : PyLong_Type.tp_name, uint_max, test_var);
6446 0 : return -1;
6447 : }
6448 0 : object->entries = test_var;
6449 : } else {
6450 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6451 : PyLong_Type.tp_name);
6452 0 : return -1;
6453 : }
6454 : }
6455 0 : return 0;
6456 : }
6457 :
6458 0 : static PyObject *py_lsa_TrustDomainInfoControllers_get_netbios_names(PyObject *obj, void *closure)
6459 : {
6460 0 : struct lsa_TrustDomainInfoControllers *object = (struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(obj);
6461 : PyObject *py_netbios_names;
6462 0 : if (object->netbios_names == NULL) {
6463 0 : Py_RETURN_NONE;
6464 : }
6465 0 : if (object->netbios_names == NULL) {
6466 0 : py_netbios_names = Py_None;
6467 0 : Py_INCREF(py_netbios_names);
6468 : } else {
6469 0 : py_netbios_names = PyList_New(object->entries);
6470 0 : if (py_netbios_names == NULL) {
6471 0 : return NULL;
6472 : }
6473 : {
6474 : int netbios_names_cntr_1;
6475 0 : for (netbios_names_cntr_1 = 0; netbios_names_cntr_1 < (object->entries); netbios_names_cntr_1++) {
6476 : PyObject *py_netbios_names_1;
6477 0 : py_netbios_names_1 = pytalloc_reference_ex(&lsa_StringLarge_Type, object->netbios_names, &object->netbios_names[netbios_names_cntr_1]);
6478 0 : PyList_SetItem(py_netbios_names, netbios_names_cntr_1, py_netbios_names_1);
6479 : }
6480 : }
6481 : }
6482 0 : return py_netbios_names;
6483 : }
6484 :
6485 0 : static int py_lsa_TrustDomainInfoControllers_set_netbios_names(PyObject *py_obj, PyObject *value, void *closure)
6486 : {
6487 0 : struct lsa_TrustDomainInfoControllers *object = (struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(py_obj);
6488 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->netbios_names));
6489 0 : if (value == NULL) {
6490 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_names");
6491 0 : return -1;
6492 : }
6493 0 : if (value == Py_None) {
6494 0 : object->netbios_names = NULL;
6495 : } else {
6496 0 : object->netbios_names = NULL;
6497 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6498 : {
6499 : int netbios_names_cntr_1;
6500 0 : object->netbios_names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->netbios_names, PyList_GET_SIZE(value));
6501 0 : if (!object->netbios_names) { return -1;; }
6502 0 : talloc_set_name_const(object->netbios_names, "ARRAY: object->netbios_names");
6503 0 : for (netbios_names_cntr_1 = 0; netbios_names_cntr_1 < PyList_GET_SIZE(value); netbios_names_cntr_1++) {
6504 0 : if (PyList_GET_ITEM(value, netbios_names_cntr_1) == NULL) {
6505 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_names[netbios_names_cntr_1]");
6506 0 : return -1;
6507 : }
6508 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, PyList_GET_ITEM(value, netbios_names_cntr_1), return -1;);
6509 0 : if (talloc_reference(object->netbios_names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, netbios_names_cntr_1))) == NULL) {
6510 0 : PyErr_NoMemory();
6511 0 : return -1;
6512 : }
6513 0 : object->netbios_names[netbios_names_cntr_1] = *(struct lsa_StringLarge *)pytalloc_get_ptr(PyList_GET_ITEM(value, netbios_names_cntr_1));
6514 : }
6515 : }
6516 : }
6517 0 : return 0;
6518 : }
6519 :
6520 : static PyGetSetDef py_lsa_TrustDomainInfoControllers_getsetters[] = {
6521 : {
6522 : .name = discard_const_p(char, "entries"),
6523 : .get = py_lsa_TrustDomainInfoControllers_get_entries,
6524 : .set = py_lsa_TrustDomainInfoControllers_set_entries,
6525 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6526 : },
6527 : {
6528 : .name = discard_const_p(char, "netbios_names"),
6529 : .get = py_lsa_TrustDomainInfoControllers_get_netbios_names,
6530 : .set = py_lsa_TrustDomainInfoControllers_set_netbios_names,
6531 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
6532 : },
6533 : { .name = NULL }
6534 : };
6535 :
6536 0 : static PyObject *py_lsa_TrustDomainInfoControllers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6537 : {
6538 0 : return pytalloc_new(struct lsa_TrustDomainInfoControllers, type);
6539 : }
6540 :
6541 :
6542 : static PyTypeObject lsa_TrustDomainInfoControllers_Type = {
6543 : PyVarObject_HEAD_INIT(NULL, 0)
6544 : .tp_name = "lsa.TrustDomainInfoControllers",
6545 : .tp_getset = py_lsa_TrustDomainInfoControllers_getsetters,
6546 : .tp_methods = NULL,
6547 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6548 : .tp_new = py_lsa_TrustDomainInfoControllers_new,
6549 : };
6550 :
6551 :
6552 48 : static PyObject *py_lsa_TrustDomainInfoPosixOffset_get_posix_offset(PyObject *obj, void *closure)
6553 : {
6554 48 : struct lsa_TrustDomainInfoPosixOffset *object = (struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(obj);
6555 : PyObject *py_posix_offset;
6556 48 : py_posix_offset = PyLong_FromUnsignedLongLong((uint32_t)object->posix_offset);
6557 48 : return py_posix_offset;
6558 : }
6559 :
6560 0 : static int py_lsa_TrustDomainInfoPosixOffset_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
6561 : {
6562 0 : struct lsa_TrustDomainInfoPosixOffset *object = (struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(py_obj);
6563 0 : if (value == NULL) {
6564 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->posix_offset");
6565 0 : return -1;
6566 : }
6567 : {
6568 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->posix_offset));
6569 0 : if (PyLong_Check(value)) {
6570 : unsigned long long test_var;
6571 0 : test_var = PyLong_AsUnsignedLongLong(value);
6572 0 : if (PyErr_Occurred() != NULL) {
6573 0 : return -1;
6574 : }
6575 0 : if (test_var > uint_max) {
6576 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6577 : PyLong_Type.tp_name, uint_max, test_var);
6578 0 : return -1;
6579 : }
6580 0 : object->posix_offset = test_var;
6581 : } else {
6582 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6583 : PyLong_Type.tp_name);
6584 0 : return -1;
6585 : }
6586 : }
6587 0 : return 0;
6588 : }
6589 :
6590 : static PyGetSetDef py_lsa_TrustDomainInfoPosixOffset_getsetters[] = {
6591 : {
6592 : .name = discard_const_p(char, "posix_offset"),
6593 : .get = py_lsa_TrustDomainInfoPosixOffset_get_posix_offset,
6594 : .set = py_lsa_TrustDomainInfoPosixOffset_set_posix_offset,
6595 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6596 : },
6597 : { .name = NULL }
6598 : };
6599 :
6600 0 : static PyObject *py_lsa_TrustDomainInfoPosixOffset_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6601 : {
6602 0 : return pytalloc_new(struct lsa_TrustDomainInfoPosixOffset, type);
6603 : }
6604 :
6605 :
6606 : static PyTypeObject lsa_TrustDomainInfoPosixOffset_Type = {
6607 : PyVarObject_HEAD_INIT(NULL, 0)
6608 : .tp_name = "lsa.TrustDomainInfoPosixOffset",
6609 : .tp_getset = py_lsa_TrustDomainInfoPosixOffset_getsetters,
6610 : .tp_methods = NULL,
6611 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6612 : .tp_new = py_lsa_TrustDomainInfoPosixOffset_new,
6613 : };
6614 :
6615 :
6616 0 : static PyObject *py_lsa_TrustDomainInfoPassword_get_password(PyObject *obj, void *closure)
6617 : {
6618 0 : struct lsa_TrustDomainInfoPassword *object = (struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(obj);
6619 : PyObject *py_password;
6620 0 : if (object->password == NULL) {
6621 0 : Py_RETURN_NONE;
6622 : }
6623 0 : if (object->password == NULL) {
6624 0 : py_password = Py_None;
6625 0 : Py_INCREF(py_password);
6626 : } else {
6627 0 : py_password = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->password, object->password);
6628 : }
6629 0 : return py_password;
6630 : }
6631 :
6632 0 : static int py_lsa_TrustDomainInfoPassword_set_password(PyObject *py_obj, PyObject *value, void *closure)
6633 : {
6634 0 : struct lsa_TrustDomainInfoPassword *object = (struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(py_obj);
6635 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->password));
6636 0 : if (value == NULL) {
6637 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
6638 0 : return -1;
6639 : }
6640 0 : if (value == Py_None) {
6641 0 : object->password = NULL;
6642 : } else {
6643 0 : object->password = NULL;
6644 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
6645 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6646 0 : PyErr_NoMemory();
6647 0 : return -1;
6648 : }
6649 0 : object->password = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
6650 : }
6651 0 : return 0;
6652 : }
6653 :
6654 0 : static PyObject *py_lsa_TrustDomainInfoPassword_get_old_password(PyObject *obj, void *closure)
6655 : {
6656 0 : struct lsa_TrustDomainInfoPassword *object = (struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(obj);
6657 : PyObject *py_old_password;
6658 0 : if (object->old_password == NULL) {
6659 0 : Py_RETURN_NONE;
6660 : }
6661 0 : if (object->old_password == NULL) {
6662 0 : py_old_password = Py_None;
6663 0 : Py_INCREF(py_old_password);
6664 : } else {
6665 0 : py_old_password = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->old_password, object->old_password);
6666 : }
6667 0 : return py_old_password;
6668 : }
6669 :
6670 0 : static int py_lsa_TrustDomainInfoPassword_set_old_password(PyObject *py_obj, PyObject *value, void *closure)
6671 : {
6672 0 : struct lsa_TrustDomainInfoPassword *object = (struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(py_obj);
6673 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->old_password));
6674 0 : if (value == NULL) {
6675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->old_password");
6676 0 : return -1;
6677 : }
6678 0 : if (value == Py_None) {
6679 0 : object->old_password = NULL;
6680 : } else {
6681 0 : object->old_password = NULL;
6682 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
6683 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6684 0 : PyErr_NoMemory();
6685 0 : return -1;
6686 : }
6687 0 : object->old_password = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
6688 : }
6689 0 : return 0;
6690 : }
6691 :
6692 : static PyGetSetDef py_lsa_TrustDomainInfoPassword_getsetters[] = {
6693 : {
6694 : .name = discard_const_p(char, "password"),
6695 : .get = py_lsa_TrustDomainInfoPassword_get_password,
6696 : .set = py_lsa_TrustDomainInfoPassword_set_password,
6697 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
6698 : },
6699 : {
6700 : .name = discard_const_p(char, "old_password"),
6701 : .get = py_lsa_TrustDomainInfoPassword_get_old_password,
6702 : .set = py_lsa_TrustDomainInfoPassword_set_old_password,
6703 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
6704 : },
6705 : { .name = NULL }
6706 : };
6707 :
6708 0 : static PyObject *py_lsa_TrustDomainInfoPassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6709 : {
6710 0 : return pytalloc_new(struct lsa_TrustDomainInfoPassword, type);
6711 : }
6712 :
6713 :
6714 : static PyTypeObject lsa_TrustDomainInfoPassword_Type = {
6715 : PyVarObject_HEAD_INIT(NULL, 0)
6716 : .tp_name = "lsa.TrustDomainInfoPassword",
6717 : .tp_getset = py_lsa_TrustDomainInfoPassword_getsetters,
6718 : .tp_methods = NULL,
6719 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6720 : .tp_new = py_lsa_TrustDomainInfoPassword_new,
6721 : };
6722 :
6723 :
6724 0 : static PyObject *py_lsa_TrustDomainInfoBasic_get_netbios_name(PyObject *obj, void *closure)
6725 : {
6726 0 : struct lsa_TrustDomainInfoBasic *object = (struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(obj);
6727 : PyObject *py_netbios_name;
6728 0 : py_netbios_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->netbios_name);
6729 0 : return py_netbios_name;
6730 : }
6731 :
6732 0 : static int py_lsa_TrustDomainInfoBasic_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
6733 : {
6734 0 : struct lsa_TrustDomainInfoBasic *object = (struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(py_obj);
6735 0 : if (value == NULL) {
6736 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_name");
6737 0 : return -1;
6738 : }
6739 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
6740 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6741 0 : PyErr_NoMemory();
6742 0 : return -1;
6743 : }
6744 0 : object->netbios_name = *(struct lsa_String *)pytalloc_get_ptr(value);
6745 0 : return 0;
6746 : }
6747 :
6748 0 : static PyObject *py_lsa_TrustDomainInfoBasic_get_sid(PyObject *obj, void *closure)
6749 : {
6750 0 : struct lsa_TrustDomainInfoBasic *object = (struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(obj);
6751 : PyObject *py_sid;
6752 0 : if (object->sid == NULL) {
6753 0 : Py_RETURN_NONE;
6754 : }
6755 0 : if (object->sid == NULL) {
6756 0 : py_sid = Py_None;
6757 0 : Py_INCREF(py_sid);
6758 : } else {
6759 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
6760 : }
6761 0 : return py_sid;
6762 : }
6763 :
6764 0 : static int py_lsa_TrustDomainInfoBasic_set_sid(PyObject *py_obj, PyObject *value, void *closure)
6765 : {
6766 0 : struct lsa_TrustDomainInfoBasic *object = (struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(py_obj);
6767 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
6768 0 : if (value == NULL) {
6769 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
6770 0 : return -1;
6771 : }
6772 0 : if (value == Py_None) {
6773 0 : object->sid = NULL;
6774 : } else {
6775 0 : object->sid = NULL;
6776 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
6777 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6778 0 : PyErr_NoMemory();
6779 0 : return -1;
6780 : }
6781 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
6782 : }
6783 0 : return 0;
6784 : }
6785 :
6786 : static PyGetSetDef py_lsa_TrustDomainInfoBasic_getsetters[] = {
6787 : {
6788 : .name = discard_const_p(char, "netbios_name"),
6789 : .get = py_lsa_TrustDomainInfoBasic_get_netbios_name,
6790 : .set = py_lsa_TrustDomainInfoBasic_set_netbios_name,
6791 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
6792 : },
6793 : {
6794 : .name = discard_const_p(char, "sid"),
6795 : .get = py_lsa_TrustDomainInfoBasic_get_sid,
6796 : .set = py_lsa_TrustDomainInfoBasic_set_sid,
6797 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
6798 : },
6799 : { .name = NULL }
6800 : };
6801 :
6802 0 : static PyObject *py_lsa_TrustDomainInfoBasic_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6803 : {
6804 0 : return pytalloc_new(struct lsa_TrustDomainInfoBasic, type);
6805 : }
6806 :
6807 :
6808 : static PyTypeObject lsa_TrustDomainInfoBasic_Type = {
6809 : PyVarObject_HEAD_INIT(NULL, 0)
6810 : .tp_name = "lsa.TrustDomainInfoBasic",
6811 : .tp_getset = py_lsa_TrustDomainInfoBasic_getsetters,
6812 : .tp_methods = NULL,
6813 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6814 : .tp_new = py_lsa_TrustDomainInfoBasic_new,
6815 : };
6816 :
6817 :
6818 604 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_domain_name(PyObject *obj, void *closure)
6819 : {
6820 604 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6821 : PyObject *py_domain_name;
6822 604 : py_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->domain_name);
6823 604 : return py_domain_name;
6824 : }
6825 :
6826 0 : static int py_lsa_TrustDomainInfoInfoEx_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
6827 : {
6828 0 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6829 0 : if (value == NULL) {
6830 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
6831 0 : return -1;
6832 : }
6833 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
6834 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6835 0 : PyErr_NoMemory();
6836 0 : return -1;
6837 : }
6838 0 : object->domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
6839 0 : return 0;
6840 : }
6841 :
6842 188 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_netbios_name(PyObject *obj, void *closure)
6843 : {
6844 188 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6845 : PyObject *py_netbios_name;
6846 188 : py_netbios_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->netbios_name);
6847 188 : return py_netbios_name;
6848 : }
6849 :
6850 0 : static int py_lsa_TrustDomainInfoInfoEx_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
6851 : {
6852 0 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6853 0 : if (value == NULL) {
6854 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_name");
6855 0 : return -1;
6856 : }
6857 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
6858 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6859 0 : PyErr_NoMemory();
6860 0 : return -1;
6861 : }
6862 0 : object->netbios_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
6863 0 : return 0;
6864 : }
6865 :
6866 120 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_sid(PyObject *obj, void *closure)
6867 : {
6868 120 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6869 : PyObject *py_sid;
6870 120 : if (object->sid == NULL) {
6871 0 : Py_RETURN_NONE;
6872 : }
6873 120 : if (object->sid == NULL) {
6874 0 : py_sid = Py_None;
6875 0 : Py_INCREF(py_sid);
6876 : } else {
6877 120 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
6878 : }
6879 120 : return py_sid;
6880 : }
6881 :
6882 22 : static int py_lsa_TrustDomainInfoInfoEx_set_sid(PyObject *py_obj, PyObject *value, void *closure)
6883 : {
6884 22 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6885 22 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
6886 22 : if (value == NULL) {
6887 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
6888 0 : return -1;
6889 : }
6890 22 : if (value == Py_None) {
6891 0 : object->sid = NULL;
6892 : } else {
6893 22 : object->sid = NULL;
6894 22 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
6895 22 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6896 0 : PyErr_NoMemory();
6897 0 : return -1;
6898 : }
6899 22 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
6900 : }
6901 22 : return 0;
6902 : }
6903 :
6904 106 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_direction(PyObject *obj, void *closure)
6905 : {
6906 106 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6907 : PyObject *py_trust_direction;
6908 106 : py_trust_direction = PyLong_FromUnsignedLongLong((uint32_t)object->trust_direction);
6909 106 : return py_trust_direction;
6910 : }
6911 :
6912 60 : static int py_lsa_TrustDomainInfoInfoEx_set_trust_direction(PyObject *py_obj, PyObject *value, void *closure)
6913 : {
6914 60 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6915 60 : if (value == NULL) {
6916 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_direction");
6917 0 : return -1;
6918 : }
6919 : {
6920 60 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_direction));
6921 60 : if (PyLong_Check(value)) {
6922 : unsigned long long test_var;
6923 60 : test_var = PyLong_AsUnsignedLongLong(value);
6924 60 : if (PyErr_Occurred() != NULL) {
6925 0 : return -1;
6926 : }
6927 60 : if (test_var > uint_max) {
6928 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6929 : PyLong_Type.tp_name, uint_max, test_var);
6930 0 : return -1;
6931 : }
6932 60 : object->trust_direction = test_var;
6933 : } else {
6934 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6935 : PyLong_Type.tp_name);
6936 0 : return -1;
6937 : }
6938 : }
6939 60 : return 0;
6940 : }
6941 :
6942 24 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_type(PyObject *obj, void *closure)
6943 : {
6944 24 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6945 : PyObject *py_trust_type;
6946 24 : py_trust_type = PyLong_FromUnsignedLongLong((uint32_t)object->trust_type);
6947 24 : return py_trust_type;
6948 : }
6949 :
6950 22 : static int py_lsa_TrustDomainInfoInfoEx_set_trust_type(PyObject *py_obj, PyObject *value, void *closure)
6951 : {
6952 22 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6953 22 : if (value == NULL) {
6954 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_type");
6955 0 : return -1;
6956 : }
6957 : {
6958 22 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_type));
6959 22 : if (PyLong_Check(value)) {
6960 : unsigned long long test_var;
6961 22 : test_var = PyLong_AsUnsignedLongLong(value);
6962 22 : if (PyErr_Occurred() != NULL) {
6963 0 : return -1;
6964 : }
6965 22 : if (test_var > uint_max) {
6966 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6967 : PyLong_Type.tp_name, uint_max, test_var);
6968 0 : return -1;
6969 : }
6970 22 : object->trust_type = test_var;
6971 : } else {
6972 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6973 : PyLong_Type.tp_name);
6974 0 : return -1;
6975 : }
6976 : }
6977 22 : return 0;
6978 : }
6979 :
6980 177 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_attributes(PyObject *obj, void *closure)
6981 : {
6982 177 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6983 : PyObject *py_trust_attributes;
6984 177 : py_trust_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->trust_attributes);
6985 177 : return py_trust_attributes;
6986 : }
6987 :
6988 44 : static int py_lsa_TrustDomainInfoInfoEx_set_trust_attributes(PyObject *py_obj, PyObject *value, void *closure)
6989 : {
6990 44 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6991 44 : if (value == NULL) {
6992 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_attributes");
6993 0 : return -1;
6994 : }
6995 : {
6996 44 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_attributes));
6997 44 : if (PyLong_Check(value)) {
6998 : unsigned long long test_var;
6999 44 : test_var = PyLong_AsUnsignedLongLong(value);
7000 44 : if (PyErr_Occurred() != NULL) {
7001 0 : return -1;
7002 : }
7003 44 : if (test_var > uint_max) {
7004 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7005 : PyLong_Type.tp_name, uint_max, test_var);
7006 0 : return -1;
7007 : }
7008 44 : object->trust_attributes = test_var;
7009 : } else {
7010 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7011 : PyLong_Type.tp_name);
7012 0 : return -1;
7013 : }
7014 : }
7015 44 : return 0;
7016 : }
7017 :
7018 : static PyGetSetDef py_lsa_TrustDomainInfoInfoEx_getsetters[] = {
7019 : {
7020 : .name = discard_const_p(char, "domain_name"),
7021 : .get = py_lsa_TrustDomainInfoInfoEx_get_domain_name,
7022 : .set = py_lsa_TrustDomainInfoInfoEx_set_domain_name,
7023 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
7024 : },
7025 : {
7026 : .name = discard_const_p(char, "netbios_name"),
7027 : .get = py_lsa_TrustDomainInfoInfoEx_get_netbios_name,
7028 : .set = py_lsa_TrustDomainInfoInfoEx_set_netbios_name,
7029 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
7030 : },
7031 : {
7032 : .name = discard_const_p(char, "sid"),
7033 : .get = py_lsa_TrustDomainInfoInfoEx_get_sid,
7034 : .set = py_lsa_TrustDomainInfoInfoEx_set_sid,
7035 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
7036 : },
7037 : {
7038 : .name = discard_const_p(char, "trust_direction"),
7039 : .get = py_lsa_TrustDomainInfoInfoEx_get_trust_direction,
7040 : .set = py_lsa_TrustDomainInfoInfoEx_set_trust_direction,
7041 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDirection")
7042 : },
7043 : {
7044 : .name = discard_const_p(char, "trust_type"),
7045 : .get = py_lsa_TrustDomainInfoInfoEx_get_trust_type,
7046 : .set = py_lsa_TrustDomainInfoInfoEx_set_trust_type,
7047 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustType")
7048 : },
7049 : {
7050 : .name = discard_const_p(char, "trust_attributes"),
7051 : .get = py_lsa_TrustDomainInfoInfoEx_get_trust_attributes,
7052 : .set = py_lsa_TrustDomainInfoInfoEx_set_trust_attributes,
7053 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustAttributes")
7054 : },
7055 : { .name = NULL }
7056 : };
7057 :
7058 22 : static PyObject *py_lsa_TrustDomainInfoInfoEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7059 : {
7060 22 : return pytalloc_new(struct lsa_TrustDomainInfoInfoEx, type);
7061 : }
7062 :
7063 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7064 : {
7065 0 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
7066 0 : PyObject *ret = NULL;
7067 : DATA_BLOB blob;
7068 : enum ndr_err_code err;
7069 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7070 0 : if (tmp_ctx == NULL) {
7071 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7072 0 : return NULL;
7073 : }
7074 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_TrustDomainInfoInfoEx);
7075 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7076 0 : TALLOC_FREE(tmp_ctx);
7077 0 : PyErr_SetNdrError(err);
7078 0 : return NULL;
7079 : }
7080 :
7081 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7082 0 : TALLOC_FREE(tmp_ctx);
7083 0 : return ret;
7084 : }
7085 :
7086 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7087 : {
7088 0 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
7089 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7090 0 : Py_ssize_t blob_length = 0;
7091 : enum ndr_err_code err;
7092 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7093 0 : PyObject *allow_remaining_obj = NULL;
7094 0 : bool allow_remaining = false;
7095 :
7096 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7097 : discard_const_p(char *, kwnames),
7098 : &blob.data, &blob_length,
7099 : &allow_remaining_obj)) {
7100 0 : return NULL;
7101 : }
7102 0 : blob.length = blob_length;
7103 :
7104 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7105 0 : allow_remaining = true;
7106 : }
7107 :
7108 0 : if (allow_remaining) {
7109 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoInfoEx);
7110 : } else {
7111 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoInfoEx);
7112 : }
7113 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7114 0 : PyErr_SetNdrError(err);
7115 0 : return NULL;
7116 : }
7117 :
7118 0 : Py_RETURN_NONE;
7119 : }
7120 :
7121 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7122 : {
7123 0 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
7124 : PyObject *ret;
7125 : char *retstr;
7126 :
7127 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_TrustDomainInfoInfoEx, "lsa_TrustDomainInfoInfoEx", object);
7128 0 : ret = PyUnicode_FromString(retstr);
7129 0 : talloc_free(retstr);
7130 :
7131 0 : return ret;
7132 : }
7133 :
7134 : static PyMethodDef py_lsa_TrustDomainInfoInfoEx_methods[] = {
7135 : { "__ndr_pack__", (PyCFunction)py_lsa_TrustDomainInfoInfoEx_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7136 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_TrustDomainInfoInfoEx_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7137 : { "__ndr_print__", (PyCFunction)py_lsa_TrustDomainInfoInfoEx_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7138 : { NULL, NULL, 0, NULL }
7139 : };
7140 :
7141 :
7142 : static PyTypeObject lsa_TrustDomainInfoInfoEx_Type = {
7143 : PyVarObject_HEAD_INIT(NULL, 0)
7144 : .tp_name = "lsa.TrustDomainInfoInfoEx",
7145 : .tp_getset = py_lsa_TrustDomainInfoInfoEx_getsetters,
7146 : .tp_methods = py_lsa_TrustDomainInfoInfoEx_methods,
7147 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7148 : .tp_new = py_lsa_TrustDomainInfoInfoEx_new,
7149 : };
7150 :
7151 :
7152 0 : static PyObject *py_lsa_TrustDomainInfoBuffer_get_last_update_time(PyObject *obj, void *closure)
7153 : {
7154 0 : struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(obj);
7155 : PyObject *py_last_update_time;
7156 0 : py_last_update_time = PyLong_FromUnsignedLongLong(object->last_update_time);
7157 0 : return py_last_update_time;
7158 : }
7159 :
7160 0 : static int py_lsa_TrustDomainInfoBuffer_set_last_update_time(PyObject *py_obj, PyObject *value, void *closure)
7161 : {
7162 0 : struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(py_obj);
7163 0 : if (value == NULL) {
7164 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_update_time");
7165 0 : return -1;
7166 : }
7167 : {
7168 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_update_time));
7169 0 : if (PyLong_Check(value)) {
7170 : unsigned long long test_var;
7171 0 : test_var = PyLong_AsUnsignedLongLong(value);
7172 0 : if (PyErr_Occurred() != NULL) {
7173 0 : return -1;
7174 : }
7175 0 : if (test_var > uint_max) {
7176 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7177 : PyLong_Type.tp_name, uint_max, test_var);
7178 0 : return -1;
7179 : }
7180 0 : object->last_update_time = test_var;
7181 : } else {
7182 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7183 : PyLong_Type.tp_name);
7184 0 : return -1;
7185 : }
7186 : }
7187 0 : return 0;
7188 : }
7189 :
7190 0 : static PyObject *py_lsa_TrustDomainInfoBuffer_get_AuthType(PyObject *obj, void *closure)
7191 : {
7192 0 : struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(obj);
7193 : PyObject *py_AuthType;
7194 0 : py_AuthType = PyLong_FromUnsignedLongLong((uint32_t)object->AuthType);
7195 0 : return py_AuthType;
7196 : }
7197 :
7198 0 : static int py_lsa_TrustDomainInfoBuffer_set_AuthType(PyObject *py_obj, PyObject *value, void *closure)
7199 : {
7200 0 : struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(py_obj);
7201 0 : if (value == NULL) {
7202 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->AuthType");
7203 0 : return -1;
7204 : }
7205 : {
7206 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->AuthType));
7207 0 : if (PyLong_Check(value)) {
7208 : unsigned long long test_var;
7209 0 : test_var = PyLong_AsUnsignedLongLong(value);
7210 0 : if (PyErr_Occurred() != NULL) {
7211 0 : return -1;
7212 : }
7213 0 : if (test_var > uint_max) {
7214 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7215 : PyLong_Type.tp_name, uint_max, test_var);
7216 0 : return -1;
7217 : }
7218 0 : object->AuthType = test_var;
7219 : } else {
7220 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7221 : PyLong_Type.tp_name);
7222 0 : return -1;
7223 : }
7224 : }
7225 0 : return 0;
7226 : }
7227 :
7228 0 : static PyObject *py_lsa_TrustDomainInfoBuffer_get_data(PyObject *obj, void *closure)
7229 : {
7230 0 : struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(obj);
7231 : PyObject *py_data;
7232 0 : py_data = pytalloc_reference_ex(&lsa_DATA_BUF2_Type, pytalloc_get_mem_ctx(obj), &object->data);
7233 0 : return py_data;
7234 : }
7235 :
7236 0 : static int py_lsa_TrustDomainInfoBuffer_set_data(PyObject *py_obj, PyObject *value, void *closure)
7237 : {
7238 0 : struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(py_obj);
7239 0 : if (value == NULL) {
7240 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
7241 0 : return -1;
7242 : }
7243 0 : PY_CHECK_TYPE(&lsa_DATA_BUF2_Type, value, return -1;);
7244 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7245 0 : PyErr_NoMemory();
7246 0 : return -1;
7247 : }
7248 0 : object->data = *(struct lsa_DATA_BUF2 *)pytalloc_get_ptr(value);
7249 0 : return 0;
7250 : }
7251 :
7252 : static PyGetSetDef py_lsa_TrustDomainInfoBuffer_getsetters[] = {
7253 : {
7254 : .name = discard_const_p(char, "last_update_time"),
7255 : .get = py_lsa_TrustDomainInfoBuffer_get_last_update_time,
7256 : .set = py_lsa_TrustDomainInfoBuffer_set_last_update_time,
7257 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
7258 : },
7259 : {
7260 : .name = discard_const_p(char, "AuthType"),
7261 : .get = py_lsa_TrustDomainInfoBuffer_get_AuthType,
7262 : .set = py_lsa_TrustDomainInfoBuffer_set_AuthType,
7263 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustAuthType")
7264 : },
7265 : {
7266 : .name = discard_const_p(char, "data"),
7267 : .get = py_lsa_TrustDomainInfoBuffer_get_data,
7268 : .set = py_lsa_TrustDomainInfoBuffer_set_data,
7269 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF2")
7270 : },
7271 : { .name = NULL }
7272 : };
7273 :
7274 0 : static PyObject *py_lsa_TrustDomainInfoBuffer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7275 : {
7276 0 : return pytalloc_new(struct lsa_TrustDomainInfoBuffer, type);
7277 : }
7278 :
7279 :
7280 : static PyTypeObject lsa_TrustDomainInfoBuffer_Type = {
7281 : PyVarObject_HEAD_INIT(NULL, 0)
7282 : .tp_name = "lsa.TrustDomainInfoBuffer",
7283 : .tp_getset = py_lsa_TrustDomainInfoBuffer_getsetters,
7284 : .tp_methods = NULL,
7285 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7286 : .tp_new = py_lsa_TrustDomainInfoBuffer_new,
7287 : };
7288 :
7289 :
7290 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_count(PyObject *obj, void *closure)
7291 : {
7292 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
7293 : PyObject *py_incoming_count;
7294 0 : py_incoming_count = PyLong_FromUnsignedLongLong((uint32_t)object->incoming_count);
7295 0 : return py_incoming_count;
7296 : }
7297 :
7298 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_count(PyObject *py_obj, PyObject *value, void *closure)
7299 : {
7300 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7301 0 : if (value == NULL) {
7302 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->incoming_count");
7303 0 : return -1;
7304 : }
7305 : {
7306 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->incoming_count));
7307 0 : if (PyLong_Check(value)) {
7308 : unsigned long long test_var;
7309 0 : test_var = PyLong_AsUnsignedLongLong(value);
7310 0 : if (PyErr_Occurred() != NULL) {
7311 0 : return -1;
7312 : }
7313 0 : if (test_var > uint_max) {
7314 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7315 : PyLong_Type.tp_name, uint_max, test_var);
7316 0 : return -1;
7317 : }
7318 0 : object->incoming_count = test_var;
7319 : } else {
7320 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7321 : PyLong_Type.tp_name);
7322 0 : return -1;
7323 : }
7324 : }
7325 0 : return 0;
7326 : }
7327 :
7328 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_current_auth_info(PyObject *obj, void *closure)
7329 : {
7330 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
7331 : PyObject *py_incoming_current_auth_info;
7332 0 : if (object->incoming_current_auth_info == NULL) {
7333 0 : Py_RETURN_NONE;
7334 : }
7335 0 : if (object->incoming_current_auth_info == NULL) {
7336 0 : py_incoming_current_auth_info = Py_None;
7337 0 : Py_INCREF(py_incoming_current_auth_info);
7338 : } else {
7339 0 : py_incoming_current_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->incoming_current_auth_info, object->incoming_current_auth_info);
7340 : }
7341 0 : return py_incoming_current_auth_info;
7342 : }
7343 :
7344 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_current_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7345 : {
7346 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7347 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->incoming_current_auth_info));
7348 0 : if (value == NULL) {
7349 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->incoming_current_auth_info");
7350 0 : return -1;
7351 : }
7352 0 : if (value == Py_None) {
7353 0 : object->incoming_current_auth_info = NULL;
7354 : } else {
7355 0 : object->incoming_current_auth_info = NULL;
7356 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
7357 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7358 0 : PyErr_NoMemory();
7359 0 : return -1;
7360 : }
7361 0 : object->incoming_current_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
7362 : }
7363 0 : return 0;
7364 : }
7365 :
7366 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_previous_auth_info(PyObject *obj, void *closure)
7367 : {
7368 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
7369 : PyObject *py_incoming_previous_auth_info;
7370 0 : if (object->incoming_previous_auth_info == NULL) {
7371 0 : Py_RETURN_NONE;
7372 : }
7373 0 : if (object->incoming_previous_auth_info == NULL) {
7374 0 : py_incoming_previous_auth_info = Py_None;
7375 0 : Py_INCREF(py_incoming_previous_auth_info);
7376 : } else {
7377 0 : py_incoming_previous_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->incoming_previous_auth_info, object->incoming_previous_auth_info);
7378 : }
7379 0 : return py_incoming_previous_auth_info;
7380 : }
7381 :
7382 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_previous_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7383 : {
7384 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7385 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->incoming_previous_auth_info));
7386 0 : if (value == NULL) {
7387 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->incoming_previous_auth_info");
7388 0 : return -1;
7389 : }
7390 0 : if (value == Py_None) {
7391 0 : object->incoming_previous_auth_info = NULL;
7392 : } else {
7393 0 : object->incoming_previous_auth_info = NULL;
7394 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
7395 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7396 0 : PyErr_NoMemory();
7397 0 : return -1;
7398 : }
7399 0 : object->incoming_previous_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
7400 : }
7401 0 : return 0;
7402 : }
7403 :
7404 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_count(PyObject *obj, void *closure)
7405 : {
7406 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
7407 : PyObject *py_outgoing_count;
7408 0 : py_outgoing_count = PyLong_FromUnsignedLongLong((uint32_t)object->outgoing_count);
7409 0 : return py_outgoing_count;
7410 : }
7411 :
7412 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_count(PyObject *py_obj, PyObject *value, void *closure)
7413 : {
7414 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7415 0 : if (value == NULL) {
7416 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->outgoing_count");
7417 0 : return -1;
7418 : }
7419 : {
7420 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->outgoing_count));
7421 0 : if (PyLong_Check(value)) {
7422 : unsigned long long test_var;
7423 0 : test_var = PyLong_AsUnsignedLongLong(value);
7424 0 : if (PyErr_Occurred() != NULL) {
7425 0 : return -1;
7426 : }
7427 0 : if (test_var > uint_max) {
7428 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7429 : PyLong_Type.tp_name, uint_max, test_var);
7430 0 : return -1;
7431 : }
7432 0 : object->outgoing_count = test_var;
7433 : } else {
7434 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7435 : PyLong_Type.tp_name);
7436 0 : return -1;
7437 : }
7438 : }
7439 0 : return 0;
7440 : }
7441 :
7442 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_current_auth_info(PyObject *obj, void *closure)
7443 : {
7444 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
7445 : PyObject *py_outgoing_current_auth_info;
7446 0 : if (object->outgoing_current_auth_info == NULL) {
7447 0 : Py_RETURN_NONE;
7448 : }
7449 0 : if (object->outgoing_current_auth_info == NULL) {
7450 0 : py_outgoing_current_auth_info = Py_None;
7451 0 : Py_INCREF(py_outgoing_current_auth_info);
7452 : } else {
7453 0 : py_outgoing_current_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->outgoing_current_auth_info, object->outgoing_current_auth_info);
7454 : }
7455 0 : return py_outgoing_current_auth_info;
7456 : }
7457 :
7458 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_current_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7459 : {
7460 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7461 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->outgoing_current_auth_info));
7462 0 : if (value == NULL) {
7463 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->outgoing_current_auth_info");
7464 0 : return -1;
7465 : }
7466 0 : if (value == Py_None) {
7467 0 : object->outgoing_current_auth_info = NULL;
7468 : } else {
7469 0 : object->outgoing_current_auth_info = NULL;
7470 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
7471 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7472 0 : PyErr_NoMemory();
7473 0 : return -1;
7474 : }
7475 0 : object->outgoing_current_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
7476 : }
7477 0 : return 0;
7478 : }
7479 :
7480 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_previous_auth_info(PyObject *obj, void *closure)
7481 : {
7482 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
7483 : PyObject *py_outgoing_previous_auth_info;
7484 0 : if (object->outgoing_previous_auth_info == NULL) {
7485 0 : Py_RETURN_NONE;
7486 : }
7487 0 : if (object->outgoing_previous_auth_info == NULL) {
7488 0 : py_outgoing_previous_auth_info = Py_None;
7489 0 : Py_INCREF(py_outgoing_previous_auth_info);
7490 : } else {
7491 0 : py_outgoing_previous_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->outgoing_previous_auth_info, object->outgoing_previous_auth_info);
7492 : }
7493 0 : return py_outgoing_previous_auth_info;
7494 : }
7495 :
7496 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_previous_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7497 : {
7498 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7499 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->outgoing_previous_auth_info));
7500 0 : if (value == NULL) {
7501 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->outgoing_previous_auth_info");
7502 0 : return -1;
7503 : }
7504 0 : if (value == Py_None) {
7505 0 : object->outgoing_previous_auth_info = NULL;
7506 : } else {
7507 0 : object->outgoing_previous_auth_info = NULL;
7508 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
7509 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7510 0 : PyErr_NoMemory();
7511 0 : return -1;
7512 : }
7513 0 : object->outgoing_previous_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
7514 : }
7515 0 : return 0;
7516 : }
7517 :
7518 : static PyGetSetDef py_lsa_TrustDomainInfoAuthInfo_getsetters[] = {
7519 : {
7520 : .name = discard_const_p(char, "incoming_count"),
7521 : .get = py_lsa_TrustDomainInfoAuthInfo_get_incoming_count,
7522 : .set = py_lsa_TrustDomainInfoAuthInfo_set_incoming_count,
7523 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7524 : },
7525 : {
7526 : .name = discard_const_p(char, "incoming_current_auth_info"),
7527 : .get = py_lsa_TrustDomainInfoAuthInfo_get_incoming_current_auth_info,
7528 : .set = py_lsa_TrustDomainInfoAuthInfo_set_incoming_current_auth_info,
7529 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoBuffer")
7530 : },
7531 : {
7532 : .name = discard_const_p(char, "incoming_previous_auth_info"),
7533 : .get = py_lsa_TrustDomainInfoAuthInfo_get_incoming_previous_auth_info,
7534 : .set = py_lsa_TrustDomainInfoAuthInfo_set_incoming_previous_auth_info,
7535 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoBuffer")
7536 : },
7537 : {
7538 : .name = discard_const_p(char, "outgoing_count"),
7539 : .get = py_lsa_TrustDomainInfoAuthInfo_get_outgoing_count,
7540 : .set = py_lsa_TrustDomainInfoAuthInfo_set_outgoing_count,
7541 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7542 : },
7543 : {
7544 : .name = discard_const_p(char, "outgoing_current_auth_info"),
7545 : .get = py_lsa_TrustDomainInfoAuthInfo_get_outgoing_current_auth_info,
7546 : .set = py_lsa_TrustDomainInfoAuthInfo_set_outgoing_current_auth_info,
7547 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoBuffer")
7548 : },
7549 : {
7550 : .name = discard_const_p(char, "outgoing_previous_auth_info"),
7551 : .get = py_lsa_TrustDomainInfoAuthInfo_get_outgoing_previous_auth_info,
7552 : .set = py_lsa_TrustDomainInfoAuthInfo_set_outgoing_previous_auth_info,
7553 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoBuffer")
7554 : },
7555 : { .name = NULL }
7556 : };
7557 :
7558 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7559 : {
7560 0 : return pytalloc_new(struct lsa_TrustDomainInfoAuthInfo, type);
7561 : }
7562 :
7563 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7564 : {
7565 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7566 0 : PyObject *ret = NULL;
7567 : DATA_BLOB blob;
7568 : enum ndr_err_code err;
7569 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7570 0 : if (tmp_ctx == NULL) {
7571 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7572 0 : return NULL;
7573 : }
7574 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_TrustDomainInfoAuthInfo);
7575 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7576 0 : TALLOC_FREE(tmp_ctx);
7577 0 : PyErr_SetNdrError(err);
7578 0 : return NULL;
7579 : }
7580 :
7581 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7582 0 : TALLOC_FREE(tmp_ctx);
7583 0 : return ret;
7584 : }
7585 :
7586 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7587 : {
7588 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7589 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7590 0 : Py_ssize_t blob_length = 0;
7591 : enum ndr_err_code err;
7592 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7593 0 : PyObject *allow_remaining_obj = NULL;
7594 0 : bool allow_remaining = false;
7595 :
7596 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7597 : discard_const_p(char *, kwnames),
7598 : &blob.data, &blob_length,
7599 : &allow_remaining_obj)) {
7600 0 : return NULL;
7601 : }
7602 0 : blob.length = blob_length;
7603 :
7604 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7605 0 : allow_remaining = true;
7606 : }
7607 :
7608 0 : if (allow_remaining) {
7609 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoAuthInfo);
7610 : } else {
7611 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoAuthInfo);
7612 : }
7613 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7614 0 : PyErr_SetNdrError(err);
7615 0 : return NULL;
7616 : }
7617 :
7618 0 : Py_RETURN_NONE;
7619 : }
7620 :
7621 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7622 : {
7623 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7624 : PyObject *ret;
7625 : char *retstr;
7626 :
7627 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_TrustDomainInfoAuthInfo, "lsa_TrustDomainInfoAuthInfo", object);
7628 0 : ret = PyUnicode_FromString(retstr);
7629 0 : talloc_free(retstr);
7630 :
7631 0 : return ret;
7632 : }
7633 :
7634 : static PyMethodDef py_lsa_TrustDomainInfoAuthInfo_methods[] = {
7635 : { "__ndr_pack__", (PyCFunction)py_lsa_TrustDomainInfoAuthInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7636 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_TrustDomainInfoAuthInfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7637 : { "__ndr_print__", (PyCFunction)py_lsa_TrustDomainInfoAuthInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7638 : { NULL, NULL, 0, NULL }
7639 : };
7640 :
7641 :
7642 : static PyTypeObject lsa_TrustDomainInfoAuthInfo_Type = {
7643 : PyVarObject_HEAD_INIT(NULL, 0)
7644 : .tp_name = "lsa.TrustDomainInfoAuthInfo",
7645 : .tp_getset = py_lsa_TrustDomainInfoAuthInfo_getsetters,
7646 : .tp_methods = py_lsa_TrustDomainInfoAuthInfo_methods,
7647 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7648 : .tp_new = py_lsa_TrustDomainInfoAuthInfo_new,
7649 : };
7650 :
7651 :
7652 24 : static PyObject *py_lsa_TrustDomainInfoFullInfo_get_info_ex(PyObject *obj, void *closure)
7653 : {
7654 24 : struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(obj);
7655 : PyObject *py_info_ex;
7656 24 : py_info_ex = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->info_ex);
7657 24 : return py_info_ex;
7658 : }
7659 :
7660 0 : static int py_lsa_TrustDomainInfoFullInfo_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
7661 : {
7662 0 : struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(py_obj);
7663 0 : if (value == NULL) {
7664 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info_ex");
7665 0 : return -1;
7666 : }
7667 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
7668 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7669 0 : PyErr_NoMemory();
7670 0 : return -1;
7671 : }
7672 0 : object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
7673 0 : return 0;
7674 : }
7675 :
7676 24 : static PyObject *py_lsa_TrustDomainInfoFullInfo_get_posix_offset(PyObject *obj, void *closure)
7677 : {
7678 24 : struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(obj);
7679 : PyObject *py_posix_offset;
7680 24 : py_posix_offset = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, pytalloc_get_mem_ctx(obj), &object->posix_offset);
7681 24 : return py_posix_offset;
7682 : }
7683 :
7684 0 : static int py_lsa_TrustDomainInfoFullInfo_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
7685 : {
7686 0 : struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(py_obj);
7687 0 : if (value == NULL) {
7688 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->posix_offset");
7689 0 : return -1;
7690 : }
7691 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, value, return -1;);
7692 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7693 0 : PyErr_NoMemory();
7694 0 : return -1;
7695 : }
7696 0 : object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
7697 0 : return 0;
7698 : }
7699 :
7700 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo_get_auth_info(PyObject *obj, void *closure)
7701 : {
7702 0 : struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(obj);
7703 : PyObject *py_auth_info;
7704 0 : py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, pytalloc_get_mem_ctx(obj), &object->auth_info);
7705 0 : return py_auth_info;
7706 : }
7707 :
7708 0 : static int py_lsa_TrustDomainInfoFullInfo_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7709 : {
7710 0 : struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(py_obj);
7711 0 : if (value == NULL) {
7712 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_info");
7713 0 : return -1;
7714 : }
7715 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, value, return -1;);
7716 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7717 0 : PyErr_NoMemory();
7718 0 : return -1;
7719 : }
7720 0 : object->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(value);
7721 0 : return 0;
7722 : }
7723 :
7724 : static PyGetSetDef py_lsa_TrustDomainInfoFullInfo_getsetters[] = {
7725 : {
7726 : .name = discard_const_p(char, "info_ex"),
7727 : .get = py_lsa_TrustDomainInfoFullInfo_get_info_ex,
7728 : .set = py_lsa_TrustDomainInfoFullInfo_set_info_ex,
7729 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
7730 : },
7731 : {
7732 : .name = discard_const_p(char, "posix_offset"),
7733 : .get = py_lsa_TrustDomainInfoFullInfo_get_posix_offset,
7734 : .set = py_lsa_TrustDomainInfoFullInfo_set_posix_offset,
7735 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoPosixOffset")
7736 : },
7737 : {
7738 : .name = discard_const_p(char, "auth_info"),
7739 : .get = py_lsa_TrustDomainInfoFullInfo_get_auth_info,
7740 : .set = py_lsa_TrustDomainInfoFullInfo_set_auth_info,
7741 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfo")
7742 : },
7743 : { .name = NULL }
7744 : };
7745 :
7746 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7747 : {
7748 0 : return pytalloc_new(struct lsa_TrustDomainInfoFullInfo, type);
7749 : }
7750 :
7751 :
7752 : static PyTypeObject lsa_TrustDomainInfoFullInfo_Type = {
7753 : PyVarObject_HEAD_INIT(NULL, 0)
7754 : .tp_name = "lsa.TrustDomainInfoFullInfo",
7755 : .tp_getset = py_lsa_TrustDomainInfoFullInfo_getsetters,
7756 : .tp_methods = NULL,
7757 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7758 : .tp_new = py_lsa_TrustDomainInfoFullInfo_new,
7759 : };
7760 :
7761 :
7762 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfoInternal_get_auth_blob(PyObject *obj, void *closure)
7763 : {
7764 0 : struct lsa_TrustDomainInfoAuthInfoInternal *object = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(obj);
7765 : PyObject *py_auth_blob;
7766 0 : py_auth_blob = pytalloc_reference_ex(&lsa_DATA_BUF2_Type, pytalloc_get_mem_ctx(obj), &object->auth_blob);
7767 0 : return py_auth_blob;
7768 : }
7769 :
7770 22 : static int py_lsa_TrustDomainInfoAuthInfoInternal_set_auth_blob(PyObject *py_obj, PyObject *value, void *closure)
7771 : {
7772 22 : struct lsa_TrustDomainInfoAuthInfoInternal *object = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(py_obj);
7773 22 : if (value == NULL) {
7774 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_blob");
7775 0 : return -1;
7776 : }
7777 22 : PY_CHECK_TYPE(&lsa_DATA_BUF2_Type, value, return -1;);
7778 22 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7779 0 : PyErr_NoMemory();
7780 0 : return -1;
7781 : }
7782 22 : object->auth_blob = *(struct lsa_DATA_BUF2 *)pytalloc_get_ptr(value);
7783 22 : return 0;
7784 : }
7785 :
7786 : static PyGetSetDef py_lsa_TrustDomainInfoAuthInfoInternal_getsetters[] = {
7787 : {
7788 : .name = discard_const_p(char, "auth_blob"),
7789 : .get = py_lsa_TrustDomainInfoAuthInfoInternal_get_auth_blob,
7790 : .set = py_lsa_TrustDomainInfoAuthInfoInternal_set_auth_blob,
7791 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF2")
7792 : },
7793 : { .name = NULL }
7794 : };
7795 :
7796 22 : static PyObject *py_lsa_TrustDomainInfoAuthInfoInternal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7797 : {
7798 22 : return pytalloc_new(struct lsa_TrustDomainInfoAuthInfoInternal, type);
7799 : }
7800 :
7801 :
7802 : static PyTypeObject lsa_TrustDomainInfoAuthInfoInternal_Type = {
7803 : PyVarObject_HEAD_INIT(NULL, 0)
7804 : .tp_name = "lsa.TrustDomainInfoAuthInfoInternal",
7805 : .tp_getset = py_lsa_TrustDomainInfoAuthInfoInternal_getsetters,
7806 : .tp_methods = NULL,
7807 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7808 : .tp_new = py_lsa_TrustDomainInfoAuthInfoInternal_new,
7809 : };
7810 :
7811 :
7812 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_info_ex(PyObject *obj, void *closure)
7813 : {
7814 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(obj);
7815 : PyObject *py_info_ex;
7816 0 : py_info_ex = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->info_ex);
7817 0 : return py_info_ex;
7818 : }
7819 :
7820 0 : static int py_lsa_TrustDomainInfoFullInfoInternal_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
7821 : {
7822 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(py_obj);
7823 0 : if (value == NULL) {
7824 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info_ex");
7825 0 : return -1;
7826 : }
7827 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
7828 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7829 0 : PyErr_NoMemory();
7830 0 : return -1;
7831 : }
7832 0 : object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
7833 0 : return 0;
7834 : }
7835 :
7836 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_posix_offset(PyObject *obj, void *closure)
7837 : {
7838 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(obj);
7839 : PyObject *py_posix_offset;
7840 0 : py_posix_offset = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, pytalloc_get_mem_ctx(obj), &object->posix_offset);
7841 0 : return py_posix_offset;
7842 : }
7843 :
7844 0 : static int py_lsa_TrustDomainInfoFullInfoInternal_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
7845 : {
7846 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(py_obj);
7847 0 : if (value == NULL) {
7848 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->posix_offset");
7849 0 : return -1;
7850 : }
7851 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, value, return -1;);
7852 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7853 0 : PyErr_NoMemory();
7854 0 : return -1;
7855 : }
7856 0 : object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
7857 0 : return 0;
7858 : }
7859 :
7860 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_auth_info(PyObject *obj, void *closure)
7861 : {
7862 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(obj);
7863 : PyObject *py_auth_info;
7864 0 : py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternal_Type, pytalloc_get_mem_ctx(obj), &object->auth_info);
7865 0 : return py_auth_info;
7866 : }
7867 :
7868 0 : static int py_lsa_TrustDomainInfoFullInfoInternal_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7869 : {
7870 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(py_obj);
7871 0 : if (value == NULL) {
7872 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_info");
7873 0 : return -1;
7874 : }
7875 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, value, return -1;);
7876 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7877 0 : PyErr_NoMemory();
7878 0 : return -1;
7879 : }
7880 0 : object->auth_info = *(struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(value);
7881 0 : return 0;
7882 : }
7883 :
7884 : static PyGetSetDef py_lsa_TrustDomainInfoFullInfoInternal_getsetters[] = {
7885 : {
7886 : .name = discard_const_p(char, "info_ex"),
7887 : .get = py_lsa_TrustDomainInfoFullInfoInternal_get_info_ex,
7888 : .set = py_lsa_TrustDomainInfoFullInfoInternal_set_info_ex,
7889 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
7890 : },
7891 : {
7892 : .name = discard_const_p(char, "posix_offset"),
7893 : .get = py_lsa_TrustDomainInfoFullInfoInternal_get_posix_offset,
7894 : .set = py_lsa_TrustDomainInfoFullInfoInternal_set_posix_offset,
7895 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoPosixOffset")
7896 : },
7897 : {
7898 : .name = discard_const_p(char, "auth_info"),
7899 : .get = py_lsa_TrustDomainInfoFullInfoInternal_get_auth_info,
7900 : .set = py_lsa_TrustDomainInfoFullInfoInternal_set_auth_info,
7901 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfoInternal")
7902 : },
7903 : { .name = NULL }
7904 : };
7905 :
7906 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7907 : {
7908 0 : return pytalloc_new(struct lsa_TrustDomainInfoFullInfoInternal, type);
7909 : }
7910 :
7911 :
7912 : static PyTypeObject lsa_TrustDomainInfoFullInfoInternal_Type = {
7913 : PyVarObject_HEAD_INIT(NULL, 0)
7914 : .tp_name = "lsa.TrustDomainInfoFullInfoInternal",
7915 : .tp_getset = py_lsa_TrustDomainInfoFullInfoInternal_getsetters,
7916 : .tp_methods = NULL,
7917 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7918 : .tp_new = py_lsa_TrustDomainInfoFullInfoInternal_new,
7919 : };
7920 :
7921 :
7922 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_info_ex(PyObject *obj, void *closure)
7923 : {
7924 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(obj);
7925 : PyObject *py_info_ex;
7926 0 : py_info_ex = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->info_ex);
7927 0 : return py_info_ex;
7928 : }
7929 :
7930 0 : static int py_lsa_TrustDomainInfoInfoEx2Internal_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
7931 : {
7932 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(py_obj);
7933 0 : if (value == NULL) {
7934 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info_ex");
7935 0 : return -1;
7936 : }
7937 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
7938 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7939 0 : PyErr_NoMemory();
7940 0 : return -1;
7941 : }
7942 0 : object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
7943 0 : return 0;
7944 : }
7945 :
7946 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_length(PyObject *obj, void *closure)
7947 : {
7948 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(obj);
7949 : PyObject *py_forest_trust_length;
7950 0 : py_forest_trust_length = PyLong_FromUnsignedLongLong((uint32_t)object->forest_trust_length);
7951 0 : return py_forest_trust_length;
7952 : }
7953 :
7954 0 : static int py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_length(PyObject *py_obj, PyObject *value, void *closure)
7955 : {
7956 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(py_obj);
7957 0 : if (value == NULL) {
7958 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest_trust_length");
7959 0 : return -1;
7960 : }
7961 : {
7962 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->forest_trust_length));
7963 0 : if (PyLong_Check(value)) {
7964 : unsigned long long test_var;
7965 0 : test_var = PyLong_AsUnsignedLongLong(value);
7966 0 : if (PyErr_Occurred() != NULL) {
7967 0 : return -1;
7968 : }
7969 0 : if (test_var > uint_max) {
7970 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7971 : PyLong_Type.tp_name, uint_max, test_var);
7972 0 : return -1;
7973 : }
7974 0 : object->forest_trust_length = test_var;
7975 : } else {
7976 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7977 : PyLong_Type.tp_name);
7978 0 : return -1;
7979 : }
7980 : }
7981 0 : return 0;
7982 : }
7983 :
7984 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_data(PyObject *obj, void *closure)
7985 : {
7986 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(obj);
7987 : PyObject *py_forest_trust_data;
7988 0 : if (object->forest_trust_data == NULL) {
7989 0 : Py_RETURN_NONE;
7990 : }
7991 0 : if (object->forest_trust_data == NULL) {
7992 0 : py_forest_trust_data = Py_None;
7993 0 : Py_INCREF(py_forest_trust_data);
7994 : } else {
7995 0 : py_forest_trust_data = PyList_New(object->forest_trust_length);
7996 0 : if (py_forest_trust_data == NULL) {
7997 0 : return NULL;
7998 : }
7999 : {
8000 : int forest_trust_data_cntr_1;
8001 0 : for (forest_trust_data_cntr_1 = 0; forest_trust_data_cntr_1 < (object->forest_trust_length); forest_trust_data_cntr_1++) {
8002 : PyObject *py_forest_trust_data_1;
8003 0 : py_forest_trust_data_1 = PyLong_FromLong((uint16_t)object->forest_trust_data[forest_trust_data_cntr_1]);
8004 0 : PyList_SetItem(py_forest_trust_data, forest_trust_data_cntr_1, py_forest_trust_data_1);
8005 : }
8006 : }
8007 : }
8008 0 : return py_forest_trust_data;
8009 : }
8010 :
8011 0 : static int py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_data(PyObject *py_obj, PyObject *value, void *closure)
8012 : {
8013 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(py_obj);
8014 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->forest_trust_data));
8015 0 : if (value == NULL) {
8016 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest_trust_data");
8017 0 : return -1;
8018 : }
8019 0 : if (value == Py_None) {
8020 0 : object->forest_trust_data = NULL;
8021 : } else {
8022 0 : object->forest_trust_data = NULL;
8023 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8024 : {
8025 : int forest_trust_data_cntr_1;
8026 0 : object->forest_trust_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->forest_trust_data, PyList_GET_SIZE(value));
8027 0 : if (!object->forest_trust_data) { return -1;; }
8028 0 : talloc_set_name_const(object->forest_trust_data, "ARRAY: object->forest_trust_data");
8029 0 : for (forest_trust_data_cntr_1 = 0; forest_trust_data_cntr_1 < PyList_GET_SIZE(value); forest_trust_data_cntr_1++) {
8030 0 : if (PyList_GET_ITEM(value, forest_trust_data_cntr_1) == NULL) {
8031 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest_trust_data[forest_trust_data_cntr_1]");
8032 0 : return -1;
8033 : }
8034 : {
8035 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->forest_trust_data[forest_trust_data_cntr_1]));
8036 0 : if (PyLong_Check(PyList_GET_ITEM(value, forest_trust_data_cntr_1))) {
8037 : unsigned long long test_var;
8038 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, forest_trust_data_cntr_1));
8039 0 : if (PyErr_Occurred() != NULL) {
8040 0 : return -1;
8041 : }
8042 0 : if (test_var > uint_max) {
8043 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8044 : PyLong_Type.tp_name, uint_max, test_var);
8045 0 : return -1;
8046 : }
8047 0 : object->forest_trust_data[forest_trust_data_cntr_1] = test_var;
8048 : } else {
8049 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8050 : PyLong_Type.tp_name);
8051 0 : return -1;
8052 : }
8053 : }
8054 : }
8055 : }
8056 : }
8057 0 : return 0;
8058 : }
8059 :
8060 : static PyGetSetDef py_lsa_TrustDomainInfoInfoEx2Internal_getsetters[] = {
8061 : {
8062 : .name = discard_const_p(char, "info_ex"),
8063 : .get = py_lsa_TrustDomainInfoInfoEx2Internal_get_info_ex,
8064 : .set = py_lsa_TrustDomainInfoInfoEx2Internal_set_info_ex,
8065 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
8066 : },
8067 : {
8068 : .name = discard_const_p(char, "forest_trust_length"),
8069 : .get = py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_length,
8070 : .set = py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_length,
8071 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8072 : },
8073 : {
8074 : .name = discard_const_p(char, "forest_trust_data"),
8075 : .get = py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_data,
8076 : .set = py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_data,
8077 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8078 : },
8079 : { .name = NULL }
8080 : };
8081 :
8082 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8083 : {
8084 0 : return pytalloc_new(struct lsa_TrustDomainInfoInfoEx2Internal, type);
8085 : }
8086 :
8087 :
8088 : static PyTypeObject lsa_TrustDomainInfoInfoEx2Internal_Type = {
8089 : PyVarObject_HEAD_INIT(NULL, 0)
8090 : .tp_name = "lsa.TrustDomainInfoInfoEx2Internal",
8091 : .tp_getset = py_lsa_TrustDomainInfoInfoEx2Internal_getsetters,
8092 : .tp_methods = NULL,
8093 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8094 : .tp_new = py_lsa_TrustDomainInfoInfoEx2Internal_new,
8095 : };
8096 :
8097 :
8098 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_info(PyObject *obj, void *closure)
8099 : {
8100 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(obj);
8101 : PyObject *py_info;
8102 0 : py_info = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx2Internal_Type, pytalloc_get_mem_ctx(obj), &object->info);
8103 0 : return py_info;
8104 : }
8105 :
8106 0 : static int py_lsa_TrustDomainInfoFullInfo2Internal_set_info(PyObject *py_obj, PyObject *value, void *closure)
8107 : {
8108 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(py_obj);
8109 0 : if (value == NULL) {
8110 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
8111 0 : return -1;
8112 : }
8113 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx2Internal_Type, value, return -1;);
8114 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8115 0 : PyErr_NoMemory();
8116 0 : return -1;
8117 : }
8118 0 : object->info = *(struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(value);
8119 0 : return 0;
8120 : }
8121 :
8122 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_posix_offset(PyObject *obj, void *closure)
8123 : {
8124 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(obj);
8125 : PyObject *py_posix_offset;
8126 0 : py_posix_offset = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, pytalloc_get_mem_ctx(obj), &object->posix_offset);
8127 0 : return py_posix_offset;
8128 : }
8129 :
8130 0 : static int py_lsa_TrustDomainInfoFullInfo2Internal_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
8131 : {
8132 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(py_obj);
8133 0 : if (value == NULL) {
8134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->posix_offset");
8135 0 : return -1;
8136 : }
8137 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, value, return -1;);
8138 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8139 0 : PyErr_NoMemory();
8140 0 : return -1;
8141 : }
8142 0 : object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
8143 0 : return 0;
8144 : }
8145 :
8146 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_auth_info(PyObject *obj, void *closure)
8147 : {
8148 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(obj);
8149 : PyObject *py_auth_info;
8150 0 : py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, pytalloc_get_mem_ctx(obj), &object->auth_info);
8151 0 : return py_auth_info;
8152 : }
8153 :
8154 0 : static int py_lsa_TrustDomainInfoFullInfo2Internal_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
8155 : {
8156 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(py_obj);
8157 0 : if (value == NULL) {
8158 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_info");
8159 0 : return -1;
8160 : }
8161 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, value, return -1;);
8162 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8163 0 : PyErr_NoMemory();
8164 0 : return -1;
8165 : }
8166 0 : object->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(value);
8167 0 : return 0;
8168 : }
8169 :
8170 : static PyGetSetDef py_lsa_TrustDomainInfoFullInfo2Internal_getsetters[] = {
8171 : {
8172 : .name = discard_const_p(char, "info"),
8173 : .get = py_lsa_TrustDomainInfoFullInfo2Internal_get_info,
8174 : .set = py_lsa_TrustDomainInfoFullInfo2Internal_set_info,
8175 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx2Internal")
8176 : },
8177 : {
8178 : .name = discard_const_p(char, "posix_offset"),
8179 : .get = py_lsa_TrustDomainInfoFullInfo2Internal_get_posix_offset,
8180 : .set = py_lsa_TrustDomainInfoFullInfo2Internal_set_posix_offset,
8181 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoPosixOffset")
8182 : },
8183 : {
8184 : .name = discard_const_p(char, "auth_info"),
8185 : .get = py_lsa_TrustDomainInfoFullInfo2Internal_get_auth_info,
8186 : .set = py_lsa_TrustDomainInfoFullInfo2Internal_set_auth_info,
8187 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfo")
8188 : },
8189 : { .name = NULL }
8190 : };
8191 :
8192 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8193 : {
8194 0 : return pytalloc_new(struct lsa_TrustDomainInfoFullInfo2Internal, type);
8195 : }
8196 :
8197 :
8198 : static PyTypeObject lsa_TrustDomainInfoFullInfo2Internal_Type = {
8199 : PyVarObject_HEAD_INIT(NULL, 0)
8200 : .tp_name = "lsa.TrustDomainInfoFullInfo2Internal",
8201 : .tp_getset = py_lsa_TrustDomainInfoFullInfo2Internal_getsetters,
8202 : .tp_methods = NULL,
8203 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8204 : .tp_new = py_lsa_TrustDomainInfoFullInfo2Internal_new,
8205 : };
8206 :
8207 :
8208 28 : static PyObject *py_lsa_TrustDomainInfoSupportedEncTypes_get_enc_types(PyObject *obj, void *closure)
8209 : {
8210 28 : struct lsa_TrustDomainInfoSupportedEncTypes *object = (struct lsa_TrustDomainInfoSupportedEncTypes *)pytalloc_get_ptr(obj);
8211 : PyObject *py_enc_types;
8212 28 : py_enc_types = PyLong_FromUnsignedLongLong((uint32_t)object->enc_types);
8213 28 : return py_enc_types;
8214 : }
8215 :
8216 15 : static int py_lsa_TrustDomainInfoSupportedEncTypes_set_enc_types(PyObject *py_obj, PyObject *value, void *closure)
8217 : {
8218 15 : struct lsa_TrustDomainInfoSupportedEncTypes *object = (struct lsa_TrustDomainInfoSupportedEncTypes *)pytalloc_get_ptr(py_obj);
8219 15 : if (value == NULL) {
8220 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->enc_types");
8221 0 : return -1;
8222 : }
8223 : {
8224 15 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enc_types));
8225 15 : if (PyLong_Check(value)) {
8226 : unsigned long long test_var;
8227 15 : test_var = PyLong_AsUnsignedLongLong(value);
8228 15 : if (PyErr_Occurred() != NULL) {
8229 0 : return -1;
8230 : }
8231 15 : if (test_var > uint_max) {
8232 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8233 : PyLong_Type.tp_name, uint_max, test_var);
8234 0 : return -1;
8235 : }
8236 15 : object->enc_types = test_var;
8237 : } else {
8238 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8239 : PyLong_Type.tp_name);
8240 0 : return -1;
8241 : }
8242 : }
8243 15 : return 0;
8244 : }
8245 :
8246 : static PyGetSetDef py_lsa_TrustDomainInfoSupportedEncTypes_getsetters[] = {
8247 : {
8248 : .name = discard_const_p(char, "enc_types"),
8249 : .get = py_lsa_TrustDomainInfoSupportedEncTypes_get_enc_types,
8250 : .set = py_lsa_TrustDomainInfoSupportedEncTypes_set_enc_types,
8251 : .doc = discard_const_p(char, "PIDL-generated element of base type kerb_EncTypes")
8252 : },
8253 : { .name = NULL }
8254 : };
8255 :
8256 11 : static PyObject *py_lsa_TrustDomainInfoSupportedEncTypes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8257 : {
8258 11 : return pytalloc_new(struct lsa_TrustDomainInfoSupportedEncTypes, type);
8259 : }
8260 :
8261 :
8262 : static PyTypeObject lsa_TrustDomainInfoSupportedEncTypes_Type = {
8263 : PyVarObject_HEAD_INIT(NULL, 0)
8264 : .tp_name = "lsa.TrustDomainInfoSupportedEncTypes",
8265 : .tp_getset = py_lsa_TrustDomainInfoSupportedEncTypes_getsetters,
8266 : .tp_methods = NULL,
8267 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8268 : .tp_new = py_lsa_TrustDomainInfoSupportedEncTypes_new,
8269 : };
8270 :
8271 144 : static PyObject *py_import_lsa_TrustedDomainInfo(TALLOC_CTX *mem_ctx, int level, union lsa_TrustedDomainInfo *in)
8272 : {
8273 : PyObject *ret;
8274 :
8275 144 : switch (level) {
8276 0 : case LSA_TRUSTED_DOMAIN_INFO_NAME:
8277 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoName_Type, mem_ctx, &in->name);
8278 0 : return ret;
8279 :
8280 0 : case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS:
8281 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoControllers_Type, mem_ctx, &in->controllers);
8282 0 : return ret;
8283 :
8284 0 : case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET:
8285 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, mem_ctx, &in->posix_offset);
8286 0 : return ret;
8287 :
8288 0 : case LSA_TRUSTED_DOMAIN_INFO_PASSWORD:
8289 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoPassword_Type, mem_ctx, &in->password);
8290 0 : return ret;
8291 :
8292 0 : case LSA_TRUSTED_DOMAIN_INFO_BASIC:
8293 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoBasic_Type, mem_ctx, &in->info_basic);
8294 0 : return ret;
8295 :
8296 96 : case LSA_TRUSTED_DOMAIN_INFO_INFO_EX:
8297 96 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, mem_ctx, &in->info_ex);
8298 96 : return ret;
8299 :
8300 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO:
8301 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, mem_ctx, &in->auth_info);
8302 0 : return ret;
8303 :
8304 24 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO:
8305 24 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfo_Type, mem_ctx, &in->full_info);
8306 24 : return ret;
8307 :
8308 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL:
8309 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternal_Type, mem_ctx, &in->auth_info_internal);
8310 0 : return ret;
8311 :
8312 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL:
8313 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfoInternal_Type, mem_ctx, &in->full_info_internal);
8314 0 : return ret;
8315 :
8316 0 : case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL:
8317 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx2Internal_Type, mem_ctx, &in->info_ex2_internal);
8318 0 : return ret;
8319 :
8320 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL:
8321 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfo2Internal_Type, mem_ctx, &in->full_info2_internal);
8322 0 : return ret;
8323 :
8324 24 : case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES:
8325 24 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoSupportedEncTypes_Type, mem_ctx, &in->enc_types);
8326 24 : return ret;
8327 :
8328 : }
8329 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
8330 0 : return NULL;
8331 : }
8332 :
8333 22 : static union lsa_TrustedDomainInfo *py_export_lsa_TrustedDomainInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
8334 : {
8335 22 : union lsa_TrustedDomainInfo *ret = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
8336 22 : switch (level) {
8337 0 : case LSA_TRUSTED_DOMAIN_INFO_NAME:
8338 0 : if (in == NULL) {
8339 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->name");
8340 0 : talloc_free(ret); return NULL;
8341 : }
8342 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoName_Type, in, talloc_free(ret); return NULL;);
8343 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8344 0 : PyErr_NoMemory();
8345 0 : talloc_free(ret); return NULL;
8346 : }
8347 0 : ret->name = *(struct lsa_TrustDomainInfoName *)pytalloc_get_ptr(in);
8348 0 : break;
8349 :
8350 0 : case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS:
8351 0 : if (in == NULL) {
8352 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->controllers");
8353 0 : talloc_free(ret); return NULL;
8354 : }
8355 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoControllers_Type, in, talloc_free(ret); return NULL;);
8356 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8357 0 : PyErr_NoMemory();
8358 0 : talloc_free(ret); return NULL;
8359 : }
8360 0 : ret->controllers = *(struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(in);
8361 0 : break;
8362 :
8363 0 : case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET:
8364 0 : if (in == NULL) {
8365 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->posix_offset");
8366 0 : talloc_free(ret); return NULL;
8367 : }
8368 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, in, talloc_free(ret); return NULL;);
8369 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8370 0 : PyErr_NoMemory();
8371 0 : talloc_free(ret); return NULL;
8372 : }
8373 0 : ret->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(in);
8374 0 : break;
8375 :
8376 0 : case LSA_TRUSTED_DOMAIN_INFO_PASSWORD:
8377 0 : if (in == NULL) {
8378 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->password");
8379 0 : talloc_free(ret); return NULL;
8380 : }
8381 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPassword_Type, in, talloc_free(ret); return NULL;);
8382 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8383 0 : PyErr_NoMemory();
8384 0 : talloc_free(ret); return NULL;
8385 : }
8386 0 : ret->password = *(struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(in);
8387 0 : break;
8388 :
8389 0 : case LSA_TRUSTED_DOMAIN_INFO_BASIC:
8390 0 : if (in == NULL) {
8391 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info_basic");
8392 0 : talloc_free(ret); return NULL;
8393 : }
8394 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBasic_Type, in, talloc_free(ret); return NULL;);
8395 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8396 0 : PyErr_NoMemory();
8397 0 : talloc_free(ret); return NULL;
8398 : }
8399 0 : ret->info_basic = *(struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(in);
8400 0 : break;
8401 :
8402 0 : case LSA_TRUSTED_DOMAIN_INFO_INFO_EX:
8403 0 : if (in == NULL) {
8404 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info_ex");
8405 0 : talloc_free(ret); return NULL;
8406 : }
8407 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, in, talloc_free(ret); return NULL;);
8408 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8409 0 : PyErr_NoMemory();
8410 0 : talloc_free(ret); return NULL;
8411 : }
8412 0 : ret->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(in);
8413 0 : break;
8414 :
8415 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO:
8416 0 : if (in == NULL) {
8417 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->auth_info");
8418 0 : talloc_free(ret); return NULL;
8419 : }
8420 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, in, talloc_free(ret); return NULL;);
8421 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8422 0 : PyErr_NoMemory();
8423 0 : talloc_free(ret); return NULL;
8424 : }
8425 0 : ret->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(in);
8426 0 : break;
8427 :
8428 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO:
8429 0 : if (in == NULL) {
8430 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->full_info");
8431 0 : talloc_free(ret); return NULL;
8432 : }
8433 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoFullInfo_Type, in, talloc_free(ret); return NULL;);
8434 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8435 0 : PyErr_NoMemory();
8436 0 : talloc_free(ret); return NULL;
8437 : }
8438 0 : ret->full_info = *(struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(in);
8439 0 : break;
8440 :
8441 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL:
8442 0 : if (in == NULL) {
8443 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->auth_info_internal");
8444 0 : talloc_free(ret); return NULL;
8445 : }
8446 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, in, talloc_free(ret); return NULL;);
8447 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8448 0 : PyErr_NoMemory();
8449 0 : talloc_free(ret); return NULL;
8450 : }
8451 0 : ret->auth_info_internal = *(struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(in);
8452 0 : break;
8453 :
8454 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL:
8455 0 : if (in == NULL) {
8456 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->full_info_internal");
8457 0 : talloc_free(ret); return NULL;
8458 : }
8459 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoFullInfoInternal_Type, in, talloc_free(ret); return NULL;);
8460 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8461 0 : PyErr_NoMemory();
8462 0 : talloc_free(ret); return NULL;
8463 : }
8464 0 : ret->full_info_internal = *(struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(in);
8465 0 : break;
8466 :
8467 0 : case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL:
8468 0 : if (in == NULL) {
8469 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info_ex2_internal");
8470 0 : talloc_free(ret); return NULL;
8471 : }
8472 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx2Internal_Type, in, talloc_free(ret); return NULL;);
8473 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8474 0 : PyErr_NoMemory();
8475 0 : talloc_free(ret); return NULL;
8476 : }
8477 0 : ret->info_ex2_internal = *(struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(in);
8478 0 : break;
8479 :
8480 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL:
8481 0 : if (in == NULL) {
8482 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->full_info2_internal");
8483 0 : talloc_free(ret); return NULL;
8484 : }
8485 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoFullInfo2Internal_Type, in, talloc_free(ret); return NULL;);
8486 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8487 0 : PyErr_NoMemory();
8488 0 : talloc_free(ret); return NULL;
8489 : }
8490 0 : ret->full_info2_internal = *(struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(in);
8491 0 : break;
8492 :
8493 22 : case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES:
8494 22 : if (in == NULL) {
8495 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->enc_types");
8496 0 : talloc_free(ret); return NULL;
8497 : }
8498 22 : PY_CHECK_TYPE(&lsa_TrustDomainInfoSupportedEncTypes_Type, in, talloc_free(ret); return NULL;);
8499 22 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8500 0 : PyErr_NoMemory();
8501 0 : talloc_free(ret); return NULL;
8502 : }
8503 22 : ret->enc_types = *(struct lsa_TrustDomainInfoSupportedEncTypes *)pytalloc_get_ptr(in);
8504 22 : break;
8505 :
8506 0 : default:
8507 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
8508 0 : talloc_free(ret);
8509 0 : ret = NULL;
8510 : }
8511 :
8512 22 : return ret;
8513 : }
8514 :
8515 144 : static PyObject *py_lsa_TrustedDomainInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8516 : {
8517 144 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
8518 144 : PyObject *mem_ctx_obj = NULL;
8519 144 : TALLOC_CTX *mem_ctx = NULL;
8520 144 : int level = 0;
8521 144 : PyObject *in_obj = NULL;
8522 144 : union lsa_TrustedDomainInfo *in = NULL;
8523 :
8524 144 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
8525 : discard_const_p(char *, kwnames),
8526 : &mem_ctx_obj,
8527 : &level,
8528 : &in_obj)) {
8529 0 : return NULL;
8530 : }
8531 144 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
8532 144 : if (mem_ctx == NULL) {
8533 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
8534 0 : return NULL;
8535 : }
8536 144 : in = (union lsa_TrustedDomainInfo *)pytalloc_get_ptr(in_obj);
8537 144 : if (in == NULL) {
8538 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_TrustedDomainInfo!");
8539 0 : return NULL;
8540 : }
8541 :
8542 144 : return py_import_lsa_TrustedDomainInfo(mem_ctx, level, in);
8543 : }
8544 :
8545 22 : static PyObject *py_lsa_TrustedDomainInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8546 : {
8547 22 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
8548 22 : PyObject *mem_ctx_obj = NULL;
8549 22 : TALLOC_CTX *mem_ctx = NULL;
8550 22 : int level = 0;
8551 22 : PyObject *in = NULL;
8552 22 : union lsa_TrustedDomainInfo *out = NULL;
8553 :
8554 22 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
8555 : discard_const_p(char *, kwnames),
8556 : &mem_ctx_obj,
8557 : &level,
8558 : &in)) {
8559 0 : return NULL;
8560 : }
8561 22 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
8562 22 : if (mem_ctx == NULL) {
8563 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
8564 0 : return NULL;
8565 : }
8566 :
8567 22 : out = py_export_lsa_TrustedDomainInfo(mem_ctx, level, in);
8568 22 : if (out == NULL) {
8569 0 : return NULL;
8570 : }
8571 :
8572 22 : return pytalloc_GenericObject_reference(out);
8573 : }
8574 :
8575 : static PyMethodDef py_lsa_TrustedDomainInfo_methods[] = {
8576 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_TrustedDomainInfo_import),
8577 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
8578 : "T.__import__(mem_ctx, level, in) => ret." },
8579 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_TrustedDomainInfo_export),
8580 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
8581 : "T.__export__(mem_ctx, level, in) => ret." },
8582 : { NULL, NULL, 0, NULL }
8583 : };
8584 :
8585 0 : static PyObject *py_lsa_TrustedDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8586 : {
8587 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
8588 0 : return NULL;
8589 : }
8590 :
8591 :
8592 : static PyTypeObject lsa_TrustedDomainInfo_Type = {
8593 : PyVarObject_HEAD_INIT(NULL, 0)
8594 : .tp_name = "lsa.TrustedDomainInfo",
8595 : .tp_getset = NULL,
8596 : .tp_methods = py_lsa_TrustedDomainInfo_methods,
8597 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8598 : .tp_new = py_lsa_TrustedDomainInfo_new,
8599 : };
8600 :
8601 :
8602 0 : static PyObject *py_lsa_DATA_BUF_PTR_get_buf(PyObject *obj, void *closure)
8603 : {
8604 0 : struct lsa_DATA_BUF_PTR *object = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(obj);
8605 : PyObject *py_buf;
8606 0 : if (object->buf == NULL) {
8607 0 : Py_RETURN_NONE;
8608 : }
8609 0 : if (object->buf == NULL) {
8610 0 : py_buf = Py_None;
8611 0 : Py_INCREF(py_buf);
8612 : } else {
8613 0 : py_buf = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->buf, object->buf);
8614 : }
8615 0 : return py_buf;
8616 : }
8617 :
8618 0 : static int py_lsa_DATA_BUF_PTR_set_buf(PyObject *py_obj, PyObject *value, void *closure)
8619 : {
8620 0 : struct lsa_DATA_BUF_PTR *object = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(py_obj);
8621 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->buf));
8622 0 : if (value == NULL) {
8623 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buf");
8624 0 : return -1;
8625 : }
8626 0 : if (value == Py_None) {
8627 0 : object->buf = NULL;
8628 : } else {
8629 0 : object->buf = NULL;
8630 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
8631 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8632 0 : PyErr_NoMemory();
8633 0 : return -1;
8634 : }
8635 0 : object->buf = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
8636 : }
8637 0 : return 0;
8638 : }
8639 :
8640 : static PyGetSetDef py_lsa_DATA_BUF_PTR_getsetters[] = {
8641 : {
8642 : .name = discard_const_p(char, "buf"),
8643 : .get = py_lsa_DATA_BUF_PTR_get_buf,
8644 : .set = py_lsa_DATA_BUF_PTR_set_buf,
8645 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
8646 : },
8647 : { .name = NULL }
8648 : };
8649 :
8650 0 : static PyObject *py_lsa_DATA_BUF_PTR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8651 : {
8652 0 : return pytalloc_new(struct lsa_DATA_BUF_PTR, type);
8653 : }
8654 :
8655 :
8656 : static PyTypeObject lsa_DATA_BUF_PTR_Type = {
8657 : PyVarObject_HEAD_INIT(NULL, 0)
8658 : .tp_name = "lsa.DATA_BUF_PTR",
8659 : .tp_getset = py_lsa_DATA_BUF_PTR_getsetters,
8660 : .tp_methods = NULL,
8661 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8662 : .tp_new = py_lsa_DATA_BUF_PTR_new,
8663 : };
8664 :
8665 :
8666 0 : static PyObject *py_lsa_RightAttribute_get_name(PyObject *obj, void *closure)
8667 : {
8668 0 : struct lsa_RightAttribute *object = (struct lsa_RightAttribute *)pytalloc_get_ptr(obj);
8669 : PyObject *py_name;
8670 0 : if (object->name == NULL) {
8671 0 : Py_RETURN_NONE;
8672 : }
8673 0 : if (object->name == NULL) {
8674 0 : py_name = Py_None;
8675 0 : Py_INCREF(py_name);
8676 : } else {
8677 0 : if (object->name == NULL) {
8678 0 : py_name = Py_None;
8679 0 : Py_INCREF(py_name);
8680 : } else {
8681 0 : py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
8682 : }
8683 : }
8684 0 : return py_name;
8685 : }
8686 :
8687 0 : static int py_lsa_RightAttribute_set_name(PyObject *py_obj, PyObject *value, void *closure)
8688 : {
8689 0 : struct lsa_RightAttribute *object = (struct lsa_RightAttribute *)pytalloc_get_ptr(py_obj);
8690 0 : if (value == NULL) {
8691 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
8692 0 : return -1;
8693 : }
8694 0 : if (value == Py_None) {
8695 0 : object->name = NULL;
8696 : } else {
8697 0 : object->name = NULL;
8698 : {
8699 : const char *test_str;
8700 : const char *talloc_str;
8701 0 : PyObject *unicode = NULL;
8702 0 : if (PyUnicode_Check(value)) {
8703 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8704 0 : if (unicode == NULL) {
8705 0 : PyErr_NoMemory();
8706 0 : return -1;
8707 : }
8708 0 : test_str = PyBytes_AS_STRING(unicode);
8709 0 : } else if (PyBytes_Check(value)) {
8710 0 : test_str = PyBytes_AS_STRING(value);
8711 : } else {
8712 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8713 0 : return -1;
8714 : }
8715 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8716 0 : if (unicode != NULL) {
8717 0 : Py_DECREF(unicode);
8718 : }
8719 0 : if (talloc_str == NULL) {
8720 0 : PyErr_NoMemory();
8721 0 : return -1;
8722 : }
8723 0 : object->name = talloc_str;
8724 : }
8725 : }
8726 0 : return 0;
8727 : }
8728 :
8729 : static PyGetSetDef py_lsa_RightAttribute_getsetters[] = {
8730 : {
8731 : .name = discard_const_p(char, "name"),
8732 : .get = py_lsa_RightAttribute_get_name,
8733 : .set = py_lsa_RightAttribute_set_name,
8734 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8735 : },
8736 : { .name = NULL }
8737 : };
8738 :
8739 0 : static PyObject *py_lsa_RightAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8740 : {
8741 0 : return pytalloc_new(struct lsa_RightAttribute, type);
8742 : }
8743 :
8744 :
8745 : static PyTypeObject lsa_RightAttribute_Type = {
8746 : PyVarObject_HEAD_INIT(NULL, 0)
8747 : .tp_name = "lsa.RightAttribute",
8748 : .tp_getset = py_lsa_RightAttribute_getsetters,
8749 : .tp_methods = NULL,
8750 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8751 : .tp_new = py_lsa_RightAttribute_new,
8752 : };
8753 :
8754 :
8755 0 : static PyObject *py_lsa_RightSet_get_count(PyObject *obj, void *closure)
8756 : {
8757 0 : struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(obj);
8758 : PyObject *py_count;
8759 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
8760 0 : return py_count;
8761 : }
8762 :
8763 0 : static int py_lsa_RightSet_set_count(PyObject *py_obj, PyObject *value, void *closure)
8764 : {
8765 0 : struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(py_obj);
8766 0 : if (value == NULL) {
8767 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
8768 0 : return -1;
8769 : }
8770 : {
8771 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
8772 0 : if (PyLong_Check(value)) {
8773 : unsigned long long test_var;
8774 0 : test_var = PyLong_AsUnsignedLongLong(value);
8775 0 : if (PyErr_Occurred() != NULL) {
8776 0 : return -1;
8777 : }
8778 0 : if (test_var > uint_max) {
8779 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8780 : PyLong_Type.tp_name, uint_max, test_var);
8781 0 : return -1;
8782 : }
8783 0 : object->count = test_var;
8784 : } else {
8785 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8786 : PyLong_Type.tp_name);
8787 0 : return -1;
8788 : }
8789 : }
8790 0 : return 0;
8791 : }
8792 :
8793 0 : static PyObject *py_lsa_RightSet_get_names(PyObject *obj, void *closure)
8794 : {
8795 0 : struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(obj);
8796 : PyObject *py_names;
8797 0 : if (object->names == NULL) {
8798 0 : Py_RETURN_NONE;
8799 : }
8800 0 : if (object->names == NULL) {
8801 0 : py_names = Py_None;
8802 0 : Py_INCREF(py_names);
8803 : } else {
8804 0 : py_names = PyList_New(object->count);
8805 0 : if (py_names == NULL) {
8806 0 : return NULL;
8807 : }
8808 : {
8809 : int names_cntr_1;
8810 0 : for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
8811 : PyObject *py_names_1;
8812 0 : py_names_1 = pytalloc_reference_ex(&lsa_StringLarge_Type, object->names, &object->names[names_cntr_1]);
8813 0 : PyList_SetItem(py_names, names_cntr_1, py_names_1);
8814 : }
8815 : }
8816 : }
8817 0 : return py_names;
8818 : }
8819 :
8820 0 : static int py_lsa_RightSet_set_names(PyObject *py_obj, PyObject *value, void *closure)
8821 : {
8822 0 : struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(py_obj);
8823 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
8824 0 : if (value == NULL) {
8825 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names");
8826 0 : return -1;
8827 : }
8828 0 : if (value == Py_None) {
8829 0 : object->names = NULL;
8830 : } else {
8831 0 : object->names = NULL;
8832 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8833 : {
8834 : int names_cntr_1;
8835 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
8836 0 : if (!object->names) { return -1;; }
8837 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
8838 0 : for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
8839 0 : if (PyList_GET_ITEM(value, names_cntr_1) == NULL) {
8840 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names[names_cntr_1]");
8841 0 : return -1;
8842 : }
8843 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
8844 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
8845 0 : PyErr_NoMemory();
8846 0 : return -1;
8847 : }
8848 0 : object->names[names_cntr_1] = *(struct lsa_StringLarge *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
8849 : }
8850 : }
8851 : }
8852 0 : return 0;
8853 : }
8854 :
8855 : static PyGetSetDef py_lsa_RightSet_getsetters[] = {
8856 : {
8857 : .name = discard_const_p(char, "count"),
8858 : .get = py_lsa_RightSet_get_count,
8859 : .set = py_lsa_RightSet_set_count,
8860 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8861 : },
8862 : {
8863 : .name = discard_const_p(char, "names"),
8864 : .get = py_lsa_RightSet_get_names,
8865 : .set = py_lsa_RightSet_set_names,
8866 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
8867 : },
8868 : { .name = NULL }
8869 : };
8870 :
8871 0 : static PyObject *py_lsa_RightSet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8872 : {
8873 0 : return pytalloc_new(struct lsa_RightSet, type);
8874 : }
8875 :
8876 :
8877 : static PyTypeObject lsa_RightSet_Type = {
8878 : PyVarObject_HEAD_INIT(NULL, 0)
8879 : .tp_name = "lsa.RightSet",
8880 : .tp_getset = py_lsa_RightSet_getsetters,
8881 : .tp_methods = NULL,
8882 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8883 : .tp_new = py_lsa_RightSet_new,
8884 : };
8885 :
8886 :
8887 0 : static PyObject *py_lsa_DomainListEx_get_count(PyObject *obj, void *closure)
8888 : {
8889 0 : struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(obj);
8890 : PyObject *py_count;
8891 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
8892 0 : return py_count;
8893 : }
8894 :
8895 0 : static int py_lsa_DomainListEx_set_count(PyObject *py_obj, PyObject *value, void *closure)
8896 : {
8897 0 : struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(py_obj);
8898 0 : if (value == NULL) {
8899 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
8900 0 : return -1;
8901 : }
8902 : {
8903 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
8904 0 : if (PyLong_Check(value)) {
8905 : unsigned long long test_var;
8906 0 : test_var = PyLong_AsUnsignedLongLong(value);
8907 0 : if (PyErr_Occurred() != NULL) {
8908 0 : return -1;
8909 : }
8910 0 : if (test_var > uint_max) {
8911 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8912 : PyLong_Type.tp_name, uint_max, test_var);
8913 0 : return -1;
8914 : }
8915 0 : object->count = test_var;
8916 : } else {
8917 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8918 : PyLong_Type.tp_name);
8919 0 : return -1;
8920 : }
8921 : }
8922 0 : return 0;
8923 : }
8924 :
8925 0 : static PyObject *py_lsa_DomainListEx_get_domains(PyObject *obj, void *closure)
8926 : {
8927 0 : struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(obj);
8928 : PyObject *py_domains;
8929 0 : if (object->domains == NULL) {
8930 0 : Py_RETURN_NONE;
8931 : }
8932 0 : if (object->domains == NULL) {
8933 0 : py_domains = Py_None;
8934 0 : Py_INCREF(py_domains);
8935 : } else {
8936 0 : py_domains = PyList_New(object->count);
8937 0 : if (py_domains == NULL) {
8938 0 : return NULL;
8939 : }
8940 : {
8941 : int domains_cntr_1;
8942 0 : for (domains_cntr_1 = 0; domains_cntr_1 < (object->count); domains_cntr_1++) {
8943 : PyObject *py_domains_1;
8944 0 : py_domains_1 = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, object->domains, &object->domains[domains_cntr_1]);
8945 0 : PyList_SetItem(py_domains, domains_cntr_1, py_domains_1);
8946 : }
8947 : }
8948 : }
8949 0 : return py_domains;
8950 : }
8951 :
8952 0 : static int py_lsa_DomainListEx_set_domains(PyObject *py_obj, PyObject *value, void *closure)
8953 : {
8954 0 : struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(py_obj);
8955 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domains));
8956 0 : if (value == NULL) {
8957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domains");
8958 0 : return -1;
8959 : }
8960 0 : if (value == Py_None) {
8961 0 : object->domains = NULL;
8962 : } else {
8963 0 : object->domains = NULL;
8964 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8965 : {
8966 : int domains_cntr_1;
8967 0 : object->domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->domains, PyList_GET_SIZE(value));
8968 0 : if (!object->domains) { return -1;; }
8969 0 : talloc_set_name_const(object->domains, "ARRAY: object->domains");
8970 0 : for (domains_cntr_1 = 0; domains_cntr_1 < PyList_GET_SIZE(value); domains_cntr_1++) {
8971 0 : if (PyList_GET_ITEM(value, domains_cntr_1) == NULL) {
8972 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domains[domains_cntr_1]");
8973 0 : return -1;
8974 : }
8975 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, PyList_GET_ITEM(value, domains_cntr_1), return -1;);
8976 0 : if (talloc_reference(object->domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, domains_cntr_1))) == NULL) {
8977 0 : PyErr_NoMemory();
8978 0 : return -1;
8979 : }
8980 0 : object->domains[domains_cntr_1] = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
8981 : }
8982 : }
8983 : }
8984 0 : return 0;
8985 : }
8986 :
8987 : static PyGetSetDef py_lsa_DomainListEx_getsetters[] = {
8988 : {
8989 : .name = discard_const_p(char, "count"),
8990 : .get = py_lsa_DomainListEx_get_count,
8991 : .set = py_lsa_DomainListEx_set_count,
8992 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8993 : },
8994 : {
8995 : .name = discard_const_p(char, "domains"),
8996 : .get = py_lsa_DomainListEx_get_domains,
8997 : .set = py_lsa_DomainListEx_set_domains,
8998 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
8999 : },
9000 : { .name = NULL }
9001 : };
9002 :
9003 0 : static PyObject *py_lsa_DomainListEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9004 : {
9005 0 : return pytalloc_new(struct lsa_DomainListEx, type);
9006 : }
9007 :
9008 :
9009 : static PyTypeObject lsa_DomainListEx_Type = {
9010 : PyVarObject_HEAD_INIT(NULL, 0)
9011 : .tp_name = "lsa.DomainListEx",
9012 : .tp_getset = py_lsa_DomainListEx_getsetters,
9013 : .tp_methods = NULL,
9014 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9015 : .tp_new = py_lsa_DomainListEx_new,
9016 : };
9017 :
9018 :
9019 0 : static PyObject *py_lsa_DomainInfoKerberos_get_authentication_options(PyObject *obj, void *closure)
9020 : {
9021 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
9022 : PyObject *py_authentication_options;
9023 0 : py_authentication_options = PyLong_FromUnsignedLongLong((uint32_t)object->authentication_options);
9024 0 : return py_authentication_options;
9025 : }
9026 :
9027 0 : static int py_lsa_DomainInfoKerberos_set_authentication_options(PyObject *py_obj, PyObject *value, void *closure)
9028 : {
9029 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
9030 0 : if (value == NULL) {
9031 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->authentication_options");
9032 0 : return -1;
9033 : }
9034 : {
9035 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->authentication_options));
9036 0 : if (PyLong_Check(value)) {
9037 : unsigned long long test_var;
9038 0 : test_var = PyLong_AsUnsignedLongLong(value);
9039 0 : if (PyErr_Occurred() != NULL) {
9040 0 : return -1;
9041 : }
9042 0 : if (test_var > uint_max) {
9043 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9044 : PyLong_Type.tp_name, uint_max, test_var);
9045 0 : return -1;
9046 : }
9047 0 : object->authentication_options = test_var;
9048 : } else {
9049 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9050 : PyLong_Type.tp_name);
9051 0 : return -1;
9052 : }
9053 : }
9054 0 : return 0;
9055 : }
9056 :
9057 0 : static PyObject *py_lsa_DomainInfoKerberos_get_service_tkt_lifetime(PyObject *obj, void *closure)
9058 : {
9059 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
9060 : PyObject *py_service_tkt_lifetime;
9061 0 : py_service_tkt_lifetime = PyLong_FromUnsignedLongLong(object->service_tkt_lifetime);
9062 0 : return py_service_tkt_lifetime;
9063 : }
9064 :
9065 0 : static int py_lsa_DomainInfoKerberos_set_service_tkt_lifetime(PyObject *py_obj, PyObject *value, void *closure)
9066 : {
9067 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
9068 0 : if (value == NULL) {
9069 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_tkt_lifetime");
9070 0 : return -1;
9071 : }
9072 : {
9073 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_tkt_lifetime));
9074 0 : if (PyLong_Check(value)) {
9075 : unsigned long long test_var;
9076 0 : test_var = PyLong_AsUnsignedLongLong(value);
9077 0 : if (PyErr_Occurred() != NULL) {
9078 0 : return -1;
9079 : }
9080 0 : if (test_var > uint_max) {
9081 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9082 : PyLong_Type.tp_name, uint_max, test_var);
9083 0 : return -1;
9084 : }
9085 0 : object->service_tkt_lifetime = test_var;
9086 : } else {
9087 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9088 : PyLong_Type.tp_name);
9089 0 : return -1;
9090 : }
9091 : }
9092 0 : return 0;
9093 : }
9094 :
9095 0 : static PyObject *py_lsa_DomainInfoKerberos_get_user_tkt_lifetime(PyObject *obj, void *closure)
9096 : {
9097 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
9098 : PyObject *py_user_tkt_lifetime;
9099 0 : py_user_tkt_lifetime = PyLong_FromUnsignedLongLong(object->user_tkt_lifetime);
9100 0 : return py_user_tkt_lifetime;
9101 : }
9102 :
9103 0 : static int py_lsa_DomainInfoKerberos_set_user_tkt_lifetime(PyObject *py_obj, PyObject *value, void *closure)
9104 : {
9105 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
9106 0 : if (value == NULL) {
9107 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_tkt_lifetime");
9108 0 : return -1;
9109 : }
9110 : {
9111 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_tkt_lifetime));
9112 0 : if (PyLong_Check(value)) {
9113 : unsigned long long test_var;
9114 0 : test_var = PyLong_AsUnsignedLongLong(value);
9115 0 : if (PyErr_Occurred() != NULL) {
9116 0 : return -1;
9117 : }
9118 0 : if (test_var > uint_max) {
9119 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9120 : PyLong_Type.tp_name, uint_max, test_var);
9121 0 : return -1;
9122 : }
9123 0 : object->user_tkt_lifetime = test_var;
9124 : } else {
9125 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9126 : PyLong_Type.tp_name);
9127 0 : return -1;
9128 : }
9129 : }
9130 0 : return 0;
9131 : }
9132 :
9133 0 : static PyObject *py_lsa_DomainInfoKerberos_get_user_tkt_renewaltime(PyObject *obj, void *closure)
9134 : {
9135 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
9136 : PyObject *py_user_tkt_renewaltime;
9137 0 : py_user_tkt_renewaltime = PyLong_FromUnsignedLongLong(object->user_tkt_renewaltime);
9138 0 : return py_user_tkt_renewaltime;
9139 : }
9140 :
9141 0 : static int py_lsa_DomainInfoKerberos_set_user_tkt_renewaltime(PyObject *py_obj, PyObject *value, void *closure)
9142 : {
9143 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
9144 0 : if (value == NULL) {
9145 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_tkt_renewaltime");
9146 0 : return -1;
9147 : }
9148 : {
9149 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_tkt_renewaltime));
9150 0 : if (PyLong_Check(value)) {
9151 : unsigned long long test_var;
9152 0 : test_var = PyLong_AsUnsignedLongLong(value);
9153 0 : if (PyErr_Occurred() != NULL) {
9154 0 : return -1;
9155 : }
9156 0 : if (test_var > uint_max) {
9157 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9158 : PyLong_Type.tp_name, uint_max, test_var);
9159 0 : return -1;
9160 : }
9161 0 : object->user_tkt_renewaltime = test_var;
9162 : } else {
9163 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9164 : PyLong_Type.tp_name);
9165 0 : return -1;
9166 : }
9167 : }
9168 0 : return 0;
9169 : }
9170 :
9171 0 : static PyObject *py_lsa_DomainInfoKerberos_get_clock_skew(PyObject *obj, void *closure)
9172 : {
9173 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
9174 : PyObject *py_clock_skew;
9175 0 : py_clock_skew = PyLong_FromUnsignedLongLong(object->clock_skew);
9176 0 : return py_clock_skew;
9177 : }
9178 :
9179 0 : static int py_lsa_DomainInfoKerberos_set_clock_skew(PyObject *py_obj, PyObject *value, void *closure)
9180 : {
9181 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
9182 0 : if (value == NULL) {
9183 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->clock_skew");
9184 0 : return -1;
9185 : }
9186 : {
9187 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->clock_skew));
9188 0 : if (PyLong_Check(value)) {
9189 : unsigned long long test_var;
9190 0 : test_var = PyLong_AsUnsignedLongLong(value);
9191 0 : if (PyErr_Occurred() != NULL) {
9192 0 : return -1;
9193 : }
9194 0 : if (test_var > uint_max) {
9195 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9196 : PyLong_Type.tp_name, uint_max, test_var);
9197 0 : return -1;
9198 : }
9199 0 : object->clock_skew = test_var;
9200 : } else {
9201 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9202 : PyLong_Type.tp_name);
9203 0 : return -1;
9204 : }
9205 : }
9206 0 : return 0;
9207 : }
9208 :
9209 0 : static PyObject *py_lsa_DomainInfoKerberos_get_reserved(PyObject *obj, void *closure)
9210 : {
9211 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
9212 : PyObject *py_reserved;
9213 0 : py_reserved = PyLong_FromUnsignedLongLong(object->reserved);
9214 0 : return py_reserved;
9215 : }
9216 :
9217 0 : static int py_lsa_DomainInfoKerberos_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
9218 : {
9219 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
9220 0 : if (value == NULL) {
9221 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
9222 0 : return -1;
9223 : }
9224 : {
9225 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
9226 0 : if (PyLong_Check(value)) {
9227 : unsigned long long test_var;
9228 0 : test_var = PyLong_AsUnsignedLongLong(value);
9229 0 : if (PyErr_Occurred() != NULL) {
9230 0 : return -1;
9231 : }
9232 0 : if (test_var > uint_max) {
9233 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9234 : PyLong_Type.tp_name, uint_max, test_var);
9235 0 : return -1;
9236 : }
9237 0 : object->reserved = test_var;
9238 : } else {
9239 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9240 : PyLong_Type.tp_name);
9241 0 : return -1;
9242 : }
9243 : }
9244 0 : return 0;
9245 : }
9246 :
9247 : static PyGetSetDef py_lsa_DomainInfoKerberos_getsetters[] = {
9248 : {
9249 : .name = discard_const_p(char, "authentication_options"),
9250 : .get = py_lsa_DomainInfoKerberos_get_authentication_options,
9251 : .set = py_lsa_DomainInfoKerberos_set_authentication_options,
9252 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_krbAuthenticationOptions")
9253 : },
9254 : {
9255 : .name = discard_const_p(char, "service_tkt_lifetime"),
9256 : .get = py_lsa_DomainInfoKerberos_get_service_tkt_lifetime,
9257 : .set = py_lsa_DomainInfoKerberos_set_service_tkt_lifetime,
9258 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9259 : },
9260 : {
9261 : .name = discard_const_p(char, "user_tkt_lifetime"),
9262 : .get = py_lsa_DomainInfoKerberos_get_user_tkt_lifetime,
9263 : .set = py_lsa_DomainInfoKerberos_set_user_tkt_lifetime,
9264 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9265 : },
9266 : {
9267 : .name = discard_const_p(char, "user_tkt_renewaltime"),
9268 : .get = py_lsa_DomainInfoKerberos_get_user_tkt_renewaltime,
9269 : .set = py_lsa_DomainInfoKerberos_set_user_tkt_renewaltime,
9270 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9271 : },
9272 : {
9273 : .name = discard_const_p(char, "clock_skew"),
9274 : .get = py_lsa_DomainInfoKerberos_get_clock_skew,
9275 : .set = py_lsa_DomainInfoKerberos_set_clock_skew,
9276 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9277 : },
9278 : {
9279 : .name = discard_const_p(char, "reserved"),
9280 : .get = py_lsa_DomainInfoKerberos_get_reserved,
9281 : .set = py_lsa_DomainInfoKerberos_set_reserved,
9282 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9283 : },
9284 : { .name = NULL }
9285 : };
9286 :
9287 0 : static PyObject *py_lsa_DomainInfoKerberos_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9288 : {
9289 0 : return pytalloc_new(struct lsa_DomainInfoKerberos, type);
9290 : }
9291 :
9292 :
9293 : static PyTypeObject lsa_DomainInfoKerberos_Type = {
9294 : PyVarObject_HEAD_INIT(NULL, 0)
9295 : .tp_name = "lsa.DomainInfoKerberos",
9296 : .tp_getset = py_lsa_DomainInfoKerberos_getsetters,
9297 : .tp_methods = NULL,
9298 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9299 : .tp_new = py_lsa_DomainInfoKerberos_new,
9300 : };
9301 :
9302 :
9303 0 : static PyObject *py_lsa_DomainInfoEfs_get_blob_size(PyObject *obj, void *closure)
9304 : {
9305 0 : struct lsa_DomainInfoEfs *object = (struct lsa_DomainInfoEfs *)pytalloc_get_ptr(obj);
9306 : PyObject *py_blob_size;
9307 0 : py_blob_size = PyLong_FromUnsignedLongLong((uint32_t)object->blob_size);
9308 0 : return py_blob_size;
9309 : }
9310 :
9311 0 : static int py_lsa_DomainInfoEfs_set_blob_size(PyObject *py_obj, PyObject *value, void *closure)
9312 : {
9313 0 : struct lsa_DomainInfoEfs *object = (struct lsa_DomainInfoEfs *)pytalloc_get_ptr(py_obj);
9314 0 : if (value == NULL) {
9315 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->blob_size");
9316 0 : return -1;
9317 : }
9318 : {
9319 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->blob_size));
9320 0 : if (PyLong_Check(value)) {
9321 : unsigned long long test_var;
9322 0 : test_var = PyLong_AsUnsignedLongLong(value);
9323 0 : if (PyErr_Occurred() != NULL) {
9324 0 : return -1;
9325 : }
9326 0 : if (test_var > uint_max) {
9327 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9328 : PyLong_Type.tp_name, uint_max, test_var);
9329 0 : return -1;
9330 : }
9331 0 : object->blob_size = test_var;
9332 : } else {
9333 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9334 : PyLong_Type.tp_name);
9335 0 : return -1;
9336 : }
9337 : }
9338 0 : return 0;
9339 : }
9340 :
9341 0 : static PyObject *py_lsa_DomainInfoEfs_get_efs_blob(PyObject *obj, void *closure)
9342 : {
9343 0 : struct lsa_DomainInfoEfs *object = (struct lsa_DomainInfoEfs *)pytalloc_get_ptr(obj);
9344 : PyObject *py_efs_blob;
9345 0 : if (object->efs_blob == NULL) {
9346 0 : Py_RETURN_NONE;
9347 : }
9348 0 : if (object->efs_blob == NULL) {
9349 0 : py_efs_blob = Py_None;
9350 0 : Py_INCREF(py_efs_blob);
9351 : } else {
9352 0 : py_efs_blob = PyList_New(object->blob_size);
9353 0 : if (py_efs_blob == NULL) {
9354 0 : return NULL;
9355 : }
9356 : {
9357 : int efs_blob_cntr_1;
9358 0 : for (efs_blob_cntr_1 = 0; efs_blob_cntr_1 < (object->blob_size); efs_blob_cntr_1++) {
9359 : PyObject *py_efs_blob_1;
9360 0 : py_efs_blob_1 = PyLong_FromLong((uint16_t)object->efs_blob[efs_blob_cntr_1]);
9361 0 : PyList_SetItem(py_efs_blob, efs_blob_cntr_1, py_efs_blob_1);
9362 : }
9363 : }
9364 : }
9365 0 : return py_efs_blob;
9366 : }
9367 :
9368 0 : static int py_lsa_DomainInfoEfs_set_efs_blob(PyObject *py_obj, PyObject *value, void *closure)
9369 : {
9370 0 : struct lsa_DomainInfoEfs *object = (struct lsa_DomainInfoEfs *)pytalloc_get_ptr(py_obj);
9371 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->efs_blob));
9372 0 : if (value == NULL) {
9373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->efs_blob");
9374 0 : return -1;
9375 : }
9376 0 : if (value == Py_None) {
9377 0 : object->efs_blob = NULL;
9378 : } else {
9379 0 : object->efs_blob = NULL;
9380 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9381 : {
9382 : int efs_blob_cntr_1;
9383 0 : object->efs_blob = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->efs_blob, PyList_GET_SIZE(value));
9384 0 : if (!object->efs_blob) { return -1;; }
9385 0 : talloc_set_name_const(object->efs_blob, "ARRAY: object->efs_blob");
9386 0 : for (efs_blob_cntr_1 = 0; efs_blob_cntr_1 < PyList_GET_SIZE(value); efs_blob_cntr_1++) {
9387 0 : if (PyList_GET_ITEM(value, efs_blob_cntr_1) == NULL) {
9388 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->efs_blob[efs_blob_cntr_1]");
9389 0 : return -1;
9390 : }
9391 : {
9392 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->efs_blob[efs_blob_cntr_1]));
9393 0 : if (PyLong_Check(PyList_GET_ITEM(value, efs_blob_cntr_1))) {
9394 : unsigned long long test_var;
9395 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, efs_blob_cntr_1));
9396 0 : if (PyErr_Occurred() != NULL) {
9397 0 : return -1;
9398 : }
9399 0 : if (test_var > uint_max) {
9400 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9401 : PyLong_Type.tp_name, uint_max, test_var);
9402 0 : return -1;
9403 : }
9404 0 : object->efs_blob[efs_blob_cntr_1] = test_var;
9405 : } else {
9406 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9407 : PyLong_Type.tp_name);
9408 0 : return -1;
9409 : }
9410 : }
9411 : }
9412 : }
9413 : }
9414 0 : return 0;
9415 : }
9416 :
9417 : static PyGetSetDef py_lsa_DomainInfoEfs_getsetters[] = {
9418 : {
9419 : .name = discard_const_p(char, "blob_size"),
9420 : .get = py_lsa_DomainInfoEfs_get_blob_size,
9421 : .set = py_lsa_DomainInfoEfs_set_blob_size,
9422 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9423 : },
9424 : {
9425 : .name = discard_const_p(char, "efs_blob"),
9426 : .get = py_lsa_DomainInfoEfs_get_efs_blob,
9427 : .set = py_lsa_DomainInfoEfs_set_efs_blob,
9428 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
9429 : },
9430 : { .name = NULL }
9431 : };
9432 :
9433 0 : static PyObject *py_lsa_DomainInfoEfs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9434 : {
9435 0 : return pytalloc_new(struct lsa_DomainInfoEfs, type);
9436 : }
9437 :
9438 :
9439 : static PyTypeObject lsa_DomainInfoEfs_Type = {
9440 : PyVarObject_HEAD_INIT(NULL, 0)
9441 : .tp_name = "lsa.DomainInfoEfs",
9442 : .tp_getset = py_lsa_DomainInfoEfs_getsetters,
9443 : .tp_methods = NULL,
9444 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9445 : .tp_new = py_lsa_DomainInfoEfs_new,
9446 : };
9447 :
9448 0 : static PyObject *py_import_lsa_DomainInformationPolicy(TALLOC_CTX *mem_ctx, int level, union lsa_DomainInformationPolicy *in)
9449 : {
9450 : PyObject *ret;
9451 :
9452 0 : switch (level) {
9453 0 : case LSA_DOMAIN_INFO_POLICY_EFS:
9454 0 : ret = pytalloc_reference_ex(&lsa_DomainInfoEfs_Type, mem_ctx, &in->efs_info);
9455 0 : return ret;
9456 :
9457 0 : case LSA_DOMAIN_INFO_POLICY_KERBEROS:
9458 0 : ret = pytalloc_reference_ex(&lsa_DomainInfoKerberos_Type, mem_ctx, &in->kerberos_info);
9459 0 : return ret;
9460 :
9461 : }
9462 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
9463 0 : return NULL;
9464 : }
9465 :
9466 0 : static union lsa_DomainInformationPolicy *py_export_lsa_DomainInformationPolicy(TALLOC_CTX *mem_ctx, int level, PyObject *in)
9467 : {
9468 0 : union lsa_DomainInformationPolicy *ret = talloc_zero(mem_ctx, union lsa_DomainInformationPolicy);
9469 0 : switch (level) {
9470 0 : case LSA_DOMAIN_INFO_POLICY_EFS:
9471 0 : if (in == NULL) {
9472 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->efs_info");
9473 0 : talloc_free(ret); return NULL;
9474 : }
9475 0 : PY_CHECK_TYPE(&lsa_DomainInfoEfs_Type, in, talloc_free(ret); return NULL;);
9476 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9477 0 : PyErr_NoMemory();
9478 0 : talloc_free(ret); return NULL;
9479 : }
9480 0 : ret->efs_info = *(struct lsa_DomainInfoEfs *)pytalloc_get_ptr(in);
9481 0 : break;
9482 :
9483 0 : case LSA_DOMAIN_INFO_POLICY_KERBEROS:
9484 0 : if (in == NULL) {
9485 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->kerberos_info");
9486 0 : talloc_free(ret); return NULL;
9487 : }
9488 0 : PY_CHECK_TYPE(&lsa_DomainInfoKerberos_Type, in, talloc_free(ret); return NULL;);
9489 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9490 0 : PyErr_NoMemory();
9491 0 : talloc_free(ret); return NULL;
9492 : }
9493 0 : ret->kerberos_info = *(struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(in);
9494 0 : break;
9495 :
9496 0 : default:
9497 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
9498 0 : talloc_free(ret);
9499 0 : ret = NULL;
9500 : }
9501 :
9502 0 : return ret;
9503 : }
9504 :
9505 0 : static PyObject *py_lsa_DomainInformationPolicy_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9506 : {
9507 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9508 0 : PyObject *mem_ctx_obj = NULL;
9509 0 : TALLOC_CTX *mem_ctx = NULL;
9510 0 : int level = 0;
9511 0 : PyObject *in_obj = NULL;
9512 0 : union lsa_DomainInformationPolicy *in = NULL;
9513 :
9514 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
9515 : discard_const_p(char *, kwnames),
9516 : &mem_ctx_obj,
9517 : &level,
9518 : &in_obj)) {
9519 0 : return NULL;
9520 : }
9521 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9522 0 : if (mem_ctx == NULL) {
9523 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9524 0 : return NULL;
9525 : }
9526 0 : in = (union lsa_DomainInformationPolicy *)pytalloc_get_ptr(in_obj);
9527 0 : if (in == NULL) {
9528 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_DomainInformationPolicy!");
9529 0 : return NULL;
9530 : }
9531 :
9532 0 : return py_import_lsa_DomainInformationPolicy(mem_ctx, level, in);
9533 : }
9534 :
9535 0 : static PyObject *py_lsa_DomainInformationPolicy_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9536 : {
9537 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9538 0 : PyObject *mem_ctx_obj = NULL;
9539 0 : TALLOC_CTX *mem_ctx = NULL;
9540 0 : int level = 0;
9541 0 : PyObject *in = NULL;
9542 0 : union lsa_DomainInformationPolicy *out = NULL;
9543 :
9544 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
9545 : discard_const_p(char *, kwnames),
9546 : &mem_ctx_obj,
9547 : &level,
9548 : &in)) {
9549 0 : return NULL;
9550 : }
9551 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9552 0 : if (mem_ctx == NULL) {
9553 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9554 0 : return NULL;
9555 : }
9556 :
9557 0 : out = py_export_lsa_DomainInformationPolicy(mem_ctx, level, in);
9558 0 : if (out == NULL) {
9559 0 : return NULL;
9560 : }
9561 :
9562 0 : return pytalloc_GenericObject_reference(out);
9563 : }
9564 :
9565 : static PyMethodDef py_lsa_DomainInformationPolicy_methods[] = {
9566 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DomainInformationPolicy_import),
9567 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9568 : "T.__import__(mem_ctx, level, in) => ret." },
9569 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DomainInformationPolicy_export),
9570 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9571 : "T.__export__(mem_ctx, level, in) => ret." },
9572 : { NULL, NULL, 0, NULL }
9573 : };
9574 :
9575 0 : static PyObject *py_lsa_DomainInformationPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9576 : {
9577 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
9578 0 : return NULL;
9579 : }
9580 :
9581 :
9582 : static PyTypeObject lsa_DomainInformationPolicy_Type = {
9583 : PyVarObject_HEAD_INIT(NULL, 0)
9584 : .tp_name = "lsa.DomainInformationPolicy",
9585 : .tp_getset = NULL,
9586 : .tp_methods = py_lsa_DomainInformationPolicy_methods,
9587 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9588 : .tp_new = py_lsa_DomainInformationPolicy_new,
9589 : };
9590 :
9591 :
9592 0 : static PyObject *py_lsa_TranslatedName2_get_sid_type(PyObject *obj, void *closure)
9593 : {
9594 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(obj);
9595 : PyObject *py_sid_type;
9596 0 : py_sid_type = PyLong_FromLong((uint16_t)object->sid_type);
9597 0 : return py_sid_type;
9598 : }
9599 :
9600 0 : static int py_lsa_TranslatedName2_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
9601 : {
9602 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
9603 0 : if (value == NULL) {
9604 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_type");
9605 0 : return -1;
9606 : }
9607 : {
9608 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
9609 0 : if (PyLong_Check(value)) {
9610 : unsigned long long test_var;
9611 0 : test_var = PyLong_AsUnsignedLongLong(value);
9612 0 : if (PyErr_Occurred() != NULL) {
9613 0 : return -1;
9614 : }
9615 0 : if (test_var > uint_max) {
9616 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9617 : PyLong_Type.tp_name, uint_max, test_var);
9618 0 : return -1;
9619 : }
9620 0 : object->sid_type = test_var;
9621 : } else {
9622 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9623 : PyLong_Type.tp_name);
9624 0 : return -1;
9625 : }
9626 : }
9627 0 : return 0;
9628 : }
9629 :
9630 5 : static PyObject *py_lsa_TranslatedName2_get_name(PyObject *obj, void *closure)
9631 : {
9632 5 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(obj);
9633 : PyObject *py_name;
9634 5 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
9635 5 : return py_name;
9636 : }
9637 :
9638 0 : static int py_lsa_TranslatedName2_set_name(PyObject *py_obj, PyObject *value, void *closure)
9639 : {
9640 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
9641 0 : if (value == NULL) {
9642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
9643 0 : return -1;
9644 : }
9645 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
9646 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9647 0 : PyErr_NoMemory();
9648 0 : return -1;
9649 : }
9650 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
9651 0 : return 0;
9652 : }
9653 :
9654 0 : static PyObject *py_lsa_TranslatedName2_get_sid_index(PyObject *obj, void *closure)
9655 : {
9656 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(obj);
9657 : PyObject *py_sid_index;
9658 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
9659 0 : return py_sid_index;
9660 : }
9661 :
9662 0 : static int py_lsa_TranslatedName2_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
9663 : {
9664 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
9665 0 : if (value == NULL) {
9666 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_index");
9667 0 : return -1;
9668 : }
9669 : {
9670 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
9671 0 : if (PyLong_Check(value)) {
9672 : unsigned long long test_var;
9673 0 : test_var = PyLong_AsUnsignedLongLong(value);
9674 0 : if (PyErr_Occurred() != NULL) {
9675 0 : return -1;
9676 : }
9677 0 : if (test_var > uint_max) {
9678 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9679 : PyLong_Type.tp_name, uint_max, test_var);
9680 0 : return -1;
9681 : }
9682 0 : object->sid_index = test_var;
9683 : } else {
9684 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9685 : PyLong_Type.tp_name);
9686 0 : return -1;
9687 : }
9688 : }
9689 0 : return 0;
9690 : }
9691 :
9692 0 : static PyObject *py_lsa_TranslatedName2_get_unknown(PyObject *obj, void *closure)
9693 : {
9694 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(obj);
9695 : PyObject *py_unknown;
9696 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)object->unknown);
9697 0 : return py_unknown;
9698 : }
9699 :
9700 0 : static int py_lsa_TranslatedName2_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
9701 : {
9702 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
9703 0 : if (value == NULL) {
9704 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown");
9705 0 : return -1;
9706 : }
9707 : {
9708 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
9709 0 : if (PyLong_Check(value)) {
9710 : unsigned long long test_var;
9711 0 : test_var = PyLong_AsUnsignedLongLong(value);
9712 0 : if (PyErr_Occurred() != NULL) {
9713 0 : return -1;
9714 : }
9715 0 : if (test_var > uint_max) {
9716 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9717 : PyLong_Type.tp_name, uint_max, test_var);
9718 0 : return -1;
9719 : }
9720 0 : object->unknown = test_var;
9721 : } else {
9722 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9723 : PyLong_Type.tp_name);
9724 0 : return -1;
9725 : }
9726 : }
9727 0 : return 0;
9728 : }
9729 :
9730 : static PyGetSetDef py_lsa_TranslatedName2_getsetters[] = {
9731 : {
9732 : .name = discard_const_p(char, "sid_type"),
9733 : .get = py_lsa_TranslatedName2_get_sid_type,
9734 : .set = py_lsa_TranslatedName2_set_sid_type,
9735 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
9736 : },
9737 : {
9738 : .name = discard_const_p(char, "name"),
9739 : .get = py_lsa_TranslatedName2_get_name,
9740 : .set = py_lsa_TranslatedName2_set_name,
9741 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9742 : },
9743 : {
9744 : .name = discard_const_p(char, "sid_index"),
9745 : .get = py_lsa_TranslatedName2_get_sid_index,
9746 : .set = py_lsa_TranslatedName2_set_sid_index,
9747 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9748 : },
9749 : {
9750 : .name = discard_const_p(char, "unknown"),
9751 : .get = py_lsa_TranslatedName2_get_unknown,
9752 : .set = py_lsa_TranslatedName2_set_unknown,
9753 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9754 : },
9755 : { .name = NULL }
9756 : };
9757 :
9758 0 : static PyObject *py_lsa_TranslatedName2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9759 : {
9760 0 : return pytalloc_new(struct lsa_TranslatedName2, type);
9761 : }
9762 :
9763 :
9764 : static PyTypeObject lsa_TranslatedName2_Type = {
9765 : PyVarObject_HEAD_INIT(NULL, 0)
9766 : .tp_name = "lsa.TranslatedName2",
9767 : .tp_getset = py_lsa_TranslatedName2_getsetters,
9768 : .tp_methods = NULL,
9769 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9770 : .tp_new = py_lsa_TranslatedName2_new,
9771 : };
9772 :
9773 :
9774 5 : static PyObject *py_lsa_TransNameArray2_get_count(PyObject *obj, void *closure)
9775 : {
9776 5 : struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(obj);
9777 : PyObject *py_count;
9778 5 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
9779 5 : return py_count;
9780 : }
9781 :
9782 0 : static int py_lsa_TransNameArray2_set_count(PyObject *py_obj, PyObject *value, void *closure)
9783 : {
9784 0 : struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_obj);
9785 0 : if (value == NULL) {
9786 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
9787 0 : return -1;
9788 : }
9789 : {
9790 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
9791 0 : if (PyLong_Check(value)) {
9792 : unsigned long long test_var;
9793 0 : test_var = PyLong_AsUnsignedLongLong(value);
9794 0 : if (PyErr_Occurred() != NULL) {
9795 0 : return -1;
9796 : }
9797 0 : if (test_var > uint_max) {
9798 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9799 : PyLong_Type.tp_name, uint_max, test_var);
9800 0 : return -1;
9801 : }
9802 0 : object->count = test_var;
9803 : } else {
9804 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9805 : PyLong_Type.tp_name);
9806 0 : return -1;
9807 : }
9808 : }
9809 0 : return 0;
9810 : }
9811 :
9812 5 : static PyObject *py_lsa_TransNameArray2_get_names(PyObject *obj, void *closure)
9813 : {
9814 5 : struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(obj);
9815 : PyObject *py_names;
9816 5 : if (object->names == NULL) {
9817 0 : Py_RETURN_NONE;
9818 : }
9819 5 : if (object->names == NULL) {
9820 0 : py_names = Py_None;
9821 0 : Py_INCREF(py_names);
9822 : } else {
9823 5 : py_names = PyList_New(object->count);
9824 5 : if (py_names == NULL) {
9825 0 : return NULL;
9826 : }
9827 : {
9828 : int names_cntr_1;
9829 10 : for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
9830 : PyObject *py_names_1;
9831 5 : py_names_1 = pytalloc_reference_ex(&lsa_TranslatedName2_Type, object->names, &object->names[names_cntr_1]);
9832 5 : PyList_SetItem(py_names, names_cntr_1, py_names_1);
9833 : }
9834 : }
9835 : }
9836 5 : return py_names;
9837 : }
9838 :
9839 0 : static int py_lsa_TransNameArray2_set_names(PyObject *py_obj, PyObject *value, void *closure)
9840 : {
9841 0 : struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_obj);
9842 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
9843 0 : if (value == NULL) {
9844 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names");
9845 0 : return -1;
9846 : }
9847 0 : if (value == Py_None) {
9848 0 : object->names = NULL;
9849 : } else {
9850 0 : object->names = NULL;
9851 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9852 : {
9853 : int names_cntr_1;
9854 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
9855 0 : if (!object->names) { return -1;; }
9856 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
9857 0 : for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
9858 0 : if (PyList_GET_ITEM(value, names_cntr_1) == NULL) {
9859 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names[names_cntr_1]");
9860 0 : return -1;
9861 : }
9862 0 : PY_CHECK_TYPE(&lsa_TranslatedName2_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
9863 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
9864 0 : PyErr_NoMemory();
9865 0 : return -1;
9866 : }
9867 0 : object->names[names_cntr_1] = *(struct lsa_TranslatedName2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
9868 : }
9869 : }
9870 : }
9871 0 : return 0;
9872 : }
9873 :
9874 : static PyGetSetDef py_lsa_TransNameArray2_getsetters[] = {
9875 : {
9876 : .name = discard_const_p(char, "count"),
9877 : .get = py_lsa_TransNameArray2_get_count,
9878 : .set = py_lsa_TransNameArray2_set_count,
9879 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9880 : },
9881 : {
9882 : .name = discard_const_p(char, "names"),
9883 : .get = py_lsa_TransNameArray2_get_names,
9884 : .set = py_lsa_TransNameArray2_set_names,
9885 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedName2")
9886 : },
9887 : { .name = NULL }
9888 : };
9889 :
9890 5 : static PyObject *py_lsa_TransNameArray2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9891 : {
9892 5 : return pytalloc_new(struct lsa_TransNameArray2, type);
9893 : }
9894 :
9895 :
9896 : static PyTypeObject lsa_TransNameArray2_Type = {
9897 : PyVarObject_HEAD_INIT(NULL, 0)
9898 : .tp_name = "lsa.TransNameArray2",
9899 : .tp_getset = py_lsa_TransNameArray2_getsetters,
9900 : .tp_methods = NULL,
9901 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9902 : .tp_new = py_lsa_TransNameArray2_new,
9903 : };
9904 :
9905 :
9906 0 : static PyObject *py_lsa_TranslatedSid2_get_sid_type(PyObject *obj, void *closure)
9907 : {
9908 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(obj);
9909 : PyObject *py_sid_type;
9910 0 : py_sid_type = PyLong_FromLong((uint16_t)object->sid_type);
9911 0 : return py_sid_type;
9912 : }
9913 :
9914 0 : static int py_lsa_TranslatedSid2_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
9915 : {
9916 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
9917 0 : if (value == NULL) {
9918 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_type");
9919 0 : return -1;
9920 : }
9921 : {
9922 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
9923 0 : if (PyLong_Check(value)) {
9924 : unsigned long long test_var;
9925 0 : test_var = PyLong_AsUnsignedLongLong(value);
9926 0 : if (PyErr_Occurred() != NULL) {
9927 0 : return -1;
9928 : }
9929 0 : if (test_var > uint_max) {
9930 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9931 : PyLong_Type.tp_name, uint_max, test_var);
9932 0 : return -1;
9933 : }
9934 0 : object->sid_type = test_var;
9935 : } else {
9936 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9937 : PyLong_Type.tp_name);
9938 0 : return -1;
9939 : }
9940 : }
9941 0 : return 0;
9942 : }
9943 :
9944 0 : static PyObject *py_lsa_TranslatedSid2_get_rid(PyObject *obj, void *closure)
9945 : {
9946 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(obj);
9947 : PyObject *py_rid;
9948 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
9949 0 : return py_rid;
9950 : }
9951 :
9952 0 : static int py_lsa_TranslatedSid2_set_rid(PyObject *py_obj, PyObject *value, void *closure)
9953 : {
9954 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
9955 0 : if (value == NULL) {
9956 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
9957 0 : return -1;
9958 : }
9959 : {
9960 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
9961 0 : if (PyLong_Check(value)) {
9962 : unsigned long long test_var;
9963 0 : test_var = PyLong_AsUnsignedLongLong(value);
9964 0 : if (PyErr_Occurred() != NULL) {
9965 0 : return -1;
9966 : }
9967 0 : if (test_var > uint_max) {
9968 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9969 : PyLong_Type.tp_name, uint_max, test_var);
9970 0 : return -1;
9971 : }
9972 0 : object->rid = test_var;
9973 : } else {
9974 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9975 : PyLong_Type.tp_name);
9976 0 : return -1;
9977 : }
9978 : }
9979 0 : return 0;
9980 : }
9981 :
9982 0 : static PyObject *py_lsa_TranslatedSid2_get_sid_index(PyObject *obj, void *closure)
9983 : {
9984 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(obj);
9985 : PyObject *py_sid_index;
9986 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
9987 0 : return py_sid_index;
9988 : }
9989 :
9990 0 : static int py_lsa_TranslatedSid2_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
9991 : {
9992 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
9993 0 : if (value == NULL) {
9994 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_index");
9995 0 : return -1;
9996 : }
9997 : {
9998 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
9999 0 : if (PyLong_Check(value)) {
10000 : unsigned long long test_var;
10001 0 : test_var = PyLong_AsUnsignedLongLong(value);
10002 0 : if (PyErr_Occurred() != NULL) {
10003 0 : return -1;
10004 : }
10005 0 : if (test_var > uint_max) {
10006 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10007 : PyLong_Type.tp_name, uint_max, test_var);
10008 0 : return -1;
10009 : }
10010 0 : object->sid_index = test_var;
10011 : } else {
10012 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10013 : PyLong_Type.tp_name);
10014 0 : return -1;
10015 : }
10016 : }
10017 0 : return 0;
10018 : }
10019 :
10020 0 : static PyObject *py_lsa_TranslatedSid2_get_unknown(PyObject *obj, void *closure)
10021 : {
10022 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(obj);
10023 : PyObject *py_unknown;
10024 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)object->unknown);
10025 0 : return py_unknown;
10026 : }
10027 :
10028 0 : static int py_lsa_TranslatedSid2_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
10029 : {
10030 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
10031 0 : if (value == NULL) {
10032 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown");
10033 0 : return -1;
10034 : }
10035 : {
10036 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
10037 0 : if (PyLong_Check(value)) {
10038 : unsigned long long test_var;
10039 0 : test_var = PyLong_AsUnsignedLongLong(value);
10040 0 : if (PyErr_Occurred() != NULL) {
10041 0 : return -1;
10042 : }
10043 0 : if (test_var > uint_max) {
10044 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10045 : PyLong_Type.tp_name, uint_max, test_var);
10046 0 : return -1;
10047 : }
10048 0 : object->unknown = test_var;
10049 : } else {
10050 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10051 : PyLong_Type.tp_name);
10052 0 : return -1;
10053 : }
10054 : }
10055 0 : return 0;
10056 : }
10057 :
10058 : static PyGetSetDef py_lsa_TranslatedSid2_getsetters[] = {
10059 : {
10060 : .name = discard_const_p(char, "sid_type"),
10061 : .get = py_lsa_TranslatedSid2_get_sid_type,
10062 : .set = py_lsa_TranslatedSid2_set_sid_type,
10063 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
10064 : },
10065 : {
10066 : .name = discard_const_p(char, "rid"),
10067 : .get = py_lsa_TranslatedSid2_get_rid,
10068 : .set = py_lsa_TranslatedSid2_set_rid,
10069 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10070 : },
10071 : {
10072 : .name = discard_const_p(char, "sid_index"),
10073 : .get = py_lsa_TranslatedSid2_get_sid_index,
10074 : .set = py_lsa_TranslatedSid2_set_sid_index,
10075 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10076 : },
10077 : {
10078 : .name = discard_const_p(char, "unknown"),
10079 : .get = py_lsa_TranslatedSid2_get_unknown,
10080 : .set = py_lsa_TranslatedSid2_set_unknown,
10081 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10082 : },
10083 : { .name = NULL }
10084 : };
10085 :
10086 0 : static PyObject *py_lsa_TranslatedSid2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10087 : {
10088 0 : return pytalloc_new(struct lsa_TranslatedSid2, type);
10089 : }
10090 :
10091 :
10092 : static PyTypeObject lsa_TranslatedSid2_Type = {
10093 : PyVarObject_HEAD_INIT(NULL, 0)
10094 : .tp_name = "lsa.TranslatedSid2",
10095 : .tp_getset = py_lsa_TranslatedSid2_getsetters,
10096 : .tp_methods = NULL,
10097 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10098 : .tp_new = py_lsa_TranslatedSid2_new,
10099 : };
10100 :
10101 :
10102 0 : static PyObject *py_lsa_TransSidArray2_get_count(PyObject *obj, void *closure)
10103 : {
10104 0 : struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(obj);
10105 : PyObject *py_count;
10106 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
10107 0 : return py_count;
10108 : }
10109 :
10110 0 : static int py_lsa_TransSidArray2_set_count(PyObject *py_obj, PyObject *value, void *closure)
10111 : {
10112 0 : struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(py_obj);
10113 0 : if (value == NULL) {
10114 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
10115 0 : return -1;
10116 : }
10117 : {
10118 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
10119 0 : if (PyLong_Check(value)) {
10120 : unsigned long long test_var;
10121 0 : test_var = PyLong_AsUnsignedLongLong(value);
10122 0 : if (PyErr_Occurred() != NULL) {
10123 0 : return -1;
10124 : }
10125 0 : if (test_var > uint_max) {
10126 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10127 : PyLong_Type.tp_name, uint_max, test_var);
10128 0 : return -1;
10129 : }
10130 0 : object->count = test_var;
10131 : } else {
10132 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10133 : PyLong_Type.tp_name);
10134 0 : return -1;
10135 : }
10136 : }
10137 0 : return 0;
10138 : }
10139 :
10140 0 : static PyObject *py_lsa_TransSidArray2_get_sids(PyObject *obj, void *closure)
10141 : {
10142 0 : struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(obj);
10143 : PyObject *py_sids;
10144 0 : if (object->sids == NULL) {
10145 0 : Py_RETURN_NONE;
10146 : }
10147 0 : if (object->sids == NULL) {
10148 0 : py_sids = Py_None;
10149 0 : Py_INCREF(py_sids);
10150 : } else {
10151 0 : py_sids = PyList_New(object->count);
10152 0 : if (py_sids == NULL) {
10153 0 : return NULL;
10154 : }
10155 : {
10156 : int sids_cntr_1;
10157 0 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->count); sids_cntr_1++) {
10158 : PyObject *py_sids_1;
10159 0 : py_sids_1 = pytalloc_reference_ex(&lsa_TranslatedSid2_Type, object->sids, &object->sids[sids_cntr_1]);
10160 0 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
10161 : }
10162 : }
10163 : }
10164 0 : return py_sids;
10165 : }
10166 :
10167 0 : static int py_lsa_TransSidArray2_set_sids(PyObject *py_obj, PyObject *value, void *closure)
10168 : {
10169 0 : struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(py_obj);
10170 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
10171 0 : if (value == NULL) {
10172 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
10173 0 : return -1;
10174 : }
10175 0 : if (value == Py_None) {
10176 0 : object->sids = NULL;
10177 : } else {
10178 0 : object->sids = NULL;
10179 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10180 : {
10181 : int sids_cntr_1;
10182 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
10183 0 : if (!object->sids) { return -1;; }
10184 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
10185 0 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
10186 0 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
10187 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_1]");
10188 0 : return -1;
10189 : }
10190 0 : PY_CHECK_TYPE(&lsa_TranslatedSid2_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
10191 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
10192 0 : PyErr_NoMemory();
10193 0 : return -1;
10194 : }
10195 0 : object->sids[sids_cntr_1] = *(struct lsa_TranslatedSid2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
10196 : }
10197 : }
10198 : }
10199 0 : return 0;
10200 : }
10201 :
10202 : static PyGetSetDef py_lsa_TransSidArray2_getsetters[] = {
10203 : {
10204 : .name = discard_const_p(char, "count"),
10205 : .get = py_lsa_TransSidArray2_get_count,
10206 : .set = py_lsa_TransSidArray2_set_count,
10207 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10208 : },
10209 : {
10210 : .name = discard_const_p(char, "sids"),
10211 : .get = py_lsa_TransSidArray2_get_sids,
10212 : .set = py_lsa_TransSidArray2_set_sids,
10213 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedSid2")
10214 : },
10215 : { .name = NULL }
10216 : };
10217 :
10218 0 : static PyObject *py_lsa_TransSidArray2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10219 : {
10220 0 : return pytalloc_new(struct lsa_TransSidArray2, type);
10221 : }
10222 :
10223 :
10224 : static PyTypeObject lsa_TransSidArray2_Type = {
10225 : PyVarObject_HEAD_INIT(NULL, 0)
10226 : .tp_name = "lsa.TransSidArray2",
10227 : .tp_getset = py_lsa_TransSidArray2_getsetters,
10228 : .tp_methods = NULL,
10229 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10230 : .tp_new = py_lsa_TransSidArray2_new,
10231 : };
10232 :
10233 :
10234 0 : static PyObject *py_lsa_TranslatedSid3_get_sid_type(PyObject *obj, void *closure)
10235 : {
10236 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
10237 : PyObject *py_sid_type;
10238 0 : py_sid_type = PyLong_FromLong((uint16_t)object->sid_type);
10239 0 : return py_sid_type;
10240 : }
10241 :
10242 0 : static int py_lsa_TranslatedSid3_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
10243 : {
10244 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
10245 0 : if (value == NULL) {
10246 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_type");
10247 0 : return -1;
10248 : }
10249 : {
10250 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
10251 0 : if (PyLong_Check(value)) {
10252 : unsigned long long test_var;
10253 0 : test_var = PyLong_AsUnsignedLongLong(value);
10254 0 : if (PyErr_Occurred() != NULL) {
10255 0 : return -1;
10256 : }
10257 0 : if (test_var > uint_max) {
10258 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10259 : PyLong_Type.tp_name, uint_max, test_var);
10260 0 : return -1;
10261 : }
10262 0 : object->sid_type = test_var;
10263 : } else {
10264 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10265 : PyLong_Type.tp_name);
10266 0 : return -1;
10267 : }
10268 : }
10269 0 : return 0;
10270 : }
10271 :
10272 1 : static PyObject *py_lsa_TranslatedSid3_get_sid(PyObject *obj, void *closure)
10273 : {
10274 1 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
10275 : PyObject *py_sid;
10276 1 : if (object->sid == NULL) {
10277 0 : Py_RETURN_NONE;
10278 : }
10279 1 : if (object->sid == NULL) {
10280 0 : py_sid = Py_None;
10281 0 : Py_INCREF(py_sid);
10282 : } else {
10283 1 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
10284 : }
10285 1 : return py_sid;
10286 : }
10287 :
10288 0 : static int py_lsa_TranslatedSid3_set_sid(PyObject *py_obj, PyObject *value, void *closure)
10289 : {
10290 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
10291 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
10292 0 : if (value == NULL) {
10293 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
10294 0 : return -1;
10295 : }
10296 0 : if (value == Py_None) {
10297 0 : object->sid = NULL;
10298 : } else {
10299 0 : object->sid = NULL;
10300 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
10301 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10302 0 : PyErr_NoMemory();
10303 0 : return -1;
10304 : }
10305 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
10306 : }
10307 0 : return 0;
10308 : }
10309 :
10310 0 : static PyObject *py_lsa_TranslatedSid3_get_sid_index(PyObject *obj, void *closure)
10311 : {
10312 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
10313 : PyObject *py_sid_index;
10314 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
10315 0 : return py_sid_index;
10316 : }
10317 :
10318 0 : static int py_lsa_TranslatedSid3_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
10319 : {
10320 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
10321 0 : if (value == NULL) {
10322 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_index");
10323 0 : return -1;
10324 : }
10325 : {
10326 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
10327 0 : if (PyLong_Check(value)) {
10328 : unsigned long long test_var;
10329 0 : test_var = PyLong_AsUnsignedLongLong(value);
10330 0 : if (PyErr_Occurred() != NULL) {
10331 0 : return -1;
10332 : }
10333 0 : if (test_var > uint_max) {
10334 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10335 : PyLong_Type.tp_name, uint_max, test_var);
10336 0 : return -1;
10337 : }
10338 0 : object->sid_index = test_var;
10339 : } else {
10340 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10341 : PyLong_Type.tp_name);
10342 0 : return -1;
10343 : }
10344 : }
10345 0 : return 0;
10346 : }
10347 :
10348 0 : static PyObject *py_lsa_TranslatedSid3_get_flags(PyObject *obj, void *closure)
10349 : {
10350 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
10351 : PyObject *py_flags;
10352 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
10353 0 : return py_flags;
10354 : }
10355 :
10356 0 : static int py_lsa_TranslatedSid3_set_flags(PyObject *py_obj, PyObject *value, void *closure)
10357 : {
10358 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
10359 0 : if (value == NULL) {
10360 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
10361 0 : return -1;
10362 : }
10363 : {
10364 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
10365 0 : if (PyLong_Check(value)) {
10366 : unsigned long long test_var;
10367 0 : test_var = PyLong_AsUnsignedLongLong(value);
10368 0 : if (PyErr_Occurred() != NULL) {
10369 0 : return -1;
10370 : }
10371 0 : if (test_var > uint_max) {
10372 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10373 : PyLong_Type.tp_name, uint_max, test_var);
10374 0 : return -1;
10375 : }
10376 0 : object->flags = test_var;
10377 : } else {
10378 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10379 : PyLong_Type.tp_name);
10380 0 : return -1;
10381 : }
10382 : }
10383 0 : return 0;
10384 : }
10385 :
10386 : static PyGetSetDef py_lsa_TranslatedSid3_getsetters[] = {
10387 : {
10388 : .name = discard_const_p(char, "sid_type"),
10389 : .get = py_lsa_TranslatedSid3_get_sid_type,
10390 : .set = py_lsa_TranslatedSid3_set_sid_type,
10391 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
10392 : },
10393 : {
10394 : .name = discard_const_p(char, "sid"),
10395 : .get = py_lsa_TranslatedSid3_get_sid,
10396 : .set = py_lsa_TranslatedSid3_set_sid,
10397 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
10398 : },
10399 : {
10400 : .name = discard_const_p(char, "sid_index"),
10401 : .get = py_lsa_TranslatedSid3_get_sid_index,
10402 : .set = py_lsa_TranslatedSid3_set_sid_index,
10403 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10404 : },
10405 : {
10406 : .name = discard_const_p(char, "flags"),
10407 : .get = py_lsa_TranslatedSid3_get_flags,
10408 : .set = py_lsa_TranslatedSid3_set_flags,
10409 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10410 : },
10411 : { .name = NULL }
10412 : };
10413 :
10414 0 : static PyObject *py_lsa_TranslatedSid3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10415 : {
10416 0 : return pytalloc_new(struct lsa_TranslatedSid3, type);
10417 : }
10418 :
10419 :
10420 : static PyTypeObject lsa_TranslatedSid3_Type = {
10421 : PyVarObject_HEAD_INIT(NULL, 0)
10422 : .tp_name = "lsa.TranslatedSid3",
10423 : .tp_getset = py_lsa_TranslatedSid3_getsetters,
10424 : .tp_methods = NULL,
10425 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10426 : .tp_new = py_lsa_TranslatedSid3_new,
10427 : };
10428 :
10429 :
10430 1 : static PyObject *py_lsa_TransSidArray3_get_count(PyObject *obj, void *closure)
10431 : {
10432 1 : struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(obj);
10433 : PyObject *py_count;
10434 1 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
10435 1 : return py_count;
10436 : }
10437 :
10438 0 : static int py_lsa_TransSidArray3_set_count(PyObject *py_obj, PyObject *value, void *closure)
10439 : {
10440 0 : struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_obj);
10441 0 : if (value == NULL) {
10442 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
10443 0 : return -1;
10444 : }
10445 : {
10446 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
10447 0 : if (PyLong_Check(value)) {
10448 : unsigned long long test_var;
10449 0 : test_var = PyLong_AsUnsignedLongLong(value);
10450 0 : if (PyErr_Occurred() != NULL) {
10451 0 : return -1;
10452 : }
10453 0 : if (test_var > uint_max) {
10454 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10455 : PyLong_Type.tp_name, uint_max, test_var);
10456 0 : return -1;
10457 : }
10458 0 : object->count = test_var;
10459 : } else {
10460 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10461 : PyLong_Type.tp_name);
10462 0 : return -1;
10463 : }
10464 : }
10465 0 : return 0;
10466 : }
10467 :
10468 1 : static PyObject *py_lsa_TransSidArray3_get_sids(PyObject *obj, void *closure)
10469 : {
10470 1 : struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(obj);
10471 : PyObject *py_sids;
10472 1 : if (object->sids == NULL) {
10473 0 : Py_RETURN_NONE;
10474 : }
10475 1 : if (object->sids == NULL) {
10476 0 : py_sids = Py_None;
10477 0 : Py_INCREF(py_sids);
10478 : } else {
10479 1 : py_sids = PyList_New(object->count);
10480 1 : if (py_sids == NULL) {
10481 0 : return NULL;
10482 : }
10483 : {
10484 : int sids_cntr_1;
10485 2 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->count); sids_cntr_1++) {
10486 : PyObject *py_sids_1;
10487 1 : py_sids_1 = pytalloc_reference_ex(&lsa_TranslatedSid3_Type, object->sids, &object->sids[sids_cntr_1]);
10488 1 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
10489 : }
10490 : }
10491 : }
10492 1 : return py_sids;
10493 : }
10494 :
10495 0 : static int py_lsa_TransSidArray3_set_sids(PyObject *py_obj, PyObject *value, void *closure)
10496 : {
10497 0 : struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_obj);
10498 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
10499 0 : if (value == NULL) {
10500 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
10501 0 : return -1;
10502 : }
10503 0 : if (value == Py_None) {
10504 0 : object->sids = NULL;
10505 : } else {
10506 0 : object->sids = NULL;
10507 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10508 : {
10509 : int sids_cntr_1;
10510 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
10511 0 : if (!object->sids) { return -1;; }
10512 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
10513 0 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
10514 0 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
10515 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_1]");
10516 0 : return -1;
10517 : }
10518 0 : PY_CHECK_TYPE(&lsa_TranslatedSid3_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
10519 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
10520 0 : PyErr_NoMemory();
10521 0 : return -1;
10522 : }
10523 0 : object->sids[sids_cntr_1] = *(struct lsa_TranslatedSid3 *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
10524 : }
10525 : }
10526 : }
10527 0 : return 0;
10528 : }
10529 :
10530 : static PyGetSetDef py_lsa_TransSidArray3_getsetters[] = {
10531 : {
10532 : .name = discard_const_p(char, "count"),
10533 : .get = py_lsa_TransSidArray3_get_count,
10534 : .set = py_lsa_TransSidArray3_set_count,
10535 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10536 : },
10537 : {
10538 : .name = discard_const_p(char, "sids"),
10539 : .get = py_lsa_TransSidArray3_get_sids,
10540 : .set = py_lsa_TransSidArray3_set_sids,
10541 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedSid3")
10542 : },
10543 : { .name = NULL }
10544 : };
10545 :
10546 6 : static PyObject *py_lsa_TransSidArray3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10547 : {
10548 6 : return pytalloc_new(struct lsa_TransSidArray3, type);
10549 : }
10550 :
10551 :
10552 : static PyTypeObject lsa_TransSidArray3_Type = {
10553 : PyVarObject_HEAD_INIT(NULL, 0)
10554 : .tp_name = "lsa.TransSidArray3",
10555 : .tp_getset = py_lsa_TransSidArray3_getsetters,
10556 : .tp_methods = NULL,
10557 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10558 : .tp_new = py_lsa_TransSidArray3_new,
10559 : };
10560 :
10561 :
10562 0 : static PyObject *py_lsa_ForestTrustBinaryData_get_length(PyObject *obj, void *closure)
10563 : {
10564 0 : struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(obj);
10565 : PyObject *py_length;
10566 0 : py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length);
10567 0 : return py_length;
10568 : }
10569 :
10570 0 : static int py_lsa_ForestTrustBinaryData_set_length(PyObject *py_obj, PyObject *value, void *closure)
10571 : {
10572 0 : struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(py_obj);
10573 0 : if (value == NULL) {
10574 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
10575 0 : return -1;
10576 : }
10577 : {
10578 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
10579 0 : if (PyLong_Check(value)) {
10580 : unsigned long long test_var;
10581 0 : test_var = PyLong_AsUnsignedLongLong(value);
10582 0 : if (PyErr_Occurred() != NULL) {
10583 0 : return -1;
10584 : }
10585 0 : if (test_var > uint_max) {
10586 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10587 : PyLong_Type.tp_name, uint_max, test_var);
10588 0 : return -1;
10589 : }
10590 0 : object->length = test_var;
10591 : } else {
10592 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10593 : PyLong_Type.tp_name);
10594 0 : return -1;
10595 : }
10596 : }
10597 0 : return 0;
10598 : }
10599 :
10600 0 : static PyObject *py_lsa_ForestTrustBinaryData_get_data(PyObject *obj, void *closure)
10601 : {
10602 0 : struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(obj);
10603 : PyObject *py_data;
10604 0 : if (object->data == NULL) {
10605 0 : Py_RETURN_NONE;
10606 : }
10607 0 : if (object->data == NULL) {
10608 0 : py_data = Py_None;
10609 0 : Py_INCREF(py_data);
10610 : } else {
10611 0 : py_data = PyList_New(object->length);
10612 0 : if (py_data == NULL) {
10613 0 : return NULL;
10614 : }
10615 : {
10616 : int data_cntr_1;
10617 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
10618 : PyObject *py_data_1;
10619 0 : py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]);
10620 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
10621 : }
10622 : }
10623 : }
10624 0 : return py_data;
10625 : }
10626 :
10627 0 : static int py_lsa_ForestTrustBinaryData_set_data(PyObject *py_obj, PyObject *value, void *closure)
10628 : {
10629 0 : struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(py_obj);
10630 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
10631 0 : if (value == NULL) {
10632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
10633 0 : return -1;
10634 : }
10635 0 : if (value == Py_None) {
10636 0 : object->data = NULL;
10637 : } else {
10638 0 : object->data = NULL;
10639 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10640 : {
10641 : int data_cntr_1;
10642 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
10643 0 : if (!object->data) { return -1;; }
10644 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
10645 0 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
10646 0 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
10647 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]");
10648 0 : return -1;
10649 : }
10650 : {
10651 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
10652 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
10653 : unsigned long long test_var;
10654 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
10655 0 : if (PyErr_Occurred() != NULL) {
10656 0 : return -1;
10657 : }
10658 0 : if (test_var > uint_max) {
10659 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10660 : PyLong_Type.tp_name, uint_max, test_var);
10661 0 : return -1;
10662 : }
10663 0 : object->data[data_cntr_1] = test_var;
10664 : } else {
10665 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10666 : PyLong_Type.tp_name);
10667 0 : return -1;
10668 : }
10669 : }
10670 : }
10671 : }
10672 : }
10673 0 : return 0;
10674 : }
10675 :
10676 : static PyGetSetDef py_lsa_ForestTrustBinaryData_getsetters[] = {
10677 : {
10678 : .name = discard_const_p(char, "length"),
10679 : .get = py_lsa_ForestTrustBinaryData_get_length,
10680 : .set = py_lsa_ForestTrustBinaryData_set_length,
10681 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
10682 : },
10683 : {
10684 : .name = discard_const_p(char, "data"),
10685 : .get = py_lsa_ForestTrustBinaryData_get_data,
10686 : .set = py_lsa_ForestTrustBinaryData_set_data,
10687 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10688 : },
10689 : { .name = NULL }
10690 : };
10691 :
10692 0 : static PyObject *py_lsa_ForestTrustBinaryData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10693 : {
10694 0 : return pytalloc_new(struct lsa_ForestTrustBinaryData, type);
10695 : }
10696 :
10697 :
10698 : static PyTypeObject lsa_ForestTrustBinaryData_Type = {
10699 : PyVarObject_HEAD_INIT(NULL, 0)
10700 : .tp_name = "lsa.ForestTrustBinaryData",
10701 : .tp_getset = py_lsa_ForestTrustBinaryData_getsetters,
10702 : .tp_methods = NULL,
10703 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10704 : .tp_new = py_lsa_ForestTrustBinaryData_new,
10705 : };
10706 :
10707 :
10708 314 : static PyObject *py_lsa_ForestTrustDomainInfo_get_domain_sid(PyObject *obj, void *closure)
10709 : {
10710 314 : struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(obj);
10711 : PyObject *py_domain_sid;
10712 314 : if (object->domain_sid == NULL) {
10713 0 : Py_RETURN_NONE;
10714 : }
10715 314 : if (object->domain_sid == NULL) {
10716 0 : py_domain_sid = Py_None;
10717 0 : Py_INCREF(py_domain_sid);
10718 : } else {
10719 314 : py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->domain_sid, object->domain_sid);
10720 : }
10721 314 : return py_domain_sid;
10722 : }
10723 :
10724 0 : static int py_lsa_ForestTrustDomainInfo_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
10725 : {
10726 0 : struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(py_obj);
10727 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domain_sid));
10728 0 : if (value == NULL) {
10729 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_sid");
10730 0 : return -1;
10731 : }
10732 0 : if (value == Py_None) {
10733 0 : object->domain_sid = NULL;
10734 : } else {
10735 0 : object->domain_sid = NULL;
10736 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
10737 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10738 0 : PyErr_NoMemory();
10739 0 : return -1;
10740 : }
10741 0 : object->domain_sid = (struct dom_sid *)pytalloc_get_ptr(value);
10742 : }
10743 0 : return 0;
10744 : }
10745 :
10746 306 : static PyObject *py_lsa_ForestTrustDomainInfo_get_dns_domain_name(PyObject *obj, void *closure)
10747 : {
10748 306 : struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(obj);
10749 : PyObject *py_dns_domain_name;
10750 306 : py_dns_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_domain_name);
10751 306 : return py_dns_domain_name;
10752 : }
10753 :
10754 0 : static int py_lsa_ForestTrustDomainInfo_set_dns_domain_name(PyObject *py_obj, PyObject *value, void *closure)
10755 : {
10756 0 : struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(py_obj);
10757 0 : if (value == NULL) {
10758 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain_name");
10759 0 : return -1;
10760 : }
10761 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
10762 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10763 0 : PyErr_NoMemory();
10764 0 : return -1;
10765 : }
10766 0 : object->dns_domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
10767 0 : return 0;
10768 : }
10769 :
10770 314 : static PyObject *py_lsa_ForestTrustDomainInfo_get_netbios_domain_name(PyObject *obj, void *closure)
10771 : {
10772 314 : struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(obj);
10773 : PyObject *py_netbios_domain_name;
10774 314 : py_netbios_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->netbios_domain_name);
10775 314 : return py_netbios_domain_name;
10776 : }
10777 :
10778 0 : static int py_lsa_ForestTrustDomainInfo_set_netbios_domain_name(PyObject *py_obj, PyObject *value, void *closure)
10779 : {
10780 0 : struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(py_obj);
10781 0 : if (value == NULL) {
10782 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_domain_name");
10783 0 : return -1;
10784 : }
10785 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
10786 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10787 0 : PyErr_NoMemory();
10788 0 : return -1;
10789 : }
10790 0 : object->netbios_domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
10791 0 : return 0;
10792 : }
10793 :
10794 : static PyGetSetDef py_lsa_ForestTrustDomainInfo_getsetters[] = {
10795 : {
10796 : .name = discard_const_p(char, "domain_sid"),
10797 : .get = py_lsa_ForestTrustDomainInfo_get_domain_sid,
10798 : .set = py_lsa_ForestTrustDomainInfo_set_domain_sid,
10799 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
10800 : },
10801 : {
10802 : .name = discard_const_p(char, "dns_domain_name"),
10803 : .get = py_lsa_ForestTrustDomainInfo_get_dns_domain_name,
10804 : .set = py_lsa_ForestTrustDomainInfo_set_dns_domain_name,
10805 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
10806 : },
10807 : {
10808 : .name = discard_const_p(char, "netbios_domain_name"),
10809 : .get = py_lsa_ForestTrustDomainInfo_get_netbios_domain_name,
10810 : .set = py_lsa_ForestTrustDomainInfo_set_netbios_domain_name,
10811 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
10812 : },
10813 : { .name = NULL }
10814 : };
10815 :
10816 0 : static PyObject *py_lsa_ForestTrustDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10817 : {
10818 0 : return pytalloc_new(struct lsa_ForestTrustDomainInfo, type);
10819 : }
10820 :
10821 :
10822 : static PyTypeObject lsa_ForestTrustDomainInfo_Type = {
10823 : PyVarObject_HEAD_INIT(NULL, 0)
10824 : .tp_name = "lsa.ForestTrustDomainInfo",
10825 : .tp_getset = py_lsa_ForestTrustDomainInfo_getsetters,
10826 : .tp_methods = NULL,
10827 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10828 : .tp_new = py_lsa_ForestTrustDomainInfo_new,
10829 : };
10830 :
10831 1922 : static PyObject *py_import_lsa_ForestTrustData(TALLOC_CTX *mem_ctx, int level, union lsa_ForestTrustData *in)
10832 : {
10833 : PyObject *ret;
10834 :
10835 1922 : switch (level) {
10836 1520 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME:
10837 1520 : ret = pytalloc_reference_ex(&lsa_StringLarge_Type, mem_ctx, &in->top_level_name);
10838 1520 : return ret;
10839 :
10840 80 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX:
10841 80 : ret = pytalloc_reference_ex(&lsa_StringLarge_Type, mem_ctx, &in->top_level_name_ex);
10842 80 : return ret;
10843 :
10844 322 : case LSA_FOREST_TRUST_DOMAIN_INFO:
10845 322 : ret = pytalloc_reference_ex(&lsa_ForestTrustDomainInfo_Type, mem_ctx, &in->domain_info);
10846 322 : return ret;
10847 :
10848 0 : default:
10849 0 : ret = pytalloc_reference_ex(&lsa_ForestTrustBinaryData_Type, mem_ctx, &in->data);
10850 0 : return ret;
10851 :
10852 : }
10853 : PyErr_SetString(PyExc_TypeError, "unknown union level");
10854 : return NULL;
10855 : }
10856 :
10857 0 : static union lsa_ForestTrustData *py_export_lsa_ForestTrustData(TALLOC_CTX *mem_ctx, int level, PyObject *in)
10858 : {
10859 0 : union lsa_ForestTrustData *ret = talloc_zero(mem_ctx, union lsa_ForestTrustData);
10860 0 : switch (level) {
10861 0 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME:
10862 0 : if (in == NULL) {
10863 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->top_level_name");
10864 0 : talloc_free(ret); return NULL;
10865 : }
10866 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, in, talloc_free(ret); return NULL;);
10867 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
10868 0 : PyErr_NoMemory();
10869 0 : talloc_free(ret); return NULL;
10870 : }
10871 0 : ret->top_level_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(in);
10872 0 : break;
10873 :
10874 0 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX:
10875 0 : if (in == NULL) {
10876 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->top_level_name_ex");
10877 0 : talloc_free(ret); return NULL;
10878 : }
10879 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, in, talloc_free(ret); return NULL;);
10880 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
10881 0 : PyErr_NoMemory();
10882 0 : talloc_free(ret); return NULL;
10883 : }
10884 0 : ret->top_level_name_ex = *(struct lsa_StringLarge *)pytalloc_get_ptr(in);
10885 0 : break;
10886 :
10887 0 : case LSA_FOREST_TRUST_DOMAIN_INFO:
10888 0 : if (in == NULL) {
10889 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain_info");
10890 0 : talloc_free(ret); return NULL;
10891 : }
10892 0 : PY_CHECK_TYPE(&lsa_ForestTrustDomainInfo_Type, in, talloc_free(ret); return NULL;);
10893 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
10894 0 : PyErr_NoMemory();
10895 0 : talloc_free(ret); return NULL;
10896 : }
10897 0 : ret->domain_info = *(struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(in);
10898 0 : break;
10899 :
10900 0 : default:
10901 0 : if (in == NULL) {
10902 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->data");
10903 0 : talloc_free(ret); return NULL;
10904 : }
10905 0 : PY_CHECK_TYPE(&lsa_ForestTrustBinaryData_Type, in, talloc_free(ret); return NULL;);
10906 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
10907 0 : PyErr_NoMemory();
10908 0 : talloc_free(ret); return NULL;
10909 : }
10910 0 : ret->data = *(struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(in);
10911 0 : break;
10912 :
10913 : }
10914 :
10915 0 : return ret;
10916 : }
10917 :
10918 1922 : static PyObject *py_lsa_ForestTrustData_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10919 : {
10920 1922 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
10921 1922 : PyObject *mem_ctx_obj = NULL;
10922 1922 : TALLOC_CTX *mem_ctx = NULL;
10923 1922 : int level = 0;
10924 1922 : PyObject *in_obj = NULL;
10925 1922 : union lsa_ForestTrustData *in = NULL;
10926 :
10927 1922 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
10928 : discard_const_p(char *, kwnames),
10929 : &mem_ctx_obj,
10930 : &level,
10931 : &in_obj)) {
10932 0 : return NULL;
10933 : }
10934 1922 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
10935 1922 : if (mem_ctx == NULL) {
10936 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
10937 0 : return NULL;
10938 : }
10939 1922 : in = (union lsa_ForestTrustData *)pytalloc_get_ptr(in_obj);
10940 1922 : if (in == NULL) {
10941 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_ForestTrustData!");
10942 0 : return NULL;
10943 : }
10944 :
10945 1922 : return py_import_lsa_ForestTrustData(mem_ctx, level, in);
10946 : }
10947 :
10948 0 : static PyObject *py_lsa_ForestTrustData_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10949 : {
10950 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
10951 0 : PyObject *mem_ctx_obj = NULL;
10952 0 : TALLOC_CTX *mem_ctx = NULL;
10953 0 : int level = 0;
10954 0 : PyObject *in = NULL;
10955 0 : union lsa_ForestTrustData *out = NULL;
10956 :
10957 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
10958 : discard_const_p(char *, kwnames),
10959 : &mem_ctx_obj,
10960 : &level,
10961 : &in)) {
10962 0 : return NULL;
10963 : }
10964 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
10965 0 : if (mem_ctx == NULL) {
10966 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
10967 0 : return NULL;
10968 : }
10969 :
10970 0 : out = py_export_lsa_ForestTrustData(mem_ctx, level, in);
10971 0 : if (out == NULL) {
10972 0 : return NULL;
10973 : }
10974 :
10975 0 : return pytalloc_GenericObject_reference(out);
10976 : }
10977 :
10978 : static PyMethodDef py_lsa_ForestTrustData_methods[] = {
10979 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_ForestTrustData_import),
10980 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
10981 : "T.__import__(mem_ctx, level, in) => ret." },
10982 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_ForestTrustData_export),
10983 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
10984 : "T.__export__(mem_ctx, level, in) => ret." },
10985 : { NULL, NULL, 0, NULL }
10986 : };
10987 :
10988 0 : static PyObject *py_lsa_ForestTrustData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10989 : {
10990 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
10991 0 : return NULL;
10992 : }
10993 :
10994 :
10995 : static PyTypeObject lsa_ForestTrustData_Type = {
10996 : PyVarObject_HEAD_INIT(NULL, 0)
10997 : .tp_name = "lsa.ForestTrustData",
10998 : .tp_getset = NULL,
10999 : .tp_methods = py_lsa_ForestTrustData_methods,
11000 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11001 : .tp_new = py_lsa_ForestTrustData_new,
11002 : };
11003 :
11004 :
11005 1862 : static PyObject *py_lsa_ForestTrustRecord_get_flags(PyObject *obj, void *closure)
11006 : {
11007 1862 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
11008 : PyObject *py_flags;
11009 1862 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
11010 1862 : return py_flags;
11011 : }
11012 :
11013 52 : static int py_lsa_ForestTrustRecord_set_flags(PyObject *py_obj, PyObject *value, void *closure)
11014 : {
11015 52 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
11016 52 : if (value == NULL) {
11017 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
11018 0 : return -1;
11019 : }
11020 : {
11021 52 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
11022 52 : if (PyLong_Check(value)) {
11023 : unsigned long long test_var;
11024 52 : test_var = PyLong_AsUnsignedLongLong(value);
11025 52 : if (PyErr_Occurred() != NULL) {
11026 0 : return -1;
11027 : }
11028 52 : if (test_var > uint_max) {
11029 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11030 : PyLong_Type.tp_name, uint_max, test_var);
11031 0 : return -1;
11032 : }
11033 52 : object->flags = test_var;
11034 : } else {
11035 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11036 : PyLong_Type.tp_name);
11037 0 : return -1;
11038 : }
11039 : }
11040 52 : return 0;
11041 : }
11042 :
11043 2766 : static PyObject *py_lsa_ForestTrustRecord_get_type(PyObject *obj, void *closure)
11044 : {
11045 2766 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
11046 : PyObject *py_type;
11047 2766 : py_type = PyLong_FromLong((uint16_t)object->type);
11048 2766 : return py_type;
11049 : }
11050 :
11051 8 : static int py_lsa_ForestTrustRecord_set_type(PyObject *py_obj, PyObject *value, void *closure)
11052 : {
11053 8 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
11054 8 : if (value == NULL) {
11055 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
11056 0 : return -1;
11057 : }
11058 : {
11059 8 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
11060 8 : if (PyLong_Check(value)) {
11061 : unsigned long long test_var;
11062 8 : test_var = PyLong_AsUnsignedLongLong(value);
11063 8 : if (PyErr_Occurred() != NULL) {
11064 0 : return -1;
11065 : }
11066 8 : if (test_var > uint_max) {
11067 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11068 : PyLong_Type.tp_name, uint_max, test_var);
11069 0 : return -1;
11070 : }
11071 8 : object->type = test_var;
11072 : } else {
11073 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11074 : PyLong_Type.tp_name);
11075 0 : return -1;
11076 : }
11077 : }
11078 8 : return 0;
11079 : }
11080 :
11081 0 : static PyObject *py_lsa_ForestTrustRecord_get_time(PyObject *obj, void *closure)
11082 : {
11083 0 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
11084 : PyObject *py_time;
11085 0 : py_time = PyLong_FromUnsignedLongLong(object->time);
11086 0 : return py_time;
11087 : }
11088 :
11089 40 : static int py_lsa_ForestTrustRecord_set_time(PyObject *py_obj, PyObject *value, void *closure)
11090 : {
11091 40 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
11092 40 : if (value == NULL) {
11093 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->time");
11094 0 : return -1;
11095 : }
11096 : {
11097 40 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
11098 40 : if (PyLong_Check(value)) {
11099 : unsigned long long test_var;
11100 40 : test_var = PyLong_AsUnsignedLongLong(value);
11101 40 : if (PyErr_Occurred() != NULL) {
11102 0 : return -1;
11103 : }
11104 40 : if (test_var > uint_max) {
11105 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11106 : PyLong_Type.tp_name, uint_max, test_var);
11107 0 : return -1;
11108 : }
11109 40 : object->time = test_var;
11110 : } else {
11111 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11112 : PyLong_Type.tp_name);
11113 0 : return -1;
11114 : }
11115 : }
11116 40 : return 0;
11117 : }
11118 :
11119 1922 : static PyObject *py_lsa_ForestTrustRecord_get_forest_trust_data(PyObject *obj, void *closure)
11120 : {
11121 1922 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
11122 : PyObject *py_forest_trust_data;
11123 1922 : py_forest_trust_data = pyrpc_import_union(&lsa_ForestTrustData_Type, pytalloc_get_mem_ctx(obj), object->type, &object->forest_trust_data, "union lsa_ForestTrustData");
11124 1922 : if (py_forest_trust_data == NULL) {
11125 0 : return NULL;
11126 : }
11127 1922 : return py_forest_trust_data;
11128 : }
11129 :
11130 0 : static int py_lsa_ForestTrustRecord_set_forest_trust_data(PyObject *py_obj, PyObject *value, void *closure)
11131 : {
11132 0 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
11133 0 : if (value == NULL) {
11134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest_trust_data");
11135 0 : return -1;
11136 : }
11137 : {
11138 : union lsa_ForestTrustData *forest_trust_data_switch_0;
11139 0 : forest_trust_data_switch_0 = (union lsa_ForestTrustData *)pyrpc_export_union(&lsa_ForestTrustData_Type, pytalloc_get_mem_ctx(py_obj), object->type, value, "union lsa_ForestTrustData");
11140 0 : if (forest_trust_data_switch_0 == NULL) {
11141 0 : return -1;
11142 : }
11143 0 : object->forest_trust_data = *forest_trust_data_switch_0;
11144 : }
11145 0 : return 0;
11146 : }
11147 :
11148 : static PyGetSetDef py_lsa_ForestTrustRecord_getsetters[] = {
11149 : {
11150 : .name = discard_const_p(char, "flags"),
11151 : .get = py_lsa_ForestTrustRecord_get_flags,
11152 : .set = py_lsa_ForestTrustRecord_set_flags,
11153 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordFlags")
11154 : },
11155 : {
11156 : .name = discard_const_p(char, "type"),
11157 : .get = py_lsa_ForestTrustRecord_get_type,
11158 : .set = py_lsa_ForestTrustRecord_set_type,
11159 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordType")
11160 : },
11161 : {
11162 : .name = discard_const_p(char, "time"),
11163 : .get = py_lsa_ForestTrustRecord_get_time,
11164 : .set = py_lsa_ForestTrustRecord_set_time,
11165 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
11166 : },
11167 : {
11168 : .name = discard_const_p(char, "forest_trust_data"),
11169 : .get = py_lsa_ForestTrustRecord_get_forest_trust_data,
11170 : .set = py_lsa_ForestTrustRecord_set_forest_trust_data,
11171 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustData")
11172 : },
11173 : { .name = NULL }
11174 : };
11175 :
11176 8 : static PyObject *py_lsa_ForestTrustRecord_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11177 : {
11178 8 : return pytalloc_new(struct lsa_ForestTrustRecord, type);
11179 : }
11180 :
11181 :
11182 : static PyTypeObject lsa_ForestTrustRecord_Type = {
11183 : PyVarObject_HEAD_INIT(NULL, 0)
11184 : .tp_name = "lsa.ForestTrustRecord",
11185 : .tp_getset = py_lsa_ForestTrustRecord_getsetters,
11186 : .tp_methods = NULL,
11187 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11188 : .tp_new = py_lsa_ForestTrustRecord_new,
11189 : };
11190 :
11191 :
11192 0 : static PyObject *py_lsa_ForestTrustInformation_get_count(PyObject *obj, void *closure)
11193 : {
11194 0 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(obj);
11195 : PyObject *py_count;
11196 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
11197 0 : return py_count;
11198 : }
11199 :
11200 64 : static int py_lsa_ForestTrustInformation_set_count(PyObject *py_obj, PyObject *value, void *closure)
11201 : {
11202 64 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
11203 64 : if (value == NULL) {
11204 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
11205 0 : return -1;
11206 : }
11207 : {
11208 64 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
11209 64 : if (PyLong_Check(value)) {
11210 : unsigned long long test_var;
11211 64 : test_var = PyLong_AsUnsignedLongLong(value);
11212 64 : if (PyErr_Occurred() != NULL) {
11213 0 : return -1;
11214 : }
11215 64 : if (test_var > uint_max) {
11216 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11217 : PyLong_Type.tp_name, uint_max, test_var);
11218 0 : return -1;
11219 : }
11220 64 : object->count = test_var;
11221 : } else {
11222 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11223 : PyLong_Type.tp_name);
11224 0 : return -1;
11225 : }
11226 : }
11227 64 : return 0;
11228 : }
11229 :
11230 840 : static PyObject *py_lsa_ForestTrustInformation_get_entries(PyObject *obj, void *closure)
11231 : {
11232 840 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(obj);
11233 : PyObject *py_entries;
11234 840 : if (object->entries == NULL) {
11235 0 : Py_RETURN_NONE;
11236 : }
11237 840 : if (object->entries == NULL) {
11238 0 : py_entries = Py_None;
11239 0 : Py_INCREF(py_entries);
11240 : } else {
11241 840 : py_entries = PyList_New(object->count);
11242 840 : if (py_entries == NULL) {
11243 0 : return NULL;
11244 : }
11245 : {
11246 : int entries_cntr_1;
11247 6060 : for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
11248 : PyObject *py_entries_1;
11249 5220 : if (object->entries[entries_cntr_1] == NULL) {
11250 0 : py_entries_1 = Py_None;
11251 0 : Py_INCREF(py_entries_1);
11252 : } else {
11253 5220 : py_entries_1 = pytalloc_reference_ex(&lsa_ForestTrustRecord_Type, object->entries[entries_cntr_1], object->entries[entries_cntr_1]);
11254 : }
11255 5220 : PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
11256 : }
11257 : }
11258 : }
11259 840 : return py_entries;
11260 : }
11261 :
11262 64 : static int py_lsa_ForestTrustInformation_set_entries(PyObject *py_obj, PyObject *value, void *closure)
11263 : {
11264 64 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
11265 64 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
11266 64 : if (value == NULL) {
11267 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries");
11268 0 : return -1;
11269 : }
11270 64 : if (value == Py_None) {
11271 0 : object->entries = NULL;
11272 : } else {
11273 64 : object->entries = NULL;
11274 64 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11275 : {
11276 : int entries_cntr_1;
11277 64 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
11278 64 : if (!object->entries) { return -1;; }
11279 64 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
11280 544 : for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
11281 480 : if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) {
11282 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]");
11283 0 : return -1;
11284 : }
11285 480 : if (PyList_GET_ITEM(value, entries_cntr_1) == Py_None) {
11286 0 : object->entries[entries_cntr_1] = NULL;
11287 : } else {
11288 480 : object->entries[entries_cntr_1] = NULL;
11289 480 : PY_CHECK_TYPE(&lsa_ForestTrustRecord_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
11290 480 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
11291 0 : PyErr_NoMemory();
11292 0 : return -1;
11293 : }
11294 480 : object->entries[entries_cntr_1] = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
11295 : }
11296 : }
11297 : }
11298 : }
11299 64 : return 0;
11300 : }
11301 :
11302 : static PyGetSetDef py_lsa_ForestTrustInformation_getsetters[] = {
11303 : {
11304 : .name = discard_const_p(char, "count"),
11305 : .get = py_lsa_ForestTrustInformation_get_count,
11306 : .set = py_lsa_ForestTrustInformation_set_count,
11307 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11308 : },
11309 : {
11310 : .name = discard_const_p(char, "entries"),
11311 : .get = py_lsa_ForestTrustInformation_get_entries,
11312 : .set = py_lsa_ForestTrustInformation_set_entries,
11313 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecord")
11314 : },
11315 : { .name = NULL }
11316 : };
11317 :
11318 48 : static PyObject *py_lsa_ForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11319 : {
11320 48 : return pytalloc_new(struct lsa_ForestTrustInformation, type);
11321 : }
11322 :
11323 0 : static PyObject *py_lsa_ForestTrustInformation_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11324 : {
11325 0 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
11326 0 : PyObject *ret = NULL;
11327 : DATA_BLOB blob;
11328 : enum ndr_err_code err;
11329 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
11330 0 : if (tmp_ctx == NULL) {
11331 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11332 0 : return NULL;
11333 : }
11334 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_ForestTrustInformation);
11335 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11336 0 : TALLOC_FREE(tmp_ctx);
11337 0 : PyErr_SetNdrError(err);
11338 0 : return NULL;
11339 : }
11340 :
11341 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11342 0 : TALLOC_FREE(tmp_ctx);
11343 0 : return ret;
11344 : }
11345 :
11346 0 : static PyObject *py_lsa_ForestTrustInformation_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11347 : {
11348 0 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
11349 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11350 0 : Py_ssize_t blob_length = 0;
11351 : enum ndr_err_code err;
11352 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11353 0 : PyObject *allow_remaining_obj = NULL;
11354 0 : bool allow_remaining = false;
11355 :
11356 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11357 : discard_const_p(char *, kwnames),
11358 : &blob.data, &blob_length,
11359 : &allow_remaining_obj)) {
11360 0 : return NULL;
11361 : }
11362 0 : blob.length = blob_length;
11363 :
11364 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11365 0 : allow_remaining = true;
11366 : }
11367 :
11368 0 : if (allow_remaining) {
11369 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustInformation);
11370 : } else {
11371 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustInformation);
11372 : }
11373 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11374 0 : PyErr_SetNdrError(err);
11375 0 : return NULL;
11376 : }
11377 :
11378 0 : Py_RETURN_NONE;
11379 : }
11380 :
11381 0 : static PyObject *py_lsa_ForestTrustInformation_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11382 : {
11383 0 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
11384 : PyObject *ret;
11385 : char *retstr;
11386 :
11387 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_ForestTrustInformation, "lsa_ForestTrustInformation", object);
11388 0 : ret = PyUnicode_FromString(retstr);
11389 0 : talloc_free(retstr);
11390 :
11391 0 : return ret;
11392 : }
11393 :
11394 : static PyMethodDef py_lsa_ForestTrustInformation_methods[] = {
11395 : { "__ndr_pack__", (PyCFunction)py_lsa_ForestTrustInformation_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11396 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_ForestTrustInformation_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
11397 : { "__ndr_print__", (PyCFunction)py_lsa_ForestTrustInformation_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11398 : { NULL, NULL, 0, NULL }
11399 : };
11400 :
11401 :
11402 : static PyTypeObject lsa_ForestTrustInformation_Type = {
11403 : PyVarObject_HEAD_INIT(NULL, 0)
11404 : .tp_name = "lsa.ForestTrustInformation",
11405 : .tp_getset = py_lsa_ForestTrustInformation_getsetters,
11406 : .tp_methods = py_lsa_ForestTrustInformation_methods,
11407 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11408 : .tp_new = py_lsa_ForestTrustInformation_new,
11409 : };
11410 :
11411 :
11412 224 : static PyObject *py_lsa_ForestTrustCollisionRecord_get_index(PyObject *obj, void *closure)
11413 : {
11414 224 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
11415 : PyObject *py_index;
11416 224 : py_index = PyLong_FromUnsignedLongLong((uint32_t)object->index);
11417 224 : return py_index;
11418 : }
11419 :
11420 0 : static int py_lsa_ForestTrustCollisionRecord_set_index(PyObject *py_obj, PyObject *value, void *closure)
11421 : {
11422 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11423 0 : if (value == NULL) {
11424 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->index");
11425 0 : return -1;
11426 : }
11427 : {
11428 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->index));
11429 0 : if (PyLong_Check(value)) {
11430 : unsigned long long test_var;
11431 0 : test_var = PyLong_AsUnsignedLongLong(value);
11432 0 : if (PyErr_Occurred() != NULL) {
11433 0 : return -1;
11434 : }
11435 0 : if (test_var > uint_max) {
11436 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11437 : PyLong_Type.tp_name, uint_max, test_var);
11438 0 : return -1;
11439 : }
11440 0 : object->index = test_var;
11441 : } else {
11442 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11443 : PyLong_Type.tp_name);
11444 0 : return -1;
11445 : }
11446 : }
11447 0 : return 0;
11448 : }
11449 :
11450 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_get_type(PyObject *obj, void *closure)
11451 : {
11452 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
11453 : PyObject *py_type;
11454 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
11455 0 : return py_type;
11456 : }
11457 :
11458 0 : static int py_lsa_ForestTrustCollisionRecord_set_type(PyObject *py_obj, PyObject *value, void *closure)
11459 : {
11460 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11461 0 : if (value == NULL) {
11462 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
11463 0 : return -1;
11464 : }
11465 : {
11466 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
11467 0 : if (PyLong_Check(value)) {
11468 : unsigned long long test_var;
11469 0 : test_var = PyLong_AsUnsignedLongLong(value);
11470 0 : if (PyErr_Occurred() != NULL) {
11471 0 : return -1;
11472 : }
11473 0 : if (test_var > uint_max) {
11474 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11475 : PyLong_Type.tp_name, uint_max, test_var);
11476 0 : return -1;
11477 : }
11478 0 : object->type = test_var;
11479 : } else {
11480 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11481 : PyLong_Type.tp_name);
11482 0 : return -1;
11483 : }
11484 : }
11485 0 : return 0;
11486 : }
11487 :
11488 32 : static PyObject *py_lsa_ForestTrustCollisionRecord_get_flags(PyObject *obj, void *closure)
11489 : {
11490 32 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
11491 : PyObject *py_flags;
11492 32 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
11493 32 : return py_flags;
11494 : }
11495 :
11496 0 : static int py_lsa_ForestTrustCollisionRecord_set_flags(PyObject *py_obj, PyObject *value, void *closure)
11497 : {
11498 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11499 0 : if (value == NULL) {
11500 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
11501 0 : return -1;
11502 : }
11503 : {
11504 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
11505 0 : if (PyLong_Check(value)) {
11506 : unsigned long long test_var;
11507 0 : test_var = PyLong_AsUnsignedLongLong(value);
11508 0 : if (PyErr_Occurred() != NULL) {
11509 0 : return -1;
11510 : }
11511 0 : if (test_var > uint_max) {
11512 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11513 : PyLong_Type.tp_name, uint_max, test_var);
11514 0 : return -1;
11515 : }
11516 0 : object->flags = test_var;
11517 : } else {
11518 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11519 : PyLong_Type.tp_name);
11520 0 : return -1;
11521 : }
11522 : }
11523 0 : return 0;
11524 : }
11525 :
11526 32 : static PyObject *py_lsa_ForestTrustCollisionRecord_get_name(PyObject *obj, void *closure)
11527 : {
11528 32 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
11529 : PyObject *py_name;
11530 32 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
11531 32 : return py_name;
11532 : }
11533 :
11534 0 : static int py_lsa_ForestTrustCollisionRecord_set_name(PyObject *py_obj, PyObject *value, void *closure)
11535 : {
11536 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11537 0 : if (value == NULL) {
11538 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
11539 0 : return -1;
11540 : }
11541 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
11542 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11543 0 : PyErr_NoMemory();
11544 0 : return -1;
11545 : }
11546 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
11547 0 : return 0;
11548 : }
11549 :
11550 : static PyGetSetDef py_lsa_ForestTrustCollisionRecord_getsetters[] = {
11551 : {
11552 : .name = discard_const_p(char, "index"),
11553 : .get = py_lsa_ForestTrustCollisionRecord_get_index,
11554 : .set = py_lsa_ForestTrustCollisionRecord_set_index,
11555 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11556 : },
11557 : {
11558 : .name = discard_const_p(char, "type"),
11559 : .get = py_lsa_ForestTrustCollisionRecord_get_type,
11560 : .set = py_lsa_ForestTrustCollisionRecord_set_type,
11561 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustCollisionRecordType")
11562 : },
11563 : {
11564 : .name = discard_const_p(char, "flags"),
11565 : .get = py_lsa_ForestTrustCollisionRecord_get_flags,
11566 : .set = py_lsa_ForestTrustCollisionRecord_set_flags,
11567 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordFlags")
11568 : },
11569 : {
11570 : .name = discard_const_p(char, "name"),
11571 : .get = py_lsa_ForestTrustCollisionRecord_get_name,
11572 : .set = py_lsa_ForestTrustCollisionRecord_set_name,
11573 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
11574 : },
11575 : { .name = NULL }
11576 : };
11577 :
11578 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11579 : {
11580 0 : return pytalloc_new(struct lsa_ForestTrustCollisionRecord, type);
11581 : }
11582 :
11583 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11584 : {
11585 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11586 0 : PyObject *ret = NULL;
11587 : DATA_BLOB blob;
11588 : enum ndr_err_code err;
11589 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
11590 0 : if (tmp_ctx == NULL) {
11591 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11592 0 : return NULL;
11593 : }
11594 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_ForestTrustCollisionRecord);
11595 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11596 0 : TALLOC_FREE(tmp_ctx);
11597 0 : PyErr_SetNdrError(err);
11598 0 : return NULL;
11599 : }
11600 :
11601 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11602 0 : TALLOC_FREE(tmp_ctx);
11603 0 : return ret;
11604 : }
11605 :
11606 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11607 : {
11608 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11609 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11610 0 : Py_ssize_t blob_length = 0;
11611 : enum ndr_err_code err;
11612 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11613 0 : PyObject *allow_remaining_obj = NULL;
11614 0 : bool allow_remaining = false;
11615 :
11616 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11617 : discard_const_p(char *, kwnames),
11618 : &blob.data, &blob_length,
11619 : &allow_remaining_obj)) {
11620 0 : return NULL;
11621 : }
11622 0 : blob.length = blob_length;
11623 :
11624 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11625 0 : allow_remaining = true;
11626 : }
11627 :
11628 0 : if (allow_remaining) {
11629 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionRecord);
11630 : } else {
11631 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionRecord);
11632 : }
11633 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11634 0 : PyErr_SetNdrError(err);
11635 0 : return NULL;
11636 : }
11637 :
11638 0 : Py_RETURN_NONE;
11639 : }
11640 :
11641 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11642 : {
11643 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11644 : PyObject *ret;
11645 : char *retstr;
11646 :
11647 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_ForestTrustCollisionRecord, "lsa_ForestTrustCollisionRecord", object);
11648 0 : ret = PyUnicode_FromString(retstr);
11649 0 : talloc_free(retstr);
11650 :
11651 0 : return ret;
11652 : }
11653 :
11654 : static PyMethodDef py_lsa_ForestTrustCollisionRecord_methods[] = {
11655 : { "__ndr_pack__", (PyCFunction)py_lsa_ForestTrustCollisionRecord_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11656 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_ForestTrustCollisionRecord_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
11657 : { "__ndr_print__", (PyCFunction)py_lsa_ForestTrustCollisionRecord_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11658 : { NULL, NULL, 0, NULL }
11659 : };
11660 :
11661 :
11662 : static PyTypeObject lsa_ForestTrustCollisionRecord_Type = {
11663 : PyVarObject_HEAD_INIT(NULL, 0)
11664 : .tp_name = "lsa.ForestTrustCollisionRecord",
11665 : .tp_getset = py_lsa_ForestTrustCollisionRecord_getsetters,
11666 : .tp_methods = py_lsa_ForestTrustCollisionRecord_methods,
11667 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11668 : .tp_new = py_lsa_ForestTrustCollisionRecord_new,
11669 : };
11670 :
11671 :
11672 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_get_count(PyObject *obj, void *closure)
11673 : {
11674 0 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(obj);
11675 : PyObject *py_count;
11676 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
11677 0 : return py_count;
11678 : }
11679 :
11680 0 : static int py_lsa_ForestTrustCollisionInfo_set_count(PyObject *py_obj, PyObject *value, void *closure)
11681 : {
11682 0 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
11683 0 : if (value == NULL) {
11684 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
11685 0 : return -1;
11686 : }
11687 : {
11688 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
11689 0 : if (PyLong_Check(value)) {
11690 : unsigned long long test_var;
11691 0 : test_var = PyLong_AsUnsignedLongLong(value);
11692 0 : if (PyErr_Occurred() != NULL) {
11693 0 : return -1;
11694 : }
11695 0 : if (test_var > uint_max) {
11696 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11697 : PyLong_Type.tp_name, uint_max, test_var);
11698 0 : return -1;
11699 : }
11700 0 : object->count = test_var;
11701 : } else {
11702 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11703 : PyLong_Type.tp_name);
11704 0 : return -1;
11705 : }
11706 : }
11707 0 : return 0;
11708 : }
11709 :
11710 112 : static PyObject *py_lsa_ForestTrustCollisionInfo_get_entries(PyObject *obj, void *closure)
11711 : {
11712 112 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(obj);
11713 : PyObject *py_entries;
11714 112 : if (object->entries == NULL) {
11715 0 : Py_RETURN_NONE;
11716 : }
11717 112 : if (object->entries == NULL) {
11718 0 : py_entries = Py_None;
11719 0 : Py_INCREF(py_entries);
11720 : } else {
11721 112 : py_entries = PyList_New(object->count);
11722 112 : if (py_entries == NULL) {
11723 0 : return NULL;
11724 : }
11725 : {
11726 : int entries_cntr_1;
11727 336 : for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
11728 : PyObject *py_entries_1;
11729 224 : if (object->entries[entries_cntr_1] == NULL) {
11730 0 : py_entries_1 = Py_None;
11731 0 : Py_INCREF(py_entries_1);
11732 : } else {
11733 224 : py_entries_1 = pytalloc_reference_ex(&lsa_ForestTrustCollisionRecord_Type, object->entries[entries_cntr_1], object->entries[entries_cntr_1]);
11734 : }
11735 224 : PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
11736 : }
11737 : }
11738 : }
11739 112 : return py_entries;
11740 : }
11741 :
11742 0 : static int py_lsa_ForestTrustCollisionInfo_set_entries(PyObject *py_obj, PyObject *value, void *closure)
11743 : {
11744 0 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
11745 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
11746 0 : if (value == NULL) {
11747 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries");
11748 0 : return -1;
11749 : }
11750 0 : if (value == Py_None) {
11751 0 : object->entries = NULL;
11752 : } else {
11753 0 : object->entries = NULL;
11754 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11755 : {
11756 : int entries_cntr_1;
11757 0 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
11758 0 : if (!object->entries) { return -1;; }
11759 0 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
11760 0 : for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
11761 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) {
11762 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]");
11763 0 : return -1;
11764 : }
11765 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == Py_None) {
11766 0 : object->entries[entries_cntr_1] = NULL;
11767 : } else {
11768 0 : object->entries[entries_cntr_1] = NULL;
11769 0 : PY_CHECK_TYPE(&lsa_ForestTrustCollisionRecord_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
11770 0 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
11771 0 : PyErr_NoMemory();
11772 0 : return -1;
11773 : }
11774 0 : object->entries[entries_cntr_1] = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
11775 : }
11776 : }
11777 : }
11778 : }
11779 0 : return 0;
11780 : }
11781 :
11782 : static PyGetSetDef py_lsa_ForestTrustCollisionInfo_getsetters[] = {
11783 : {
11784 : .name = discard_const_p(char, "count"),
11785 : .get = py_lsa_ForestTrustCollisionInfo_get_count,
11786 : .set = py_lsa_ForestTrustCollisionInfo_set_count,
11787 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11788 : },
11789 : {
11790 : .name = discard_const_p(char, "entries"),
11791 : .get = py_lsa_ForestTrustCollisionInfo_get_entries,
11792 : .set = py_lsa_ForestTrustCollisionInfo_set_entries,
11793 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustCollisionRecord")
11794 : },
11795 : { .name = NULL }
11796 : };
11797 :
11798 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11799 : {
11800 0 : return pytalloc_new(struct lsa_ForestTrustCollisionInfo, type);
11801 : }
11802 :
11803 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11804 : {
11805 0 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
11806 0 : PyObject *ret = NULL;
11807 : DATA_BLOB blob;
11808 : enum ndr_err_code err;
11809 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
11810 0 : if (tmp_ctx == NULL) {
11811 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11812 0 : return NULL;
11813 : }
11814 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_ForestTrustCollisionInfo);
11815 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11816 0 : TALLOC_FREE(tmp_ctx);
11817 0 : PyErr_SetNdrError(err);
11818 0 : return NULL;
11819 : }
11820 :
11821 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11822 0 : TALLOC_FREE(tmp_ctx);
11823 0 : return ret;
11824 : }
11825 :
11826 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11827 : {
11828 0 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
11829 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11830 0 : Py_ssize_t blob_length = 0;
11831 : enum ndr_err_code err;
11832 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11833 0 : PyObject *allow_remaining_obj = NULL;
11834 0 : bool allow_remaining = false;
11835 :
11836 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11837 : discard_const_p(char *, kwnames),
11838 : &blob.data, &blob_length,
11839 : &allow_remaining_obj)) {
11840 0 : return NULL;
11841 : }
11842 0 : blob.length = blob_length;
11843 :
11844 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11845 0 : allow_remaining = true;
11846 : }
11847 :
11848 0 : if (allow_remaining) {
11849 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionInfo);
11850 : } else {
11851 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionInfo);
11852 : }
11853 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11854 0 : PyErr_SetNdrError(err);
11855 0 : return NULL;
11856 : }
11857 :
11858 0 : Py_RETURN_NONE;
11859 : }
11860 :
11861 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11862 : {
11863 0 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
11864 : PyObject *ret;
11865 : char *retstr;
11866 :
11867 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_ForestTrustCollisionInfo, "lsa_ForestTrustCollisionInfo", object);
11868 0 : ret = PyUnicode_FromString(retstr);
11869 0 : talloc_free(retstr);
11870 :
11871 0 : return ret;
11872 : }
11873 :
11874 : static PyMethodDef py_lsa_ForestTrustCollisionInfo_methods[] = {
11875 : { "__ndr_pack__", (PyCFunction)py_lsa_ForestTrustCollisionInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11876 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_ForestTrustCollisionInfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
11877 : { "__ndr_print__", (PyCFunction)py_lsa_ForestTrustCollisionInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11878 : { NULL, NULL, 0, NULL }
11879 : };
11880 :
11881 :
11882 : static PyTypeObject lsa_ForestTrustCollisionInfo_Type = {
11883 : PyVarObject_HEAD_INIT(NULL, 0)
11884 : .tp_name = "lsa.ForestTrustCollisionInfo",
11885 : .tp_getset = py_lsa_ForestTrustCollisionInfo_getsetters,
11886 : .tp_methods = py_lsa_ForestTrustCollisionInfo_methods,
11887 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11888 : .tp_new = py_lsa_ForestTrustCollisionInfo_new,
11889 : };
11890 :
11891 :
11892 :
11893 0 : static PyObject *py_lsa_Close_in_get_handle(PyObject *obj, void *closure)
11894 : {
11895 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(obj);
11896 : PyObject *py_handle;
11897 0 : if (object->in.handle == NULL) {
11898 0 : Py_RETURN_NONE;
11899 : }
11900 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
11901 0 : return py_handle;
11902 : }
11903 :
11904 0 : static int py_lsa_Close_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
11905 : {
11906 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(py_obj);
11907 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
11908 0 : if (value == NULL) {
11909 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
11910 0 : return -1;
11911 : }
11912 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
11913 0 : if (object->in.handle == NULL) {
11914 0 : PyErr_NoMemory();
11915 0 : return -1;
11916 : }
11917 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
11918 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11919 0 : PyErr_NoMemory();
11920 0 : return -1;
11921 : }
11922 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
11923 0 : return 0;
11924 : }
11925 :
11926 0 : static PyObject *py_lsa_Close_out_get_handle(PyObject *obj, void *closure)
11927 : {
11928 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(obj);
11929 : PyObject *py_handle;
11930 0 : if (object->out.handle == NULL) {
11931 0 : Py_RETURN_NONE;
11932 : }
11933 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
11934 0 : return py_handle;
11935 : }
11936 :
11937 0 : static int py_lsa_Close_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
11938 : {
11939 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(py_obj);
11940 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
11941 0 : if (value == NULL) {
11942 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
11943 0 : return -1;
11944 : }
11945 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
11946 0 : if (object->out.handle == NULL) {
11947 0 : PyErr_NoMemory();
11948 0 : return -1;
11949 : }
11950 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
11951 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11952 0 : PyErr_NoMemory();
11953 0 : return -1;
11954 : }
11955 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
11956 0 : return 0;
11957 : }
11958 :
11959 0 : static PyObject *py_lsa_Close_get_result(PyObject *obj, void *closure)
11960 : {
11961 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(obj);
11962 : PyObject *py_result;
11963 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
11964 0 : return py_result;
11965 : }
11966 :
11967 0 : static int py_lsa_Close_set_result(PyObject *py_obj, PyObject *value, void *closure)
11968 : {
11969 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(py_obj);
11970 0 : if (value == NULL) {
11971 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
11972 0 : return -1;
11973 : }
11974 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
11975 0 : return 0;
11976 : }
11977 :
11978 : static PyGetSetDef py_lsa_Close_getsetters[] = {
11979 : {
11980 : .name = discard_const_p(char, "in_handle"),
11981 : .get = py_lsa_Close_in_get_handle,
11982 : .set = py_lsa_Close_in_set_handle,
11983 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
11984 : },
11985 : {
11986 : .name = discard_const_p(char, "out_handle"),
11987 : .get = py_lsa_Close_out_get_handle,
11988 : .set = py_lsa_Close_out_set_handle,
11989 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
11990 : },
11991 : {
11992 : .name = discard_const_p(char, "result"),
11993 : .get = py_lsa_Close_get_result,
11994 : .set = py_lsa_Close_set_result,
11995 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
11996 : },
11997 : { .name = NULL }
11998 : };
11999 :
12000 0 : static PyObject *py_lsa_Close_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12001 : {
12002 0 : PyObject *self = pytalloc_new(struct lsa_Close, type);
12003 0 : struct lsa_Close *_self = (struct lsa_Close *)pytalloc_get_ptr(self);
12004 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
12005 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
12006 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
12007 0 : return self;
12008 : }
12009 :
12010 0 : static PyObject *py_lsa_Close_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
12011 : {
12012 :
12013 :
12014 0 : return PyLong_FromLong(0);
12015 : }
12016 :
12017 0 : static PyObject *py_lsa_Close_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
12018 : {
12019 0 : const struct ndr_interface_call *call = NULL;
12020 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(py_obj);
12021 0 : PyObject *ret = NULL;
12022 0 : struct ndr_push *push = NULL;
12023 : DATA_BLOB blob;
12024 : enum ndr_err_code err;
12025 :
12026 0 : if (ndr_table_lsarpc.num_calls < 1) {
12027 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Close_ndr_pack");
12028 0 : return NULL;
12029 : }
12030 0 : call = &ndr_table_lsarpc.calls[0];
12031 :
12032 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
12033 0 : if (push == NULL) {
12034 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12035 0 : return NULL;
12036 : }
12037 :
12038 0 : push->flags |= ndr_push_flags;
12039 :
12040 0 : err = call->ndr_push(push, ndr_inout_flags, object);
12041 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12042 0 : TALLOC_FREE(push);
12043 0 : PyErr_SetNdrError(err);
12044 0 : return NULL;
12045 : }
12046 0 : blob = ndr_push_blob(push);
12047 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
12048 0 : TALLOC_FREE(push);
12049 0 : return ret;
12050 : }
12051 :
12052 0 : static PyObject *py_lsa_Close_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12053 : {
12054 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12055 0 : PyObject *bigendian_obj = NULL;
12056 0 : PyObject *ndr64_obj = NULL;
12057 0 : uint32_t ndr_push_flags = 0;
12058 :
12059 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
12060 : discard_const_p(char *, kwnames),
12061 : &bigendian_obj,
12062 : &ndr64_obj)) {
12063 0 : return NULL;
12064 : }
12065 :
12066 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12067 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12068 : }
12069 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12070 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12071 : }
12072 :
12073 0 : return py_lsa_Close_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
12074 : }
12075 :
12076 0 : static PyObject *py_lsa_Close_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12077 : {
12078 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12079 0 : PyObject *bigendian_obj = NULL;
12080 0 : PyObject *ndr64_obj = NULL;
12081 0 : uint32_t ndr_push_flags = 0;
12082 :
12083 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
12084 : discard_const_p(char *, kwnames),
12085 : &bigendian_obj,
12086 : &ndr64_obj)) {
12087 0 : return NULL;
12088 : }
12089 :
12090 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12091 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12092 : }
12093 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12094 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12095 : }
12096 :
12097 0 : return py_lsa_Close_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
12098 : }
12099 :
12100 0 : static PyObject *py_lsa_Close_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
12101 : {
12102 0 : const struct ndr_interface_call *call = NULL;
12103 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(py_obj);
12104 0 : struct ndr_pull *pull = NULL;
12105 : enum ndr_err_code err;
12106 :
12107 0 : if (ndr_table_lsarpc.num_calls < 1) {
12108 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Close_ndr_unpack");
12109 0 : return NULL;
12110 : }
12111 0 : call = &ndr_table_lsarpc.calls[0];
12112 :
12113 0 : pull = ndr_pull_init_blob(blob, object);
12114 0 : if (pull == NULL) {
12115 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12116 0 : return NULL;
12117 : }
12118 :
12119 0 : pull->flags |= ndr_pull_flags;
12120 :
12121 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
12122 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12123 0 : TALLOC_FREE(pull);
12124 0 : PyErr_SetNdrError(err);
12125 0 : return NULL;
12126 : }
12127 0 : if (!allow_remaining) {
12128 : uint32_t highest_ofs;
12129 :
12130 0 : if (pull->offset > pull->relative_highest_offset) {
12131 0 : highest_ofs = pull->offset;
12132 : } else {
12133 0 : highest_ofs = pull->relative_highest_offset;
12134 : }
12135 0 : if (highest_ofs < pull->data_size) {
12136 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
12137 : "not all bytes consumed ofs[%u] size[%u]",
12138 : highest_ofs, pull->data_size);
12139 0 : TALLOC_FREE(pull);
12140 0 : PyErr_SetNdrError(err);
12141 0 : return NULL;
12142 : }
12143 : }
12144 :
12145 0 : TALLOC_FREE(pull);
12146 0 : Py_RETURN_NONE;
12147 : }
12148 :
12149 0 : static PyObject *py_lsa_Close_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12150 : {
12151 : DATA_BLOB blob;
12152 0 : Py_ssize_t blob_length = 0;
12153 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12154 0 : PyObject *bigendian_obj = NULL;
12155 0 : PyObject *ndr64_obj = NULL;
12156 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12157 0 : PyObject *allow_remaining_obj = NULL;
12158 0 : bool allow_remaining = false;
12159 :
12160 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
12161 : discard_const_p(char *, kwnames),
12162 : &blob.data, &blob_length,
12163 : &bigendian_obj,
12164 : &ndr64_obj,
12165 : &allow_remaining_obj)) {
12166 0 : return NULL;
12167 : }
12168 0 : blob.length = blob_length;
12169 :
12170 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12171 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12172 : }
12173 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12174 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12175 : }
12176 :
12177 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12178 0 : allow_remaining = true;
12179 : }
12180 :
12181 0 : return py_lsa_Close_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
12182 : }
12183 :
12184 0 : static PyObject *py_lsa_Close_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12185 : {
12186 : DATA_BLOB blob;
12187 0 : Py_ssize_t blob_length = 0;
12188 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12189 0 : PyObject *bigendian_obj = NULL;
12190 0 : PyObject *ndr64_obj = NULL;
12191 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12192 0 : PyObject *allow_remaining_obj = NULL;
12193 0 : bool allow_remaining = false;
12194 :
12195 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
12196 : discard_const_p(char *, kwnames),
12197 : &blob.data, &blob_length,
12198 : &bigendian_obj,
12199 : &ndr64_obj,
12200 : &allow_remaining_obj)) {
12201 0 : return NULL;
12202 : }
12203 0 : blob.length = blob_length;
12204 :
12205 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12206 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12207 : }
12208 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12209 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12210 : }
12211 :
12212 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12213 0 : allow_remaining = true;
12214 : }
12215 :
12216 0 : return py_lsa_Close_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
12217 : }
12218 :
12219 0 : static PyObject *py_lsa_Close_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
12220 : {
12221 0 : const struct ndr_interface_call *call = NULL;
12222 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(py_obj);
12223 : PyObject *ret;
12224 : char *retstr;
12225 :
12226 0 : if (ndr_table_lsarpc.num_calls < 1) {
12227 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Close_ndr_print");
12228 0 : return NULL;
12229 : }
12230 0 : call = &ndr_table_lsarpc.calls[0];
12231 :
12232 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
12233 0 : ret = PyUnicode_FromString(retstr);
12234 0 : TALLOC_FREE(retstr);
12235 :
12236 0 : return ret;
12237 : }
12238 :
12239 0 : static PyObject *py_lsa_Close_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12240 : {
12241 0 : return py_lsa_Close_ndr_print(py_obj, "lsa_Close_in", NDR_IN);
12242 : }
12243 :
12244 0 : static PyObject *py_lsa_Close_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12245 : {
12246 0 : return py_lsa_Close_ndr_print(py_obj, "lsa_Close_out", NDR_OUT);
12247 : }
12248 :
12249 : static PyMethodDef py_lsa_Close_methods[] = {
12250 : { "opnum", (PyCFunction)py_lsa_Close_ndr_opnum, METH_NOARGS|METH_CLASS,
12251 : "lsa.Close.opnum() -> 0 (0x00) " },
12252 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Close_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
12253 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
12254 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Close_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
12255 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
12256 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Close_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
12257 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
12258 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Close_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
12259 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
12260 : { "__ndr_print_in__", (PyCFunction)py_lsa_Close_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
12261 : { "__ndr_print_out__", (PyCFunction)py_lsa_Close_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
12262 : { NULL, NULL, 0, NULL }
12263 : };
12264 :
12265 :
12266 : static PyTypeObject lsa_Close_Type = {
12267 : PyVarObject_HEAD_INIT(NULL, 0)
12268 : .tp_name = "lsa.Close",
12269 : .tp_getset = py_lsa_Close_getsetters,
12270 : .tp_methods = py_lsa_Close_methods,
12271 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12272 : .tp_new = py_lsa_Close_new,
12273 : };
12274 :
12275 23 : static bool pack_py_lsa_Close_args_in(PyObject *args, PyObject *kwargs, struct lsa_Close *r)
12276 : {
12277 : PyObject *py_handle;
12278 23 : const char *kwnames[] = {
12279 : "handle", NULL
12280 : };
12281 :
12282 23 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_Close", discard_const_p(char *, kwnames), &py_handle)) {
12283 0 : return false;
12284 : }
12285 :
12286 23 : if (py_handle == NULL) {
12287 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
12288 0 : return false;
12289 : }
12290 23 : r->in.handle = talloc_ptrtype(r, r->in.handle);
12291 23 : if (r->in.handle == NULL) {
12292 0 : PyErr_NoMemory();
12293 0 : return false;
12294 : }
12295 23 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12296 23 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12297 0 : PyErr_NoMemory();
12298 0 : return false;
12299 : }
12300 23 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12301 23 : return true;
12302 : }
12303 :
12304 23 : static PyObject *unpack_py_lsa_Close_args_out(struct lsa_Close *r)
12305 : {
12306 : PyObject *result;
12307 : PyObject *py_handle;
12308 23 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
12309 23 : result = py_handle;
12310 23 : if (NT_STATUS_IS_ERR(r->out.result)) {
12311 0 : PyErr_SetNTSTATUS(r->out.result);
12312 0 : return NULL;
12313 : }
12314 :
12315 23 : return result;
12316 : }
12317 :
12318 :
12319 0 : static PyObject *py_lsa_Delete_in_get_handle(PyObject *obj, void *closure)
12320 : {
12321 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(obj);
12322 : PyObject *py_handle;
12323 0 : if (object->in.handle == NULL) {
12324 0 : Py_RETURN_NONE;
12325 : }
12326 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
12327 0 : return py_handle;
12328 : }
12329 :
12330 0 : static int py_lsa_Delete_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
12331 : {
12332 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(py_obj);
12333 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
12334 0 : if (value == NULL) {
12335 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
12336 0 : return -1;
12337 : }
12338 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
12339 0 : if (object->in.handle == NULL) {
12340 0 : PyErr_NoMemory();
12341 0 : return -1;
12342 : }
12343 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
12344 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12345 0 : PyErr_NoMemory();
12346 0 : return -1;
12347 : }
12348 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
12349 0 : return 0;
12350 : }
12351 :
12352 0 : static PyObject *py_lsa_Delete_get_result(PyObject *obj, void *closure)
12353 : {
12354 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(obj);
12355 : PyObject *py_result;
12356 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
12357 0 : return py_result;
12358 : }
12359 :
12360 0 : static int py_lsa_Delete_set_result(PyObject *py_obj, PyObject *value, void *closure)
12361 : {
12362 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(py_obj);
12363 0 : if (value == NULL) {
12364 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
12365 0 : return -1;
12366 : }
12367 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
12368 0 : return 0;
12369 : }
12370 :
12371 : static PyGetSetDef py_lsa_Delete_getsetters[] = {
12372 : {
12373 : .name = discard_const_p(char, "in_handle"),
12374 : .get = py_lsa_Delete_in_get_handle,
12375 : .set = py_lsa_Delete_in_set_handle,
12376 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
12377 : },
12378 : {
12379 : .name = discard_const_p(char, "result"),
12380 : .get = py_lsa_Delete_get_result,
12381 : .set = py_lsa_Delete_set_result,
12382 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
12383 : },
12384 : { .name = NULL }
12385 : };
12386 :
12387 0 : static PyObject *py_lsa_Delete_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12388 : {
12389 0 : PyObject *self = pytalloc_new(struct lsa_Delete, type);
12390 0 : struct lsa_Delete *_self = (struct lsa_Delete *)pytalloc_get_ptr(self);
12391 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
12392 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
12393 0 : return self;
12394 : }
12395 :
12396 0 : static PyObject *py_lsa_Delete_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
12397 : {
12398 :
12399 :
12400 0 : return PyLong_FromLong(1);
12401 : }
12402 :
12403 0 : static PyObject *py_lsa_Delete_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
12404 : {
12405 0 : const struct ndr_interface_call *call = NULL;
12406 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(py_obj);
12407 0 : PyObject *ret = NULL;
12408 0 : struct ndr_push *push = NULL;
12409 : DATA_BLOB blob;
12410 : enum ndr_err_code err;
12411 :
12412 0 : if (ndr_table_lsarpc.num_calls < 2) {
12413 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Delete_ndr_pack");
12414 0 : return NULL;
12415 : }
12416 0 : call = &ndr_table_lsarpc.calls[1];
12417 :
12418 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
12419 0 : if (push == NULL) {
12420 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12421 0 : return NULL;
12422 : }
12423 :
12424 0 : push->flags |= ndr_push_flags;
12425 :
12426 0 : err = call->ndr_push(push, ndr_inout_flags, object);
12427 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12428 0 : TALLOC_FREE(push);
12429 0 : PyErr_SetNdrError(err);
12430 0 : return NULL;
12431 : }
12432 0 : blob = ndr_push_blob(push);
12433 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
12434 0 : TALLOC_FREE(push);
12435 0 : return ret;
12436 : }
12437 :
12438 0 : static PyObject *py_lsa_Delete_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12439 : {
12440 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12441 0 : PyObject *bigendian_obj = NULL;
12442 0 : PyObject *ndr64_obj = NULL;
12443 0 : uint32_t ndr_push_flags = 0;
12444 :
12445 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
12446 : discard_const_p(char *, kwnames),
12447 : &bigendian_obj,
12448 : &ndr64_obj)) {
12449 0 : return NULL;
12450 : }
12451 :
12452 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12453 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12454 : }
12455 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12456 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12457 : }
12458 :
12459 0 : return py_lsa_Delete_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
12460 : }
12461 :
12462 0 : static PyObject *py_lsa_Delete_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12463 : {
12464 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12465 0 : PyObject *bigendian_obj = NULL;
12466 0 : PyObject *ndr64_obj = NULL;
12467 0 : uint32_t ndr_push_flags = 0;
12468 :
12469 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
12470 : discard_const_p(char *, kwnames),
12471 : &bigendian_obj,
12472 : &ndr64_obj)) {
12473 0 : return NULL;
12474 : }
12475 :
12476 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12477 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12478 : }
12479 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12480 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12481 : }
12482 :
12483 0 : return py_lsa_Delete_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
12484 : }
12485 :
12486 0 : static PyObject *py_lsa_Delete_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
12487 : {
12488 0 : const struct ndr_interface_call *call = NULL;
12489 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(py_obj);
12490 0 : struct ndr_pull *pull = NULL;
12491 : enum ndr_err_code err;
12492 :
12493 0 : if (ndr_table_lsarpc.num_calls < 2) {
12494 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Delete_ndr_unpack");
12495 0 : return NULL;
12496 : }
12497 0 : call = &ndr_table_lsarpc.calls[1];
12498 :
12499 0 : pull = ndr_pull_init_blob(blob, object);
12500 0 : if (pull == NULL) {
12501 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12502 0 : return NULL;
12503 : }
12504 :
12505 0 : pull->flags |= ndr_pull_flags;
12506 :
12507 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
12508 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12509 0 : TALLOC_FREE(pull);
12510 0 : PyErr_SetNdrError(err);
12511 0 : return NULL;
12512 : }
12513 0 : if (!allow_remaining) {
12514 : uint32_t highest_ofs;
12515 :
12516 0 : if (pull->offset > pull->relative_highest_offset) {
12517 0 : highest_ofs = pull->offset;
12518 : } else {
12519 0 : highest_ofs = pull->relative_highest_offset;
12520 : }
12521 0 : if (highest_ofs < pull->data_size) {
12522 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
12523 : "not all bytes consumed ofs[%u] size[%u]",
12524 : highest_ofs, pull->data_size);
12525 0 : TALLOC_FREE(pull);
12526 0 : PyErr_SetNdrError(err);
12527 0 : return NULL;
12528 : }
12529 : }
12530 :
12531 0 : TALLOC_FREE(pull);
12532 0 : Py_RETURN_NONE;
12533 : }
12534 :
12535 0 : static PyObject *py_lsa_Delete_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12536 : {
12537 : DATA_BLOB blob;
12538 0 : Py_ssize_t blob_length = 0;
12539 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12540 0 : PyObject *bigendian_obj = NULL;
12541 0 : PyObject *ndr64_obj = NULL;
12542 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12543 0 : PyObject *allow_remaining_obj = NULL;
12544 0 : bool allow_remaining = false;
12545 :
12546 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
12547 : discard_const_p(char *, kwnames),
12548 : &blob.data, &blob_length,
12549 : &bigendian_obj,
12550 : &ndr64_obj,
12551 : &allow_remaining_obj)) {
12552 0 : return NULL;
12553 : }
12554 0 : blob.length = blob_length;
12555 :
12556 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12557 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12558 : }
12559 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12560 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12561 : }
12562 :
12563 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12564 0 : allow_remaining = true;
12565 : }
12566 :
12567 0 : return py_lsa_Delete_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
12568 : }
12569 :
12570 0 : static PyObject *py_lsa_Delete_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12571 : {
12572 : DATA_BLOB blob;
12573 0 : Py_ssize_t blob_length = 0;
12574 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12575 0 : PyObject *bigendian_obj = NULL;
12576 0 : PyObject *ndr64_obj = NULL;
12577 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12578 0 : PyObject *allow_remaining_obj = NULL;
12579 0 : bool allow_remaining = false;
12580 :
12581 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
12582 : discard_const_p(char *, kwnames),
12583 : &blob.data, &blob_length,
12584 : &bigendian_obj,
12585 : &ndr64_obj,
12586 : &allow_remaining_obj)) {
12587 0 : return NULL;
12588 : }
12589 0 : blob.length = blob_length;
12590 :
12591 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12592 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12593 : }
12594 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12595 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12596 : }
12597 :
12598 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12599 0 : allow_remaining = true;
12600 : }
12601 :
12602 0 : return py_lsa_Delete_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
12603 : }
12604 :
12605 0 : static PyObject *py_lsa_Delete_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
12606 : {
12607 0 : const struct ndr_interface_call *call = NULL;
12608 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(py_obj);
12609 : PyObject *ret;
12610 : char *retstr;
12611 :
12612 0 : if (ndr_table_lsarpc.num_calls < 2) {
12613 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Delete_ndr_print");
12614 0 : return NULL;
12615 : }
12616 0 : call = &ndr_table_lsarpc.calls[1];
12617 :
12618 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
12619 0 : ret = PyUnicode_FromString(retstr);
12620 0 : TALLOC_FREE(retstr);
12621 :
12622 0 : return ret;
12623 : }
12624 :
12625 0 : static PyObject *py_lsa_Delete_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12626 : {
12627 0 : return py_lsa_Delete_ndr_print(py_obj, "lsa_Delete_in", NDR_IN);
12628 : }
12629 :
12630 0 : static PyObject *py_lsa_Delete_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12631 : {
12632 0 : return py_lsa_Delete_ndr_print(py_obj, "lsa_Delete_out", NDR_OUT);
12633 : }
12634 :
12635 : static PyMethodDef py_lsa_Delete_methods[] = {
12636 : { "opnum", (PyCFunction)py_lsa_Delete_ndr_opnum, METH_NOARGS|METH_CLASS,
12637 : "lsa.Delete.opnum() -> 1 (0x01) " },
12638 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Delete_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
12639 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
12640 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Delete_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
12641 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
12642 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Delete_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
12643 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
12644 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Delete_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
12645 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
12646 : { "__ndr_print_in__", (PyCFunction)py_lsa_Delete_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
12647 : { "__ndr_print_out__", (PyCFunction)py_lsa_Delete_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
12648 : { NULL, NULL, 0, NULL }
12649 : };
12650 :
12651 :
12652 : static PyTypeObject lsa_Delete_Type = {
12653 : PyVarObject_HEAD_INIT(NULL, 0)
12654 : .tp_name = "lsa.Delete",
12655 : .tp_getset = py_lsa_Delete_getsetters,
12656 : .tp_methods = py_lsa_Delete_methods,
12657 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12658 : .tp_new = py_lsa_Delete_new,
12659 : };
12660 :
12661 0 : static bool pack_py_lsa_Delete_args_in(PyObject *args, PyObject *kwargs, struct lsa_Delete *r)
12662 : {
12663 : PyObject *py_handle;
12664 0 : const char *kwnames[] = {
12665 : "handle", NULL
12666 : };
12667 :
12668 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_Delete", discard_const_p(char *, kwnames), &py_handle)) {
12669 0 : return false;
12670 : }
12671 :
12672 0 : if (py_handle == NULL) {
12673 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
12674 0 : return false;
12675 : }
12676 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
12677 0 : if (r->in.handle == NULL) {
12678 0 : PyErr_NoMemory();
12679 0 : return false;
12680 : }
12681 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12682 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12683 0 : PyErr_NoMemory();
12684 0 : return false;
12685 : }
12686 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12687 0 : return true;
12688 : }
12689 :
12690 0 : static PyObject *unpack_py_lsa_Delete_args_out(struct lsa_Delete *r)
12691 : {
12692 : PyObject *result;
12693 0 : result = Py_None;
12694 0 : Py_INCREF(result);
12695 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
12696 0 : PyErr_SetNTSTATUS(r->out.result);
12697 0 : return NULL;
12698 : }
12699 :
12700 0 : return result;
12701 : }
12702 :
12703 :
12704 0 : static PyObject *py_lsa_EnumPrivs_in_get_handle(PyObject *obj, void *closure)
12705 : {
12706 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(obj);
12707 : PyObject *py_handle;
12708 0 : if (object->in.handle == NULL) {
12709 0 : Py_RETURN_NONE;
12710 : }
12711 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
12712 0 : return py_handle;
12713 : }
12714 :
12715 0 : static int py_lsa_EnumPrivs_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
12716 : {
12717 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12718 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
12719 0 : if (value == NULL) {
12720 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
12721 0 : return -1;
12722 : }
12723 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
12724 0 : if (object->in.handle == NULL) {
12725 0 : PyErr_NoMemory();
12726 0 : return -1;
12727 : }
12728 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
12729 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12730 0 : PyErr_NoMemory();
12731 0 : return -1;
12732 : }
12733 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
12734 0 : return 0;
12735 : }
12736 :
12737 0 : static PyObject *py_lsa_EnumPrivs_in_get_resume_handle(PyObject *obj, void *closure)
12738 : {
12739 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(obj);
12740 : PyObject *py_resume_handle;
12741 0 : if (object->in.resume_handle == NULL) {
12742 0 : Py_RETURN_NONE;
12743 : }
12744 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
12745 0 : return py_resume_handle;
12746 : }
12747 :
12748 0 : static int py_lsa_EnumPrivs_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
12749 : {
12750 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12751 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
12752 0 : if (value == NULL) {
12753 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
12754 0 : return -1;
12755 : }
12756 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
12757 0 : if (object->in.resume_handle == NULL) {
12758 0 : PyErr_NoMemory();
12759 0 : return -1;
12760 : }
12761 : {
12762 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
12763 0 : if (PyLong_Check(value)) {
12764 : unsigned long long test_var;
12765 0 : test_var = PyLong_AsUnsignedLongLong(value);
12766 0 : if (PyErr_Occurred() != NULL) {
12767 0 : return -1;
12768 : }
12769 0 : if (test_var > uint_max) {
12770 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12771 : PyLong_Type.tp_name, uint_max, test_var);
12772 0 : return -1;
12773 : }
12774 0 : *object->in.resume_handle = test_var;
12775 : } else {
12776 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12777 : PyLong_Type.tp_name);
12778 0 : return -1;
12779 : }
12780 : }
12781 0 : return 0;
12782 : }
12783 :
12784 0 : static PyObject *py_lsa_EnumPrivs_out_get_resume_handle(PyObject *obj, void *closure)
12785 : {
12786 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(obj);
12787 : PyObject *py_resume_handle;
12788 0 : if (object->out.resume_handle == NULL) {
12789 0 : Py_RETURN_NONE;
12790 : }
12791 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
12792 0 : return py_resume_handle;
12793 : }
12794 :
12795 0 : static int py_lsa_EnumPrivs_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
12796 : {
12797 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12798 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
12799 0 : if (value == NULL) {
12800 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
12801 0 : return -1;
12802 : }
12803 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
12804 0 : if (object->out.resume_handle == NULL) {
12805 0 : PyErr_NoMemory();
12806 0 : return -1;
12807 : }
12808 : {
12809 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
12810 0 : if (PyLong_Check(value)) {
12811 : unsigned long long test_var;
12812 0 : test_var = PyLong_AsUnsignedLongLong(value);
12813 0 : if (PyErr_Occurred() != NULL) {
12814 0 : return -1;
12815 : }
12816 0 : if (test_var > uint_max) {
12817 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12818 : PyLong_Type.tp_name, uint_max, test_var);
12819 0 : return -1;
12820 : }
12821 0 : *object->out.resume_handle = test_var;
12822 : } else {
12823 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12824 : PyLong_Type.tp_name);
12825 0 : return -1;
12826 : }
12827 : }
12828 0 : return 0;
12829 : }
12830 :
12831 0 : static PyObject *py_lsa_EnumPrivs_out_get_privs(PyObject *obj, void *closure)
12832 : {
12833 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(obj);
12834 : PyObject *py_privs;
12835 0 : if (object->out.privs == NULL) {
12836 0 : Py_RETURN_NONE;
12837 : }
12838 0 : py_privs = pytalloc_reference_ex(&lsa_PrivArray_Type, object->out.privs, object->out.privs);
12839 0 : return py_privs;
12840 : }
12841 :
12842 0 : static int py_lsa_EnumPrivs_out_set_privs(PyObject *py_obj, PyObject *value, void *closure)
12843 : {
12844 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12845 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.privs));
12846 0 : if (value == NULL) {
12847 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.privs");
12848 0 : return -1;
12849 : }
12850 0 : object->out.privs = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.privs);
12851 0 : if (object->out.privs == NULL) {
12852 0 : PyErr_NoMemory();
12853 0 : return -1;
12854 : }
12855 0 : PY_CHECK_TYPE(&lsa_PrivArray_Type, value, return -1;);
12856 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12857 0 : PyErr_NoMemory();
12858 0 : return -1;
12859 : }
12860 0 : object->out.privs = (struct lsa_PrivArray *)pytalloc_get_ptr(value);
12861 0 : return 0;
12862 : }
12863 :
12864 0 : static PyObject *py_lsa_EnumPrivs_in_get_max_count(PyObject *obj, void *closure)
12865 : {
12866 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(obj);
12867 : PyObject *py_max_count;
12868 0 : py_max_count = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_count);
12869 0 : return py_max_count;
12870 : }
12871 :
12872 0 : static int py_lsa_EnumPrivs_in_set_max_count(PyObject *py_obj, PyObject *value, void *closure)
12873 : {
12874 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12875 0 : if (value == NULL) {
12876 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_count");
12877 0 : return -1;
12878 : }
12879 : {
12880 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_count));
12881 0 : if (PyLong_Check(value)) {
12882 : unsigned long long test_var;
12883 0 : test_var = PyLong_AsUnsignedLongLong(value);
12884 0 : if (PyErr_Occurred() != NULL) {
12885 0 : return -1;
12886 : }
12887 0 : if (test_var > uint_max) {
12888 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12889 : PyLong_Type.tp_name, uint_max, test_var);
12890 0 : return -1;
12891 : }
12892 0 : object->in.max_count = test_var;
12893 : } else {
12894 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12895 : PyLong_Type.tp_name);
12896 0 : return -1;
12897 : }
12898 : }
12899 0 : return 0;
12900 : }
12901 :
12902 0 : static PyObject *py_lsa_EnumPrivs_get_result(PyObject *obj, void *closure)
12903 : {
12904 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(obj);
12905 : PyObject *py_result;
12906 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
12907 0 : return py_result;
12908 : }
12909 :
12910 0 : static int py_lsa_EnumPrivs_set_result(PyObject *py_obj, PyObject *value, void *closure)
12911 : {
12912 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12913 0 : if (value == NULL) {
12914 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
12915 0 : return -1;
12916 : }
12917 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
12918 0 : return 0;
12919 : }
12920 :
12921 : static PyGetSetDef py_lsa_EnumPrivs_getsetters[] = {
12922 : {
12923 : .name = discard_const_p(char, "in_handle"),
12924 : .get = py_lsa_EnumPrivs_in_get_handle,
12925 : .set = py_lsa_EnumPrivs_in_set_handle,
12926 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
12927 : },
12928 : {
12929 : .name = discard_const_p(char, "in_resume_handle"),
12930 : .get = py_lsa_EnumPrivs_in_get_resume_handle,
12931 : .set = py_lsa_EnumPrivs_in_set_resume_handle,
12932 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12933 : },
12934 : {
12935 : .name = discard_const_p(char, "out_resume_handle"),
12936 : .get = py_lsa_EnumPrivs_out_get_resume_handle,
12937 : .set = py_lsa_EnumPrivs_out_set_resume_handle,
12938 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12939 : },
12940 : {
12941 : .name = discard_const_p(char, "out_privs"),
12942 : .get = py_lsa_EnumPrivs_out_get_privs,
12943 : .set = py_lsa_EnumPrivs_out_set_privs,
12944 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivArray")
12945 : },
12946 : {
12947 : .name = discard_const_p(char, "in_max_count"),
12948 : .get = py_lsa_EnumPrivs_in_get_max_count,
12949 : .set = py_lsa_EnumPrivs_in_set_max_count,
12950 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12951 : },
12952 : {
12953 : .name = discard_const_p(char, "result"),
12954 : .get = py_lsa_EnumPrivs_get_result,
12955 : .set = py_lsa_EnumPrivs_set_result,
12956 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
12957 : },
12958 : { .name = NULL }
12959 : };
12960 :
12961 0 : static PyObject *py_lsa_EnumPrivs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12962 : {
12963 0 : PyObject *self = pytalloc_new(struct lsa_EnumPrivs, type);
12964 0 : struct lsa_EnumPrivs *_self = (struct lsa_EnumPrivs *)pytalloc_get_ptr(self);
12965 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
12966 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
12967 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
12968 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
12969 0 : _self->out.privs = talloc_zero(mem_ctx, struct lsa_PrivArray);
12970 0 : return self;
12971 : }
12972 :
12973 0 : static PyObject *py_lsa_EnumPrivs_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
12974 : {
12975 :
12976 :
12977 0 : return PyLong_FromLong(2);
12978 : }
12979 :
12980 0 : static PyObject *py_lsa_EnumPrivs_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
12981 : {
12982 0 : const struct ndr_interface_call *call = NULL;
12983 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12984 0 : PyObject *ret = NULL;
12985 0 : struct ndr_push *push = NULL;
12986 : DATA_BLOB blob;
12987 : enum ndr_err_code err;
12988 :
12989 0 : if (ndr_table_lsarpc.num_calls < 3) {
12990 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivs_ndr_pack");
12991 0 : return NULL;
12992 : }
12993 0 : call = &ndr_table_lsarpc.calls[2];
12994 :
12995 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
12996 0 : if (push == NULL) {
12997 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12998 0 : return NULL;
12999 : }
13000 :
13001 0 : push->flags |= ndr_push_flags;
13002 :
13003 0 : err = call->ndr_push(push, ndr_inout_flags, object);
13004 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13005 0 : TALLOC_FREE(push);
13006 0 : PyErr_SetNdrError(err);
13007 0 : return NULL;
13008 : }
13009 0 : blob = ndr_push_blob(push);
13010 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
13011 0 : TALLOC_FREE(push);
13012 0 : return ret;
13013 : }
13014 :
13015 0 : static PyObject *py_lsa_EnumPrivs_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13016 : {
13017 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13018 0 : PyObject *bigendian_obj = NULL;
13019 0 : PyObject *ndr64_obj = NULL;
13020 0 : uint32_t ndr_push_flags = 0;
13021 :
13022 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
13023 : discard_const_p(char *, kwnames),
13024 : &bigendian_obj,
13025 : &ndr64_obj)) {
13026 0 : return NULL;
13027 : }
13028 :
13029 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13030 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13031 : }
13032 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13033 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13034 : }
13035 :
13036 0 : return py_lsa_EnumPrivs_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
13037 : }
13038 :
13039 0 : static PyObject *py_lsa_EnumPrivs_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13040 : {
13041 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13042 0 : PyObject *bigendian_obj = NULL;
13043 0 : PyObject *ndr64_obj = NULL;
13044 0 : uint32_t ndr_push_flags = 0;
13045 :
13046 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
13047 : discard_const_p(char *, kwnames),
13048 : &bigendian_obj,
13049 : &ndr64_obj)) {
13050 0 : return NULL;
13051 : }
13052 :
13053 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13054 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13055 : }
13056 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13057 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13058 : }
13059 :
13060 0 : return py_lsa_EnumPrivs_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
13061 : }
13062 :
13063 0 : static PyObject *py_lsa_EnumPrivs_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
13064 : {
13065 0 : const struct ndr_interface_call *call = NULL;
13066 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
13067 0 : struct ndr_pull *pull = NULL;
13068 : enum ndr_err_code err;
13069 :
13070 0 : if (ndr_table_lsarpc.num_calls < 3) {
13071 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivs_ndr_unpack");
13072 0 : return NULL;
13073 : }
13074 0 : call = &ndr_table_lsarpc.calls[2];
13075 :
13076 0 : pull = ndr_pull_init_blob(blob, object);
13077 0 : if (pull == NULL) {
13078 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13079 0 : return NULL;
13080 : }
13081 :
13082 0 : pull->flags |= ndr_pull_flags;
13083 :
13084 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
13085 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13086 0 : TALLOC_FREE(pull);
13087 0 : PyErr_SetNdrError(err);
13088 0 : return NULL;
13089 : }
13090 0 : if (!allow_remaining) {
13091 : uint32_t highest_ofs;
13092 :
13093 0 : if (pull->offset > pull->relative_highest_offset) {
13094 0 : highest_ofs = pull->offset;
13095 : } else {
13096 0 : highest_ofs = pull->relative_highest_offset;
13097 : }
13098 0 : if (highest_ofs < pull->data_size) {
13099 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
13100 : "not all bytes consumed ofs[%u] size[%u]",
13101 : highest_ofs, pull->data_size);
13102 0 : TALLOC_FREE(pull);
13103 0 : PyErr_SetNdrError(err);
13104 0 : return NULL;
13105 : }
13106 : }
13107 :
13108 0 : TALLOC_FREE(pull);
13109 0 : Py_RETURN_NONE;
13110 : }
13111 :
13112 0 : static PyObject *py_lsa_EnumPrivs_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13113 : {
13114 : DATA_BLOB blob;
13115 0 : Py_ssize_t blob_length = 0;
13116 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13117 0 : PyObject *bigendian_obj = NULL;
13118 0 : PyObject *ndr64_obj = NULL;
13119 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13120 0 : PyObject *allow_remaining_obj = NULL;
13121 0 : bool allow_remaining = false;
13122 :
13123 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
13124 : discard_const_p(char *, kwnames),
13125 : &blob.data, &blob_length,
13126 : &bigendian_obj,
13127 : &ndr64_obj,
13128 : &allow_remaining_obj)) {
13129 0 : return NULL;
13130 : }
13131 0 : blob.length = blob_length;
13132 :
13133 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13134 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13135 : }
13136 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13137 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13138 : }
13139 :
13140 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13141 0 : allow_remaining = true;
13142 : }
13143 :
13144 0 : return py_lsa_EnumPrivs_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
13145 : }
13146 :
13147 0 : static PyObject *py_lsa_EnumPrivs_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13148 : {
13149 : DATA_BLOB blob;
13150 0 : Py_ssize_t blob_length = 0;
13151 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13152 0 : PyObject *bigendian_obj = NULL;
13153 0 : PyObject *ndr64_obj = NULL;
13154 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13155 0 : PyObject *allow_remaining_obj = NULL;
13156 0 : bool allow_remaining = false;
13157 :
13158 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
13159 : discard_const_p(char *, kwnames),
13160 : &blob.data, &blob_length,
13161 : &bigendian_obj,
13162 : &ndr64_obj,
13163 : &allow_remaining_obj)) {
13164 0 : return NULL;
13165 : }
13166 0 : blob.length = blob_length;
13167 :
13168 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13169 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13170 : }
13171 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13172 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13173 : }
13174 :
13175 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13176 0 : allow_remaining = true;
13177 : }
13178 :
13179 0 : return py_lsa_EnumPrivs_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
13180 : }
13181 :
13182 0 : static PyObject *py_lsa_EnumPrivs_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
13183 : {
13184 0 : const struct ndr_interface_call *call = NULL;
13185 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
13186 : PyObject *ret;
13187 : char *retstr;
13188 :
13189 0 : if (ndr_table_lsarpc.num_calls < 3) {
13190 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivs_ndr_print");
13191 0 : return NULL;
13192 : }
13193 0 : call = &ndr_table_lsarpc.calls[2];
13194 :
13195 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
13196 0 : ret = PyUnicode_FromString(retstr);
13197 0 : TALLOC_FREE(retstr);
13198 :
13199 0 : return ret;
13200 : }
13201 :
13202 0 : static PyObject *py_lsa_EnumPrivs_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13203 : {
13204 0 : return py_lsa_EnumPrivs_ndr_print(py_obj, "lsa_EnumPrivs_in", NDR_IN);
13205 : }
13206 :
13207 0 : static PyObject *py_lsa_EnumPrivs_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13208 : {
13209 0 : return py_lsa_EnumPrivs_ndr_print(py_obj, "lsa_EnumPrivs_out", NDR_OUT);
13210 : }
13211 :
13212 : static PyMethodDef py_lsa_EnumPrivs_methods[] = {
13213 : { "opnum", (PyCFunction)py_lsa_EnumPrivs_ndr_opnum, METH_NOARGS|METH_CLASS,
13214 : "lsa.EnumPrivs.opnum() -> 2 (0x02) " },
13215 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivs_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
13216 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
13217 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivs_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
13218 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
13219 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivs_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
13220 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
13221 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivs_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
13222 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
13223 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumPrivs_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
13224 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumPrivs_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
13225 : { NULL, NULL, 0, NULL }
13226 : };
13227 :
13228 :
13229 : static PyTypeObject lsa_EnumPrivs_Type = {
13230 : PyVarObject_HEAD_INIT(NULL, 0)
13231 : .tp_name = "lsa.EnumPrivs",
13232 : .tp_getset = py_lsa_EnumPrivs_getsetters,
13233 : .tp_methods = py_lsa_EnumPrivs_methods,
13234 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13235 : .tp_new = py_lsa_EnumPrivs_new,
13236 : };
13237 :
13238 0 : static bool pack_py_lsa_EnumPrivs_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumPrivs *r)
13239 : {
13240 : PyObject *py_handle;
13241 : PyObject *py_resume_handle;
13242 : PyObject *py_max_count;
13243 0 : const char *kwnames[] = {
13244 : "handle", "resume_handle", "max_count", NULL
13245 : };
13246 :
13247 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumPrivs", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_count)) {
13248 0 : return false;
13249 : }
13250 :
13251 0 : if (py_handle == NULL) {
13252 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
13253 0 : return false;
13254 : }
13255 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
13256 0 : if (r->in.handle == NULL) {
13257 0 : PyErr_NoMemory();
13258 0 : return false;
13259 : }
13260 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13261 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13262 0 : PyErr_NoMemory();
13263 0 : return false;
13264 : }
13265 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13266 0 : if (py_resume_handle == NULL) {
13267 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
13268 0 : return false;
13269 : }
13270 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
13271 0 : if (r->in.resume_handle == NULL) {
13272 0 : PyErr_NoMemory();
13273 0 : return false;
13274 : }
13275 : {
13276 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
13277 0 : if (PyLong_Check(py_resume_handle)) {
13278 : unsigned long long test_var;
13279 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
13280 0 : if (PyErr_Occurred() != NULL) {
13281 0 : return false;
13282 : }
13283 0 : if (test_var > uint_max) {
13284 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13285 : PyLong_Type.tp_name, uint_max, test_var);
13286 0 : return false;
13287 : }
13288 0 : *r->in.resume_handle = test_var;
13289 : } else {
13290 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13291 : PyLong_Type.tp_name);
13292 0 : return false;
13293 : }
13294 : }
13295 0 : if (py_max_count == NULL) {
13296 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_count");
13297 0 : return false;
13298 : }
13299 : {
13300 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_count));
13301 0 : if (PyLong_Check(py_max_count)) {
13302 : unsigned long long test_var;
13303 0 : test_var = PyLong_AsUnsignedLongLong(py_max_count);
13304 0 : if (PyErr_Occurred() != NULL) {
13305 0 : return false;
13306 : }
13307 0 : if (test_var > uint_max) {
13308 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13309 : PyLong_Type.tp_name, uint_max, test_var);
13310 0 : return false;
13311 : }
13312 0 : r->in.max_count = test_var;
13313 : } else {
13314 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13315 : PyLong_Type.tp_name);
13316 0 : return false;
13317 : }
13318 : }
13319 0 : return true;
13320 : }
13321 :
13322 0 : static PyObject *unpack_py_lsa_EnumPrivs_args_out(struct lsa_EnumPrivs *r)
13323 : {
13324 : PyObject *result;
13325 : PyObject *py_resume_handle;
13326 : PyObject *py_privs;
13327 0 : result = PyTuple_New(2);
13328 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
13329 0 : PyTuple_SetItem(result, 0, py_resume_handle);
13330 0 : py_privs = pytalloc_reference_ex(&lsa_PrivArray_Type, r->out.privs, r->out.privs);
13331 0 : PyTuple_SetItem(result, 1, py_privs);
13332 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
13333 0 : PyErr_SetNTSTATUS(r->out.result);
13334 0 : return NULL;
13335 : }
13336 :
13337 0 : return result;
13338 : }
13339 :
13340 :
13341 0 : static PyObject *py_lsa_QuerySecurity_in_get_handle(PyObject *obj, void *closure)
13342 : {
13343 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(obj);
13344 : PyObject *py_handle;
13345 0 : if (object->in.handle == NULL) {
13346 0 : Py_RETURN_NONE;
13347 : }
13348 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
13349 0 : return py_handle;
13350 : }
13351 :
13352 0 : static int py_lsa_QuerySecurity_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
13353 : {
13354 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13355 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
13356 0 : if (value == NULL) {
13357 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
13358 0 : return -1;
13359 : }
13360 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
13361 0 : if (object->in.handle == NULL) {
13362 0 : PyErr_NoMemory();
13363 0 : return -1;
13364 : }
13365 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
13366 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13367 0 : PyErr_NoMemory();
13368 0 : return -1;
13369 : }
13370 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
13371 0 : return 0;
13372 : }
13373 :
13374 0 : static PyObject *py_lsa_QuerySecurity_in_get_sec_info(PyObject *obj, void *closure)
13375 : {
13376 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(obj);
13377 : PyObject *py_sec_info;
13378 0 : py_sec_info = PyLong_FromUnsignedLongLong((uint32_t)object->in.sec_info);
13379 0 : return py_sec_info;
13380 : }
13381 :
13382 0 : static int py_lsa_QuerySecurity_in_set_sec_info(PyObject *py_obj, PyObject *value, void *closure)
13383 : {
13384 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13385 0 : if (value == NULL) {
13386 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sec_info");
13387 0 : return -1;
13388 : }
13389 : {
13390 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.sec_info));
13391 0 : if (PyLong_Check(value)) {
13392 : unsigned long long test_var;
13393 0 : test_var = PyLong_AsUnsignedLongLong(value);
13394 0 : if (PyErr_Occurred() != NULL) {
13395 0 : return -1;
13396 : }
13397 0 : if (test_var > uint_max) {
13398 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13399 : PyLong_Type.tp_name, uint_max, test_var);
13400 0 : return -1;
13401 : }
13402 0 : object->in.sec_info = test_var;
13403 : } else {
13404 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13405 : PyLong_Type.tp_name);
13406 0 : return -1;
13407 : }
13408 : }
13409 0 : return 0;
13410 : }
13411 :
13412 0 : static PyObject *py_lsa_QuerySecurity_out_get_sdbuf(PyObject *obj, void *closure)
13413 : {
13414 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(obj);
13415 : PyObject *py_sdbuf;
13416 0 : if (object->out.sdbuf == NULL) {
13417 0 : Py_RETURN_NONE;
13418 : }
13419 0 : if (*object->out.sdbuf == NULL) {
13420 0 : py_sdbuf = Py_None;
13421 0 : Py_INCREF(py_sdbuf);
13422 : } else {
13423 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *object->out.sdbuf, *object->out.sdbuf);
13424 : }
13425 0 : return py_sdbuf;
13426 : }
13427 :
13428 0 : static int py_lsa_QuerySecurity_out_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
13429 : {
13430 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13431 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sdbuf));
13432 0 : if (value == NULL) {
13433 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sdbuf");
13434 0 : return -1;
13435 : }
13436 0 : object->out.sdbuf = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sdbuf);
13437 0 : if (object->out.sdbuf == NULL) {
13438 0 : PyErr_NoMemory();
13439 0 : return -1;
13440 : }
13441 0 : if (value == Py_None) {
13442 0 : *object->out.sdbuf = NULL;
13443 : } else {
13444 0 : *object->out.sdbuf = NULL;
13445 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
13446 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13447 0 : PyErr_NoMemory();
13448 0 : return -1;
13449 : }
13450 0 : *object->out.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(value);
13451 : }
13452 0 : return 0;
13453 : }
13454 :
13455 0 : static PyObject *py_lsa_QuerySecurity_get_result(PyObject *obj, void *closure)
13456 : {
13457 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(obj);
13458 : PyObject *py_result;
13459 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
13460 0 : return py_result;
13461 : }
13462 :
13463 0 : static int py_lsa_QuerySecurity_set_result(PyObject *py_obj, PyObject *value, void *closure)
13464 : {
13465 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13466 0 : if (value == NULL) {
13467 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
13468 0 : return -1;
13469 : }
13470 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
13471 0 : return 0;
13472 : }
13473 :
13474 : static PyGetSetDef py_lsa_QuerySecurity_getsetters[] = {
13475 : {
13476 : .name = discard_const_p(char, "in_handle"),
13477 : .get = py_lsa_QuerySecurity_in_get_handle,
13478 : .set = py_lsa_QuerySecurity_in_set_handle,
13479 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
13480 : },
13481 : {
13482 : .name = discard_const_p(char, "in_sec_info"),
13483 : .get = py_lsa_QuerySecurity_in_get_sec_info,
13484 : .set = py_lsa_QuerySecurity_in_set_sec_info,
13485 : .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
13486 : },
13487 : {
13488 : .name = discard_const_p(char, "out_sdbuf"),
13489 : .get = py_lsa_QuerySecurity_out_get_sdbuf,
13490 : .set = py_lsa_QuerySecurity_out_set_sdbuf,
13491 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
13492 : },
13493 : {
13494 : .name = discard_const_p(char, "result"),
13495 : .get = py_lsa_QuerySecurity_get_result,
13496 : .set = py_lsa_QuerySecurity_set_result,
13497 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
13498 : },
13499 : { .name = NULL }
13500 : };
13501 :
13502 0 : static PyObject *py_lsa_QuerySecurity_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13503 : {
13504 0 : PyObject *self = pytalloc_new(struct lsa_QuerySecurity, type);
13505 0 : struct lsa_QuerySecurity *_self = (struct lsa_QuerySecurity *)pytalloc_get_ptr(self);
13506 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
13507 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
13508 : /* a pointer to a NULL pointer */
13509 0 : _self->out.sdbuf = talloc_zero(mem_ctx, struct sec_desc_buf *);
13510 0 : return self;
13511 : }
13512 :
13513 0 : static PyObject *py_lsa_QuerySecurity_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
13514 : {
13515 :
13516 :
13517 0 : return PyLong_FromLong(3);
13518 : }
13519 :
13520 0 : static PyObject *py_lsa_QuerySecurity_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
13521 : {
13522 0 : const struct ndr_interface_call *call = NULL;
13523 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13524 0 : PyObject *ret = NULL;
13525 0 : struct ndr_push *push = NULL;
13526 : DATA_BLOB blob;
13527 : enum ndr_err_code err;
13528 :
13529 0 : if (ndr_table_lsarpc.num_calls < 4) {
13530 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecurity_ndr_pack");
13531 0 : return NULL;
13532 : }
13533 0 : call = &ndr_table_lsarpc.calls[3];
13534 :
13535 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
13536 0 : if (push == NULL) {
13537 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13538 0 : return NULL;
13539 : }
13540 :
13541 0 : push->flags |= ndr_push_flags;
13542 :
13543 0 : err = call->ndr_push(push, ndr_inout_flags, object);
13544 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13545 0 : TALLOC_FREE(push);
13546 0 : PyErr_SetNdrError(err);
13547 0 : return NULL;
13548 : }
13549 0 : blob = ndr_push_blob(push);
13550 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
13551 0 : TALLOC_FREE(push);
13552 0 : return ret;
13553 : }
13554 :
13555 0 : static PyObject *py_lsa_QuerySecurity_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13556 : {
13557 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13558 0 : PyObject *bigendian_obj = NULL;
13559 0 : PyObject *ndr64_obj = NULL;
13560 0 : uint32_t ndr_push_flags = 0;
13561 :
13562 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
13563 : discard_const_p(char *, kwnames),
13564 : &bigendian_obj,
13565 : &ndr64_obj)) {
13566 0 : return NULL;
13567 : }
13568 :
13569 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13570 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13571 : }
13572 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13573 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13574 : }
13575 :
13576 0 : return py_lsa_QuerySecurity_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
13577 : }
13578 :
13579 0 : static PyObject *py_lsa_QuerySecurity_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13580 : {
13581 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13582 0 : PyObject *bigendian_obj = NULL;
13583 0 : PyObject *ndr64_obj = NULL;
13584 0 : uint32_t ndr_push_flags = 0;
13585 :
13586 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
13587 : discard_const_p(char *, kwnames),
13588 : &bigendian_obj,
13589 : &ndr64_obj)) {
13590 0 : return NULL;
13591 : }
13592 :
13593 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13594 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13595 : }
13596 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13597 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13598 : }
13599 :
13600 0 : return py_lsa_QuerySecurity_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
13601 : }
13602 :
13603 0 : static PyObject *py_lsa_QuerySecurity_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
13604 : {
13605 0 : const struct ndr_interface_call *call = NULL;
13606 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13607 0 : struct ndr_pull *pull = NULL;
13608 : enum ndr_err_code err;
13609 :
13610 0 : if (ndr_table_lsarpc.num_calls < 4) {
13611 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecurity_ndr_unpack");
13612 0 : return NULL;
13613 : }
13614 0 : call = &ndr_table_lsarpc.calls[3];
13615 :
13616 0 : pull = ndr_pull_init_blob(blob, object);
13617 0 : if (pull == NULL) {
13618 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13619 0 : return NULL;
13620 : }
13621 :
13622 0 : pull->flags |= ndr_pull_flags;
13623 :
13624 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
13625 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13626 0 : TALLOC_FREE(pull);
13627 0 : PyErr_SetNdrError(err);
13628 0 : return NULL;
13629 : }
13630 0 : if (!allow_remaining) {
13631 : uint32_t highest_ofs;
13632 :
13633 0 : if (pull->offset > pull->relative_highest_offset) {
13634 0 : highest_ofs = pull->offset;
13635 : } else {
13636 0 : highest_ofs = pull->relative_highest_offset;
13637 : }
13638 0 : if (highest_ofs < pull->data_size) {
13639 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
13640 : "not all bytes consumed ofs[%u] size[%u]",
13641 : highest_ofs, pull->data_size);
13642 0 : TALLOC_FREE(pull);
13643 0 : PyErr_SetNdrError(err);
13644 0 : return NULL;
13645 : }
13646 : }
13647 :
13648 0 : TALLOC_FREE(pull);
13649 0 : Py_RETURN_NONE;
13650 : }
13651 :
13652 0 : static PyObject *py_lsa_QuerySecurity_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13653 : {
13654 : DATA_BLOB blob;
13655 0 : Py_ssize_t blob_length = 0;
13656 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13657 0 : PyObject *bigendian_obj = NULL;
13658 0 : PyObject *ndr64_obj = NULL;
13659 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13660 0 : PyObject *allow_remaining_obj = NULL;
13661 0 : bool allow_remaining = false;
13662 :
13663 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
13664 : discard_const_p(char *, kwnames),
13665 : &blob.data, &blob_length,
13666 : &bigendian_obj,
13667 : &ndr64_obj,
13668 : &allow_remaining_obj)) {
13669 0 : return NULL;
13670 : }
13671 0 : blob.length = blob_length;
13672 :
13673 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13674 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13675 : }
13676 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13677 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13678 : }
13679 :
13680 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13681 0 : allow_remaining = true;
13682 : }
13683 :
13684 0 : return py_lsa_QuerySecurity_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
13685 : }
13686 :
13687 0 : static PyObject *py_lsa_QuerySecurity_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13688 : {
13689 : DATA_BLOB blob;
13690 0 : Py_ssize_t blob_length = 0;
13691 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13692 0 : PyObject *bigendian_obj = NULL;
13693 0 : PyObject *ndr64_obj = NULL;
13694 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13695 0 : PyObject *allow_remaining_obj = NULL;
13696 0 : bool allow_remaining = false;
13697 :
13698 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
13699 : discard_const_p(char *, kwnames),
13700 : &blob.data, &blob_length,
13701 : &bigendian_obj,
13702 : &ndr64_obj,
13703 : &allow_remaining_obj)) {
13704 0 : return NULL;
13705 : }
13706 0 : blob.length = blob_length;
13707 :
13708 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13709 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13710 : }
13711 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13712 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13713 : }
13714 :
13715 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13716 0 : allow_remaining = true;
13717 : }
13718 :
13719 0 : return py_lsa_QuerySecurity_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
13720 : }
13721 :
13722 0 : static PyObject *py_lsa_QuerySecurity_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
13723 : {
13724 0 : const struct ndr_interface_call *call = NULL;
13725 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13726 : PyObject *ret;
13727 : char *retstr;
13728 :
13729 0 : if (ndr_table_lsarpc.num_calls < 4) {
13730 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecurity_ndr_print");
13731 0 : return NULL;
13732 : }
13733 0 : call = &ndr_table_lsarpc.calls[3];
13734 :
13735 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
13736 0 : ret = PyUnicode_FromString(retstr);
13737 0 : TALLOC_FREE(retstr);
13738 :
13739 0 : return ret;
13740 : }
13741 :
13742 0 : static PyObject *py_lsa_QuerySecurity_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13743 : {
13744 0 : return py_lsa_QuerySecurity_ndr_print(py_obj, "lsa_QuerySecurity_in", NDR_IN);
13745 : }
13746 :
13747 0 : static PyObject *py_lsa_QuerySecurity_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13748 : {
13749 0 : return py_lsa_QuerySecurity_ndr_print(py_obj, "lsa_QuerySecurity_out", NDR_OUT);
13750 : }
13751 :
13752 : static PyMethodDef py_lsa_QuerySecurity_methods[] = {
13753 : { "opnum", (PyCFunction)py_lsa_QuerySecurity_ndr_opnum, METH_NOARGS|METH_CLASS,
13754 : "lsa.QuerySecurity.opnum() -> 3 (0x03) " },
13755 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecurity_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
13756 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
13757 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecurity_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
13758 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
13759 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecurity_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
13760 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
13761 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecurity_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
13762 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
13763 : { "__ndr_print_in__", (PyCFunction)py_lsa_QuerySecurity_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
13764 : { "__ndr_print_out__", (PyCFunction)py_lsa_QuerySecurity_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
13765 : { NULL, NULL, 0, NULL }
13766 : };
13767 :
13768 :
13769 : static PyTypeObject lsa_QuerySecurity_Type = {
13770 : PyVarObject_HEAD_INIT(NULL, 0)
13771 : .tp_name = "lsa.QuerySecurity",
13772 : .tp_getset = py_lsa_QuerySecurity_getsetters,
13773 : .tp_methods = py_lsa_QuerySecurity_methods,
13774 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13775 : .tp_new = py_lsa_QuerySecurity_new,
13776 : };
13777 :
13778 0 : static bool pack_py_lsa_QuerySecurity_args_in(PyObject *args, PyObject *kwargs, struct lsa_QuerySecurity *r)
13779 : {
13780 : PyObject *py_handle;
13781 : PyObject *py_sec_info;
13782 0 : const char *kwnames[] = {
13783 : "handle", "sec_info", NULL
13784 : };
13785 :
13786 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QuerySecurity", discard_const_p(char *, kwnames), &py_handle, &py_sec_info)) {
13787 0 : return false;
13788 : }
13789 :
13790 0 : if (py_handle == NULL) {
13791 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
13792 0 : return false;
13793 : }
13794 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
13795 0 : if (r->in.handle == NULL) {
13796 0 : PyErr_NoMemory();
13797 0 : return false;
13798 : }
13799 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13800 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13801 0 : PyErr_NoMemory();
13802 0 : return false;
13803 : }
13804 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13805 0 : if (py_sec_info == NULL) {
13806 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sec_info");
13807 0 : return false;
13808 : }
13809 : {
13810 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.sec_info));
13811 0 : if (PyLong_Check(py_sec_info)) {
13812 : unsigned long long test_var;
13813 0 : test_var = PyLong_AsUnsignedLongLong(py_sec_info);
13814 0 : if (PyErr_Occurred() != NULL) {
13815 0 : return false;
13816 : }
13817 0 : if (test_var > uint_max) {
13818 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13819 : PyLong_Type.tp_name, uint_max, test_var);
13820 0 : return false;
13821 : }
13822 0 : r->in.sec_info = test_var;
13823 : } else {
13824 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13825 : PyLong_Type.tp_name);
13826 0 : return false;
13827 : }
13828 : }
13829 0 : return true;
13830 : }
13831 :
13832 0 : static PyObject *unpack_py_lsa_QuerySecurity_args_out(struct lsa_QuerySecurity *r)
13833 : {
13834 : PyObject *result;
13835 : PyObject *py_sdbuf;
13836 0 : if (*r->out.sdbuf == NULL) {
13837 0 : py_sdbuf = Py_None;
13838 0 : Py_INCREF(py_sdbuf);
13839 : } else {
13840 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *r->out.sdbuf, *r->out.sdbuf);
13841 : }
13842 0 : result = py_sdbuf;
13843 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
13844 0 : PyErr_SetNTSTATUS(r->out.result);
13845 0 : return NULL;
13846 : }
13847 :
13848 0 : return result;
13849 : }
13850 :
13851 :
13852 0 : static PyObject *py_lsa_SetSecObj_in_get_handle(PyObject *obj, void *closure)
13853 : {
13854 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(obj);
13855 : PyObject *py_handle;
13856 0 : if (object->in.handle == NULL) {
13857 0 : Py_RETURN_NONE;
13858 : }
13859 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
13860 0 : return py_handle;
13861 : }
13862 :
13863 0 : static int py_lsa_SetSecObj_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
13864 : {
13865 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
13866 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
13867 0 : if (value == NULL) {
13868 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
13869 0 : return -1;
13870 : }
13871 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
13872 0 : if (object->in.handle == NULL) {
13873 0 : PyErr_NoMemory();
13874 0 : return -1;
13875 : }
13876 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
13877 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13878 0 : PyErr_NoMemory();
13879 0 : return -1;
13880 : }
13881 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
13882 0 : return 0;
13883 : }
13884 :
13885 0 : static PyObject *py_lsa_SetSecObj_in_get_sec_info(PyObject *obj, void *closure)
13886 : {
13887 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(obj);
13888 : PyObject *py_sec_info;
13889 0 : py_sec_info = PyLong_FromUnsignedLongLong((uint32_t)object->in.sec_info);
13890 0 : return py_sec_info;
13891 : }
13892 :
13893 0 : static int py_lsa_SetSecObj_in_set_sec_info(PyObject *py_obj, PyObject *value, void *closure)
13894 : {
13895 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
13896 0 : if (value == NULL) {
13897 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sec_info");
13898 0 : return -1;
13899 : }
13900 : {
13901 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.sec_info));
13902 0 : if (PyLong_Check(value)) {
13903 : unsigned long long test_var;
13904 0 : test_var = PyLong_AsUnsignedLongLong(value);
13905 0 : if (PyErr_Occurred() != NULL) {
13906 0 : return -1;
13907 : }
13908 0 : if (test_var > uint_max) {
13909 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13910 : PyLong_Type.tp_name, uint_max, test_var);
13911 0 : return -1;
13912 : }
13913 0 : object->in.sec_info = test_var;
13914 : } else {
13915 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13916 : PyLong_Type.tp_name);
13917 0 : return -1;
13918 : }
13919 : }
13920 0 : return 0;
13921 : }
13922 :
13923 0 : static PyObject *py_lsa_SetSecObj_in_get_sdbuf(PyObject *obj, void *closure)
13924 : {
13925 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(obj);
13926 : PyObject *py_sdbuf;
13927 0 : if (object->in.sdbuf == NULL) {
13928 0 : Py_RETURN_NONE;
13929 : }
13930 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, object->in.sdbuf, object->in.sdbuf);
13931 0 : return py_sdbuf;
13932 : }
13933 :
13934 0 : static int py_lsa_SetSecObj_in_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
13935 : {
13936 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
13937 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sdbuf));
13938 0 : if (value == NULL) {
13939 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sdbuf");
13940 0 : return -1;
13941 : }
13942 0 : object->in.sdbuf = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sdbuf);
13943 0 : if (object->in.sdbuf == NULL) {
13944 0 : PyErr_NoMemory();
13945 0 : return -1;
13946 : }
13947 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
13948 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13949 0 : PyErr_NoMemory();
13950 0 : return -1;
13951 : }
13952 0 : object->in.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(value);
13953 0 : return 0;
13954 : }
13955 :
13956 0 : static PyObject *py_lsa_SetSecObj_get_result(PyObject *obj, void *closure)
13957 : {
13958 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(obj);
13959 : PyObject *py_result;
13960 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
13961 0 : return py_result;
13962 : }
13963 :
13964 0 : static int py_lsa_SetSecObj_set_result(PyObject *py_obj, PyObject *value, void *closure)
13965 : {
13966 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
13967 0 : if (value == NULL) {
13968 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
13969 0 : return -1;
13970 : }
13971 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
13972 0 : return 0;
13973 : }
13974 :
13975 : static PyGetSetDef py_lsa_SetSecObj_getsetters[] = {
13976 : {
13977 : .name = discard_const_p(char, "in_handle"),
13978 : .get = py_lsa_SetSecObj_in_get_handle,
13979 : .set = py_lsa_SetSecObj_in_set_handle,
13980 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
13981 : },
13982 : {
13983 : .name = discard_const_p(char, "in_sec_info"),
13984 : .get = py_lsa_SetSecObj_in_get_sec_info,
13985 : .set = py_lsa_SetSecObj_in_set_sec_info,
13986 : .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
13987 : },
13988 : {
13989 : .name = discard_const_p(char, "in_sdbuf"),
13990 : .get = py_lsa_SetSecObj_in_get_sdbuf,
13991 : .set = py_lsa_SetSecObj_in_set_sdbuf,
13992 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
13993 : },
13994 : {
13995 : .name = discard_const_p(char, "result"),
13996 : .get = py_lsa_SetSecObj_get_result,
13997 : .set = py_lsa_SetSecObj_set_result,
13998 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
13999 : },
14000 : { .name = NULL }
14001 : };
14002 :
14003 0 : static PyObject *py_lsa_SetSecObj_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14004 : {
14005 0 : PyObject *self = pytalloc_new(struct lsa_SetSecObj, type);
14006 0 : struct lsa_SetSecObj *_self = (struct lsa_SetSecObj *)pytalloc_get_ptr(self);
14007 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
14008 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
14009 0 : _self->in.sdbuf = talloc_zero(mem_ctx, struct sec_desc_buf);
14010 0 : return self;
14011 : }
14012 :
14013 0 : static PyObject *py_lsa_SetSecObj_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
14014 : {
14015 :
14016 :
14017 0 : return PyLong_FromLong(4);
14018 : }
14019 :
14020 0 : static PyObject *py_lsa_SetSecObj_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
14021 : {
14022 0 : const struct ndr_interface_call *call = NULL;
14023 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
14024 0 : PyObject *ret = NULL;
14025 0 : struct ndr_push *push = NULL;
14026 : DATA_BLOB blob;
14027 : enum ndr_err_code err;
14028 :
14029 0 : if (ndr_table_lsarpc.num_calls < 5) {
14030 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecObj_ndr_pack");
14031 0 : return NULL;
14032 : }
14033 0 : call = &ndr_table_lsarpc.calls[4];
14034 :
14035 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
14036 0 : if (push == NULL) {
14037 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14038 0 : return NULL;
14039 : }
14040 :
14041 0 : push->flags |= ndr_push_flags;
14042 :
14043 0 : err = call->ndr_push(push, ndr_inout_flags, object);
14044 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14045 0 : TALLOC_FREE(push);
14046 0 : PyErr_SetNdrError(err);
14047 0 : return NULL;
14048 : }
14049 0 : blob = ndr_push_blob(push);
14050 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14051 0 : TALLOC_FREE(push);
14052 0 : return ret;
14053 : }
14054 :
14055 0 : static PyObject *py_lsa_SetSecObj_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14056 : {
14057 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14058 0 : PyObject *bigendian_obj = NULL;
14059 0 : PyObject *ndr64_obj = NULL;
14060 0 : uint32_t ndr_push_flags = 0;
14061 :
14062 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
14063 : discard_const_p(char *, kwnames),
14064 : &bigendian_obj,
14065 : &ndr64_obj)) {
14066 0 : return NULL;
14067 : }
14068 :
14069 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14070 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14071 : }
14072 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14073 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14074 : }
14075 :
14076 0 : return py_lsa_SetSecObj_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
14077 : }
14078 :
14079 0 : static PyObject *py_lsa_SetSecObj_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14080 : {
14081 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14082 0 : PyObject *bigendian_obj = NULL;
14083 0 : PyObject *ndr64_obj = NULL;
14084 0 : uint32_t ndr_push_flags = 0;
14085 :
14086 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
14087 : discard_const_p(char *, kwnames),
14088 : &bigendian_obj,
14089 : &ndr64_obj)) {
14090 0 : return NULL;
14091 : }
14092 :
14093 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14094 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14095 : }
14096 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14097 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14098 : }
14099 :
14100 0 : return py_lsa_SetSecObj_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
14101 : }
14102 :
14103 0 : static PyObject *py_lsa_SetSecObj_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
14104 : {
14105 0 : const struct ndr_interface_call *call = NULL;
14106 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
14107 0 : struct ndr_pull *pull = NULL;
14108 : enum ndr_err_code err;
14109 :
14110 0 : if (ndr_table_lsarpc.num_calls < 5) {
14111 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecObj_ndr_unpack");
14112 0 : return NULL;
14113 : }
14114 0 : call = &ndr_table_lsarpc.calls[4];
14115 :
14116 0 : pull = ndr_pull_init_blob(blob, object);
14117 0 : if (pull == NULL) {
14118 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14119 0 : return NULL;
14120 : }
14121 :
14122 0 : pull->flags |= ndr_pull_flags;
14123 :
14124 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
14125 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14126 0 : TALLOC_FREE(pull);
14127 0 : PyErr_SetNdrError(err);
14128 0 : return NULL;
14129 : }
14130 0 : if (!allow_remaining) {
14131 : uint32_t highest_ofs;
14132 :
14133 0 : if (pull->offset > pull->relative_highest_offset) {
14134 0 : highest_ofs = pull->offset;
14135 : } else {
14136 0 : highest_ofs = pull->relative_highest_offset;
14137 : }
14138 0 : if (highest_ofs < pull->data_size) {
14139 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
14140 : "not all bytes consumed ofs[%u] size[%u]",
14141 : highest_ofs, pull->data_size);
14142 0 : TALLOC_FREE(pull);
14143 0 : PyErr_SetNdrError(err);
14144 0 : return NULL;
14145 : }
14146 : }
14147 :
14148 0 : TALLOC_FREE(pull);
14149 0 : Py_RETURN_NONE;
14150 : }
14151 :
14152 0 : static PyObject *py_lsa_SetSecObj_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14153 : {
14154 : DATA_BLOB blob;
14155 0 : Py_ssize_t blob_length = 0;
14156 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14157 0 : PyObject *bigendian_obj = NULL;
14158 0 : PyObject *ndr64_obj = NULL;
14159 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14160 0 : PyObject *allow_remaining_obj = NULL;
14161 0 : bool allow_remaining = false;
14162 :
14163 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
14164 : discard_const_p(char *, kwnames),
14165 : &blob.data, &blob_length,
14166 : &bigendian_obj,
14167 : &ndr64_obj,
14168 : &allow_remaining_obj)) {
14169 0 : return NULL;
14170 : }
14171 0 : blob.length = blob_length;
14172 :
14173 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14174 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14175 : }
14176 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14177 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14178 : }
14179 :
14180 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14181 0 : allow_remaining = true;
14182 : }
14183 :
14184 0 : return py_lsa_SetSecObj_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
14185 : }
14186 :
14187 0 : static PyObject *py_lsa_SetSecObj_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14188 : {
14189 : DATA_BLOB blob;
14190 0 : Py_ssize_t blob_length = 0;
14191 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14192 0 : PyObject *bigendian_obj = NULL;
14193 0 : PyObject *ndr64_obj = NULL;
14194 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14195 0 : PyObject *allow_remaining_obj = NULL;
14196 0 : bool allow_remaining = false;
14197 :
14198 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
14199 : discard_const_p(char *, kwnames),
14200 : &blob.data, &blob_length,
14201 : &bigendian_obj,
14202 : &ndr64_obj,
14203 : &allow_remaining_obj)) {
14204 0 : return NULL;
14205 : }
14206 0 : blob.length = blob_length;
14207 :
14208 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14209 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14210 : }
14211 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14212 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14213 : }
14214 :
14215 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14216 0 : allow_remaining = true;
14217 : }
14218 :
14219 0 : return py_lsa_SetSecObj_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
14220 : }
14221 :
14222 0 : static PyObject *py_lsa_SetSecObj_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
14223 : {
14224 0 : const struct ndr_interface_call *call = NULL;
14225 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
14226 : PyObject *ret;
14227 : char *retstr;
14228 :
14229 0 : if (ndr_table_lsarpc.num_calls < 5) {
14230 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecObj_ndr_print");
14231 0 : return NULL;
14232 : }
14233 0 : call = &ndr_table_lsarpc.calls[4];
14234 :
14235 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
14236 0 : ret = PyUnicode_FromString(retstr);
14237 0 : TALLOC_FREE(retstr);
14238 :
14239 0 : return ret;
14240 : }
14241 :
14242 0 : static PyObject *py_lsa_SetSecObj_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14243 : {
14244 0 : return py_lsa_SetSecObj_ndr_print(py_obj, "lsa_SetSecObj_in", NDR_IN);
14245 : }
14246 :
14247 0 : static PyObject *py_lsa_SetSecObj_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14248 : {
14249 0 : return py_lsa_SetSecObj_ndr_print(py_obj, "lsa_SetSecObj_out", NDR_OUT);
14250 : }
14251 :
14252 : static PyMethodDef py_lsa_SetSecObj_methods[] = {
14253 : { "opnum", (PyCFunction)py_lsa_SetSecObj_ndr_opnum, METH_NOARGS|METH_CLASS,
14254 : "lsa.SetSecObj.opnum() -> 4 (0x04) " },
14255 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecObj_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
14256 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
14257 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecObj_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
14258 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
14259 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecObj_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
14260 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
14261 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecObj_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
14262 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
14263 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetSecObj_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
14264 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetSecObj_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
14265 : { NULL, NULL, 0, NULL }
14266 : };
14267 :
14268 :
14269 : static PyTypeObject lsa_SetSecObj_Type = {
14270 : PyVarObject_HEAD_INIT(NULL, 0)
14271 : .tp_name = "lsa.SetSecObj",
14272 : .tp_getset = py_lsa_SetSecObj_getsetters,
14273 : .tp_methods = py_lsa_SetSecObj_methods,
14274 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14275 : .tp_new = py_lsa_SetSecObj_new,
14276 : };
14277 :
14278 0 : static bool pack_py_lsa_SetSecObj_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSecObj *r)
14279 : {
14280 : PyObject *py_handle;
14281 : PyObject *py_sec_info;
14282 : PyObject *py_sdbuf;
14283 0 : const char *kwnames[] = {
14284 : "handle", "sec_info", "sdbuf", NULL
14285 : };
14286 :
14287 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetSecObj", discard_const_p(char *, kwnames), &py_handle, &py_sec_info, &py_sdbuf)) {
14288 0 : return false;
14289 : }
14290 :
14291 0 : if (py_handle == NULL) {
14292 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
14293 0 : return false;
14294 : }
14295 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
14296 0 : if (r->in.handle == NULL) {
14297 0 : PyErr_NoMemory();
14298 0 : return false;
14299 : }
14300 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
14301 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
14302 0 : PyErr_NoMemory();
14303 0 : return false;
14304 : }
14305 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
14306 0 : if (py_sec_info == NULL) {
14307 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sec_info");
14308 0 : return false;
14309 : }
14310 : {
14311 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.sec_info));
14312 0 : if (PyLong_Check(py_sec_info)) {
14313 : unsigned long long test_var;
14314 0 : test_var = PyLong_AsUnsignedLongLong(py_sec_info);
14315 0 : if (PyErr_Occurred() != NULL) {
14316 0 : return false;
14317 : }
14318 0 : if (test_var > uint_max) {
14319 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14320 : PyLong_Type.tp_name, uint_max, test_var);
14321 0 : return false;
14322 : }
14323 0 : r->in.sec_info = test_var;
14324 : } else {
14325 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14326 : PyLong_Type.tp_name);
14327 0 : return false;
14328 : }
14329 : }
14330 0 : if (py_sdbuf == NULL) {
14331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sdbuf");
14332 0 : return false;
14333 : }
14334 0 : r->in.sdbuf = talloc_ptrtype(r, r->in.sdbuf);
14335 0 : if (r->in.sdbuf == NULL) {
14336 0 : PyErr_NoMemory();
14337 0 : return false;
14338 : }
14339 0 : PY_CHECK_TYPE(sec_desc_buf_Type, py_sdbuf, return false;);
14340 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sdbuf)) == NULL) {
14341 0 : PyErr_NoMemory();
14342 0 : return false;
14343 : }
14344 0 : r->in.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(py_sdbuf);
14345 0 : return true;
14346 : }
14347 :
14348 0 : static PyObject *unpack_py_lsa_SetSecObj_args_out(struct lsa_SetSecObj *r)
14349 : {
14350 : PyObject *result;
14351 0 : result = Py_None;
14352 0 : Py_INCREF(result);
14353 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
14354 0 : PyErr_SetNTSTATUS(r->out.result);
14355 0 : return NULL;
14356 : }
14357 :
14358 0 : return result;
14359 : }
14360 :
14361 :
14362 0 : static PyObject *py_lsa_OpenPolicy_in_get_system_name(PyObject *obj, void *closure)
14363 : {
14364 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(obj);
14365 : PyObject *py_system_name;
14366 0 : if (object->in.system_name == NULL) {
14367 0 : Py_RETURN_NONE;
14368 : }
14369 0 : if (object->in.system_name == NULL) {
14370 0 : py_system_name = Py_None;
14371 0 : Py_INCREF(py_system_name);
14372 : } else {
14373 0 : py_system_name = PyLong_FromLong((uint16_t)*object->in.system_name);
14374 : }
14375 0 : return py_system_name;
14376 : }
14377 :
14378 0 : static int py_lsa_OpenPolicy_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
14379 : {
14380 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14381 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.system_name));
14382 0 : if (value == NULL) {
14383 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name");
14384 0 : return -1;
14385 : }
14386 0 : if (value == Py_None) {
14387 0 : object->in.system_name = NULL;
14388 : } else {
14389 0 : object->in.system_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.system_name);
14390 0 : if (object->in.system_name == NULL) {
14391 0 : PyErr_NoMemory();
14392 0 : return -1;
14393 : }
14394 : {
14395 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.system_name));
14396 0 : if (PyLong_Check(value)) {
14397 : unsigned long long test_var;
14398 0 : test_var = PyLong_AsUnsignedLongLong(value);
14399 0 : if (PyErr_Occurred() != NULL) {
14400 0 : return -1;
14401 : }
14402 0 : if (test_var > uint_max) {
14403 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14404 : PyLong_Type.tp_name, uint_max, test_var);
14405 0 : return -1;
14406 : }
14407 0 : *object->in.system_name = test_var;
14408 : } else {
14409 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14410 : PyLong_Type.tp_name);
14411 0 : return -1;
14412 : }
14413 : }
14414 : }
14415 0 : return 0;
14416 : }
14417 :
14418 0 : static PyObject *py_lsa_OpenPolicy_in_get_attr(PyObject *obj, void *closure)
14419 : {
14420 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(obj);
14421 : PyObject *py_attr;
14422 0 : if (object->in.attr == NULL) {
14423 0 : Py_RETURN_NONE;
14424 : }
14425 0 : py_attr = pytalloc_reference_ex(&lsa_ObjectAttribute_Type, object->in.attr, object->in.attr);
14426 0 : return py_attr;
14427 : }
14428 :
14429 0 : static int py_lsa_OpenPolicy_in_set_attr(PyObject *py_obj, PyObject *value, void *closure)
14430 : {
14431 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14432 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.attr));
14433 0 : if (value == NULL) {
14434 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.attr");
14435 0 : return -1;
14436 : }
14437 0 : object->in.attr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.attr);
14438 0 : if (object->in.attr == NULL) {
14439 0 : PyErr_NoMemory();
14440 0 : return -1;
14441 : }
14442 0 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, value, return -1;);
14443 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14444 0 : PyErr_NoMemory();
14445 0 : return -1;
14446 : }
14447 0 : object->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(value);
14448 0 : return 0;
14449 : }
14450 :
14451 0 : static PyObject *py_lsa_OpenPolicy_in_get_access_mask(PyObject *obj, void *closure)
14452 : {
14453 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(obj);
14454 : PyObject *py_access_mask;
14455 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
14456 0 : return py_access_mask;
14457 : }
14458 :
14459 0 : static int py_lsa_OpenPolicy_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
14460 : {
14461 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14462 0 : if (value == NULL) {
14463 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
14464 0 : return -1;
14465 : }
14466 : {
14467 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
14468 0 : if (PyLong_Check(value)) {
14469 : unsigned long long test_var;
14470 0 : test_var = PyLong_AsUnsignedLongLong(value);
14471 0 : if (PyErr_Occurred() != NULL) {
14472 0 : return -1;
14473 : }
14474 0 : if (test_var > uint_max) {
14475 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14476 : PyLong_Type.tp_name, uint_max, test_var);
14477 0 : return -1;
14478 : }
14479 0 : object->in.access_mask = test_var;
14480 : } else {
14481 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14482 : PyLong_Type.tp_name);
14483 0 : return -1;
14484 : }
14485 : }
14486 0 : return 0;
14487 : }
14488 :
14489 0 : static PyObject *py_lsa_OpenPolicy_out_get_handle(PyObject *obj, void *closure)
14490 : {
14491 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(obj);
14492 : PyObject *py_handle;
14493 0 : if (object->out.handle == NULL) {
14494 0 : Py_RETURN_NONE;
14495 : }
14496 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
14497 0 : return py_handle;
14498 : }
14499 :
14500 0 : static int py_lsa_OpenPolicy_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
14501 : {
14502 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14503 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
14504 0 : if (value == NULL) {
14505 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
14506 0 : return -1;
14507 : }
14508 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
14509 0 : if (object->out.handle == NULL) {
14510 0 : PyErr_NoMemory();
14511 0 : return -1;
14512 : }
14513 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
14514 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14515 0 : PyErr_NoMemory();
14516 0 : return -1;
14517 : }
14518 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
14519 0 : return 0;
14520 : }
14521 :
14522 0 : static PyObject *py_lsa_OpenPolicy_get_result(PyObject *obj, void *closure)
14523 : {
14524 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(obj);
14525 : PyObject *py_result;
14526 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
14527 0 : return py_result;
14528 : }
14529 :
14530 0 : static int py_lsa_OpenPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
14531 : {
14532 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14533 0 : if (value == NULL) {
14534 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
14535 0 : return -1;
14536 : }
14537 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
14538 0 : return 0;
14539 : }
14540 :
14541 : static PyGetSetDef py_lsa_OpenPolicy_getsetters[] = {
14542 : {
14543 : .name = discard_const_p(char, "in_system_name"),
14544 : .get = py_lsa_OpenPolicy_in_get_system_name,
14545 : .set = py_lsa_OpenPolicy_in_set_system_name,
14546 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
14547 : },
14548 : {
14549 : .name = discard_const_p(char, "in_attr"),
14550 : .get = py_lsa_OpenPolicy_in_get_attr,
14551 : .set = py_lsa_OpenPolicy_in_set_attr,
14552 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ObjectAttribute")
14553 : },
14554 : {
14555 : .name = discard_const_p(char, "in_access_mask"),
14556 : .get = py_lsa_OpenPolicy_in_get_access_mask,
14557 : .set = py_lsa_OpenPolicy_in_set_access_mask,
14558 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyAccessMask")
14559 : },
14560 : {
14561 : .name = discard_const_p(char, "out_handle"),
14562 : .get = py_lsa_OpenPolicy_out_get_handle,
14563 : .set = py_lsa_OpenPolicy_out_set_handle,
14564 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
14565 : },
14566 : {
14567 : .name = discard_const_p(char, "result"),
14568 : .get = py_lsa_OpenPolicy_get_result,
14569 : .set = py_lsa_OpenPolicy_set_result,
14570 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
14571 : },
14572 : { .name = NULL }
14573 : };
14574 :
14575 0 : static PyObject *py_lsa_OpenPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14576 : {
14577 0 : PyObject *self = pytalloc_new(struct lsa_OpenPolicy, type);
14578 0 : struct lsa_OpenPolicy *_self = (struct lsa_OpenPolicy *)pytalloc_get_ptr(self);
14579 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
14580 0 : _self->in.attr = talloc_zero(mem_ctx, struct lsa_ObjectAttribute);
14581 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
14582 0 : return self;
14583 : }
14584 :
14585 0 : static PyObject *py_lsa_OpenPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
14586 : {
14587 :
14588 :
14589 0 : return PyLong_FromLong(6);
14590 : }
14591 :
14592 0 : static PyObject *py_lsa_OpenPolicy_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
14593 : {
14594 0 : const struct ndr_interface_call *call = NULL;
14595 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14596 0 : PyObject *ret = NULL;
14597 0 : struct ndr_push *push = NULL;
14598 : DATA_BLOB blob;
14599 : enum ndr_err_code err;
14600 :
14601 0 : if (ndr_table_lsarpc.num_calls < 7) {
14602 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy_ndr_pack");
14603 0 : return NULL;
14604 : }
14605 0 : call = &ndr_table_lsarpc.calls[6];
14606 :
14607 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
14608 0 : if (push == NULL) {
14609 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14610 0 : return NULL;
14611 : }
14612 :
14613 0 : push->flags |= ndr_push_flags;
14614 :
14615 0 : err = call->ndr_push(push, ndr_inout_flags, object);
14616 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14617 0 : TALLOC_FREE(push);
14618 0 : PyErr_SetNdrError(err);
14619 0 : return NULL;
14620 : }
14621 0 : blob = ndr_push_blob(push);
14622 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14623 0 : TALLOC_FREE(push);
14624 0 : return ret;
14625 : }
14626 :
14627 0 : static PyObject *py_lsa_OpenPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14628 : {
14629 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14630 0 : PyObject *bigendian_obj = NULL;
14631 0 : PyObject *ndr64_obj = NULL;
14632 0 : uint32_t ndr_push_flags = 0;
14633 :
14634 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
14635 : discard_const_p(char *, kwnames),
14636 : &bigendian_obj,
14637 : &ndr64_obj)) {
14638 0 : return NULL;
14639 : }
14640 :
14641 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14642 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14643 : }
14644 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14645 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14646 : }
14647 :
14648 0 : return py_lsa_OpenPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
14649 : }
14650 :
14651 0 : static PyObject *py_lsa_OpenPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14652 : {
14653 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14654 0 : PyObject *bigendian_obj = NULL;
14655 0 : PyObject *ndr64_obj = NULL;
14656 0 : uint32_t ndr_push_flags = 0;
14657 :
14658 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
14659 : discard_const_p(char *, kwnames),
14660 : &bigendian_obj,
14661 : &ndr64_obj)) {
14662 0 : return NULL;
14663 : }
14664 :
14665 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14666 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14667 : }
14668 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14669 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14670 : }
14671 :
14672 0 : return py_lsa_OpenPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
14673 : }
14674 :
14675 0 : static PyObject *py_lsa_OpenPolicy_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
14676 : {
14677 0 : const struct ndr_interface_call *call = NULL;
14678 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14679 0 : struct ndr_pull *pull = NULL;
14680 : enum ndr_err_code err;
14681 :
14682 0 : if (ndr_table_lsarpc.num_calls < 7) {
14683 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy_ndr_unpack");
14684 0 : return NULL;
14685 : }
14686 0 : call = &ndr_table_lsarpc.calls[6];
14687 :
14688 0 : pull = ndr_pull_init_blob(blob, object);
14689 0 : if (pull == NULL) {
14690 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14691 0 : return NULL;
14692 : }
14693 :
14694 0 : pull->flags |= ndr_pull_flags;
14695 :
14696 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
14697 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14698 0 : TALLOC_FREE(pull);
14699 0 : PyErr_SetNdrError(err);
14700 0 : return NULL;
14701 : }
14702 0 : if (!allow_remaining) {
14703 : uint32_t highest_ofs;
14704 :
14705 0 : if (pull->offset > pull->relative_highest_offset) {
14706 0 : highest_ofs = pull->offset;
14707 : } else {
14708 0 : highest_ofs = pull->relative_highest_offset;
14709 : }
14710 0 : if (highest_ofs < pull->data_size) {
14711 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
14712 : "not all bytes consumed ofs[%u] size[%u]",
14713 : highest_ofs, pull->data_size);
14714 0 : TALLOC_FREE(pull);
14715 0 : PyErr_SetNdrError(err);
14716 0 : return NULL;
14717 : }
14718 : }
14719 :
14720 0 : TALLOC_FREE(pull);
14721 0 : Py_RETURN_NONE;
14722 : }
14723 :
14724 0 : static PyObject *py_lsa_OpenPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14725 : {
14726 : DATA_BLOB blob;
14727 0 : Py_ssize_t blob_length = 0;
14728 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14729 0 : PyObject *bigendian_obj = NULL;
14730 0 : PyObject *ndr64_obj = NULL;
14731 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14732 0 : PyObject *allow_remaining_obj = NULL;
14733 0 : bool allow_remaining = false;
14734 :
14735 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
14736 : discard_const_p(char *, kwnames),
14737 : &blob.data, &blob_length,
14738 : &bigendian_obj,
14739 : &ndr64_obj,
14740 : &allow_remaining_obj)) {
14741 0 : return NULL;
14742 : }
14743 0 : blob.length = blob_length;
14744 :
14745 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14746 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14747 : }
14748 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14749 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14750 : }
14751 :
14752 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14753 0 : allow_remaining = true;
14754 : }
14755 :
14756 0 : return py_lsa_OpenPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
14757 : }
14758 :
14759 0 : static PyObject *py_lsa_OpenPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14760 : {
14761 : DATA_BLOB blob;
14762 0 : Py_ssize_t blob_length = 0;
14763 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14764 0 : PyObject *bigendian_obj = NULL;
14765 0 : PyObject *ndr64_obj = NULL;
14766 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14767 0 : PyObject *allow_remaining_obj = NULL;
14768 0 : bool allow_remaining = false;
14769 :
14770 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
14771 : discard_const_p(char *, kwnames),
14772 : &blob.data, &blob_length,
14773 : &bigendian_obj,
14774 : &ndr64_obj,
14775 : &allow_remaining_obj)) {
14776 0 : return NULL;
14777 : }
14778 0 : blob.length = blob_length;
14779 :
14780 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14781 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14782 : }
14783 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14784 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14785 : }
14786 :
14787 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14788 0 : allow_remaining = true;
14789 : }
14790 :
14791 0 : return py_lsa_OpenPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
14792 : }
14793 :
14794 0 : static PyObject *py_lsa_OpenPolicy_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
14795 : {
14796 0 : const struct ndr_interface_call *call = NULL;
14797 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14798 : PyObject *ret;
14799 : char *retstr;
14800 :
14801 0 : if (ndr_table_lsarpc.num_calls < 7) {
14802 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy_ndr_print");
14803 0 : return NULL;
14804 : }
14805 0 : call = &ndr_table_lsarpc.calls[6];
14806 :
14807 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
14808 0 : ret = PyUnicode_FromString(retstr);
14809 0 : TALLOC_FREE(retstr);
14810 :
14811 0 : return ret;
14812 : }
14813 :
14814 0 : static PyObject *py_lsa_OpenPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14815 : {
14816 0 : return py_lsa_OpenPolicy_ndr_print(py_obj, "lsa_OpenPolicy_in", NDR_IN);
14817 : }
14818 :
14819 0 : static PyObject *py_lsa_OpenPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14820 : {
14821 0 : return py_lsa_OpenPolicy_ndr_print(py_obj, "lsa_OpenPolicy_out", NDR_OUT);
14822 : }
14823 :
14824 : static PyMethodDef py_lsa_OpenPolicy_methods[] = {
14825 : { "opnum", (PyCFunction)py_lsa_OpenPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
14826 : "lsa.OpenPolicy.opnum() -> 6 (0x06) " },
14827 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
14828 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
14829 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
14830 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
14831 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
14832 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
14833 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
14834 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
14835 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
14836 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
14837 : { NULL, NULL, 0, NULL }
14838 : };
14839 :
14840 :
14841 : static PyTypeObject lsa_OpenPolicy_Type = {
14842 : PyVarObject_HEAD_INIT(NULL, 0)
14843 : .tp_name = "lsa.OpenPolicy",
14844 : .tp_getset = py_lsa_OpenPolicy_getsetters,
14845 : .tp_methods = py_lsa_OpenPolicy_methods,
14846 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14847 : .tp_new = py_lsa_OpenPolicy_new,
14848 : };
14849 :
14850 0 : static bool pack_py_lsa_OpenPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenPolicy *r)
14851 : {
14852 : PyObject *py_system_name;
14853 : PyObject *py_attr;
14854 : PyObject *py_access_mask;
14855 0 : const char *kwnames[] = {
14856 : "system_name", "attr", "access_mask", NULL
14857 : };
14858 :
14859 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenPolicy", discard_const_p(char *, kwnames), &py_system_name, &py_attr, &py_access_mask)) {
14860 0 : return false;
14861 : }
14862 :
14863 0 : if (py_system_name == NULL) {
14864 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name");
14865 0 : return false;
14866 : }
14867 0 : if (py_system_name == Py_None) {
14868 0 : r->in.system_name = NULL;
14869 : } else {
14870 0 : r->in.system_name = talloc_ptrtype(r, r->in.system_name);
14871 0 : if (r->in.system_name == NULL) {
14872 0 : PyErr_NoMemory();
14873 0 : return false;
14874 : }
14875 : {
14876 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.system_name));
14877 0 : if (PyLong_Check(py_system_name)) {
14878 : unsigned long long test_var;
14879 0 : test_var = PyLong_AsUnsignedLongLong(py_system_name);
14880 0 : if (PyErr_Occurred() != NULL) {
14881 0 : return false;
14882 : }
14883 0 : if (test_var > uint_max) {
14884 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14885 : PyLong_Type.tp_name, uint_max, test_var);
14886 0 : return false;
14887 : }
14888 0 : *r->in.system_name = test_var;
14889 : } else {
14890 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14891 : PyLong_Type.tp_name);
14892 0 : return false;
14893 : }
14894 : }
14895 : }
14896 0 : if (py_attr == NULL) {
14897 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.attr");
14898 0 : return false;
14899 : }
14900 0 : r->in.attr = talloc_ptrtype(r, r->in.attr);
14901 0 : if (r->in.attr == NULL) {
14902 0 : PyErr_NoMemory();
14903 0 : return false;
14904 : }
14905 0 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, py_attr, return false;);
14906 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_attr)) == NULL) {
14907 0 : PyErr_NoMemory();
14908 0 : return false;
14909 : }
14910 0 : r->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_attr);
14911 0 : if (py_access_mask == NULL) {
14912 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
14913 0 : return false;
14914 : }
14915 : {
14916 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
14917 0 : if (PyLong_Check(py_access_mask)) {
14918 : unsigned long long test_var;
14919 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
14920 0 : if (PyErr_Occurred() != NULL) {
14921 0 : return false;
14922 : }
14923 0 : if (test_var > uint_max) {
14924 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14925 : PyLong_Type.tp_name, uint_max, test_var);
14926 0 : return false;
14927 : }
14928 0 : r->in.access_mask = test_var;
14929 : } else {
14930 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14931 : PyLong_Type.tp_name);
14932 0 : return false;
14933 : }
14934 : }
14935 0 : return true;
14936 : }
14937 :
14938 0 : static PyObject *unpack_py_lsa_OpenPolicy_args_out(struct lsa_OpenPolicy *r)
14939 : {
14940 : PyObject *result;
14941 : PyObject *py_handle;
14942 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
14943 0 : result = py_handle;
14944 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
14945 0 : PyErr_SetNTSTATUS(r->out.result);
14946 0 : return NULL;
14947 : }
14948 :
14949 0 : return result;
14950 : }
14951 :
14952 :
14953 0 : static PyObject *py_lsa_QueryInfoPolicy_in_get_handle(PyObject *obj, void *closure)
14954 : {
14955 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(obj);
14956 : PyObject *py_handle;
14957 0 : if (object->in.handle == NULL) {
14958 0 : Py_RETURN_NONE;
14959 : }
14960 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
14961 0 : return py_handle;
14962 : }
14963 :
14964 0 : static int py_lsa_QueryInfoPolicy_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
14965 : {
14966 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
14967 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
14968 0 : if (value == NULL) {
14969 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
14970 0 : return -1;
14971 : }
14972 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
14973 0 : if (object->in.handle == NULL) {
14974 0 : PyErr_NoMemory();
14975 0 : return -1;
14976 : }
14977 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
14978 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14979 0 : PyErr_NoMemory();
14980 0 : return -1;
14981 : }
14982 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
14983 0 : return 0;
14984 : }
14985 :
14986 0 : static PyObject *py_lsa_QueryInfoPolicy_in_get_level(PyObject *obj, void *closure)
14987 : {
14988 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(obj);
14989 : PyObject *py_level;
14990 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
14991 0 : return py_level;
14992 : }
14993 :
14994 0 : static int py_lsa_QueryInfoPolicy_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
14995 : {
14996 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
14997 0 : if (value == NULL) {
14998 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
14999 0 : return -1;
15000 : }
15001 : {
15002 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
15003 0 : if (PyLong_Check(value)) {
15004 : unsigned long long test_var;
15005 0 : test_var = PyLong_AsUnsignedLongLong(value);
15006 0 : if (PyErr_Occurred() != NULL) {
15007 0 : return -1;
15008 : }
15009 0 : if (test_var > uint_max) {
15010 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15011 : PyLong_Type.tp_name, uint_max, test_var);
15012 0 : return -1;
15013 : }
15014 0 : object->in.level = test_var;
15015 : } else {
15016 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15017 : PyLong_Type.tp_name);
15018 0 : return -1;
15019 : }
15020 : }
15021 0 : return 0;
15022 : }
15023 :
15024 0 : static PyObject *py_lsa_QueryInfoPolicy_out_get_info(PyObject *obj, void *closure)
15025 : {
15026 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(obj);
15027 : PyObject *py_info;
15028 0 : if (object->out.info == NULL) {
15029 0 : Py_RETURN_NONE;
15030 : }
15031 0 : if (*object->out.info == NULL) {
15032 0 : py_info = Py_None;
15033 0 : Py_INCREF(py_info);
15034 : } else {
15035 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_PolicyInformation");
15036 0 : if (py_info == NULL) {
15037 0 : return NULL;
15038 : }
15039 : }
15040 0 : return py_info;
15041 : }
15042 :
15043 0 : static int py_lsa_QueryInfoPolicy_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
15044 : {
15045 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
15046 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
15047 0 : if (value == NULL) {
15048 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
15049 0 : return -1;
15050 : }
15051 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
15052 0 : if (object->out.info == NULL) {
15053 0 : PyErr_NoMemory();
15054 0 : return -1;
15055 : }
15056 0 : if (value == Py_None) {
15057 0 : *object->out.info = NULL;
15058 : } else {
15059 0 : *object->out.info = NULL;
15060 : {
15061 : union lsa_PolicyInformation *info_switch_2;
15062 0 : info_switch_2 = (union lsa_PolicyInformation *)pyrpc_export_union(&lsa_PolicyInformation_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union lsa_PolicyInformation");
15063 0 : if (info_switch_2 == NULL) {
15064 0 : return -1;
15065 : }
15066 0 : *object->out.info = info_switch_2;
15067 : }
15068 : }
15069 0 : return 0;
15070 : }
15071 :
15072 0 : static PyObject *py_lsa_QueryInfoPolicy_get_result(PyObject *obj, void *closure)
15073 : {
15074 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(obj);
15075 : PyObject *py_result;
15076 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
15077 0 : return py_result;
15078 : }
15079 :
15080 0 : static int py_lsa_QueryInfoPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
15081 : {
15082 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
15083 0 : if (value == NULL) {
15084 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
15085 0 : return -1;
15086 : }
15087 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
15088 0 : return 0;
15089 : }
15090 :
15091 : static PyGetSetDef py_lsa_QueryInfoPolicy_getsetters[] = {
15092 : {
15093 : .name = discard_const_p(char, "in_handle"),
15094 : .get = py_lsa_QueryInfoPolicy_in_get_handle,
15095 : .set = py_lsa_QueryInfoPolicy_in_set_handle,
15096 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
15097 : },
15098 : {
15099 : .name = discard_const_p(char, "in_level"),
15100 : .get = py_lsa_QueryInfoPolicy_in_get_level,
15101 : .set = py_lsa_QueryInfoPolicy_in_set_level,
15102 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInfo")
15103 : },
15104 : {
15105 : .name = discard_const_p(char, "out_info"),
15106 : .get = py_lsa_QueryInfoPolicy_out_get_info,
15107 : .set = py_lsa_QueryInfoPolicy_out_set_info,
15108 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInformation")
15109 : },
15110 : {
15111 : .name = discard_const_p(char, "result"),
15112 : .get = py_lsa_QueryInfoPolicy_get_result,
15113 : .set = py_lsa_QueryInfoPolicy_set_result,
15114 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
15115 : },
15116 : { .name = NULL }
15117 : };
15118 :
15119 0 : static PyObject *py_lsa_QueryInfoPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15120 : {
15121 0 : PyObject *self = pytalloc_new(struct lsa_QueryInfoPolicy, type);
15122 0 : struct lsa_QueryInfoPolicy *_self = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(self);
15123 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
15124 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
15125 : /* a pointer to a NULL pointer */
15126 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_PolicyInformation *);
15127 0 : return self;
15128 : }
15129 :
15130 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
15131 : {
15132 :
15133 :
15134 0 : return PyLong_FromLong(7);
15135 : }
15136 :
15137 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
15138 : {
15139 0 : const struct ndr_interface_call *call = NULL;
15140 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
15141 0 : PyObject *ret = NULL;
15142 0 : struct ndr_push *push = NULL;
15143 : DATA_BLOB blob;
15144 : enum ndr_err_code err;
15145 :
15146 0 : if (ndr_table_lsarpc.num_calls < 8) {
15147 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy_ndr_pack");
15148 0 : return NULL;
15149 : }
15150 0 : call = &ndr_table_lsarpc.calls[7];
15151 :
15152 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
15153 0 : if (push == NULL) {
15154 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15155 0 : return NULL;
15156 : }
15157 :
15158 0 : push->flags |= ndr_push_flags;
15159 :
15160 0 : err = call->ndr_push(push, ndr_inout_flags, object);
15161 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15162 0 : TALLOC_FREE(push);
15163 0 : PyErr_SetNdrError(err);
15164 0 : return NULL;
15165 : }
15166 0 : blob = ndr_push_blob(push);
15167 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15168 0 : TALLOC_FREE(push);
15169 0 : return ret;
15170 : }
15171 :
15172 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15173 : {
15174 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15175 0 : PyObject *bigendian_obj = NULL;
15176 0 : PyObject *ndr64_obj = NULL;
15177 0 : uint32_t ndr_push_flags = 0;
15178 :
15179 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
15180 : discard_const_p(char *, kwnames),
15181 : &bigendian_obj,
15182 : &ndr64_obj)) {
15183 0 : return NULL;
15184 : }
15185 :
15186 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15187 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15188 : }
15189 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15190 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15191 : }
15192 :
15193 0 : return py_lsa_QueryInfoPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
15194 : }
15195 :
15196 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15197 : {
15198 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15199 0 : PyObject *bigendian_obj = NULL;
15200 0 : PyObject *ndr64_obj = NULL;
15201 0 : uint32_t ndr_push_flags = 0;
15202 :
15203 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
15204 : discard_const_p(char *, kwnames),
15205 : &bigendian_obj,
15206 : &ndr64_obj)) {
15207 0 : return NULL;
15208 : }
15209 :
15210 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15211 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15212 : }
15213 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15214 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15215 : }
15216 :
15217 0 : return py_lsa_QueryInfoPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
15218 : }
15219 :
15220 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
15221 : {
15222 0 : const struct ndr_interface_call *call = NULL;
15223 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
15224 0 : struct ndr_pull *pull = NULL;
15225 : enum ndr_err_code err;
15226 :
15227 0 : if (ndr_table_lsarpc.num_calls < 8) {
15228 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy_ndr_unpack");
15229 0 : return NULL;
15230 : }
15231 0 : call = &ndr_table_lsarpc.calls[7];
15232 :
15233 0 : pull = ndr_pull_init_blob(blob, object);
15234 0 : if (pull == NULL) {
15235 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15236 0 : return NULL;
15237 : }
15238 :
15239 0 : pull->flags |= ndr_pull_flags;
15240 :
15241 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
15242 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15243 0 : TALLOC_FREE(pull);
15244 0 : PyErr_SetNdrError(err);
15245 0 : return NULL;
15246 : }
15247 0 : if (!allow_remaining) {
15248 : uint32_t highest_ofs;
15249 :
15250 0 : if (pull->offset > pull->relative_highest_offset) {
15251 0 : highest_ofs = pull->offset;
15252 : } else {
15253 0 : highest_ofs = pull->relative_highest_offset;
15254 : }
15255 0 : if (highest_ofs < pull->data_size) {
15256 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
15257 : "not all bytes consumed ofs[%u] size[%u]",
15258 : highest_ofs, pull->data_size);
15259 0 : TALLOC_FREE(pull);
15260 0 : PyErr_SetNdrError(err);
15261 0 : return NULL;
15262 : }
15263 : }
15264 :
15265 0 : TALLOC_FREE(pull);
15266 0 : Py_RETURN_NONE;
15267 : }
15268 :
15269 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15270 : {
15271 : DATA_BLOB blob;
15272 0 : Py_ssize_t blob_length = 0;
15273 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15274 0 : PyObject *bigendian_obj = NULL;
15275 0 : PyObject *ndr64_obj = NULL;
15276 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15277 0 : PyObject *allow_remaining_obj = NULL;
15278 0 : bool allow_remaining = false;
15279 :
15280 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
15281 : discard_const_p(char *, kwnames),
15282 : &blob.data, &blob_length,
15283 : &bigendian_obj,
15284 : &ndr64_obj,
15285 : &allow_remaining_obj)) {
15286 0 : return NULL;
15287 : }
15288 0 : blob.length = blob_length;
15289 :
15290 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15291 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15292 : }
15293 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15294 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15295 : }
15296 :
15297 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15298 0 : allow_remaining = true;
15299 : }
15300 :
15301 0 : return py_lsa_QueryInfoPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
15302 : }
15303 :
15304 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15305 : {
15306 : DATA_BLOB blob;
15307 0 : Py_ssize_t blob_length = 0;
15308 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15309 0 : PyObject *bigendian_obj = NULL;
15310 0 : PyObject *ndr64_obj = NULL;
15311 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15312 0 : PyObject *allow_remaining_obj = NULL;
15313 0 : bool allow_remaining = false;
15314 :
15315 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
15316 : discard_const_p(char *, kwnames),
15317 : &blob.data, &blob_length,
15318 : &bigendian_obj,
15319 : &ndr64_obj,
15320 : &allow_remaining_obj)) {
15321 0 : return NULL;
15322 : }
15323 0 : blob.length = blob_length;
15324 :
15325 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15326 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15327 : }
15328 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15329 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15330 : }
15331 :
15332 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15333 0 : allow_remaining = true;
15334 : }
15335 :
15336 0 : return py_lsa_QueryInfoPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
15337 : }
15338 :
15339 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
15340 : {
15341 0 : const struct ndr_interface_call *call = NULL;
15342 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
15343 : PyObject *ret;
15344 : char *retstr;
15345 :
15346 0 : if (ndr_table_lsarpc.num_calls < 8) {
15347 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy_ndr_print");
15348 0 : return NULL;
15349 : }
15350 0 : call = &ndr_table_lsarpc.calls[7];
15351 :
15352 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
15353 0 : ret = PyUnicode_FromString(retstr);
15354 0 : TALLOC_FREE(retstr);
15355 :
15356 0 : return ret;
15357 : }
15358 :
15359 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15360 : {
15361 0 : return py_lsa_QueryInfoPolicy_ndr_print(py_obj, "lsa_QueryInfoPolicy_in", NDR_IN);
15362 : }
15363 :
15364 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15365 : {
15366 0 : return py_lsa_QueryInfoPolicy_ndr_print(py_obj, "lsa_QueryInfoPolicy_out", NDR_OUT);
15367 : }
15368 :
15369 : static PyMethodDef py_lsa_QueryInfoPolicy_methods[] = {
15370 : { "opnum", (PyCFunction)py_lsa_QueryInfoPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
15371 : "lsa.QueryInfoPolicy.opnum() -> 7 (0x07) " },
15372 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
15373 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
15374 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
15375 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
15376 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
15377 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
15378 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
15379 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
15380 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryInfoPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
15381 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryInfoPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
15382 : { NULL, NULL, 0, NULL }
15383 : };
15384 :
15385 :
15386 : static PyTypeObject lsa_QueryInfoPolicy_Type = {
15387 : PyVarObject_HEAD_INIT(NULL, 0)
15388 : .tp_name = "lsa.QueryInfoPolicy",
15389 : .tp_getset = py_lsa_QueryInfoPolicy_getsetters,
15390 : .tp_methods = py_lsa_QueryInfoPolicy_methods,
15391 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15392 : .tp_new = py_lsa_QueryInfoPolicy_new,
15393 : };
15394 :
15395 0 : static bool pack_py_lsa_QueryInfoPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryInfoPolicy *r)
15396 : {
15397 : PyObject *py_handle;
15398 : PyObject *py_level;
15399 0 : const char *kwnames[] = {
15400 : "handle", "level", NULL
15401 : };
15402 :
15403 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryInfoPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
15404 0 : return false;
15405 : }
15406 :
15407 0 : if (py_handle == NULL) {
15408 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
15409 0 : return false;
15410 : }
15411 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
15412 0 : if (r->in.handle == NULL) {
15413 0 : PyErr_NoMemory();
15414 0 : return false;
15415 : }
15416 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
15417 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
15418 0 : PyErr_NoMemory();
15419 0 : return false;
15420 : }
15421 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
15422 0 : if (py_level == NULL) {
15423 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
15424 0 : return false;
15425 : }
15426 : {
15427 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
15428 0 : if (PyLong_Check(py_level)) {
15429 : unsigned long long test_var;
15430 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
15431 0 : if (PyErr_Occurred() != NULL) {
15432 0 : return false;
15433 : }
15434 0 : if (test_var > uint_max) {
15435 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15436 : PyLong_Type.tp_name, uint_max, test_var);
15437 0 : return false;
15438 : }
15439 0 : r->in.level = test_var;
15440 : } else {
15441 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15442 : PyLong_Type.tp_name);
15443 0 : return false;
15444 : }
15445 : }
15446 0 : return true;
15447 : }
15448 :
15449 0 : static PyObject *unpack_py_lsa_QueryInfoPolicy_args_out(struct lsa_QueryInfoPolicy *r)
15450 : {
15451 : PyObject *result;
15452 : PyObject *py_info;
15453 0 : if (*r->out.info == NULL) {
15454 0 : py_info = Py_None;
15455 0 : Py_INCREF(py_info);
15456 : } else {
15457 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_PolicyInformation");
15458 0 : if (py_info == NULL) {
15459 0 : return NULL;
15460 : }
15461 : }
15462 0 : result = py_info;
15463 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
15464 0 : PyErr_SetNTSTATUS(r->out.result);
15465 0 : return NULL;
15466 : }
15467 :
15468 0 : return result;
15469 : }
15470 :
15471 :
15472 0 : static PyObject *py_lsa_SetInfoPolicy_in_get_handle(PyObject *obj, void *closure)
15473 : {
15474 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(obj);
15475 : PyObject *py_handle;
15476 0 : if (object->in.handle == NULL) {
15477 0 : Py_RETURN_NONE;
15478 : }
15479 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
15480 0 : return py_handle;
15481 : }
15482 :
15483 0 : static int py_lsa_SetInfoPolicy_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
15484 : {
15485 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15486 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
15487 0 : if (value == NULL) {
15488 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
15489 0 : return -1;
15490 : }
15491 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
15492 0 : if (object->in.handle == NULL) {
15493 0 : PyErr_NoMemory();
15494 0 : return -1;
15495 : }
15496 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
15497 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
15498 0 : PyErr_NoMemory();
15499 0 : return -1;
15500 : }
15501 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
15502 0 : return 0;
15503 : }
15504 :
15505 0 : static PyObject *py_lsa_SetInfoPolicy_in_get_level(PyObject *obj, void *closure)
15506 : {
15507 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(obj);
15508 : PyObject *py_level;
15509 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
15510 0 : return py_level;
15511 : }
15512 :
15513 0 : static int py_lsa_SetInfoPolicy_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
15514 : {
15515 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15516 0 : if (value == NULL) {
15517 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
15518 0 : return -1;
15519 : }
15520 : {
15521 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
15522 0 : if (PyLong_Check(value)) {
15523 : unsigned long long test_var;
15524 0 : test_var = PyLong_AsUnsignedLongLong(value);
15525 0 : if (PyErr_Occurred() != NULL) {
15526 0 : return -1;
15527 : }
15528 0 : if (test_var > uint_max) {
15529 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15530 : PyLong_Type.tp_name, uint_max, test_var);
15531 0 : return -1;
15532 : }
15533 0 : object->in.level = test_var;
15534 : } else {
15535 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15536 : PyLong_Type.tp_name);
15537 0 : return -1;
15538 : }
15539 : }
15540 0 : return 0;
15541 : }
15542 :
15543 0 : static PyObject *py_lsa_SetInfoPolicy_in_get_info(PyObject *obj, void *closure)
15544 : {
15545 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(obj);
15546 : PyObject *py_info;
15547 0 : if (object->in.info == NULL) {
15548 0 : Py_RETURN_NONE;
15549 : }
15550 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, object->in.info, object->in.level, object->in.info, "union lsa_PolicyInformation");
15551 0 : if (py_info == NULL) {
15552 0 : return NULL;
15553 : }
15554 0 : return py_info;
15555 : }
15556 :
15557 0 : static int py_lsa_SetInfoPolicy_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
15558 : {
15559 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15560 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
15561 0 : if (value == NULL) {
15562 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
15563 0 : return -1;
15564 : }
15565 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
15566 0 : if (object->in.info == NULL) {
15567 0 : PyErr_NoMemory();
15568 0 : return -1;
15569 : }
15570 : {
15571 : union lsa_PolicyInformation *info_switch_1;
15572 0 : info_switch_1 = (union lsa_PolicyInformation *)pyrpc_export_union(&lsa_PolicyInformation_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union lsa_PolicyInformation");
15573 0 : if (info_switch_1 == NULL) {
15574 0 : return -1;
15575 : }
15576 0 : object->in.info = info_switch_1;
15577 : }
15578 0 : return 0;
15579 : }
15580 :
15581 0 : static PyObject *py_lsa_SetInfoPolicy_get_result(PyObject *obj, void *closure)
15582 : {
15583 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(obj);
15584 : PyObject *py_result;
15585 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
15586 0 : return py_result;
15587 : }
15588 :
15589 0 : static int py_lsa_SetInfoPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
15590 : {
15591 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15592 0 : if (value == NULL) {
15593 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
15594 0 : return -1;
15595 : }
15596 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
15597 0 : return 0;
15598 : }
15599 :
15600 : static PyGetSetDef py_lsa_SetInfoPolicy_getsetters[] = {
15601 : {
15602 : .name = discard_const_p(char, "in_handle"),
15603 : .get = py_lsa_SetInfoPolicy_in_get_handle,
15604 : .set = py_lsa_SetInfoPolicy_in_set_handle,
15605 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
15606 : },
15607 : {
15608 : .name = discard_const_p(char, "in_level"),
15609 : .get = py_lsa_SetInfoPolicy_in_get_level,
15610 : .set = py_lsa_SetInfoPolicy_in_set_level,
15611 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInfo")
15612 : },
15613 : {
15614 : .name = discard_const_p(char, "in_info"),
15615 : .get = py_lsa_SetInfoPolicy_in_get_info,
15616 : .set = py_lsa_SetInfoPolicy_in_set_info,
15617 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInformation")
15618 : },
15619 : {
15620 : .name = discard_const_p(char, "result"),
15621 : .get = py_lsa_SetInfoPolicy_get_result,
15622 : .set = py_lsa_SetInfoPolicy_set_result,
15623 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
15624 : },
15625 : { .name = NULL }
15626 : };
15627 :
15628 0 : static PyObject *py_lsa_SetInfoPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15629 : {
15630 0 : PyObject *self = pytalloc_new(struct lsa_SetInfoPolicy, type);
15631 0 : struct lsa_SetInfoPolicy *_self = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(self);
15632 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
15633 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
15634 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_PolicyInformation);
15635 0 : return self;
15636 : }
15637 :
15638 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
15639 : {
15640 :
15641 :
15642 0 : return PyLong_FromLong(8);
15643 : }
15644 :
15645 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
15646 : {
15647 0 : const struct ndr_interface_call *call = NULL;
15648 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15649 0 : PyObject *ret = NULL;
15650 0 : struct ndr_push *push = NULL;
15651 : DATA_BLOB blob;
15652 : enum ndr_err_code err;
15653 :
15654 0 : if (ndr_table_lsarpc.num_calls < 9) {
15655 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy_ndr_pack");
15656 0 : return NULL;
15657 : }
15658 0 : call = &ndr_table_lsarpc.calls[8];
15659 :
15660 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
15661 0 : if (push == NULL) {
15662 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15663 0 : return NULL;
15664 : }
15665 :
15666 0 : push->flags |= ndr_push_flags;
15667 :
15668 0 : err = call->ndr_push(push, ndr_inout_flags, object);
15669 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15670 0 : TALLOC_FREE(push);
15671 0 : PyErr_SetNdrError(err);
15672 0 : return NULL;
15673 : }
15674 0 : blob = ndr_push_blob(push);
15675 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15676 0 : TALLOC_FREE(push);
15677 0 : return ret;
15678 : }
15679 :
15680 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15681 : {
15682 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15683 0 : PyObject *bigendian_obj = NULL;
15684 0 : PyObject *ndr64_obj = NULL;
15685 0 : uint32_t ndr_push_flags = 0;
15686 :
15687 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
15688 : discard_const_p(char *, kwnames),
15689 : &bigendian_obj,
15690 : &ndr64_obj)) {
15691 0 : return NULL;
15692 : }
15693 :
15694 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15695 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15696 : }
15697 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15698 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15699 : }
15700 :
15701 0 : return py_lsa_SetInfoPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
15702 : }
15703 :
15704 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15705 : {
15706 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15707 0 : PyObject *bigendian_obj = NULL;
15708 0 : PyObject *ndr64_obj = NULL;
15709 0 : uint32_t ndr_push_flags = 0;
15710 :
15711 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
15712 : discard_const_p(char *, kwnames),
15713 : &bigendian_obj,
15714 : &ndr64_obj)) {
15715 0 : return NULL;
15716 : }
15717 :
15718 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15719 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15720 : }
15721 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15722 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15723 : }
15724 :
15725 0 : return py_lsa_SetInfoPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
15726 : }
15727 :
15728 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
15729 : {
15730 0 : const struct ndr_interface_call *call = NULL;
15731 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15732 0 : struct ndr_pull *pull = NULL;
15733 : enum ndr_err_code err;
15734 :
15735 0 : if (ndr_table_lsarpc.num_calls < 9) {
15736 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy_ndr_unpack");
15737 0 : return NULL;
15738 : }
15739 0 : call = &ndr_table_lsarpc.calls[8];
15740 :
15741 0 : pull = ndr_pull_init_blob(blob, object);
15742 0 : if (pull == NULL) {
15743 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15744 0 : return NULL;
15745 : }
15746 :
15747 0 : pull->flags |= ndr_pull_flags;
15748 :
15749 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
15750 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15751 0 : TALLOC_FREE(pull);
15752 0 : PyErr_SetNdrError(err);
15753 0 : return NULL;
15754 : }
15755 0 : if (!allow_remaining) {
15756 : uint32_t highest_ofs;
15757 :
15758 0 : if (pull->offset > pull->relative_highest_offset) {
15759 0 : highest_ofs = pull->offset;
15760 : } else {
15761 0 : highest_ofs = pull->relative_highest_offset;
15762 : }
15763 0 : if (highest_ofs < pull->data_size) {
15764 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
15765 : "not all bytes consumed ofs[%u] size[%u]",
15766 : highest_ofs, pull->data_size);
15767 0 : TALLOC_FREE(pull);
15768 0 : PyErr_SetNdrError(err);
15769 0 : return NULL;
15770 : }
15771 : }
15772 :
15773 0 : TALLOC_FREE(pull);
15774 0 : Py_RETURN_NONE;
15775 : }
15776 :
15777 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15778 : {
15779 : DATA_BLOB blob;
15780 0 : Py_ssize_t blob_length = 0;
15781 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15782 0 : PyObject *bigendian_obj = NULL;
15783 0 : PyObject *ndr64_obj = NULL;
15784 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15785 0 : PyObject *allow_remaining_obj = NULL;
15786 0 : bool allow_remaining = false;
15787 :
15788 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
15789 : discard_const_p(char *, kwnames),
15790 : &blob.data, &blob_length,
15791 : &bigendian_obj,
15792 : &ndr64_obj,
15793 : &allow_remaining_obj)) {
15794 0 : return NULL;
15795 : }
15796 0 : blob.length = blob_length;
15797 :
15798 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15799 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15800 : }
15801 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15802 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15803 : }
15804 :
15805 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15806 0 : allow_remaining = true;
15807 : }
15808 :
15809 0 : return py_lsa_SetInfoPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
15810 : }
15811 :
15812 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15813 : {
15814 : DATA_BLOB blob;
15815 0 : Py_ssize_t blob_length = 0;
15816 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15817 0 : PyObject *bigendian_obj = NULL;
15818 0 : PyObject *ndr64_obj = NULL;
15819 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15820 0 : PyObject *allow_remaining_obj = NULL;
15821 0 : bool allow_remaining = false;
15822 :
15823 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
15824 : discard_const_p(char *, kwnames),
15825 : &blob.data, &blob_length,
15826 : &bigendian_obj,
15827 : &ndr64_obj,
15828 : &allow_remaining_obj)) {
15829 0 : return NULL;
15830 : }
15831 0 : blob.length = blob_length;
15832 :
15833 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15834 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15835 : }
15836 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15837 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15838 : }
15839 :
15840 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15841 0 : allow_remaining = true;
15842 : }
15843 :
15844 0 : return py_lsa_SetInfoPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
15845 : }
15846 :
15847 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
15848 : {
15849 0 : const struct ndr_interface_call *call = NULL;
15850 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15851 : PyObject *ret;
15852 : char *retstr;
15853 :
15854 0 : if (ndr_table_lsarpc.num_calls < 9) {
15855 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy_ndr_print");
15856 0 : return NULL;
15857 : }
15858 0 : call = &ndr_table_lsarpc.calls[8];
15859 :
15860 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
15861 0 : ret = PyUnicode_FromString(retstr);
15862 0 : TALLOC_FREE(retstr);
15863 :
15864 0 : return ret;
15865 : }
15866 :
15867 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15868 : {
15869 0 : return py_lsa_SetInfoPolicy_ndr_print(py_obj, "lsa_SetInfoPolicy_in", NDR_IN);
15870 : }
15871 :
15872 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15873 : {
15874 0 : return py_lsa_SetInfoPolicy_ndr_print(py_obj, "lsa_SetInfoPolicy_out", NDR_OUT);
15875 : }
15876 :
15877 : static PyMethodDef py_lsa_SetInfoPolicy_methods[] = {
15878 : { "opnum", (PyCFunction)py_lsa_SetInfoPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
15879 : "lsa.SetInfoPolicy.opnum() -> 8 (0x08) " },
15880 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
15881 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
15882 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
15883 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
15884 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
15885 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
15886 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
15887 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
15888 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetInfoPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
15889 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetInfoPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
15890 : { NULL, NULL, 0, NULL }
15891 : };
15892 :
15893 :
15894 : static PyTypeObject lsa_SetInfoPolicy_Type = {
15895 : PyVarObject_HEAD_INIT(NULL, 0)
15896 : .tp_name = "lsa.SetInfoPolicy",
15897 : .tp_getset = py_lsa_SetInfoPolicy_getsetters,
15898 : .tp_methods = py_lsa_SetInfoPolicy_methods,
15899 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15900 : .tp_new = py_lsa_SetInfoPolicy_new,
15901 : };
15902 :
15903 0 : static bool pack_py_lsa_SetInfoPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInfoPolicy *r)
15904 : {
15905 : PyObject *py_handle;
15906 : PyObject *py_level;
15907 : PyObject *py_info;
15908 0 : const char *kwnames[] = {
15909 : "handle", "level", "info", NULL
15910 : };
15911 :
15912 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInfoPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
15913 0 : return false;
15914 : }
15915 :
15916 0 : if (py_handle == NULL) {
15917 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
15918 0 : return false;
15919 : }
15920 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
15921 0 : if (r->in.handle == NULL) {
15922 0 : PyErr_NoMemory();
15923 0 : return false;
15924 : }
15925 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
15926 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
15927 0 : PyErr_NoMemory();
15928 0 : return false;
15929 : }
15930 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
15931 0 : if (py_level == NULL) {
15932 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
15933 0 : return false;
15934 : }
15935 : {
15936 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
15937 0 : if (PyLong_Check(py_level)) {
15938 : unsigned long long test_var;
15939 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
15940 0 : if (PyErr_Occurred() != NULL) {
15941 0 : return false;
15942 : }
15943 0 : if (test_var > uint_max) {
15944 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15945 : PyLong_Type.tp_name, uint_max, test_var);
15946 0 : return false;
15947 : }
15948 0 : r->in.level = test_var;
15949 : } else {
15950 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15951 : PyLong_Type.tp_name);
15952 0 : return false;
15953 : }
15954 : }
15955 0 : if (py_info == NULL) {
15956 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
15957 0 : return false;
15958 : }
15959 0 : r->in.info = talloc_ptrtype(r, r->in.info);
15960 0 : if (r->in.info == NULL) {
15961 0 : PyErr_NoMemory();
15962 0 : return false;
15963 : }
15964 : {
15965 : union lsa_PolicyInformation *info_switch_1;
15966 0 : info_switch_1 = (union lsa_PolicyInformation *)pyrpc_export_union(&lsa_PolicyInformation_Type, r, r->in.level, py_info, "union lsa_PolicyInformation");
15967 0 : if (info_switch_1 == NULL) {
15968 0 : return false;
15969 : }
15970 0 : r->in.info = info_switch_1;
15971 : }
15972 0 : return true;
15973 : }
15974 :
15975 0 : static PyObject *unpack_py_lsa_SetInfoPolicy_args_out(struct lsa_SetInfoPolicy *r)
15976 : {
15977 : PyObject *result;
15978 0 : result = Py_None;
15979 0 : Py_INCREF(result);
15980 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
15981 0 : PyErr_SetNTSTATUS(r->out.result);
15982 0 : return NULL;
15983 : }
15984 :
15985 0 : return result;
15986 : }
15987 :
15988 :
15989 0 : static PyObject *py_lsa_CreateAccount_in_get_handle(PyObject *obj, void *closure)
15990 : {
15991 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(obj);
15992 : PyObject *py_handle;
15993 0 : if (object->in.handle == NULL) {
15994 0 : Py_RETURN_NONE;
15995 : }
15996 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
15997 0 : return py_handle;
15998 : }
15999 :
16000 0 : static int py_lsa_CreateAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
16001 : {
16002 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16003 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
16004 0 : if (value == NULL) {
16005 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
16006 0 : return -1;
16007 : }
16008 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
16009 0 : if (object->in.handle == NULL) {
16010 0 : PyErr_NoMemory();
16011 0 : return -1;
16012 : }
16013 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
16014 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16015 0 : PyErr_NoMemory();
16016 0 : return -1;
16017 : }
16018 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
16019 0 : return 0;
16020 : }
16021 :
16022 0 : static PyObject *py_lsa_CreateAccount_in_get_sid(PyObject *obj, void *closure)
16023 : {
16024 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(obj);
16025 : PyObject *py_sid;
16026 0 : if (object->in.sid == NULL) {
16027 0 : Py_RETURN_NONE;
16028 : }
16029 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
16030 0 : return py_sid;
16031 : }
16032 :
16033 0 : static int py_lsa_CreateAccount_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
16034 : {
16035 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16036 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
16037 0 : if (value == NULL) {
16038 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
16039 0 : return -1;
16040 : }
16041 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
16042 0 : if (object->in.sid == NULL) {
16043 0 : PyErr_NoMemory();
16044 0 : return -1;
16045 : }
16046 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
16047 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16048 0 : PyErr_NoMemory();
16049 0 : return -1;
16050 : }
16051 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
16052 0 : return 0;
16053 : }
16054 :
16055 0 : static PyObject *py_lsa_CreateAccount_in_get_access_mask(PyObject *obj, void *closure)
16056 : {
16057 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(obj);
16058 : PyObject *py_access_mask;
16059 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
16060 0 : return py_access_mask;
16061 : }
16062 :
16063 0 : static int py_lsa_CreateAccount_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
16064 : {
16065 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16066 0 : if (value == NULL) {
16067 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
16068 0 : return -1;
16069 : }
16070 : {
16071 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
16072 0 : if (PyLong_Check(value)) {
16073 : unsigned long long test_var;
16074 0 : test_var = PyLong_AsUnsignedLongLong(value);
16075 0 : if (PyErr_Occurred() != NULL) {
16076 0 : return -1;
16077 : }
16078 0 : if (test_var > uint_max) {
16079 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16080 : PyLong_Type.tp_name, uint_max, test_var);
16081 0 : return -1;
16082 : }
16083 0 : object->in.access_mask = test_var;
16084 : } else {
16085 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16086 : PyLong_Type.tp_name);
16087 0 : return -1;
16088 : }
16089 : }
16090 0 : return 0;
16091 : }
16092 :
16093 0 : static PyObject *py_lsa_CreateAccount_out_get_acct_handle(PyObject *obj, void *closure)
16094 : {
16095 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(obj);
16096 : PyObject *py_acct_handle;
16097 0 : if (object->out.acct_handle == NULL) {
16098 0 : Py_RETURN_NONE;
16099 : }
16100 0 : py_acct_handle = pytalloc_reference_ex(policy_handle_Type, object->out.acct_handle, object->out.acct_handle);
16101 0 : return py_acct_handle;
16102 : }
16103 :
16104 0 : static int py_lsa_CreateAccount_out_set_acct_handle(PyObject *py_obj, PyObject *value, void *closure)
16105 : {
16106 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16107 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.acct_handle));
16108 0 : if (value == NULL) {
16109 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.acct_handle");
16110 0 : return -1;
16111 : }
16112 0 : object->out.acct_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.acct_handle);
16113 0 : if (object->out.acct_handle == NULL) {
16114 0 : PyErr_NoMemory();
16115 0 : return -1;
16116 : }
16117 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
16118 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16119 0 : PyErr_NoMemory();
16120 0 : return -1;
16121 : }
16122 0 : object->out.acct_handle = (struct policy_handle *)pytalloc_get_ptr(value);
16123 0 : return 0;
16124 : }
16125 :
16126 0 : static PyObject *py_lsa_CreateAccount_get_result(PyObject *obj, void *closure)
16127 : {
16128 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(obj);
16129 : PyObject *py_result;
16130 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
16131 0 : return py_result;
16132 : }
16133 :
16134 0 : static int py_lsa_CreateAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
16135 : {
16136 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16137 0 : if (value == NULL) {
16138 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
16139 0 : return -1;
16140 : }
16141 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
16142 0 : return 0;
16143 : }
16144 :
16145 : static PyGetSetDef py_lsa_CreateAccount_getsetters[] = {
16146 : {
16147 : .name = discard_const_p(char, "in_handle"),
16148 : .get = py_lsa_CreateAccount_in_get_handle,
16149 : .set = py_lsa_CreateAccount_in_set_handle,
16150 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
16151 : },
16152 : {
16153 : .name = discard_const_p(char, "in_sid"),
16154 : .get = py_lsa_CreateAccount_in_get_sid,
16155 : .set = py_lsa_CreateAccount_in_set_sid,
16156 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
16157 : },
16158 : {
16159 : .name = discard_const_p(char, "in_access_mask"),
16160 : .get = py_lsa_CreateAccount_in_get_access_mask,
16161 : .set = py_lsa_CreateAccount_in_set_access_mask,
16162 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AccountAccessMask")
16163 : },
16164 : {
16165 : .name = discard_const_p(char, "out_acct_handle"),
16166 : .get = py_lsa_CreateAccount_out_get_acct_handle,
16167 : .set = py_lsa_CreateAccount_out_set_acct_handle,
16168 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
16169 : },
16170 : {
16171 : .name = discard_const_p(char, "result"),
16172 : .get = py_lsa_CreateAccount_get_result,
16173 : .set = py_lsa_CreateAccount_set_result,
16174 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
16175 : },
16176 : { .name = NULL }
16177 : };
16178 :
16179 0 : static PyObject *py_lsa_CreateAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16180 : {
16181 0 : PyObject *self = pytalloc_new(struct lsa_CreateAccount, type);
16182 0 : struct lsa_CreateAccount *_self = (struct lsa_CreateAccount *)pytalloc_get_ptr(self);
16183 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
16184 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
16185 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
16186 0 : _self->out.acct_handle = talloc_zero(mem_ctx, struct policy_handle);
16187 0 : return self;
16188 : }
16189 :
16190 0 : static PyObject *py_lsa_CreateAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
16191 : {
16192 :
16193 :
16194 0 : return PyLong_FromLong(10);
16195 : }
16196 :
16197 0 : static PyObject *py_lsa_CreateAccount_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
16198 : {
16199 0 : const struct ndr_interface_call *call = NULL;
16200 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16201 0 : PyObject *ret = NULL;
16202 0 : struct ndr_push *push = NULL;
16203 : DATA_BLOB blob;
16204 : enum ndr_err_code err;
16205 :
16206 0 : if (ndr_table_lsarpc.num_calls < 11) {
16207 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateAccount_ndr_pack");
16208 0 : return NULL;
16209 : }
16210 0 : call = &ndr_table_lsarpc.calls[10];
16211 :
16212 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
16213 0 : if (push == NULL) {
16214 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16215 0 : return NULL;
16216 : }
16217 :
16218 0 : push->flags |= ndr_push_flags;
16219 :
16220 0 : err = call->ndr_push(push, ndr_inout_flags, object);
16221 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16222 0 : TALLOC_FREE(push);
16223 0 : PyErr_SetNdrError(err);
16224 0 : return NULL;
16225 : }
16226 0 : blob = ndr_push_blob(push);
16227 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16228 0 : TALLOC_FREE(push);
16229 0 : return ret;
16230 : }
16231 :
16232 0 : static PyObject *py_lsa_CreateAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16233 : {
16234 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16235 0 : PyObject *bigendian_obj = NULL;
16236 0 : PyObject *ndr64_obj = NULL;
16237 0 : uint32_t ndr_push_flags = 0;
16238 :
16239 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
16240 : discard_const_p(char *, kwnames),
16241 : &bigendian_obj,
16242 : &ndr64_obj)) {
16243 0 : return NULL;
16244 : }
16245 :
16246 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16247 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16248 : }
16249 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16250 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16251 : }
16252 :
16253 0 : return py_lsa_CreateAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
16254 : }
16255 :
16256 0 : static PyObject *py_lsa_CreateAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16257 : {
16258 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16259 0 : PyObject *bigendian_obj = NULL;
16260 0 : PyObject *ndr64_obj = NULL;
16261 0 : uint32_t ndr_push_flags = 0;
16262 :
16263 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
16264 : discard_const_p(char *, kwnames),
16265 : &bigendian_obj,
16266 : &ndr64_obj)) {
16267 0 : return NULL;
16268 : }
16269 :
16270 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16271 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16272 : }
16273 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16274 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16275 : }
16276 :
16277 0 : return py_lsa_CreateAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
16278 : }
16279 :
16280 0 : static PyObject *py_lsa_CreateAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
16281 : {
16282 0 : const struct ndr_interface_call *call = NULL;
16283 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16284 0 : struct ndr_pull *pull = NULL;
16285 : enum ndr_err_code err;
16286 :
16287 0 : if (ndr_table_lsarpc.num_calls < 11) {
16288 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateAccount_ndr_unpack");
16289 0 : return NULL;
16290 : }
16291 0 : call = &ndr_table_lsarpc.calls[10];
16292 :
16293 0 : pull = ndr_pull_init_blob(blob, object);
16294 0 : if (pull == NULL) {
16295 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16296 0 : return NULL;
16297 : }
16298 :
16299 0 : pull->flags |= ndr_pull_flags;
16300 :
16301 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
16302 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16303 0 : TALLOC_FREE(pull);
16304 0 : PyErr_SetNdrError(err);
16305 0 : return NULL;
16306 : }
16307 0 : if (!allow_remaining) {
16308 : uint32_t highest_ofs;
16309 :
16310 0 : if (pull->offset > pull->relative_highest_offset) {
16311 0 : highest_ofs = pull->offset;
16312 : } else {
16313 0 : highest_ofs = pull->relative_highest_offset;
16314 : }
16315 0 : if (highest_ofs < pull->data_size) {
16316 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
16317 : "not all bytes consumed ofs[%u] size[%u]",
16318 : highest_ofs, pull->data_size);
16319 0 : TALLOC_FREE(pull);
16320 0 : PyErr_SetNdrError(err);
16321 0 : return NULL;
16322 : }
16323 : }
16324 :
16325 0 : TALLOC_FREE(pull);
16326 0 : Py_RETURN_NONE;
16327 : }
16328 :
16329 0 : static PyObject *py_lsa_CreateAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16330 : {
16331 : DATA_BLOB blob;
16332 0 : Py_ssize_t blob_length = 0;
16333 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16334 0 : PyObject *bigendian_obj = NULL;
16335 0 : PyObject *ndr64_obj = NULL;
16336 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16337 0 : PyObject *allow_remaining_obj = NULL;
16338 0 : bool allow_remaining = false;
16339 :
16340 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
16341 : discard_const_p(char *, kwnames),
16342 : &blob.data, &blob_length,
16343 : &bigendian_obj,
16344 : &ndr64_obj,
16345 : &allow_remaining_obj)) {
16346 0 : return NULL;
16347 : }
16348 0 : blob.length = blob_length;
16349 :
16350 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16351 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16352 : }
16353 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16354 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16355 : }
16356 :
16357 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16358 0 : allow_remaining = true;
16359 : }
16360 :
16361 0 : return py_lsa_CreateAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
16362 : }
16363 :
16364 0 : static PyObject *py_lsa_CreateAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16365 : {
16366 : DATA_BLOB blob;
16367 0 : Py_ssize_t blob_length = 0;
16368 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16369 0 : PyObject *bigendian_obj = NULL;
16370 0 : PyObject *ndr64_obj = NULL;
16371 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16372 0 : PyObject *allow_remaining_obj = NULL;
16373 0 : bool allow_remaining = false;
16374 :
16375 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
16376 : discard_const_p(char *, kwnames),
16377 : &blob.data, &blob_length,
16378 : &bigendian_obj,
16379 : &ndr64_obj,
16380 : &allow_remaining_obj)) {
16381 0 : return NULL;
16382 : }
16383 0 : blob.length = blob_length;
16384 :
16385 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16386 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16387 : }
16388 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16389 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16390 : }
16391 :
16392 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16393 0 : allow_remaining = true;
16394 : }
16395 :
16396 0 : return py_lsa_CreateAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
16397 : }
16398 :
16399 0 : static PyObject *py_lsa_CreateAccount_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
16400 : {
16401 0 : const struct ndr_interface_call *call = NULL;
16402 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16403 : PyObject *ret;
16404 : char *retstr;
16405 :
16406 0 : if (ndr_table_lsarpc.num_calls < 11) {
16407 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateAccount_ndr_print");
16408 0 : return NULL;
16409 : }
16410 0 : call = &ndr_table_lsarpc.calls[10];
16411 :
16412 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
16413 0 : ret = PyUnicode_FromString(retstr);
16414 0 : TALLOC_FREE(retstr);
16415 :
16416 0 : return ret;
16417 : }
16418 :
16419 0 : static PyObject *py_lsa_CreateAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16420 : {
16421 0 : return py_lsa_CreateAccount_ndr_print(py_obj, "lsa_CreateAccount_in", NDR_IN);
16422 : }
16423 :
16424 0 : static PyObject *py_lsa_CreateAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16425 : {
16426 0 : return py_lsa_CreateAccount_ndr_print(py_obj, "lsa_CreateAccount_out", NDR_OUT);
16427 : }
16428 :
16429 : static PyMethodDef py_lsa_CreateAccount_methods[] = {
16430 : { "opnum", (PyCFunction)py_lsa_CreateAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
16431 : "lsa.CreateAccount.opnum() -> 10 (0x0a) " },
16432 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
16433 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
16434 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
16435 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
16436 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
16437 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
16438 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
16439 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
16440 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
16441 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
16442 : { NULL, NULL, 0, NULL }
16443 : };
16444 :
16445 :
16446 : static PyTypeObject lsa_CreateAccount_Type = {
16447 : PyVarObject_HEAD_INIT(NULL, 0)
16448 : .tp_name = "lsa.CreateAccount",
16449 : .tp_getset = py_lsa_CreateAccount_getsetters,
16450 : .tp_methods = py_lsa_CreateAccount_methods,
16451 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16452 : .tp_new = py_lsa_CreateAccount_new,
16453 : };
16454 :
16455 0 : static bool pack_py_lsa_CreateAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateAccount *r)
16456 : {
16457 : PyObject *py_handle;
16458 : PyObject *py_sid;
16459 : PyObject *py_access_mask;
16460 0 : const char *kwnames[] = {
16461 : "handle", "sid", "access_mask", NULL
16462 : };
16463 :
16464 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateAccount", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
16465 0 : return false;
16466 : }
16467 :
16468 0 : if (py_handle == NULL) {
16469 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
16470 0 : return false;
16471 : }
16472 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
16473 0 : if (r->in.handle == NULL) {
16474 0 : PyErr_NoMemory();
16475 0 : return false;
16476 : }
16477 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
16478 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
16479 0 : PyErr_NoMemory();
16480 0 : return false;
16481 : }
16482 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
16483 0 : if (py_sid == NULL) {
16484 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
16485 0 : return false;
16486 : }
16487 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
16488 0 : if (r->in.sid == NULL) {
16489 0 : PyErr_NoMemory();
16490 0 : return false;
16491 : }
16492 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
16493 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
16494 0 : PyErr_NoMemory();
16495 0 : return false;
16496 : }
16497 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
16498 0 : if (py_access_mask == NULL) {
16499 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
16500 0 : return false;
16501 : }
16502 : {
16503 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
16504 0 : if (PyLong_Check(py_access_mask)) {
16505 : unsigned long long test_var;
16506 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
16507 0 : if (PyErr_Occurred() != NULL) {
16508 0 : return false;
16509 : }
16510 0 : if (test_var > uint_max) {
16511 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16512 : PyLong_Type.tp_name, uint_max, test_var);
16513 0 : return false;
16514 : }
16515 0 : r->in.access_mask = test_var;
16516 : } else {
16517 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16518 : PyLong_Type.tp_name);
16519 0 : return false;
16520 : }
16521 : }
16522 0 : return true;
16523 : }
16524 :
16525 0 : static PyObject *unpack_py_lsa_CreateAccount_args_out(struct lsa_CreateAccount *r)
16526 : {
16527 : PyObject *result;
16528 : PyObject *py_acct_handle;
16529 0 : py_acct_handle = pytalloc_reference_ex(policy_handle_Type, r->out.acct_handle, r->out.acct_handle);
16530 0 : result = py_acct_handle;
16531 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
16532 0 : PyErr_SetNTSTATUS(r->out.result);
16533 0 : return NULL;
16534 : }
16535 :
16536 0 : return result;
16537 : }
16538 :
16539 :
16540 0 : static PyObject *py_lsa_EnumAccounts_in_get_handle(PyObject *obj, void *closure)
16541 : {
16542 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(obj);
16543 : PyObject *py_handle;
16544 0 : if (object->in.handle == NULL) {
16545 0 : Py_RETURN_NONE;
16546 : }
16547 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
16548 0 : return py_handle;
16549 : }
16550 :
16551 0 : static int py_lsa_EnumAccounts_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
16552 : {
16553 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16554 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
16555 0 : if (value == NULL) {
16556 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
16557 0 : return -1;
16558 : }
16559 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
16560 0 : if (object->in.handle == NULL) {
16561 0 : PyErr_NoMemory();
16562 0 : return -1;
16563 : }
16564 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
16565 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16566 0 : PyErr_NoMemory();
16567 0 : return -1;
16568 : }
16569 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
16570 0 : return 0;
16571 : }
16572 :
16573 0 : static PyObject *py_lsa_EnumAccounts_in_get_resume_handle(PyObject *obj, void *closure)
16574 : {
16575 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(obj);
16576 : PyObject *py_resume_handle;
16577 0 : if (object->in.resume_handle == NULL) {
16578 0 : Py_RETURN_NONE;
16579 : }
16580 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
16581 0 : return py_resume_handle;
16582 : }
16583 :
16584 0 : static int py_lsa_EnumAccounts_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
16585 : {
16586 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16587 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
16588 0 : if (value == NULL) {
16589 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
16590 0 : return -1;
16591 : }
16592 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
16593 0 : if (object->in.resume_handle == NULL) {
16594 0 : PyErr_NoMemory();
16595 0 : return -1;
16596 : }
16597 : {
16598 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
16599 0 : if (PyLong_Check(value)) {
16600 : unsigned long long test_var;
16601 0 : test_var = PyLong_AsUnsignedLongLong(value);
16602 0 : if (PyErr_Occurred() != NULL) {
16603 0 : return -1;
16604 : }
16605 0 : if (test_var > uint_max) {
16606 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16607 : PyLong_Type.tp_name, uint_max, test_var);
16608 0 : return -1;
16609 : }
16610 0 : *object->in.resume_handle = test_var;
16611 : } else {
16612 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16613 : PyLong_Type.tp_name);
16614 0 : return -1;
16615 : }
16616 : }
16617 0 : return 0;
16618 : }
16619 :
16620 0 : static PyObject *py_lsa_EnumAccounts_out_get_resume_handle(PyObject *obj, void *closure)
16621 : {
16622 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(obj);
16623 : PyObject *py_resume_handle;
16624 0 : if (object->out.resume_handle == NULL) {
16625 0 : Py_RETURN_NONE;
16626 : }
16627 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
16628 0 : return py_resume_handle;
16629 : }
16630 :
16631 0 : static int py_lsa_EnumAccounts_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
16632 : {
16633 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16634 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
16635 0 : if (value == NULL) {
16636 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
16637 0 : return -1;
16638 : }
16639 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
16640 0 : if (object->out.resume_handle == NULL) {
16641 0 : PyErr_NoMemory();
16642 0 : return -1;
16643 : }
16644 : {
16645 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
16646 0 : if (PyLong_Check(value)) {
16647 : unsigned long long test_var;
16648 0 : test_var = PyLong_AsUnsignedLongLong(value);
16649 0 : if (PyErr_Occurred() != NULL) {
16650 0 : return -1;
16651 : }
16652 0 : if (test_var > uint_max) {
16653 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16654 : PyLong_Type.tp_name, uint_max, test_var);
16655 0 : return -1;
16656 : }
16657 0 : *object->out.resume_handle = test_var;
16658 : } else {
16659 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16660 : PyLong_Type.tp_name);
16661 0 : return -1;
16662 : }
16663 : }
16664 0 : return 0;
16665 : }
16666 :
16667 0 : static PyObject *py_lsa_EnumAccounts_out_get_sids(PyObject *obj, void *closure)
16668 : {
16669 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(obj);
16670 : PyObject *py_sids;
16671 0 : if (object->out.sids == NULL) {
16672 0 : Py_RETURN_NONE;
16673 : }
16674 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->out.sids, object->out.sids);
16675 0 : return py_sids;
16676 : }
16677 :
16678 0 : static int py_lsa_EnumAccounts_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
16679 : {
16680 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16681 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
16682 0 : if (value == NULL) {
16683 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
16684 0 : return -1;
16685 : }
16686 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
16687 0 : if (object->out.sids == NULL) {
16688 0 : PyErr_NoMemory();
16689 0 : return -1;
16690 : }
16691 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
16692 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16693 0 : PyErr_NoMemory();
16694 0 : return -1;
16695 : }
16696 0 : object->out.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
16697 0 : return 0;
16698 : }
16699 :
16700 0 : static PyObject *py_lsa_EnumAccounts_in_get_num_entries(PyObject *obj, void *closure)
16701 : {
16702 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(obj);
16703 : PyObject *py_num_entries;
16704 0 : py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_entries);
16705 0 : return py_num_entries;
16706 : }
16707 :
16708 0 : static int py_lsa_EnumAccounts_in_set_num_entries(PyObject *py_obj, PyObject *value, void *closure)
16709 : {
16710 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16711 0 : if (value == NULL) {
16712 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_entries");
16713 0 : return -1;
16714 : }
16715 : {
16716 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_entries));
16717 0 : if (PyLong_Check(value)) {
16718 : unsigned long long test_var;
16719 0 : test_var = PyLong_AsUnsignedLongLong(value);
16720 0 : if (PyErr_Occurred() != NULL) {
16721 0 : return -1;
16722 : }
16723 0 : if (test_var > uint_max) {
16724 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16725 : PyLong_Type.tp_name, uint_max, test_var);
16726 0 : return -1;
16727 : }
16728 0 : object->in.num_entries = test_var;
16729 : } else {
16730 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16731 : PyLong_Type.tp_name);
16732 0 : return -1;
16733 : }
16734 : }
16735 0 : return 0;
16736 : }
16737 :
16738 0 : static PyObject *py_lsa_EnumAccounts_get_result(PyObject *obj, void *closure)
16739 : {
16740 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(obj);
16741 : PyObject *py_result;
16742 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
16743 0 : return py_result;
16744 : }
16745 :
16746 0 : static int py_lsa_EnumAccounts_set_result(PyObject *py_obj, PyObject *value, void *closure)
16747 : {
16748 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16749 0 : if (value == NULL) {
16750 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
16751 0 : return -1;
16752 : }
16753 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
16754 0 : return 0;
16755 : }
16756 :
16757 : static PyGetSetDef py_lsa_EnumAccounts_getsetters[] = {
16758 : {
16759 : .name = discard_const_p(char, "in_handle"),
16760 : .get = py_lsa_EnumAccounts_in_get_handle,
16761 : .set = py_lsa_EnumAccounts_in_set_handle,
16762 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
16763 : },
16764 : {
16765 : .name = discard_const_p(char, "in_resume_handle"),
16766 : .get = py_lsa_EnumAccounts_in_get_resume_handle,
16767 : .set = py_lsa_EnumAccounts_in_set_resume_handle,
16768 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16769 : },
16770 : {
16771 : .name = discard_const_p(char, "out_resume_handle"),
16772 : .get = py_lsa_EnumAccounts_out_get_resume_handle,
16773 : .set = py_lsa_EnumAccounts_out_set_resume_handle,
16774 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16775 : },
16776 : {
16777 : .name = discard_const_p(char, "out_sids"),
16778 : .get = py_lsa_EnumAccounts_out_get_sids,
16779 : .set = py_lsa_EnumAccounts_out_set_sids,
16780 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
16781 : },
16782 : {
16783 : .name = discard_const_p(char, "in_num_entries"),
16784 : .get = py_lsa_EnumAccounts_in_get_num_entries,
16785 : .set = py_lsa_EnumAccounts_in_set_num_entries,
16786 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16787 : },
16788 : {
16789 : .name = discard_const_p(char, "result"),
16790 : .get = py_lsa_EnumAccounts_get_result,
16791 : .set = py_lsa_EnumAccounts_set_result,
16792 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
16793 : },
16794 : { .name = NULL }
16795 : };
16796 :
16797 0 : static PyObject *py_lsa_EnumAccounts_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16798 : {
16799 0 : PyObject *self = pytalloc_new(struct lsa_EnumAccounts, type);
16800 0 : struct lsa_EnumAccounts *_self = (struct lsa_EnumAccounts *)pytalloc_get_ptr(self);
16801 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
16802 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
16803 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
16804 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
16805 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
16806 0 : return self;
16807 : }
16808 :
16809 0 : static PyObject *py_lsa_EnumAccounts_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
16810 : {
16811 :
16812 :
16813 0 : return PyLong_FromLong(11);
16814 : }
16815 :
16816 0 : static PyObject *py_lsa_EnumAccounts_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
16817 : {
16818 0 : const struct ndr_interface_call *call = NULL;
16819 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16820 0 : PyObject *ret = NULL;
16821 0 : struct ndr_push *push = NULL;
16822 : DATA_BLOB blob;
16823 : enum ndr_err_code err;
16824 :
16825 0 : if (ndr_table_lsarpc.num_calls < 12) {
16826 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccounts_ndr_pack");
16827 0 : return NULL;
16828 : }
16829 0 : call = &ndr_table_lsarpc.calls[11];
16830 :
16831 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
16832 0 : if (push == NULL) {
16833 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16834 0 : return NULL;
16835 : }
16836 :
16837 0 : push->flags |= ndr_push_flags;
16838 :
16839 0 : err = call->ndr_push(push, ndr_inout_flags, object);
16840 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16841 0 : TALLOC_FREE(push);
16842 0 : PyErr_SetNdrError(err);
16843 0 : return NULL;
16844 : }
16845 0 : blob = ndr_push_blob(push);
16846 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16847 0 : TALLOC_FREE(push);
16848 0 : return ret;
16849 : }
16850 :
16851 0 : static PyObject *py_lsa_EnumAccounts_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16852 : {
16853 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16854 0 : PyObject *bigendian_obj = NULL;
16855 0 : PyObject *ndr64_obj = NULL;
16856 0 : uint32_t ndr_push_flags = 0;
16857 :
16858 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
16859 : discard_const_p(char *, kwnames),
16860 : &bigendian_obj,
16861 : &ndr64_obj)) {
16862 0 : return NULL;
16863 : }
16864 :
16865 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16866 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16867 : }
16868 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16869 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16870 : }
16871 :
16872 0 : return py_lsa_EnumAccounts_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
16873 : }
16874 :
16875 0 : static PyObject *py_lsa_EnumAccounts_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16876 : {
16877 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16878 0 : PyObject *bigendian_obj = NULL;
16879 0 : PyObject *ndr64_obj = NULL;
16880 0 : uint32_t ndr_push_flags = 0;
16881 :
16882 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
16883 : discard_const_p(char *, kwnames),
16884 : &bigendian_obj,
16885 : &ndr64_obj)) {
16886 0 : return NULL;
16887 : }
16888 :
16889 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16890 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16891 : }
16892 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16893 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16894 : }
16895 :
16896 0 : return py_lsa_EnumAccounts_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
16897 : }
16898 :
16899 0 : static PyObject *py_lsa_EnumAccounts_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
16900 : {
16901 0 : const struct ndr_interface_call *call = NULL;
16902 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16903 0 : struct ndr_pull *pull = NULL;
16904 : enum ndr_err_code err;
16905 :
16906 0 : if (ndr_table_lsarpc.num_calls < 12) {
16907 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccounts_ndr_unpack");
16908 0 : return NULL;
16909 : }
16910 0 : call = &ndr_table_lsarpc.calls[11];
16911 :
16912 0 : pull = ndr_pull_init_blob(blob, object);
16913 0 : if (pull == NULL) {
16914 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16915 0 : return NULL;
16916 : }
16917 :
16918 0 : pull->flags |= ndr_pull_flags;
16919 :
16920 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
16921 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16922 0 : TALLOC_FREE(pull);
16923 0 : PyErr_SetNdrError(err);
16924 0 : return NULL;
16925 : }
16926 0 : if (!allow_remaining) {
16927 : uint32_t highest_ofs;
16928 :
16929 0 : if (pull->offset > pull->relative_highest_offset) {
16930 0 : highest_ofs = pull->offset;
16931 : } else {
16932 0 : highest_ofs = pull->relative_highest_offset;
16933 : }
16934 0 : if (highest_ofs < pull->data_size) {
16935 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
16936 : "not all bytes consumed ofs[%u] size[%u]",
16937 : highest_ofs, pull->data_size);
16938 0 : TALLOC_FREE(pull);
16939 0 : PyErr_SetNdrError(err);
16940 0 : return NULL;
16941 : }
16942 : }
16943 :
16944 0 : TALLOC_FREE(pull);
16945 0 : Py_RETURN_NONE;
16946 : }
16947 :
16948 0 : static PyObject *py_lsa_EnumAccounts_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16949 : {
16950 : DATA_BLOB blob;
16951 0 : Py_ssize_t blob_length = 0;
16952 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16953 0 : PyObject *bigendian_obj = NULL;
16954 0 : PyObject *ndr64_obj = NULL;
16955 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16956 0 : PyObject *allow_remaining_obj = NULL;
16957 0 : bool allow_remaining = false;
16958 :
16959 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
16960 : discard_const_p(char *, kwnames),
16961 : &blob.data, &blob_length,
16962 : &bigendian_obj,
16963 : &ndr64_obj,
16964 : &allow_remaining_obj)) {
16965 0 : return NULL;
16966 : }
16967 0 : blob.length = blob_length;
16968 :
16969 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16970 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16971 : }
16972 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16973 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16974 : }
16975 :
16976 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16977 0 : allow_remaining = true;
16978 : }
16979 :
16980 0 : return py_lsa_EnumAccounts_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
16981 : }
16982 :
16983 0 : static PyObject *py_lsa_EnumAccounts_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16984 : {
16985 : DATA_BLOB blob;
16986 0 : Py_ssize_t blob_length = 0;
16987 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16988 0 : PyObject *bigendian_obj = NULL;
16989 0 : PyObject *ndr64_obj = NULL;
16990 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16991 0 : PyObject *allow_remaining_obj = NULL;
16992 0 : bool allow_remaining = false;
16993 :
16994 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
16995 : discard_const_p(char *, kwnames),
16996 : &blob.data, &blob_length,
16997 : &bigendian_obj,
16998 : &ndr64_obj,
16999 : &allow_remaining_obj)) {
17000 0 : return NULL;
17001 : }
17002 0 : blob.length = blob_length;
17003 :
17004 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17005 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17006 : }
17007 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17008 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17009 : }
17010 :
17011 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17012 0 : allow_remaining = true;
17013 : }
17014 :
17015 0 : return py_lsa_EnumAccounts_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
17016 : }
17017 :
17018 0 : static PyObject *py_lsa_EnumAccounts_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
17019 : {
17020 0 : const struct ndr_interface_call *call = NULL;
17021 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
17022 : PyObject *ret;
17023 : char *retstr;
17024 :
17025 0 : if (ndr_table_lsarpc.num_calls < 12) {
17026 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccounts_ndr_print");
17027 0 : return NULL;
17028 : }
17029 0 : call = &ndr_table_lsarpc.calls[11];
17030 :
17031 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
17032 0 : ret = PyUnicode_FromString(retstr);
17033 0 : TALLOC_FREE(retstr);
17034 :
17035 0 : return ret;
17036 : }
17037 :
17038 0 : static PyObject *py_lsa_EnumAccounts_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17039 : {
17040 0 : return py_lsa_EnumAccounts_ndr_print(py_obj, "lsa_EnumAccounts_in", NDR_IN);
17041 : }
17042 :
17043 0 : static PyObject *py_lsa_EnumAccounts_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17044 : {
17045 0 : return py_lsa_EnumAccounts_ndr_print(py_obj, "lsa_EnumAccounts_out", NDR_OUT);
17046 : }
17047 :
17048 : static PyMethodDef py_lsa_EnumAccounts_methods[] = {
17049 : { "opnum", (PyCFunction)py_lsa_EnumAccounts_ndr_opnum, METH_NOARGS|METH_CLASS,
17050 : "lsa.EnumAccounts.opnum() -> 11 (0x0b) " },
17051 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccounts_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
17052 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
17053 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccounts_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
17054 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
17055 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccounts_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
17056 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
17057 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccounts_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
17058 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
17059 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumAccounts_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
17060 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumAccounts_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
17061 : { NULL, NULL, 0, NULL }
17062 : };
17063 :
17064 :
17065 : static PyTypeObject lsa_EnumAccounts_Type = {
17066 : PyVarObject_HEAD_INIT(NULL, 0)
17067 : .tp_name = "lsa.EnumAccounts",
17068 : .tp_getset = py_lsa_EnumAccounts_getsetters,
17069 : .tp_methods = py_lsa_EnumAccounts_methods,
17070 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17071 : .tp_new = py_lsa_EnumAccounts_new,
17072 : };
17073 :
17074 0 : static bool pack_py_lsa_EnumAccounts_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccounts *r)
17075 : {
17076 : PyObject *py_handle;
17077 : PyObject *py_resume_handle;
17078 : PyObject *py_num_entries;
17079 0 : const char *kwnames[] = {
17080 : "handle", "resume_handle", "num_entries", NULL
17081 : };
17082 :
17083 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumAccounts", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_num_entries)) {
17084 0 : return false;
17085 : }
17086 :
17087 0 : if (py_handle == NULL) {
17088 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
17089 0 : return false;
17090 : }
17091 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
17092 0 : if (r->in.handle == NULL) {
17093 0 : PyErr_NoMemory();
17094 0 : return false;
17095 : }
17096 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
17097 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
17098 0 : PyErr_NoMemory();
17099 0 : return false;
17100 : }
17101 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
17102 0 : if (py_resume_handle == NULL) {
17103 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
17104 0 : return false;
17105 : }
17106 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
17107 0 : if (r->in.resume_handle == NULL) {
17108 0 : PyErr_NoMemory();
17109 0 : return false;
17110 : }
17111 : {
17112 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
17113 0 : if (PyLong_Check(py_resume_handle)) {
17114 : unsigned long long test_var;
17115 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
17116 0 : if (PyErr_Occurred() != NULL) {
17117 0 : return false;
17118 : }
17119 0 : if (test_var > uint_max) {
17120 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17121 : PyLong_Type.tp_name, uint_max, test_var);
17122 0 : return false;
17123 : }
17124 0 : *r->in.resume_handle = test_var;
17125 : } else {
17126 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17127 : PyLong_Type.tp_name);
17128 0 : return false;
17129 : }
17130 : }
17131 0 : if (py_num_entries == NULL) {
17132 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.num_entries");
17133 0 : return false;
17134 : }
17135 : {
17136 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.num_entries));
17137 0 : if (PyLong_Check(py_num_entries)) {
17138 : unsigned long long test_var;
17139 0 : test_var = PyLong_AsUnsignedLongLong(py_num_entries);
17140 0 : if (PyErr_Occurred() != NULL) {
17141 0 : return false;
17142 : }
17143 0 : if (test_var > uint_max) {
17144 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17145 : PyLong_Type.tp_name, uint_max, test_var);
17146 0 : return false;
17147 : }
17148 0 : r->in.num_entries = test_var;
17149 : } else {
17150 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17151 : PyLong_Type.tp_name);
17152 0 : return false;
17153 : }
17154 : }
17155 0 : return true;
17156 : }
17157 :
17158 0 : static PyObject *unpack_py_lsa_EnumAccounts_args_out(struct lsa_EnumAccounts *r)
17159 : {
17160 : PyObject *result;
17161 : PyObject *py_resume_handle;
17162 : PyObject *py_sids;
17163 0 : result = PyTuple_New(2);
17164 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
17165 0 : PyTuple_SetItem(result, 0, py_resume_handle);
17166 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, r->out.sids, r->out.sids);
17167 0 : PyTuple_SetItem(result, 1, py_sids);
17168 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
17169 0 : PyErr_SetNTSTATUS(r->out.result);
17170 0 : return NULL;
17171 : }
17172 :
17173 0 : return result;
17174 : }
17175 :
17176 :
17177 0 : static PyObject *py_lsa_CreateTrustedDomain_in_get_policy_handle(PyObject *obj, void *closure)
17178 : {
17179 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(obj);
17180 : PyObject *py_policy_handle;
17181 0 : if (object->in.policy_handle == NULL) {
17182 0 : Py_RETURN_NONE;
17183 : }
17184 0 : py_policy_handle = pytalloc_reference_ex(policy_handle_Type, object->in.policy_handle, object->in.policy_handle);
17185 0 : return py_policy_handle;
17186 : }
17187 :
17188 0 : static int py_lsa_CreateTrustedDomain_in_set_policy_handle(PyObject *py_obj, PyObject *value, void *closure)
17189 : {
17190 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17191 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.policy_handle));
17192 0 : if (value == NULL) {
17193 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.policy_handle");
17194 0 : return -1;
17195 : }
17196 0 : object->in.policy_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.policy_handle);
17197 0 : if (object->in.policy_handle == NULL) {
17198 0 : PyErr_NoMemory();
17199 0 : return -1;
17200 : }
17201 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17202 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17203 0 : PyErr_NoMemory();
17204 0 : return -1;
17205 : }
17206 0 : object->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(value);
17207 0 : return 0;
17208 : }
17209 :
17210 0 : static PyObject *py_lsa_CreateTrustedDomain_in_get_info(PyObject *obj, void *closure)
17211 : {
17212 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(obj);
17213 : PyObject *py_info;
17214 0 : if (object->in.info == NULL) {
17215 0 : Py_RETURN_NONE;
17216 : }
17217 0 : py_info = pytalloc_reference_ex(&lsa_DomainInfo_Type, object->in.info, object->in.info);
17218 0 : return py_info;
17219 : }
17220 :
17221 0 : static int py_lsa_CreateTrustedDomain_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
17222 : {
17223 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17224 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
17225 0 : if (value == NULL) {
17226 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
17227 0 : return -1;
17228 : }
17229 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
17230 0 : if (object->in.info == NULL) {
17231 0 : PyErr_NoMemory();
17232 0 : return -1;
17233 : }
17234 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, value, return -1;);
17235 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17236 0 : PyErr_NoMemory();
17237 0 : return -1;
17238 : }
17239 0 : object->in.info = (struct lsa_DomainInfo *)pytalloc_get_ptr(value);
17240 0 : return 0;
17241 : }
17242 :
17243 0 : static PyObject *py_lsa_CreateTrustedDomain_in_get_access_mask(PyObject *obj, void *closure)
17244 : {
17245 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(obj);
17246 : PyObject *py_access_mask;
17247 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
17248 0 : return py_access_mask;
17249 : }
17250 :
17251 0 : static int py_lsa_CreateTrustedDomain_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
17252 : {
17253 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17254 0 : if (value == NULL) {
17255 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
17256 0 : return -1;
17257 : }
17258 : {
17259 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
17260 0 : if (PyLong_Check(value)) {
17261 : unsigned long long test_var;
17262 0 : test_var = PyLong_AsUnsignedLongLong(value);
17263 0 : if (PyErr_Occurred() != NULL) {
17264 0 : return -1;
17265 : }
17266 0 : if (test_var > uint_max) {
17267 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17268 : PyLong_Type.tp_name, uint_max, test_var);
17269 0 : return -1;
17270 : }
17271 0 : object->in.access_mask = test_var;
17272 : } else {
17273 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17274 : PyLong_Type.tp_name);
17275 0 : return -1;
17276 : }
17277 : }
17278 0 : return 0;
17279 : }
17280 :
17281 0 : static PyObject *py_lsa_CreateTrustedDomain_out_get_trustdom_handle(PyObject *obj, void *closure)
17282 : {
17283 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(obj);
17284 : PyObject *py_trustdom_handle;
17285 0 : if (object->out.trustdom_handle == NULL) {
17286 0 : Py_RETURN_NONE;
17287 : }
17288 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
17289 0 : return py_trustdom_handle;
17290 : }
17291 :
17292 0 : static int py_lsa_CreateTrustedDomain_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
17293 : {
17294 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17295 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
17296 0 : if (value == NULL) {
17297 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trustdom_handle");
17298 0 : return -1;
17299 : }
17300 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
17301 0 : if (object->out.trustdom_handle == NULL) {
17302 0 : PyErr_NoMemory();
17303 0 : return -1;
17304 : }
17305 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17306 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17307 0 : PyErr_NoMemory();
17308 0 : return -1;
17309 : }
17310 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
17311 0 : return 0;
17312 : }
17313 :
17314 0 : static PyObject *py_lsa_CreateTrustedDomain_get_result(PyObject *obj, void *closure)
17315 : {
17316 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(obj);
17317 : PyObject *py_result;
17318 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
17319 0 : return py_result;
17320 : }
17321 :
17322 0 : static int py_lsa_CreateTrustedDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
17323 : {
17324 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17325 0 : if (value == NULL) {
17326 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
17327 0 : return -1;
17328 : }
17329 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
17330 0 : return 0;
17331 : }
17332 :
17333 : static PyGetSetDef py_lsa_CreateTrustedDomain_getsetters[] = {
17334 : {
17335 : .name = discard_const_p(char, "in_policy_handle"),
17336 : .get = py_lsa_CreateTrustedDomain_in_get_policy_handle,
17337 : .set = py_lsa_CreateTrustedDomain_in_set_policy_handle,
17338 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17339 : },
17340 : {
17341 : .name = discard_const_p(char, "in_info"),
17342 : .get = py_lsa_CreateTrustedDomain_in_get_info,
17343 : .set = py_lsa_CreateTrustedDomain_in_set_info,
17344 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInfo")
17345 : },
17346 : {
17347 : .name = discard_const_p(char, "in_access_mask"),
17348 : .get = py_lsa_CreateTrustedDomain_in_get_access_mask,
17349 : .set = py_lsa_CreateTrustedDomain_in_set_access_mask,
17350 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
17351 : },
17352 : {
17353 : .name = discard_const_p(char, "out_trustdom_handle"),
17354 : .get = py_lsa_CreateTrustedDomain_out_get_trustdom_handle,
17355 : .set = py_lsa_CreateTrustedDomain_out_set_trustdom_handle,
17356 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17357 : },
17358 : {
17359 : .name = discard_const_p(char, "result"),
17360 : .get = py_lsa_CreateTrustedDomain_get_result,
17361 : .set = py_lsa_CreateTrustedDomain_set_result,
17362 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
17363 : },
17364 : { .name = NULL }
17365 : };
17366 :
17367 0 : static PyObject *py_lsa_CreateTrustedDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17368 : {
17369 0 : PyObject *self = pytalloc_new(struct lsa_CreateTrustedDomain, type);
17370 0 : struct lsa_CreateTrustedDomain *_self = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(self);
17371 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
17372 0 : _self->in.policy_handle = talloc_zero(mem_ctx, struct policy_handle);
17373 0 : _self->in.info = talloc_zero(mem_ctx, struct lsa_DomainInfo);
17374 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
17375 0 : return self;
17376 : }
17377 :
17378 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
17379 : {
17380 :
17381 :
17382 0 : return PyLong_FromLong(12);
17383 : }
17384 :
17385 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
17386 : {
17387 0 : const struct ndr_interface_call *call = NULL;
17388 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17389 0 : PyObject *ret = NULL;
17390 0 : struct ndr_push *push = NULL;
17391 : DATA_BLOB blob;
17392 : enum ndr_err_code err;
17393 :
17394 0 : if (ndr_table_lsarpc.num_calls < 13) {
17395 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomain_ndr_pack");
17396 0 : return NULL;
17397 : }
17398 0 : call = &ndr_table_lsarpc.calls[12];
17399 :
17400 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
17401 0 : if (push == NULL) {
17402 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17403 0 : return NULL;
17404 : }
17405 :
17406 0 : push->flags |= ndr_push_flags;
17407 :
17408 0 : err = call->ndr_push(push, ndr_inout_flags, object);
17409 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17410 0 : TALLOC_FREE(push);
17411 0 : PyErr_SetNdrError(err);
17412 0 : return NULL;
17413 : }
17414 0 : blob = ndr_push_blob(push);
17415 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
17416 0 : TALLOC_FREE(push);
17417 0 : return ret;
17418 : }
17419 :
17420 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17421 : {
17422 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17423 0 : PyObject *bigendian_obj = NULL;
17424 0 : PyObject *ndr64_obj = NULL;
17425 0 : uint32_t ndr_push_flags = 0;
17426 :
17427 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
17428 : discard_const_p(char *, kwnames),
17429 : &bigendian_obj,
17430 : &ndr64_obj)) {
17431 0 : return NULL;
17432 : }
17433 :
17434 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17435 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17436 : }
17437 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17438 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17439 : }
17440 :
17441 0 : return py_lsa_CreateTrustedDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
17442 : }
17443 :
17444 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17445 : {
17446 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17447 0 : PyObject *bigendian_obj = NULL;
17448 0 : PyObject *ndr64_obj = NULL;
17449 0 : uint32_t ndr_push_flags = 0;
17450 :
17451 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
17452 : discard_const_p(char *, kwnames),
17453 : &bigendian_obj,
17454 : &ndr64_obj)) {
17455 0 : return NULL;
17456 : }
17457 :
17458 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17459 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17460 : }
17461 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17462 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17463 : }
17464 :
17465 0 : return py_lsa_CreateTrustedDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
17466 : }
17467 :
17468 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
17469 : {
17470 0 : const struct ndr_interface_call *call = NULL;
17471 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17472 0 : struct ndr_pull *pull = NULL;
17473 : enum ndr_err_code err;
17474 :
17475 0 : if (ndr_table_lsarpc.num_calls < 13) {
17476 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomain_ndr_unpack");
17477 0 : return NULL;
17478 : }
17479 0 : call = &ndr_table_lsarpc.calls[12];
17480 :
17481 0 : pull = ndr_pull_init_blob(blob, object);
17482 0 : if (pull == NULL) {
17483 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17484 0 : return NULL;
17485 : }
17486 :
17487 0 : pull->flags |= ndr_pull_flags;
17488 :
17489 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
17490 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17491 0 : TALLOC_FREE(pull);
17492 0 : PyErr_SetNdrError(err);
17493 0 : return NULL;
17494 : }
17495 0 : if (!allow_remaining) {
17496 : uint32_t highest_ofs;
17497 :
17498 0 : if (pull->offset > pull->relative_highest_offset) {
17499 0 : highest_ofs = pull->offset;
17500 : } else {
17501 0 : highest_ofs = pull->relative_highest_offset;
17502 : }
17503 0 : if (highest_ofs < pull->data_size) {
17504 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
17505 : "not all bytes consumed ofs[%u] size[%u]",
17506 : highest_ofs, pull->data_size);
17507 0 : TALLOC_FREE(pull);
17508 0 : PyErr_SetNdrError(err);
17509 0 : return NULL;
17510 : }
17511 : }
17512 :
17513 0 : TALLOC_FREE(pull);
17514 0 : Py_RETURN_NONE;
17515 : }
17516 :
17517 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17518 : {
17519 : DATA_BLOB blob;
17520 0 : Py_ssize_t blob_length = 0;
17521 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17522 0 : PyObject *bigendian_obj = NULL;
17523 0 : PyObject *ndr64_obj = NULL;
17524 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17525 0 : PyObject *allow_remaining_obj = NULL;
17526 0 : bool allow_remaining = false;
17527 :
17528 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
17529 : discard_const_p(char *, kwnames),
17530 : &blob.data, &blob_length,
17531 : &bigendian_obj,
17532 : &ndr64_obj,
17533 : &allow_remaining_obj)) {
17534 0 : return NULL;
17535 : }
17536 0 : blob.length = blob_length;
17537 :
17538 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17539 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17540 : }
17541 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17542 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17543 : }
17544 :
17545 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17546 0 : allow_remaining = true;
17547 : }
17548 :
17549 0 : return py_lsa_CreateTrustedDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
17550 : }
17551 :
17552 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17553 : {
17554 : DATA_BLOB blob;
17555 0 : Py_ssize_t blob_length = 0;
17556 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17557 0 : PyObject *bigendian_obj = NULL;
17558 0 : PyObject *ndr64_obj = NULL;
17559 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17560 0 : PyObject *allow_remaining_obj = NULL;
17561 0 : bool allow_remaining = false;
17562 :
17563 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
17564 : discard_const_p(char *, kwnames),
17565 : &blob.data, &blob_length,
17566 : &bigendian_obj,
17567 : &ndr64_obj,
17568 : &allow_remaining_obj)) {
17569 0 : return NULL;
17570 : }
17571 0 : blob.length = blob_length;
17572 :
17573 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17574 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17575 : }
17576 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17577 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17578 : }
17579 :
17580 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17581 0 : allow_remaining = true;
17582 : }
17583 :
17584 0 : return py_lsa_CreateTrustedDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
17585 : }
17586 :
17587 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
17588 : {
17589 0 : const struct ndr_interface_call *call = NULL;
17590 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17591 : PyObject *ret;
17592 : char *retstr;
17593 :
17594 0 : if (ndr_table_lsarpc.num_calls < 13) {
17595 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomain_ndr_print");
17596 0 : return NULL;
17597 : }
17598 0 : call = &ndr_table_lsarpc.calls[12];
17599 :
17600 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
17601 0 : ret = PyUnicode_FromString(retstr);
17602 0 : TALLOC_FREE(retstr);
17603 :
17604 0 : return ret;
17605 : }
17606 :
17607 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17608 : {
17609 0 : return py_lsa_CreateTrustedDomain_ndr_print(py_obj, "lsa_CreateTrustedDomain_in", NDR_IN);
17610 : }
17611 :
17612 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17613 : {
17614 0 : return py_lsa_CreateTrustedDomain_ndr_print(py_obj, "lsa_CreateTrustedDomain_out", NDR_OUT);
17615 : }
17616 :
17617 : static PyMethodDef py_lsa_CreateTrustedDomain_methods[] = {
17618 : { "opnum", (PyCFunction)py_lsa_CreateTrustedDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
17619 : "lsa.CreateTrustedDomain.opnum() -> 12 (0x0c) " },
17620 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
17621 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
17622 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
17623 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
17624 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
17625 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
17626 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
17627 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
17628 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateTrustedDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
17629 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateTrustedDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
17630 : { NULL, NULL, 0, NULL }
17631 : };
17632 :
17633 :
17634 : static PyTypeObject lsa_CreateTrustedDomain_Type = {
17635 : PyVarObject_HEAD_INIT(NULL, 0)
17636 : .tp_name = "lsa.CreateTrustedDomain",
17637 : .tp_getset = py_lsa_CreateTrustedDomain_getsetters,
17638 : .tp_methods = py_lsa_CreateTrustedDomain_methods,
17639 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17640 : .tp_new = py_lsa_CreateTrustedDomain_new,
17641 : };
17642 :
17643 0 : static bool pack_py_lsa_CreateTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomain *r)
17644 : {
17645 : PyObject *py_policy_handle;
17646 : PyObject *py_info;
17647 : PyObject *py_access_mask;
17648 0 : const char *kwnames[] = {
17649 : "policy_handle", "info", "access_mask", NULL
17650 : };
17651 :
17652 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateTrustedDomain", discard_const_p(char *, kwnames), &py_policy_handle, &py_info, &py_access_mask)) {
17653 0 : return false;
17654 : }
17655 :
17656 0 : if (py_policy_handle == NULL) {
17657 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.policy_handle");
17658 0 : return false;
17659 : }
17660 0 : r->in.policy_handle = talloc_ptrtype(r, r->in.policy_handle);
17661 0 : if (r->in.policy_handle == NULL) {
17662 0 : PyErr_NoMemory();
17663 0 : return false;
17664 : }
17665 0 : PY_CHECK_TYPE(policy_handle_Type, py_policy_handle, return false;);
17666 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_policy_handle)) == NULL) {
17667 0 : PyErr_NoMemory();
17668 0 : return false;
17669 : }
17670 0 : r->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(py_policy_handle);
17671 0 : if (py_info == NULL) {
17672 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
17673 0 : return false;
17674 : }
17675 0 : r->in.info = talloc_ptrtype(r, r->in.info);
17676 0 : if (r->in.info == NULL) {
17677 0 : PyErr_NoMemory();
17678 0 : return false;
17679 : }
17680 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, py_info, return false;);
17681 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
17682 0 : PyErr_NoMemory();
17683 0 : return false;
17684 : }
17685 0 : r->in.info = (struct lsa_DomainInfo *)pytalloc_get_ptr(py_info);
17686 0 : if (py_access_mask == NULL) {
17687 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
17688 0 : return false;
17689 : }
17690 : {
17691 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
17692 0 : if (PyLong_Check(py_access_mask)) {
17693 : unsigned long long test_var;
17694 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
17695 0 : if (PyErr_Occurred() != NULL) {
17696 0 : return false;
17697 : }
17698 0 : if (test_var > uint_max) {
17699 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17700 : PyLong_Type.tp_name, uint_max, test_var);
17701 0 : return false;
17702 : }
17703 0 : r->in.access_mask = test_var;
17704 : } else {
17705 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17706 : PyLong_Type.tp_name);
17707 0 : return false;
17708 : }
17709 : }
17710 0 : return true;
17711 : }
17712 :
17713 0 : static PyObject *unpack_py_lsa_CreateTrustedDomain_args_out(struct lsa_CreateTrustedDomain *r)
17714 : {
17715 : PyObject *result;
17716 : PyObject *py_trustdom_handle;
17717 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
17718 0 : result = py_trustdom_handle;
17719 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
17720 0 : PyErr_SetNTSTATUS(r->out.result);
17721 0 : return NULL;
17722 : }
17723 :
17724 0 : return result;
17725 : }
17726 :
17727 :
17728 0 : static PyObject *py_lsa_EnumTrustDom_in_get_handle(PyObject *obj, void *closure)
17729 : {
17730 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(obj);
17731 : PyObject *py_handle;
17732 0 : if (object->in.handle == NULL) {
17733 0 : Py_RETURN_NONE;
17734 : }
17735 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
17736 0 : return py_handle;
17737 : }
17738 :
17739 0 : static int py_lsa_EnumTrustDom_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
17740 : {
17741 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
17742 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
17743 0 : if (value == NULL) {
17744 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
17745 0 : return -1;
17746 : }
17747 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
17748 0 : if (object->in.handle == NULL) {
17749 0 : PyErr_NoMemory();
17750 0 : return -1;
17751 : }
17752 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17753 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17754 0 : PyErr_NoMemory();
17755 0 : return -1;
17756 : }
17757 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
17758 0 : return 0;
17759 : }
17760 :
17761 0 : static PyObject *py_lsa_EnumTrustDom_in_get_resume_handle(PyObject *obj, void *closure)
17762 : {
17763 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(obj);
17764 : PyObject *py_resume_handle;
17765 0 : if (object->in.resume_handle == NULL) {
17766 0 : Py_RETURN_NONE;
17767 : }
17768 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
17769 0 : return py_resume_handle;
17770 : }
17771 :
17772 0 : static int py_lsa_EnumTrustDom_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
17773 : {
17774 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
17775 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
17776 0 : if (value == NULL) {
17777 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
17778 0 : return -1;
17779 : }
17780 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
17781 0 : if (object->in.resume_handle == NULL) {
17782 0 : PyErr_NoMemory();
17783 0 : return -1;
17784 : }
17785 : {
17786 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
17787 0 : if (PyLong_Check(value)) {
17788 : unsigned long long test_var;
17789 0 : test_var = PyLong_AsUnsignedLongLong(value);
17790 0 : if (PyErr_Occurred() != NULL) {
17791 0 : return -1;
17792 : }
17793 0 : if (test_var > uint_max) {
17794 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17795 : PyLong_Type.tp_name, uint_max, test_var);
17796 0 : return -1;
17797 : }
17798 0 : *object->in.resume_handle = test_var;
17799 : } else {
17800 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17801 : PyLong_Type.tp_name);
17802 0 : return -1;
17803 : }
17804 : }
17805 0 : return 0;
17806 : }
17807 :
17808 0 : static PyObject *py_lsa_EnumTrustDom_out_get_resume_handle(PyObject *obj, void *closure)
17809 : {
17810 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(obj);
17811 : PyObject *py_resume_handle;
17812 0 : if (object->out.resume_handle == NULL) {
17813 0 : Py_RETURN_NONE;
17814 : }
17815 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
17816 0 : return py_resume_handle;
17817 : }
17818 :
17819 0 : static int py_lsa_EnumTrustDom_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
17820 : {
17821 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
17822 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
17823 0 : if (value == NULL) {
17824 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
17825 0 : return -1;
17826 : }
17827 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
17828 0 : if (object->out.resume_handle == NULL) {
17829 0 : PyErr_NoMemory();
17830 0 : return -1;
17831 : }
17832 : {
17833 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
17834 0 : if (PyLong_Check(value)) {
17835 : unsigned long long test_var;
17836 0 : test_var = PyLong_AsUnsignedLongLong(value);
17837 0 : if (PyErr_Occurred() != NULL) {
17838 0 : return -1;
17839 : }
17840 0 : if (test_var > uint_max) {
17841 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17842 : PyLong_Type.tp_name, uint_max, test_var);
17843 0 : return -1;
17844 : }
17845 0 : *object->out.resume_handle = test_var;
17846 : } else {
17847 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17848 : PyLong_Type.tp_name);
17849 0 : return -1;
17850 : }
17851 : }
17852 0 : return 0;
17853 : }
17854 :
17855 0 : static PyObject *py_lsa_EnumTrustDom_out_get_domains(PyObject *obj, void *closure)
17856 : {
17857 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(obj);
17858 : PyObject *py_domains;
17859 0 : if (object->out.domains == NULL) {
17860 0 : Py_RETURN_NONE;
17861 : }
17862 0 : py_domains = pytalloc_reference_ex(&lsa_DomainList_Type, object->out.domains, object->out.domains);
17863 0 : return py_domains;
17864 : }
17865 :
17866 0 : static int py_lsa_EnumTrustDom_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
17867 : {
17868 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
17869 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
17870 0 : if (value == NULL) {
17871 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
17872 0 : return -1;
17873 : }
17874 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
17875 0 : if (object->out.domains == NULL) {
17876 0 : PyErr_NoMemory();
17877 0 : return -1;
17878 : }
17879 0 : PY_CHECK_TYPE(&lsa_DomainList_Type, value, return -1;);
17880 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17881 0 : PyErr_NoMemory();
17882 0 : return -1;
17883 : }
17884 0 : object->out.domains = (struct lsa_DomainList *)pytalloc_get_ptr(value);
17885 0 : return 0;
17886 : }
17887 :
17888 0 : static PyObject *py_lsa_EnumTrustDom_in_get_max_size(PyObject *obj, void *closure)
17889 : {
17890 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(obj);
17891 : PyObject *py_max_size;
17892 0 : py_max_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_size);
17893 0 : return py_max_size;
17894 : }
17895 :
17896 0 : static int py_lsa_EnumTrustDom_in_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
17897 : {
17898 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
17899 0 : if (value == NULL) {
17900 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_size");
17901 0 : return -1;
17902 : }
17903 : {
17904 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_size));
17905 0 : if (PyLong_Check(value)) {
17906 : unsigned long long test_var;
17907 0 : test_var = PyLong_AsUnsignedLongLong(value);
17908 0 : if (PyErr_Occurred() != NULL) {
17909 0 : return -1;
17910 : }
17911 0 : if (test_var > uint_max) {
17912 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17913 : PyLong_Type.tp_name, uint_max, test_var);
17914 0 : return -1;
17915 : }
17916 0 : object->in.max_size = test_var;
17917 : } else {
17918 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17919 : PyLong_Type.tp_name);
17920 0 : return -1;
17921 : }
17922 : }
17923 0 : return 0;
17924 : }
17925 :
17926 0 : static PyObject *py_lsa_EnumTrustDom_get_result(PyObject *obj, void *closure)
17927 : {
17928 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(obj);
17929 : PyObject *py_result;
17930 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
17931 0 : return py_result;
17932 : }
17933 :
17934 0 : static int py_lsa_EnumTrustDom_set_result(PyObject *py_obj, PyObject *value, void *closure)
17935 : {
17936 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
17937 0 : if (value == NULL) {
17938 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
17939 0 : return -1;
17940 : }
17941 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
17942 0 : return 0;
17943 : }
17944 :
17945 : static PyGetSetDef py_lsa_EnumTrustDom_getsetters[] = {
17946 : {
17947 : .name = discard_const_p(char, "in_handle"),
17948 : .get = py_lsa_EnumTrustDom_in_get_handle,
17949 : .set = py_lsa_EnumTrustDom_in_set_handle,
17950 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17951 : },
17952 : {
17953 : .name = discard_const_p(char, "in_resume_handle"),
17954 : .get = py_lsa_EnumTrustDom_in_get_resume_handle,
17955 : .set = py_lsa_EnumTrustDom_in_set_resume_handle,
17956 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17957 : },
17958 : {
17959 : .name = discard_const_p(char, "out_resume_handle"),
17960 : .get = py_lsa_EnumTrustDom_out_get_resume_handle,
17961 : .set = py_lsa_EnumTrustDom_out_set_resume_handle,
17962 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17963 : },
17964 : {
17965 : .name = discard_const_p(char, "out_domains"),
17966 : .get = py_lsa_EnumTrustDom_out_get_domains,
17967 : .set = py_lsa_EnumTrustDom_out_set_domains,
17968 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainList")
17969 : },
17970 : {
17971 : .name = discard_const_p(char, "in_max_size"),
17972 : .get = py_lsa_EnumTrustDom_in_get_max_size,
17973 : .set = py_lsa_EnumTrustDom_in_set_max_size,
17974 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17975 : },
17976 : {
17977 : .name = discard_const_p(char, "result"),
17978 : .get = py_lsa_EnumTrustDom_get_result,
17979 : .set = py_lsa_EnumTrustDom_set_result,
17980 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
17981 : },
17982 : { .name = NULL }
17983 : };
17984 :
17985 0 : static PyObject *py_lsa_EnumTrustDom_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17986 : {
17987 0 : PyObject *self = pytalloc_new(struct lsa_EnumTrustDom, type);
17988 0 : struct lsa_EnumTrustDom *_self = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(self);
17989 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
17990 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
17991 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
17992 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
17993 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_DomainList);
17994 0 : return self;
17995 : }
17996 :
17997 0 : static PyObject *py_lsa_EnumTrustDom_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
17998 : {
17999 :
18000 :
18001 0 : return PyLong_FromLong(13);
18002 : }
18003 :
18004 0 : static PyObject *py_lsa_EnumTrustDom_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
18005 : {
18006 0 : const struct ndr_interface_call *call = NULL;
18007 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
18008 0 : PyObject *ret = NULL;
18009 0 : struct ndr_push *push = NULL;
18010 : DATA_BLOB blob;
18011 : enum ndr_err_code err;
18012 :
18013 0 : if (ndr_table_lsarpc.num_calls < 14) {
18014 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustDom_ndr_pack");
18015 0 : return NULL;
18016 : }
18017 0 : call = &ndr_table_lsarpc.calls[13];
18018 :
18019 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
18020 0 : if (push == NULL) {
18021 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18022 0 : return NULL;
18023 : }
18024 :
18025 0 : push->flags |= ndr_push_flags;
18026 :
18027 0 : err = call->ndr_push(push, ndr_inout_flags, object);
18028 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18029 0 : TALLOC_FREE(push);
18030 0 : PyErr_SetNdrError(err);
18031 0 : return NULL;
18032 : }
18033 0 : blob = ndr_push_blob(push);
18034 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
18035 0 : TALLOC_FREE(push);
18036 0 : return ret;
18037 : }
18038 :
18039 0 : static PyObject *py_lsa_EnumTrustDom_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18040 : {
18041 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18042 0 : PyObject *bigendian_obj = NULL;
18043 0 : PyObject *ndr64_obj = NULL;
18044 0 : uint32_t ndr_push_flags = 0;
18045 :
18046 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
18047 : discard_const_p(char *, kwnames),
18048 : &bigendian_obj,
18049 : &ndr64_obj)) {
18050 0 : return NULL;
18051 : }
18052 :
18053 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18054 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18055 : }
18056 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18057 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18058 : }
18059 :
18060 0 : return py_lsa_EnumTrustDom_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
18061 : }
18062 :
18063 0 : static PyObject *py_lsa_EnumTrustDom_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18064 : {
18065 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18066 0 : PyObject *bigendian_obj = NULL;
18067 0 : PyObject *ndr64_obj = NULL;
18068 0 : uint32_t ndr_push_flags = 0;
18069 :
18070 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
18071 : discard_const_p(char *, kwnames),
18072 : &bigendian_obj,
18073 : &ndr64_obj)) {
18074 0 : return NULL;
18075 : }
18076 :
18077 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18078 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18079 : }
18080 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18081 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18082 : }
18083 :
18084 0 : return py_lsa_EnumTrustDom_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
18085 : }
18086 :
18087 0 : static PyObject *py_lsa_EnumTrustDom_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
18088 : {
18089 0 : const struct ndr_interface_call *call = NULL;
18090 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
18091 0 : struct ndr_pull *pull = NULL;
18092 : enum ndr_err_code err;
18093 :
18094 0 : if (ndr_table_lsarpc.num_calls < 14) {
18095 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustDom_ndr_unpack");
18096 0 : return NULL;
18097 : }
18098 0 : call = &ndr_table_lsarpc.calls[13];
18099 :
18100 0 : pull = ndr_pull_init_blob(blob, object);
18101 0 : if (pull == NULL) {
18102 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18103 0 : return NULL;
18104 : }
18105 :
18106 0 : pull->flags |= ndr_pull_flags;
18107 :
18108 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
18109 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18110 0 : TALLOC_FREE(pull);
18111 0 : PyErr_SetNdrError(err);
18112 0 : return NULL;
18113 : }
18114 0 : if (!allow_remaining) {
18115 : uint32_t highest_ofs;
18116 :
18117 0 : if (pull->offset > pull->relative_highest_offset) {
18118 0 : highest_ofs = pull->offset;
18119 : } else {
18120 0 : highest_ofs = pull->relative_highest_offset;
18121 : }
18122 0 : if (highest_ofs < pull->data_size) {
18123 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
18124 : "not all bytes consumed ofs[%u] size[%u]",
18125 : highest_ofs, pull->data_size);
18126 0 : TALLOC_FREE(pull);
18127 0 : PyErr_SetNdrError(err);
18128 0 : return NULL;
18129 : }
18130 : }
18131 :
18132 0 : TALLOC_FREE(pull);
18133 0 : Py_RETURN_NONE;
18134 : }
18135 :
18136 0 : static PyObject *py_lsa_EnumTrustDom_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18137 : {
18138 : DATA_BLOB blob;
18139 0 : Py_ssize_t blob_length = 0;
18140 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18141 0 : PyObject *bigendian_obj = NULL;
18142 0 : PyObject *ndr64_obj = NULL;
18143 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18144 0 : PyObject *allow_remaining_obj = NULL;
18145 0 : bool allow_remaining = false;
18146 :
18147 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
18148 : discard_const_p(char *, kwnames),
18149 : &blob.data, &blob_length,
18150 : &bigendian_obj,
18151 : &ndr64_obj,
18152 : &allow_remaining_obj)) {
18153 0 : return NULL;
18154 : }
18155 0 : blob.length = blob_length;
18156 :
18157 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18158 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18159 : }
18160 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18161 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18162 : }
18163 :
18164 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18165 0 : allow_remaining = true;
18166 : }
18167 :
18168 0 : return py_lsa_EnumTrustDom_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
18169 : }
18170 :
18171 0 : static PyObject *py_lsa_EnumTrustDom_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18172 : {
18173 : DATA_BLOB blob;
18174 0 : Py_ssize_t blob_length = 0;
18175 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18176 0 : PyObject *bigendian_obj = NULL;
18177 0 : PyObject *ndr64_obj = NULL;
18178 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18179 0 : PyObject *allow_remaining_obj = NULL;
18180 0 : bool allow_remaining = false;
18181 :
18182 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
18183 : discard_const_p(char *, kwnames),
18184 : &blob.data, &blob_length,
18185 : &bigendian_obj,
18186 : &ndr64_obj,
18187 : &allow_remaining_obj)) {
18188 0 : return NULL;
18189 : }
18190 0 : blob.length = blob_length;
18191 :
18192 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18193 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18194 : }
18195 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18196 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18197 : }
18198 :
18199 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18200 0 : allow_remaining = true;
18201 : }
18202 :
18203 0 : return py_lsa_EnumTrustDom_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
18204 : }
18205 :
18206 0 : static PyObject *py_lsa_EnumTrustDom_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
18207 : {
18208 0 : const struct ndr_interface_call *call = NULL;
18209 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
18210 : PyObject *ret;
18211 : char *retstr;
18212 :
18213 0 : if (ndr_table_lsarpc.num_calls < 14) {
18214 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustDom_ndr_print");
18215 0 : return NULL;
18216 : }
18217 0 : call = &ndr_table_lsarpc.calls[13];
18218 :
18219 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
18220 0 : ret = PyUnicode_FromString(retstr);
18221 0 : TALLOC_FREE(retstr);
18222 :
18223 0 : return ret;
18224 : }
18225 :
18226 0 : static PyObject *py_lsa_EnumTrustDom_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18227 : {
18228 0 : return py_lsa_EnumTrustDom_ndr_print(py_obj, "lsa_EnumTrustDom_in", NDR_IN);
18229 : }
18230 :
18231 0 : static PyObject *py_lsa_EnumTrustDom_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18232 : {
18233 0 : return py_lsa_EnumTrustDom_ndr_print(py_obj, "lsa_EnumTrustDom_out", NDR_OUT);
18234 : }
18235 :
18236 : static PyMethodDef py_lsa_EnumTrustDom_methods[] = {
18237 : { "opnum", (PyCFunction)py_lsa_EnumTrustDom_ndr_opnum, METH_NOARGS|METH_CLASS,
18238 : "lsa.EnumTrustDom.opnum() -> 13 (0x0d) " },
18239 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustDom_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
18240 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
18241 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustDom_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
18242 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
18243 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustDom_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
18244 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
18245 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustDom_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
18246 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
18247 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumTrustDom_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
18248 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumTrustDom_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
18249 : { NULL, NULL, 0, NULL }
18250 : };
18251 :
18252 :
18253 : static PyTypeObject lsa_EnumTrustDom_Type = {
18254 : PyVarObject_HEAD_INIT(NULL, 0)
18255 : .tp_name = "lsa.EnumTrustDom",
18256 : .tp_getset = py_lsa_EnumTrustDom_getsetters,
18257 : .tp_methods = py_lsa_EnumTrustDom_methods,
18258 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
18259 : .tp_new = py_lsa_EnumTrustDom_new,
18260 : };
18261 :
18262 0 : static bool pack_py_lsa_EnumTrustDom_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumTrustDom *r)
18263 : {
18264 : PyObject *py_handle;
18265 : PyObject *py_resume_handle;
18266 : PyObject *py_max_size;
18267 0 : const char *kwnames[] = {
18268 : "handle", "resume_handle", "max_size", NULL
18269 : };
18270 :
18271 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumTrustDom", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_size)) {
18272 0 : return false;
18273 : }
18274 :
18275 0 : if (py_handle == NULL) {
18276 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
18277 0 : return false;
18278 : }
18279 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
18280 0 : if (r->in.handle == NULL) {
18281 0 : PyErr_NoMemory();
18282 0 : return false;
18283 : }
18284 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
18285 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
18286 0 : PyErr_NoMemory();
18287 0 : return false;
18288 : }
18289 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
18290 0 : if (py_resume_handle == NULL) {
18291 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
18292 0 : return false;
18293 : }
18294 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
18295 0 : if (r->in.resume_handle == NULL) {
18296 0 : PyErr_NoMemory();
18297 0 : return false;
18298 : }
18299 : {
18300 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
18301 0 : if (PyLong_Check(py_resume_handle)) {
18302 : unsigned long long test_var;
18303 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
18304 0 : if (PyErr_Occurred() != NULL) {
18305 0 : return false;
18306 : }
18307 0 : if (test_var > uint_max) {
18308 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18309 : PyLong_Type.tp_name, uint_max, test_var);
18310 0 : return false;
18311 : }
18312 0 : *r->in.resume_handle = test_var;
18313 : } else {
18314 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18315 : PyLong_Type.tp_name);
18316 0 : return false;
18317 : }
18318 : }
18319 0 : if (py_max_size == NULL) {
18320 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_size");
18321 0 : return false;
18322 : }
18323 : {
18324 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size));
18325 0 : if (PyLong_Check(py_max_size)) {
18326 : unsigned long long test_var;
18327 0 : test_var = PyLong_AsUnsignedLongLong(py_max_size);
18328 0 : if (PyErr_Occurred() != NULL) {
18329 0 : return false;
18330 : }
18331 0 : if (test_var > uint_max) {
18332 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18333 : PyLong_Type.tp_name, uint_max, test_var);
18334 0 : return false;
18335 : }
18336 0 : r->in.max_size = test_var;
18337 : } else {
18338 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18339 : PyLong_Type.tp_name);
18340 0 : return false;
18341 : }
18342 : }
18343 0 : return true;
18344 : }
18345 :
18346 0 : static PyObject *unpack_py_lsa_EnumTrustDom_args_out(struct lsa_EnumTrustDom *r)
18347 : {
18348 : PyObject *result;
18349 : PyObject *py_resume_handle;
18350 : PyObject *py_domains;
18351 0 : result = PyTuple_New(2);
18352 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
18353 0 : PyTuple_SetItem(result, 0, py_resume_handle);
18354 0 : py_domains = pytalloc_reference_ex(&lsa_DomainList_Type, r->out.domains, r->out.domains);
18355 0 : PyTuple_SetItem(result, 1, py_domains);
18356 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
18357 0 : PyErr_SetNTSTATUS(r->out.result);
18358 0 : return NULL;
18359 : }
18360 :
18361 0 : return result;
18362 : }
18363 :
18364 :
18365 0 : static PyObject *py_lsa_LookupNames_in_get_handle(PyObject *obj, void *closure)
18366 : {
18367 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18368 : PyObject *py_handle;
18369 0 : if (object->in.handle == NULL) {
18370 0 : Py_RETURN_NONE;
18371 : }
18372 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
18373 0 : return py_handle;
18374 : }
18375 :
18376 0 : static int py_lsa_LookupNames_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
18377 : {
18378 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18379 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
18380 0 : if (value == NULL) {
18381 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
18382 0 : return -1;
18383 : }
18384 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
18385 0 : if (object->in.handle == NULL) {
18386 0 : PyErr_NoMemory();
18387 0 : return -1;
18388 : }
18389 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
18390 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18391 0 : PyErr_NoMemory();
18392 0 : return -1;
18393 : }
18394 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
18395 0 : return 0;
18396 : }
18397 :
18398 0 : static PyObject *py_lsa_LookupNames_in_get_num_names(PyObject *obj, void *closure)
18399 : {
18400 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18401 : PyObject *py_num_names;
18402 0 : py_num_names = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_names);
18403 0 : return py_num_names;
18404 : }
18405 :
18406 0 : static int py_lsa_LookupNames_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
18407 : {
18408 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18409 0 : if (value == NULL) {
18410 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_names");
18411 0 : return -1;
18412 : }
18413 : {
18414 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names));
18415 0 : if (PyLong_Check(value)) {
18416 : unsigned long long test_var;
18417 0 : test_var = PyLong_AsUnsignedLongLong(value);
18418 0 : if (PyErr_Occurred() != NULL) {
18419 0 : return -1;
18420 : }
18421 0 : if (test_var > uint_max) {
18422 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18423 : PyLong_Type.tp_name, uint_max, test_var);
18424 0 : return -1;
18425 : }
18426 0 : object->in.num_names = test_var;
18427 : } else {
18428 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18429 : PyLong_Type.tp_name);
18430 0 : return -1;
18431 : }
18432 : }
18433 0 : return 0;
18434 : }
18435 :
18436 0 : static PyObject *py_lsa_LookupNames_in_get_names(PyObject *obj, void *closure)
18437 : {
18438 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18439 : PyObject *py_names;
18440 0 : py_names = PyList_New(object->in.num_names);
18441 0 : if (py_names == NULL) {
18442 0 : return NULL;
18443 : }
18444 : {
18445 : int names_cntr_0;
18446 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) {
18447 : PyObject *py_names_0;
18448 0 : py_names_0 = pytalloc_reference_ex(&lsa_String_Type, object->in.names, &object->in.names[names_cntr_0]);
18449 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
18450 : }
18451 : }
18452 0 : return py_names;
18453 : }
18454 :
18455 0 : static int py_lsa_LookupNames_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
18456 : {
18457 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18458 0 : if (value == NULL) {
18459 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
18460 0 : return -1;
18461 : }
18462 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
18463 : {
18464 : int names_cntr_0;
18465 0 : object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value));
18466 0 : if (!object->in.names) { return -1;; }
18467 0 : talloc_set_name_const(object->in.names, "ARRAY: object->in.names");
18468 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
18469 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
18470 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names[names_cntr_0]");
18471 0 : return -1;
18472 : }
18473 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
18474 0 : if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
18475 0 : PyErr_NoMemory();
18476 0 : return -1;
18477 : }
18478 0 : object->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
18479 : }
18480 : }
18481 0 : return 0;
18482 : }
18483 :
18484 0 : static PyObject *py_lsa_LookupNames_out_get_domains(PyObject *obj, void *closure)
18485 : {
18486 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18487 : PyObject *py_domains;
18488 0 : if (object->out.domains == NULL) {
18489 0 : Py_RETURN_NONE;
18490 : }
18491 0 : if (*object->out.domains == NULL) {
18492 0 : py_domains = Py_None;
18493 0 : Py_INCREF(py_domains);
18494 : } else {
18495 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
18496 : }
18497 0 : return py_domains;
18498 : }
18499 :
18500 0 : static int py_lsa_LookupNames_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
18501 : {
18502 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18503 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
18504 0 : if (value == NULL) {
18505 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
18506 0 : return -1;
18507 : }
18508 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
18509 0 : if (object->out.domains == NULL) {
18510 0 : PyErr_NoMemory();
18511 0 : return -1;
18512 : }
18513 0 : if (value == Py_None) {
18514 0 : *object->out.domains = NULL;
18515 : } else {
18516 0 : *object->out.domains = NULL;
18517 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
18518 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18519 0 : PyErr_NoMemory();
18520 0 : return -1;
18521 : }
18522 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
18523 : }
18524 0 : return 0;
18525 : }
18526 :
18527 0 : static PyObject *py_lsa_LookupNames_in_get_sids(PyObject *obj, void *closure)
18528 : {
18529 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18530 : PyObject *py_sids;
18531 0 : if (object->in.sids == NULL) {
18532 0 : Py_RETURN_NONE;
18533 : }
18534 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray_Type, object->in.sids, object->in.sids);
18535 0 : return py_sids;
18536 : }
18537 :
18538 0 : static int py_lsa_LookupNames_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
18539 : {
18540 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18541 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
18542 0 : if (value == NULL) {
18543 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
18544 0 : return -1;
18545 : }
18546 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
18547 0 : if (object->in.sids == NULL) {
18548 0 : PyErr_NoMemory();
18549 0 : return -1;
18550 : }
18551 0 : PY_CHECK_TYPE(&lsa_TransSidArray_Type, value, return -1;);
18552 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18553 0 : PyErr_NoMemory();
18554 0 : return -1;
18555 : }
18556 0 : object->in.sids = (struct lsa_TransSidArray *)pytalloc_get_ptr(value);
18557 0 : return 0;
18558 : }
18559 :
18560 0 : static PyObject *py_lsa_LookupNames_out_get_sids(PyObject *obj, void *closure)
18561 : {
18562 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18563 : PyObject *py_sids;
18564 0 : if (object->out.sids == NULL) {
18565 0 : Py_RETURN_NONE;
18566 : }
18567 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray_Type, object->out.sids, object->out.sids);
18568 0 : return py_sids;
18569 : }
18570 :
18571 0 : static int py_lsa_LookupNames_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
18572 : {
18573 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18574 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
18575 0 : if (value == NULL) {
18576 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
18577 0 : return -1;
18578 : }
18579 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
18580 0 : if (object->out.sids == NULL) {
18581 0 : PyErr_NoMemory();
18582 0 : return -1;
18583 : }
18584 0 : PY_CHECK_TYPE(&lsa_TransSidArray_Type, value, return -1;);
18585 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18586 0 : PyErr_NoMemory();
18587 0 : return -1;
18588 : }
18589 0 : object->out.sids = (struct lsa_TransSidArray *)pytalloc_get_ptr(value);
18590 0 : return 0;
18591 : }
18592 :
18593 0 : static PyObject *py_lsa_LookupNames_in_get_level(PyObject *obj, void *closure)
18594 : {
18595 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18596 : PyObject *py_level;
18597 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
18598 0 : return py_level;
18599 : }
18600 :
18601 0 : static int py_lsa_LookupNames_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
18602 : {
18603 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18604 0 : if (value == NULL) {
18605 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
18606 0 : return -1;
18607 : }
18608 : {
18609 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
18610 0 : if (PyLong_Check(value)) {
18611 : unsigned long long test_var;
18612 0 : test_var = PyLong_AsUnsignedLongLong(value);
18613 0 : if (PyErr_Occurred() != NULL) {
18614 0 : return -1;
18615 : }
18616 0 : if (test_var > uint_max) {
18617 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18618 : PyLong_Type.tp_name, uint_max, test_var);
18619 0 : return -1;
18620 : }
18621 0 : object->in.level = test_var;
18622 : } else {
18623 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18624 : PyLong_Type.tp_name);
18625 0 : return -1;
18626 : }
18627 : }
18628 0 : return 0;
18629 : }
18630 :
18631 0 : static PyObject *py_lsa_LookupNames_in_get_count(PyObject *obj, void *closure)
18632 : {
18633 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18634 : PyObject *py_count;
18635 0 : if (object->in.count == NULL) {
18636 0 : Py_RETURN_NONE;
18637 : }
18638 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
18639 0 : return py_count;
18640 : }
18641 :
18642 0 : static int py_lsa_LookupNames_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
18643 : {
18644 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18645 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
18646 0 : if (value == NULL) {
18647 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
18648 0 : return -1;
18649 : }
18650 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
18651 0 : if (object->in.count == NULL) {
18652 0 : PyErr_NoMemory();
18653 0 : return -1;
18654 : }
18655 : {
18656 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
18657 0 : if (PyLong_Check(value)) {
18658 : unsigned long long test_var;
18659 0 : test_var = PyLong_AsUnsignedLongLong(value);
18660 0 : if (PyErr_Occurred() != NULL) {
18661 0 : return -1;
18662 : }
18663 0 : if (test_var > uint_max) {
18664 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18665 : PyLong_Type.tp_name, uint_max, test_var);
18666 0 : return -1;
18667 : }
18668 0 : *object->in.count = test_var;
18669 : } else {
18670 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18671 : PyLong_Type.tp_name);
18672 0 : return -1;
18673 : }
18674 : }
18675 0 : return 0;
18676 : }
18677 :
18678 0 : static PyObject *py_lsa_LookupNames_out_get_count(PyObject *obj, void *closure)
18679 : {
18680 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18681 : PyObject *py_count;
18682 0 : if (object->out.count == NULL) {
18683 0 : Py_RETURN_NONE;
18684 : }
18685 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
18686 0 : return py_count;
18687 : }
18688 :
18689 0 : static int py_lsa_LookupNames_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
18690 : {
18691 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18692 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
18693 0 : if (value == NULL) {
18694 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
18695 0 : return -1;
18696 : }
18697 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
18698 0 : if (object->out.count == NULL) {
18699 0 : PyErr_NoMemory();
18700 0 : return -1;
18701 : }
18702 : {
18703 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
18704 0 : if (PyLong_Check(value)) {
18705 : unsigned long long test_var;
18706 0 : test_var = PyLong_AsUnsignedLongLong(value);
18707 0 : if (PyErr_Occurred() != NULL) {
18708 0 : return -1;
18709 : }
18710 0 : if (test_var > uint_max) {
18711 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18712 : PyLong_Type.tp_name, uint_max, test_var);
18713 0 : return -1;
18714 : }
18715 0 : *object->out.count = test_var;
18716 : } else {
18717 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18718 : PyLong_Type.tp_name);
18719 0 : return -1;
18720 : }
18721 : }
18722 0 : return 0;
18723 : }
18724 :
18725 0 : static PyObject *py_lsa_LookupNames_get_result(PyObject *obj, void *closure)
18726 : {
18727 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18728 : PyObject *py_result;
18729 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
18730 0 : return py_result;
18731 : }
18732 :
18733 0 : static int py_lsa_LookupNames_set_result(PyObject *py_obj, PyObject *value, void *closure)
18734 : {
18735 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18736 0 : if (value == NULL) {
18737 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
18738 0 : return -1;
18739 : }
18740 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
18741 0 : return 0;
18742 : }
18743 :
18744 : static PyGetSetDef py_lsa_LookupNames_getsetters[] = {
18745 : {
18746 : .name = discard_const_p(char, "in_handle"),
18747 : .get = py_lsa_LookupNames_in_get_handle,
18748 : .set = py_lsa_LookupNames_in_set_handle,
18749 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
18750 : },
18751 : {
18752 : .name = discard_const_p(char, "in_num_names"),
18753 : .get = py_lsa_LookupNames_in_get_num_names,
18754 : .set = py_lsa_LookupNames_in_set_num_names,
18755 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18756 : },
18757 : {
18758 : .name = discard_const_p(char, "in_names"),
18759 : .get = py_lsa_LookupNames_in_get_names,
18760 : .set = py_lsa_LookupNames_in_set_names,
18761 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
18762 : },
18763 : {
18764 : .name = discard_const_p(char, "out_domains"),
18765 : .get = py_lsa_LookupNames_out_get_domains,
18766 : .set = py_lsa_LookupNames_out_set_domains,
18767 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
18768 : },
18769 : {
18770 : .name = discard_const_p(char, "in_sids"),
18771 : .get = py_lsa_LookupNames_in_get_sids,
18772 : .set = py_lsa_LookupNames_in_set_sids,
18773 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray")
18774 : },
18775 : {
18776 : .name = discard_const_p(char, "out_sids"),
18777 : .get = py_lsa_LookupNames_out_get_sids,
18778 : .set = py_lsa_LookupNames_out_set_sids,
18779 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray")
18780 : },
18781 : {
18782 : .name = discard_const_p(char, "in_level"),
18783 : .get = py_lsa_LookupNames_in_get_level,
18784 : .set = py_lsa_LookupNames_in_set_level,
18785 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
18786 : },
18787 : {
18788 : .name = discard_const_p(char, "in_count"),
18789 : .get = py_lsa_LookupNames_in_get_count,
18790 : .set = py_lsa_LookupNames_in_set_count,
18791 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18792 : },
18793 : {
18794 : .name = discard_const_p(char, "out_count"),
18795 : .get = py_lsa_LookupNames_out_get_count,
18796 : .set = py_lsa_LookupNames_out_set_count,
18797 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18798 : },
18799 : {
18800 : .name = discard_const_p(char, "result"),
18801 : .get = py_lsa_LookupNames_get_result,
18802 : .set = py_lsa_LookupNames_set_result,
18803 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
18804 : },
18805 : { .name = NULL }
18806 : };
18807 :
18808 0 : static PyObject *py_lsa_LookupNames_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18809 : {
18810 0 : PyObject *self = pytalloc_new(struct lsa_LookupNames, type);
18811 0 : struct lsa_LookupNames *_self = (struct lsa_LookupNames *)pytalloc_get_ptr(self);
18812 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
18813 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
18814 : /* a pointer to a NULL pointer */
18815 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
18816 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray);
18817 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray);
18818 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
18819 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
18820 0 : return self;
18821 : }
18822 :
18823 0 : static PyObject *py_lsa_LookupNames_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
18824 : {
18825 :
18826 :
18827 0 : return PyLong_FromLong(14);
18828 : }
18829 :
18830 0 : static PyObject *py_lsa_LookupNames_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
18831 : {
18832 0 : const struct ndr_interface_call *call = NULL;
18833 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18834 0 : PyObject *ret = NULL;
18835 0 : struct ndr_push *push = NULL;
18836 : DATA_BLOB blob;
18837 : enum ndr_err_code err;
18838 :
18839 0 : if (ndr_table_lsarpc.num_calls < 15) {
18840 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames_ndr_pack");
18841 0 : return NULL;
18842 : }
18843 0 : call = &ndr_table_lsarpc.calls[14];
18844 :
18845 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
18846 0 : if (push == NULL) {
18847 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18848 0 : return NULL;
18849 : }
18850 :
18851 0 : push->flags |= ndr_push_flags;
18852 :
18853 0 : err = call->ndr_push(push, ndr_inout_flags, object);
18854 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18855 0 : TALLOC_FREE(push);
18856 0 : PyErr_SetNdrError(err);
18857 0 : return NULL;
18858 : }
18859 0 : blob = ndr_push_blob(push);
18860 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
18861 0 : TALLOC_FREE(push);
18862 0 : return ret;
18863 : }
18864 :
18865 0 : static PyObject *py_lsa_LookupNames_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18866 : {
18867 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18868 0 : PyObject *bigendian_obj = NULL;
18869 0 : PyObject *ndr64_obj = NULL;
18870 0 : uint32_t ndr_push_flags = 0;
18871 :
18872 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
18873 : discard_const_p(char *, kwnames),
18874 : &bigendian_obj,
18875 : &ndr64_obj)) {
18876 0 : return NULL;
18877 : }
18878 :
18879 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18880 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18881 : }
18882 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18883 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18884 : }
18885 :
18886 0 : return py_lsa_LookupNames_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
18887 : }
18888 :
18889 0 : static PyObject *py_lsa_LookupNames_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18890 : {
18891 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18892 0 : PyObject *bigendian_obj = NULL;
18893 0 : PyObject *ndr64_obj = NULL;
18894 0 : uint32_t ndr_push_flags = 0;
18895 :
18896 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
18897 : discard_const_p(char *, kwnames),
18898 : &bigendian_obj,
18899 : &ndr64_obj)) {
18900 0 : return NULL;
18901 : }
18902 :
18903 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18904 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18905 : }
18906 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18907 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18908 : }
18909 :
18910 0 : return py_lsa_LookupNames_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
18911 : }
18912 :
18913 0 : static PyObject *py_lsa_LookupNames_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
18914 : {
18915 0 : const struct ndr_interface_call *call = NULL;
18916 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18917 0 : struct ndr_pull *pull = NULL;
18918 : enum ndr_err_code err;
18919 :
18920 0 : if (ndr_table_lsarpc.num_calls < 15) {
18921 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames_ndr_unpack");
18922 0 : return NULL;
18923 : }
18924 0 : call = &ndr_table_lsarpc.calls[14];
18925 :
18926 0 : pull = ndr_pull_init_blob(blob, object);
18927 0 : if (pull == NULL) {
18928 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18929 0 : return NULL;
18930 : }
18931 :
18932 0 : pull->flags |= ndr_pull_flags;
18933 :
18934 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
18935 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18936 0 : TALLOC_FREE(pull);
18937 0 : PyErr_SetNdrError(err);
18938 0 : return NULL;
18939 : }
18940 0 : if (!allow_remaining) {
18941 : uint32_t highest_ofs;
18942 :
18943 0 : if (pull->offset > pull->relative_highest_offset) {
18944 0 : highest_ofs = pull->offset;
18945 : } else {
18946 0 : highest_ofs = pull->relative_highest_offset;
18947 : }
18948 0 : if (highest_ofs < pull->data_size) {
18949 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
18950 : "not all bytes consumed ofs[%u] size[%u]",
18951 : highest_ofs, pull->data_size);
18952 0 : TALLOC_FREE(pull);
18953 0 : PyErr_SetNdrError(err);
18954 0 : return NULL;
18955 : }
18956 : }
18957 :
18958 0 : TALLOC_FREE(pull);
18959 0 : Py_RETURN_NONE;
18960 : }
18961 :
18962 0 : static PyObject *py_lsa_LookupNames_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18963 : {
18964 : DATA_BLOB blob;
18965 0 : Py_ssize_t blob_length = 0;
18966 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18967 0 : PyObject *bigendian_obj = NULL;
18968 0 : PyObject *ndr64_obj = NULL;
18969 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18970 0 : PyObject *allow_remaining_obj = NULL;
18971 0 : bool allow_remaining = false;
18972 :
18973 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
18974 : discard_const_p(char *, kwnames),
18975 : &blob.data, &blob_length,
18976 : &bigendian_obj,
18977 : &ndr64_obj,
18978 : &allow_remaining_obj)) {
18979 0 : return NULL;
18980 : }
18981 0 : blob.length = blob_length;
18982 :
18983 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18984 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18985 : }
18986 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18987 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18988 : }
18989 :
18990 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18991 0 : allow_remaining = true;
18992 : }
18993 :
18994 0 : return py_lsa_LookupNames_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
18995 : }
18996 :
18997 0 : static PyObject *py_lsa_LookupNames_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18998 : {
18999 : DATA_BLOB blob;
19000 0 : Py_ssize_t blob_length = 0;
19001 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19002 0 : PyObject *bigendian_obj = NULL;
19003 0 : PyObject *ndr64_obj = NULL;
19004 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19005 0 : PyObject *allow_remaining_obj = NULL;
19006 0 : bool allow_remaining = false;
19007 :
19008 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
19009 : discard_const_p(char *, kwnames),
19010 : &blob.data, &blob_length,
19011 : &bigendian_obj,
19012 : &ndr64_obj,
19013 : &allow_remaining_obj)) {
19014 0 : return NULL;
19015 : }
19016 0 : blob.length = blob_length;
19017 :
19018 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19019 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19020 : }
19021 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19022 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19023 : }
19024 :
19025 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19026 0 : allow_remaining = true;
19027 : }
19028 :
19029 0 : return py_lsa_LookupNames_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
19030 : }
19031 :
19032 0 : static PyObject *py_lsa_LookupNames_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
19033 : {
19034 0 : const struct ndr_interface_call *call = NULL;
19035 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
19036 : PyObject *ret;
19037 : char *retstr;
19038 :
19039 0 : if (ndr_table_lsarpc.num_calls < 15) {
19040 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames_ndr_print");
19041 0 : return NULL;
19042 : }
19043 0 : call = &ndr_table_lsarpc.calls[14];
19044 :
19045 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
19046 0 : ret = PyUnicode_FromString(retstr);
19047 0 : TALLOC_FREE(retstr);
19048 :
19049 0 : return ret;
19050 : }
19051 :
19052 0 : static PyObject *py_lsa_LookupNames_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19053 : {
19054 0 : return py_lsa_LookupNames_ndr_print(py_obj, "lsa_LookupNames_in", NDR_IN);
19055 : }
19056 :
19057 0 : static PyObject *py_lsa_LookupNames_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19058 : {
19059 0 : return py_lsa_LookupNames_ndr_print(py_obj, "lsa_LookupNames_out", NDR_OUT);
19060 : }
19061 :
19062 : static PyMethodDef py_lsa_LookupNames_methods[] = {
19063 : { "opnum", (PyCFunction)py_lsa_LookupNames_ndr_opnum, METH_NOARGS|METH_CLASS,
19064 : "lsa.LookupNames.opnum() -> 14 (0x0e) " },
19065 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
19066 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
19067 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
19068 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
19069 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
19070 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
19071 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
19072 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
19073 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupNames_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
19074 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupNames_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
19075 : { NULL, NULL, 0, NULL }
19076 : };
19077 :
19078 :
19079 : static PyTypeObject lsa_LookupNames_Type = {
19080 : PyVarObject_HEAD_INIT(NULL, 0)
19081 : .tp_name = "lsa.LookupNames",
19082 : .tp_getset = py_lsa_LookupNames_getsetters,
19083 : .tp_methods = py_lsa_LookupNames_methods,
19084 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19085 : .tp_new = py_lsa_LookupNames_new,
19086 : };
19087 :
19088 1 : static bool pack_py_lsa_LookupNames_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames *r)
19089 : {
19090 : PyObject *py_handle;
19091 : PyObject *py_names;
19092 : PyObject *py_sids;
19093 : PyObject *py_level;
19094 : PyObject *py_count;
19095 1 : const char *kwnames[] = {
19096 : "handle", "names", "sids", "level", "count", NULL
19097 : };
19098 :
19099 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_LookupNames", discard_const_p(char *, kwnames), &py_handle, &py_names, &py_sids, &py_level, &py_count)) {
19100 0 : return false;
19101 : }
19102 :
19103 1 : if (py_handle == NULL) {
19104 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
19105 0 : return false;
19106 : }
19107 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
19108 1 : if (r->in.handle == NULL) {
19109 0 : PyErr_NoMemory();
19110 0 : return false;
19111 : }
19112 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
19113 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
19114 0 : PyErr_NoMemory();
19115 0 : return false;
19116 : }
19117 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
19118 1 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
19119 1 : r->in.num_names = PyList_GET_SIZE(py_names);
19120 1 : if (py_names == NULL) {
19121 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
19122 0 : return false;
19123 : }
19124 1 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
19125 : {
19126 : int names_cntr_0;
19127 1 : r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
19128 1 : if (!r->in.names) { return false;; }
19129 1 : talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
19130 3 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
19131 2 : if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) {
19132 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names[names_cntr_0]");
19133 0 : return false;
19134 : }
19135 2 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
19136 2 : if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
19137 0 : PyErr_NoMemory();
19138 0 : return false;
19139 : }
19140 2 : r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
19141 : }
19142 : }
19143 1 : if (py_sids == NULL) {
19144 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
19145 0 : return false;
19146 : }
19147 1 : r->in.sids = talloc_ptrtype(r, r->in.sids);
19148 1 : if (r->in.sids == NULL) {
19149 0 : PyErr_NoMemory();
19150 0 : return false;
19151 : }
19152 1 : PY_CHECK_TYPE(&lsa_TransSidArray_Type, py_sids, return false;);
19153 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
19154 0 : PyErr_NoMemory();
19155 0 : return false;
19156 : }
19157 1 : r->in.sids = (struct lsa_TransSidArray *)pytalloc_get_ptr(py_sids);
19158 1 : if (py_level == NULL) {
19159 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
19160 0 : return false;
19161 : }
19162 : {
19163 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
19164 1 : if (PyLong_Check(py_level)) {
19165 : unsigned long long test_var;
19166 1 : test_var = PyLong_AsUnsignedLongLong(py_level);
19167 1 : if (PyErr_Occurred() != NULL) {
19168 0 : return false;
19169 : }
19170 1 : if (test_var > uint_max) {
19171 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19172 : PyLong_Type.tp_name, uint_max, test_var);
19173 0 : return false;
19174 : }
19175 1 : r->in.level = test_var;
19176 : } else {
19177 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19178 : PyLong_Type.tp_name);
19179 0 : return false;
19180 : }
19181 : }
19182 1 : if (py_count == NULL) {
19183 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
19184 0 : return false;
19185 : }
19186 1 : r->in.count = talloc_ptrtype(r, r->in.count);
19187 1 : if (r->in.count == NULL) {
19188 0 : PyErr_NoMemory();
19189 0 : return false;
19190 : }
19191 : {
19192 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
19193 1 : if (PyLong_Check(py_count)) {
19194 : unsigned long long test_var;
19195 1 : test_var = PyLong_AsUnsignedLongLong(py_count);
19196 1 : if (PyErr_Occurred() != NULL) {
19197 0 : return false;
19198 : }
19199 1 : if (test_var > uint_max) {
19200 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19201 : PyLong_Type.tp_name, uint_max, test_var);
19202 0 : return false;
19203 : }
19204 1 : *r->in.count = test_var;
19205 : } else {
19206 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19207 : PyLong_Type.tp_name);
19208 0 : return false;
19209 : }
19210 : }
19211 1 : return true;
19212 : }
19213 :
19214 1 : static PyObject *unpack_py_lsa_LookupNames_args_out(struct lsa_LookupNames *r)
19215 : {
19216 : PyObject *result;
19217 : PyObject *py_domains;
19218 : PyObject *py_sids;
19219 : PyObject *py_count;
19220 1 : result = PyTuple_New(3);
19221 1 : if (*r->out.domains == NULL) {
19222 0 : py_domains = Py_None;
19223 0 : Py_INCREF(py_domains);
19224 : } else {
19225 1 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
19226 : }
19227 1 : PyTuple_SetItem(result, 0, py_domains);
19228 1 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray_Type, r->out.sids, r->out.sids);
19229 1 : PyTuple_SetItem(result, 1, py_sids);
19230 1 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
19231 1 : PyTuple_SetItem(result, 2, py_count);
19232 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
19233 0 : PyErr_SetNTSTATUS(r->out.result);
19234 0 : return NULL;
19235 : }
19236 :
19237 1 : return result;
19238 : }
19239 :
19240 :
19241 0 : static PyObject *py_lsa_LookupSids_in_get_handle(PyObject *obj, void *closure)
19242 : {
19243 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19244 : PyObject *py_handle;
19245 0 : if (object->in.handle == NULL) {
19246 0 : Py_RETURN_NONE;
19247 : }
19248 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
19249 0 : return py_handle;
19250 : }
19251 :
19252 0 : static int py_lsa_LookupSids_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
19253 : {
19254 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19255 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
19256 0 : if (value == NULL) {
19257 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
19258 0 : return -1;
19259 : }
19260 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
19261 0 : if (object->in.handle == NULL) {
19262 0 : PyErr_NoMemory();
19263 0 : return -1;
19264 : }
19265 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
19266 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19267 0 : PyErr_NoMemory();
19268 0 : return -1;
19269 : }
19270 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
19271 0 : return 0;
19272 : }
19273 :
19274 0 : static PyObject *py_lsa_LookupSids_in_get_sids(PyObject *obj, void *closure)
19275 : {
19276 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19277 : PyObject *py_sids;
19278 0 : if (object->in.sids == NULL) {
19279 0 : Py_RETURN_NONE;
19280 : }
19281 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->in.sids, object->in.sids);
19282 0 : return py_sids;
19283 : }
19284 :
19285 0 : static int py_lsa_LookupSids_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
19286 : {
19287 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19288 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
19289 0 : if (value == NULL) {
19290 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
19291 0 : return -1;
19292 : }
19293 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
19294 0 : if (object->in.sids == NULL) {
19295 0 : PyErr_NoMemory();
19296 0 : return -1;
19297 : }
19298 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
19299 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19300 0 : PyErr_NoMemory();
19301 0 : return -1;
19302 : }
19303 0 : object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
19304 0 : return 0;
19305 : }
19306 :
19307 0 : static PyObject *py_lsa_LookupSids_out_get_domains(PyObject *obj, void *closure)
19308 : {
19309 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19310 : PyObject *py_domains;
19311 0 : if (object->out.domains == NULL) {
19312 0 : Py_RETURN_NONE;
19313 : }
19314 0 : if (*object->out.domains == NULL) {
19315 0 : py_domains = Py_None;
19316 0 : Py_INCREF(py_domains);
19317 : } else {
19318 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
19319 : }
19320 0 : return py_domains;
19321 : }
19322 :
19323 0 : static int py_lsa_LookupSids_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
19324 : {
19325 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19326 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
19327 0 : if (value == NULL) {
19328 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
19329 0 : return -1;
19330 : }
19331 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
19332 0 : if (object->out.domains == NULL) {
19333 0 : PyErr_NoMemory();
19334 0 : return -1;
19335 : }
19336 0 : if (value == Py_None) {
19337 0 : *object->out.domains = NULL;
19338 : } else {
19339 0 : *object->out.domains = NULL;
19340 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
19341 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19342 0 : PyErr_NoMemory();
19343 0 : return -1;
19344 : }
19345 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
19346 : }
19347 0 : return 0;
19348 : }
19349 :
19350 0 : static PyObject *py_lsa_LookupSids_in_get_names(PyObject *obj, void *closure)
19351 : {
19352 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19353 : PyObject *py_names;
19354 0 : if (object->in.names == NULL) {
19355 0 : Py_RETURN_NONE;
19356 : }
19357 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray_Type, object->in.names, object->in.names);
19358 0 : return py_names;
19359 : }
19360 :
19361 0 : static int py_lsa_LookupSids_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
19362 : {
19363 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19364 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.names));
19365 0 : if (value == NULL) {
19366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
19367 0 : return -1;
19368 : }
19369 0 : object->in.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names);
19370 0 : if (object->in.names == NULL) {
19371 0 : PyErr_NoMemory();
19372 0 : return -1;
19373 : }
19374 0 : PY_CHECK_TYPE(&lsa_TransNameArray_Type, value, return -1;);
19375 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19376 0 : PyErr_NoMemory();
19377 0 : return -1;
19378 : }
19379 0 : object->in.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(value);
19380 0 : return 0;
19381 : }
19382 :
19383 0 : static PyObject *py_lsa_LookupSids_out_get_names(PyObject *obj, void *closure)
19384 : {
19385 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19386 : PyObject *py_names;
19387 0 : if (object->out.names == NULL) {
19388 0 : Py_RETURN_NONE;
19389 : }
19390 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray_Type, object->out.names, object->out.names);
19391 0 : return py_names;
19392 : }
19393 :
19394 0 : static int py_lsa_LookupSids_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
19395 : {
19396 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19397 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
19398 0 : if (value == NULL) {
19399 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.names");
19400 0 : return -1;
19401 : }
19402 0 : object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
19403 0 : if (object->out.names == NULL) {
19404 0 : PyErr_NoMemory();
19405 0 : return -1;
19406 : }
19407 0 : PY_CHECK_TYPE(&lsa_TransNameArray_Type, value, return -1;);
19408 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19409 0 : PyErr_NoMemory();
19410 0 : return -1;
19411 : }
19412 0 : object->out.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(value);
19413 0 : return 0;
19414 : }
19415 :
19416 0 : static PyObject *py_lsa_LookupSids_in_get_level(PyObject *obj, void *closure)
19417 : {
19418 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19419 : PyObject *py_level;
19420 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
19421 0 : return py_level;
19422 : }
19423 :
19424 0 : static int py_lsa_LookupSids_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
19425 : {
19426 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19427 0 : if (value == NULL) {
19428 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
19429 0 : return -1;
19430 : }
19431 : {
19432 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
19433 0 : if (PyLong_Check(value)) {
19434 : unsigned long long test_var;
19435 0 : test_var = PyLong_AsUnsignedLongLong(value);
19436 0 : if (PyErr_Occurred() != NULL) {
19437 0 : return -1;
19438 : }
19439 0 : if (test_var > uint_max) {
19440 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19441 : PyLong_Type.tp_name, uint_max, test_var);
19442 0 : return -1;
19443 : }
19444 0 : object->in.level = test_var;
19445 : } else {
19446 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19447 : PyLong_Type.tp_name);
19448 0 : return -1;
19449 : }
19450 : }
19451 0 : return 0;
19452 : }
19453 :
19454 0 : static PyObject *py_lsa_LookupSids_in_get_count(PyObject *obj, void *closure)
19455 : {
19456 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19457 : PyObject *py_count;
19458 0 : if (object->in.count == NULL) {
19459 0 : Py_RETURN_NONE;
19460 : }
19461 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
19462 0 : return py_count;
19463 : }
19464 :
19465 0 : static int py_lsa_LookupSids_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
19466 : {
19467 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19468 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
19469 0 : if (value == NULL) {
19470 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
19471 0 : return -1;
19472 : }
19473 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
19474 0 : if (object->in.count == NULL) {
19475 0 : PyErr_NoMemory();
19476 0 : return -1;
19477 : }
19478 : {
19479 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
19480 0 : if (PyLong_Check(value)) {
19481 : unsigned long long test_var;
19482 0 : test_var = PyLong_AsUnsignedLongLong(value);
19483 0 : if (PyErr_Occurred() != NULL) {
19484 0 : return -1;
19485 : }
19486 0 : if (test_var > uint_max) {
19487 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19488 : PyLong_Type.tp_name, uint_max, test_var);
19489 0 : return -1;
19490 : }
19491 0 : *object->in.count = test_var;
19492 : } else {
19493 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19494 : PyLong_Type.tp_name);
19495 0 : return -1;
19496 : }
19497 : }
19498 0 : return 0;
19499 : }
19500 :
19501 0 : static PyObject *py_lsa_LookupSids_out_get_count(PyObject *obj, void *closure)
19502 : {
19503 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19504 : PyObject *py_count;
19505 0 : if (object->out.count == NULL) {
19506 0 : Py_RETURN_NONE;
19507 : }
19508 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
19509 0 : return py_count;
19510 : }
19511 :
19512 0 : static int py_lsa_LookupSids_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
19513 : {
19514 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19515 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
19516 0 : if (value == NULL) {
19517 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
19518 0 : return -1;
19519 : }
19520 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
19521 0 : if (object->out.count == NULL) {
19522 0 : PyErr_NoMemory();
19523 0 : return -1;
19524 : }
19525 : {
19526 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
19527 0 : if (PyLong_Check(value)) {
19528 : unsigned long long test_var;
19529 0 : test_var = PyLong_AsUnsignedLongLong(value);
19530 0 : if (PyErr_Occurred() != NULL) {
19531 0 : return -1;
19532 : }
19533 0 : if (test_var > uint_max) {
19534 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19535 : PyLong_Type.tp_name, uint_max, test_var);
19536 0 : return -1;
19537 : }
19538 0 : *object->out.count = test_var;
19539 : } else {
19540 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19541 : PyLong_Type.tp_name);
19542 0 : return -1;
19543 : }
19544 : }
19545 0 : return 0;
19546 : }
19547 :
19548 0 : static PyObject *py_lsa_LookupSids_get_result(PyObject *obj, void *closure)
19549 : {
19550 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19551 : PyObject *py_result;
19552 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
19553 0 : return py_result;
19554 : }
19555 :
19556 0 : static int py_lsa_LookupSids_set_result(PyObject *py_obj, PyObject *value, void *closure)
19557 : {
19558 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19559 0 : if (value == NULL) {
19560 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
19561 0 : return -1;
19562 : }
19563 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
19564 0 : return 0;
19565 : }
19566 :
19567 : static PyGetSetDef py_lsa_LookupSids_getsetters[] = {
19568 : {
19569 : .name = discard_const_p(char, "in_handle"),
19570 : .get = py_lsa_LookupSids_in_get_handle,
19571 : .set = py_lsa_LookupSids_in_set_handle,
19572 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
19573 : },
19574 : {
19575 : .name = discard_const_p(char, "in_sids"),
19576 : .get = py_lsa_LookupSids_in_get_sids,
19577 : .set = py_lsa_LookupSids_in_set_sids,
19578 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
19579 : },
19580 : {
19581 : .name = discard_const_p(char, "out_domains"),
19582 : .get = py_lsa_LookupSids_out_get_domains,
19583 : .set = py_lsa_LookupSids_out_set_domains,
19584 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
19585 : },
19586 : {
19587 : .name = discard_const_p(char, "in_names"),
19588 : .get = py_lsa_LookupSids_in_get_names,
19589 : .set = py_lsa_LookupSids_in_set_names,
19590 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray")
19591 : },
19592 : {
19593 : .name = discard_const_p(char, "out_names"),
19594 : .get = py_lsa_LookupSids_out_get_names,
19595 : .set = py_lsa_LookupSids_out_set_names,
19596 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray")
19597 : },
19598 : {
19599 : .name = discard_const_p(char, "in_level"),
19600 : .get = py_lsa_LookupSids_in_get_level,
19601 : .set = py_lsa_LookupSids_in_set_level,
19602 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
19603 : },
19604 : {
19605 : .name = discard_const_p(char, "in_count"),
19606 : .get = py_lsa_LookupSids_in_get_count,
19607 : .set = py_lsa_LookupSids_in_set_count,
19608 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19609 : },
19610 : {
19611 : .name = discard_const_p(char, "out_count"),
19612 : .get = py_lsa_LookupSids_out_get_count,
19613 : .set = py_lsa_LookupSids_out_set_count,
19614 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19615 : },
19616 : {
19617 : .name = discard_const_p(char, "result"),
19618 : .get = py_lsa_LookupSids_get_result,
19619 : .set = py_lsa_LookupSids_set_result,
19620 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
19621 : },
19622 : { .name = NULL }
19623 : };
19624 :
19625 0 : static PyObject *py_lsa_LookupSids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19626 : {
19627 0 : PyObject *self = pytalloc_new(struct lsa_LookupSids, type);
19628 0 : struct lsa_LookupSids *_self = (struct lsa_LookupSids *)pytalloc_get_ptr(self);
19629 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
19630 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
19631 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
19632 : /* a pointer to a NULL pointer */
19633 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
19634 0 : _self->in.names = talloc_zero(mem_ctx, struct lsa_TransNameArray);
19635 0 : _self->out.names = talloc_zero(mem_ctx, struct lsa_TransNameArray);
19636 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
19637 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
19638 0 : return self;
19639 : }
19640 :
19641 0 : static PyObject *py_lsa_LookupSids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
19642 : {
19643 :
19644 :
19645 0 : return PyLong_FromLong(15);
19646 : }
19647 :
19648 0 : static PyObject *py_lsa_LookupSids_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
19649 : {
19650 0 : const struct ndr_interface_call *call = NULL;
19651 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19652 0 : PyObject *ret = NULL;
19653 0 : struct ndr_push *push = NULL;
19654 : DATA_BLOB blob;
19655 : enum ndr_err_code err;
19656 :
19657 0 : if (ndr_table_lsarpc.num_calls < 16) {
19658 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids_ndr_pack");
19659 0 : return NULL;
19660 : }
19661 0 : call = &ndr_table_lsarpc.calls[15];
19662 :
19663 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
19664 0 : if (push == NULL) {
19665 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19666 0 : return NULL;
19667 : }
19668 :
19669 0 : push->flags |= ndr_push_flags;
19670 :
19671 0 : err = call->ndr_push(push, ndr_inout_flags, object);
19672 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19673 0 : TALLOC_FREE(push);
19674 0 : PyErr_SetNdrError(err);
19675 0 : return NULL;
19676 : }
19677 0 : blob = ndr_push_blob(push);
19678 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
19679 0 : TALLOC_FREE(push);
19680 0 : return ret;
19681 : }
19682 :
19683 0 : static PyObject *py_lsa_LookupSids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19684 : {
19685 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19686 0 : PyObject *bigendian_obj = NULL;
19687 0 : PyObject *ndr64_obj = NULL;
19688 0 : uint32_t ndr_push_flags = 0;
19689 :
19690 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
19691 : discard_const_p(char *, kwnames),
19692 : &bigendian_obj,
19693 : &ndr64_obj)) {
19694 0 : return NULL;
19695 : }
19696 :
19697 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19698 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19699 : }
19700 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19701 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19702 : }
19703 :
19704 0 : return py_lsa_LookupSids_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
19705 : }
19706 :
19707 0 : static PyObject *py_lsa_LookupSids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19708 : {
19709 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19710 0 : PyObject *bigendian_obj = NULL;
19711 0 : PyObject *ndr64_obj = NULL;
19712 0 : uint32_t ndr_push_flags = 0;
19713 :
19714 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
19715 : discard_const_p(char *, kwnames),
19716 : &bigendian_obj,
19717 : &ndr64_obj)) {
19718 0 : return NULL;
19719 : }
19720 :
19721 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19722 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19723 : }
19724 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19725 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19726 : }
19727 :
19728 0 : return py_lsa_LookupSids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
19729 : }
19730 :
19731 0 : static PyObject *py_lsa_LookupSids_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
19732 : {
19733 0 : const struct ndr_interface_call *call = NULL;
19734 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19735 0 : struct ndr_pull *pull = NULL;
19736 : enum ndr_err_code err;
19737 :
19738 0 : if (ndr_table_lsarpc.num_calls < 16) {
19739 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids_ndr_unpack");
19740 0 : return NULL;
19741 : }
19742 0 : call = &ndr_table_lsarpc.calls[15];
19743 :
19744 0 : pull = ndr_pull_init_blob(blob, object);
19745 0 : if (pull == NULL) {
19746 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19747 0 : return NULL;
19748 : }
19749 :
19750 0 : pull->flags |= ndr_pull_flags;
19751 :
19752 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
19753 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19754 0 : TALLOC_FREE(pull);
19755 0 : PyErr_SetNdrError(err);
19756 0 : return NULL;
19757 : }
19758 0 : if (!allow_remaining) {
19759 : uint32_t highest_ofs;
19760 :
19761 0 : if (pull->offset > pull->relative_highest_offset) {
19762 0 : highest_ofs = pull->offset;
19763 : } else {
19764 0 : highest_ofs = pull->relative_highest_offset;
19765 : }
19766 0 : if (highest_ofs < pull->data_size) {
19767 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
19768 : "not all bytes consumed ofs[%u] size[%u]",
19769 : highest_ofs, pull->data_size);
19770 0 : TALLOC_FREE(pull);
19771 0 : PyErr_SetNdrError(err);
19772 0 : return NULL;
19773 : }
19774 : }
19775 :
19776 0 : TALLOC_FREE(pull);
19777 0 : Py_RETURN_NONE;
19778 : }
19779 :
19780 0 : static PyObject *py_lsa_LookupSids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19781 : {
19782 : DATA_BLOB blob;
19783 0 : Py_ssize_t blob_length = 0;
19784 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19785 0 : PyObject *bigendian_obj = NULL;
19786 0 : PyObject *ndr64_obj = NULL;
19787 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19788 0 : PyObject *allow_remaining_obj = NULL;
19789 0 : bool allow_remaining = false;
19790 :
19791 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
19792 : discard_const_p(char *, kwnames),
19793 : &blob.data, &blob_length,
19794 : &bigendian_obj,
19795 : &ndr64_obj,
19796 : &allow_remaining_obj)) {
19797 0 : return NULL;
19798 : }
19799 0 : blob.length = blob_length;
19800 :
19801 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19802 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19803 : }
19804 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19805 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19806 : }
19807 :
19808 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19809 0 : allow_remaining = true;
19810 : }
19811 :
19812 0 : return py_lsa_LookupSids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
19813 : }
19814 :
19815 0 : static PyObject *py_lsa_LookupSids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19816 : {
19817 : DATA_BLOB blob;
19818 0 : Py_ssize_t blob_length = 0;
19819 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19820 0 : PyObject *bigendian_obj = NULL;
19821 0 : PyObject *ndr64_obj = NULL;
19822 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19823 0 : PyObject *allow_remaining_obj = NULL;
19824 0 : bool allow_remaining = false;
19825 :
19826 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
19827 : discard_const_p(char *, kwnames),
19828 : &blob.data, &blob_length,
19829 : &bigendian_obj,
19830 : &ndr64_obj,
19831 : &allow_remaining_obj)) {
19832 0 : return NULL;
19833 : }
19834 0 : blob.length = blob_length;
19835 :
19836 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19837 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19838 : }
19839 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19840 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19841 : }
19842 :
19843 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19844 0 : allow_remaining = true;
19845 : }
19846 :
19847 0 : return py_lsa_LookupSids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
19848 : }
19849 :
19850 0 : static PyObject *py_lsa_LookupSids_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
19851 : {
19852 0 : const struct ndr_interface_call *call = NULL;
19853 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19854 : PyObject *ret;
19855 : char *retstr;
19856 :
19857 0 : if (ndr_table_lsarpc.num_calls < 16) {
19858 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids_ndr_print");
19859 0 : return NULL;
19860 : }
19861 0 : call = &ndr_table_lsarpc.calls[15];
19862 :
19863 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
19864 0 : ret = PyUnicode_FromString(retstr);
19865 0 : TALLOC_FREE(retstr);
19866 :
19867 0 : return ret;
19868 : }
19869 :
19870 0 : static PyObject *py_lsa_LookupSids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19871 : {
19872 0 : return py_lsa_LookupSids_ndr_print(py_obj, "lsa_LookupSids_in", NDR_IN);
19873 : }
19874 :
19875 0 : static PyObject *py_lsa_LookupSids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19876 : {
19877 0 : return py_lsa_LookupSids_ndr_print(py_obj, "lsa_LookupSids_out", NDR_OUT);
19878 : }
19879 :
19880 : static PyMethodDef py_lsa_LookupSids_methods[] = {
19881 : { "opnum", (PyCFunction)py_lsa_LookupSids_ndr_opnum, METH_NOARGS|METH_CLASS,
19882 : "lsa.LookupSids.opnum() -> 15 (0x0f) " },
19883 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
19884 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
19885 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
19886 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
19887 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
19888 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
19889 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
19890 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
19891 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupSids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
19892 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupSids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
19893 : { NULL, NULL, 0, NULL }
19894 : };
19895 :
19896 :
19897 : static PyTypeObject lsa_LookupSids_Type = {
19898 : PyVarObject_HEAD_INIT(NULL, 0)
19899 : .tp_name = "lsa.LookupSids",
19900 : .tp_getset = py_lsa_LookupSids_getsetters,
19901 : .tp_methods = py_lsa_LookupSids_methods,
19902 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19903 : .tp_new = py_lsa_LookupSids_new,
19904 : };
19905 :
19906 1 : static bool pack_py_lsa_LookupSids_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids *r)
19907 : {
19908 : PyObject *py_handle;
19909 : PyObject *py_sids;
19910 : PyObject *py_names;
19911 : PyObject *py_level;
19912 : PyObject *py_count;
19913 1 : const char *kwnames[] = {
19914 : "handle", "sids", "names", "level", "count", NULL
19915 : };
19916 :
19917 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_LookupSids", discard_const_p(char *, kwnames), &py_handle, &py_sids, &py_names, &py_level, &py_count)) {
19918 0 : return false;
19919 : }
19920 :
19921 1 : if (py_handle == NULL) {
19922 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
19923 0 : return false;
19924 : }
19925 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
19926 1 : if (r->in.handle == NULL) {
19927 0 : PyErr_NoMemory();
19928 0 : return false;
19929 : }
19930 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
19931 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
19932 0 : PyErr_NoMemory();
19933 0 : return false;
19934 : }
19935 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
19936 1 : if (py_sids == NULL) {
19937 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
19938 0 : return false;
19939 : }
19940 1 : r->in.sids = talloc_ptrtype(r, r->in.sids);
19941 1 : if (r->in.sids == NULL) {
19942 0 : PyErr_NoMemory();
19943 0 : return false;
19944 : }
19945 1 : PY_CHECK_TYPE(&lsa_SidArray_Type, py_sids, return false;);
19946 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
19947 0 : PyErr_NoMemory();
19948 0 : return false;
19949 : }
19950 1 : r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
19951 1 : if (py_names == NULL) {
19952 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
19953 0 : return false;
19954 : }
19955 1 : r->in.names = talloc_ptrtype(r, r->in.names);
19956 1 : if (r->in.names == NULL) {
19957 0 : PyErr_NoMemory();
19958 0 : return false;
19959 : }
19960 1 : PY_CHECK_TYPE(&lsa_TransNameArray_Type, py_names, return false;);
19961 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_names)) == NULL) {
19962 0 : PyErr_NoMemory();
19963 0 : return false;
19964 : }
19965 1 : r->in.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_names);
19966 1 : if (py_level == NULL) {
19967 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
19968 0 : return false;
19969 : }
19970 : {
19971 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
19972 1 : if (PyLong_Check(py_level)) {
19973 : unsigned long long test_var;
19974 1 : test_var = PyLong_AsUnsignedLongLong(py_level);
19975 1 : if (PyErr_Occurred() != NULL) {
19976 0 : return false;
19977 : }
19978 1 : if (test_var > uint_max) {
19979 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19980 : PyLong_Type.tp_name, uint_max, test_var);
19981 0 : return false;
19982 : }
19983 1 : r->in.level = test_var;
19984 : } else {
19985 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19986 : PyLong_Type.tp_name);
19987 0 : return false;
19988 : }
19989 : }
19990 1 : if (py_count == NULL) {
19991 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
19992 0 : return false;
19993 : }
19994 1 : r->in.count = talloc_ptrtype(r, r->in.count);
19995 1 : if (r->in.count == NULL) {
19996 0 : PyErr_NoMemory();
19997 0 : return false;
19998 : }
19999 : {
20000 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
20001 1 : if (PyLong_Check(py_count)) {
20002 : unsigned long long test_var;
20003 1 : test_var = PyLong_AsUnsignedLongLong(py_count);
20004 1 : if (PyErr_Occurred() != NULL) {
20005 0 : return false;
20006 : }
20007 1 : if (test_var > uint_max) {
20008 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20009 : PyLong_Type.tp_name, uint_max, test_var);
20010 0 : return false;
20011 : }
20012 1 : *r->in.count = test_var;
20013 : } else {
20014 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20015 : PyLong_Type.tp_name);
20016 0 : return false;
20017 : }
20018 : }
20019 1 : return true;
20020 : }
20021 :
20022 1 : static PyObject *unpack_py_lsa_LookupSids_args_out(struct lsa_LookupSids *r)
20023 : {
20024 : PyObject *result;
20025 : PyObject *py_domains;
20026 : PyObject *py_names;
20027 : PyObject *py_count;
20028 1 : result = PyTuple_New(3);
20029 1 : if (*r->out.domains == NULL) {
20030 0 : py_domains = Py_None;
20031 0 : Py_INCREF(py_domains);
20032 : } else {
20033 1 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
20034 : }
20035 1 : PyTuple_SetItem(result, 0, py_domains);
20036 1 : py_names = pytalloc_reference_ex(&lsa_TransNameArray_Type, r->out.names, r->out.names);
20037 1 : PyTuple_SetItem(result, 1, py_names);
20038 1 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
20039 1 : PyTuple_SetItem(result, 2, py_count);
20040 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
20041 0 : PyErr_SetNTSTATUS(r->out.result);
20042 0 : return NULL;
20043 : }
20044 :
20045 1 : return result;
20046 : }
20047 :
20048 :
20049 0 : static PyObject *py_lsa_CreateSecret_in_get_handle(PyObject *obj, void *closure)
20050 : {
20051 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(obj);
20052 : PyObject *py_handle;
20053 0 : if (object->in.handle == NULL) {
20054 0 : Py_RETURN_NONE;
20055 : }
20056 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
20057 0 : return py_handle;
20058 : }
20059 :
20060 0 : static int py_lsa_CreateSecret_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
20061 : {
20062 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20063 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
20064 0 : if (value == NULL) {
20065 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
20066 0 : return -1;
20067 : }
20068 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
20069 0 : if (object->in.handle == NULL) {
20070 0 : PyErr_NoMemory();
20071 0 : return -1;
20072 : }
20073 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20074 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20075 0 : PyErr_NoMemory();
20076 0 : return -1;
20077 : }
20078 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
20079 0 : return 0;
20080 : }
20081 :
20082 0 : static PyObject *py_lsa_CreateSecret_in_get_name(PyObject *obj, void *closure)
20083 : {
20084 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(obj);
20085 : PyObject *py_name;
20086 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->in.name);
20087 0 : return py_name;
20088 : }
20089 :
20090 0 : static int py_lsa_CreateSecret_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
20091 : {
20092 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20093 0 : if (value == NULL) {
20094 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
20095 0 : return -1;
20096 : }
20097 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
20098 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20099 0 : PyErr_NoMemory();
20100 0 : return -1;
20101 : }
20102 0 : object->in.name = *(struct lsa_String *)pytalloc_get_ptr(value);
20103 0 : return 0;
20104 : }
20105 :
20106 0 : static PyObject *py_lsa_CreateSecret_in_get_access_mask(PyObject *obj, void *closure)
20107 : {
20108 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(obj);
20109 : PyObject *py_access_mask;
20110 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
20111 0 : return py_access_mask;
20112 : }
20113 :
20114 0 : static int py_lsa_CreateSecret_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
20115 : {
20116 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20117 0 : if (value == NULL) {
20118 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
20119 0 : return -1;
20120 : }
20121 : {
20122 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
20123 0 : if (PyLong_Check(value)) {
20124 : unsigned long long test_var;
20125 0 : test_var = PyLong_AsUnsignedLongLong(value);
20126 0 : if (PyErr_Occurred() != NULL) {
20127 0 : return -1;
20128 : }
20129 0 : if (test_var > uint_max) {
20130 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20131 : PyLong_Type.tp_name, uint_max, test_var);
20132 0 : return -1;
20133 : }
20134 0 : object->in.access_mask = test_var;
20135 : } else {
20136 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20137 : PyLong_Type.tp_name);
20138 0 : return -1;
20139 : }
20140 : }
20141 0 : return 0;
20142 : }
20143 :
20144 0 : static PyObject *py_lsa_CreateSecret_out_get_sec_handle(PyObject *obj, void *closure)
20145 : {
20146 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(obj);
20147 : PyObject *py_sec_handle;
20148 0 : if (object->out.sec_handle == NULL) {
20149 0 : Py_RETURN_NONE;
20150 : }
20151 0 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, object->out.sec_handle, object->out.sec_handle);
20152 0 : return py_sec_handle;
20153 : }
20154 :
20155 0 : static int py_lsa_CreateSecret_out_set_sec_handle(PyObject *py_obj, PyObject *value, void *closure)
20156 : {
20157 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20158 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sec_handle));
20159 0 : if (value == NULL) {
20160 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sec_handle");
20161 0 : return -1;
20162 : }
20163 0 : object->out.sec_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sec_handle);
20164 0 : if (object->out.sec_handle == NULL) {
20165 0 : PyErr_NoMemory();
20166 0 : return -1;
20167 : }
20168 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20169 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20170 0 : PyErr_NoMemory();
20171 0 : return -1;
20172 : }
20173 0 : object->out.sec_handle = (struct policy_handle *)pytalloc_get_ptr(value);
20174 0 : return 0;
20175 : }
20176 :
20177 0 : static PyObject *py_lsa_CreateSecret_get_result(PyObject *obj, void *closure)
20178 : {
20179 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(obj);
20180 : PyObject *py_result;
20181 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
20182 0 : return py_result;
20183 : }
20184 :
20185 0 : static int py_lsa_CreateSecret_set_result(PyObject *py_obj, PyObject *value, void *closure)
20186 : {
20187 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20188 0 : if (value == NULL) {
20189 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
20190 0 : return -1;
20191 : }
20192 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
20193 0 : return 0;
20194 : }
20195 :
20196 : static PyGetSetDef py_lsa_CreateSecret_getsetters[] = {
20197 : {
20198 : .name = discard_const_p(char, "in_handle"),
20199 : .get = py_lsa_CreateSecret_in_get_handle,
20200 : .set = py_lsa_CreateSecret_in_set_handle,
20201 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20202 : },
20203 : {
20204 : .name = discard_const_p(char, "in_name"),
20205 : .get = py_lsa_CreateSecret_in_get_name,
20206 : .set = py_lsa_CreateSecret_in_set_name,
20207 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
20208 : },
20209 : {
20210 : .name = discard_const_p(char, "in_access_mask"),
20211 : .get = py_lsa_CreateSecret_in_get_access_mask,
20212 : .set = py_lsa_CreateSecret_in_set_access_mask,
20213 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SecretAccessMask")
20214 : },
20215 : {
20216 : .name = discard_const_p(char, "out_sec_handle"),
20217 : .get = py_lsa_CreateSecret_out_get_sec_handle,
20218 : .set = py_lsa_CreateSecret_out_set_sec_handle,
20219 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20220 : },
20221 : {
20222 : .name = discard_const_p(char, "result"),
20223 : .get = py_lsa_CreateSecret_get_result,
20224 : .set = py_lsa_CreateSecret_set_result,
20225 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
20226 : },
20227 : { .name = NULL }
20228 : };
20229 :
20230 0 : static PyObject *py_lsa_CreateSecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20231 : {
20232 0 : PyObject *self = pytalloc_new(struct lsa_CreateSecret, type);
20233 0 : struct lsa_CreateSecret *_self = (struct lsa_CreateSecret *)pytalloc_get_ptr(self);
20234 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
20235 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
20236 0 : _self->out.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
20237 0 : return self;
20238 : }
20239 :
20240 0 : static PyObject *py_lsa_CreateSecret_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
20241 : {
20242 :
20243 :
20244 0 : return PyLong_FromLong(16);
20245 : }
20246 :
20247 0 : static PyObject *py_lsa_CreateSecret_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
20248 : {
20249 0 : const struct ndr_interface_call *call = NULL;
20250 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20251 0 : PyObject *ret = NULL;
20252 0 : struct ndr_push *push = NULL;
20253 : DATA_BLOB blob;
20254 : enum ndr_err_code err;
20255 :
20256 0 : if (ndr_table_lsarpc.num_calls < 17) {
20257 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateSecret_ndr_pack");
20258 0 : return NULL;
20259 : }
20260 0 : call = &ndr_table_lsarpc.calls[16];
20261 :
20262 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
20263 0 : if (push == NULL) {
20264 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20265 0 : return NULL;
20266 : }
20267 :
20268 0 : push->flags |= ndr_push_flags;
20269 :
20270 0 : err = call->ndr_push(push, ndr_inout_flags, object);
20271 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20272 0 : TALLOC_FREE(push);
20273 0 : PyErr_SetNdrError(err);
20274 0 : return NULL;
20275 : }
20276 0 : blob = ndr_push_blob(push);
20277 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
20278 0 : TALLOC_FREE(push);
20279 0 : return ret;
20280 : }
20281 :
20282 0 : static PyObject *py_lsa_CreateSecret_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20283 : {
20284 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20285 0 : PyObject *bigendian_obj = NULL;
20286 0 : PyObject *ndr64_obj = NULL;
20287 0 : uint32_t ndr_push_flags = 0;
20288 :
20289 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
20290 : discard_const_p(char *, kwnames),
20291 : &bigendian_obj,
20292 : &ndr64_obj)) {
20293 0 : return NULL;
20294 : }
20295 :
20296 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20297 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20298 : }
20299 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20300 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20301 : }
20302 :
20303 0 : return py_lsa_CreateSecret_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
20304 : }
20305 :
20306 0 : static PyObject *py_lsa_CreateSecret_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20307 : {
20308 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20309 0 : PyObject *bigendian_obj = NULL;
20310 0 : PyObject *ndr64_obj = NULL;
20311 0 : uint32_t ndr_push_flags = 0;
20312 :
20313 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
20314 : discard_const_p(char *, kwnames),
20315 : &bigendian_obj,
20316 : &ndr64_obj)) {
20317 0 : return NULL;
20318 : }
20319 :
20320 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20321 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20322 : }
20323 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20324 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20325 : }
20326 :
20327 0 : return py_lsa_CreateSecret_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
20328 : }
20329 :
20330 0 : static PyObject *py_lsa_CreateSecret_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
20331 : {
20332 0 : const struct ndr_interface_call *call = NULL;
20333 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20334 0 : struct ndr_pull *pull = NULL;
20335 : enum ndr_err_code err;
20336 :
20337 0 : if (ndr_table_lsarpc.num_calls < 17) {
20338 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateSecret_ndr_unpack");
20339 0 : return NULL;
20340 : }
20341 0 : call = &ndr_table_lsarpc.calls[16];
20342 :
20343 0 : pull = ndr_pull_init_blob(blob, object);
20344 0 : if (pull == NULL) {
20345 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20346 0 : return NULL;
20347 : }
20348 :
20349 0 : pull->flags |= ndr_pull_flags;
20350 :
20351 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
20352 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20353 0 : TALLOC_FREE(pull);
20354 0 : PyErr_SetNdrError(err);
20355 0 : return NULL;
20356 : }
20357 0 : if (!allow_remaining) {
20358 : uint32_t highest_ofs;
20359 :
20360 0 : if (pull->offset > pull->relative_highest_offset) {
20361 0 : highest_ofs = pull->offset;
20362 : } else {
20363 0 : highest_ofs = pull->relative_highest_offset;
20364 : }
20365 0 : if (highest_ofs < pull->data_size) {
20366 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
20367 : "not all bytes consumed ofs[%u] size[%u]",
20368 : highest_ofs, pull->data_size);
20369 0 : TALLOC_FREE(pull);
20370 0 : PyErr_SetNdrError(err);
20371 0 : return NULL;
20372 : }
20373 : }
20374 :
20375 0 : TALLOC_FREE(pull);
20376 0 : Py_RETURN_NONE;
20377 : }
20378 :
20379 0 : static PyObject *py_lsa_CreateSecret_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20380 : {
20381 : DATA_BLOB blob;
20382 0 : Py_ssize_t blob_length = 0;
20383 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20384 0 : PyObject *bigendian_obj = NULL;
20385 0 : PyObject *ndr64_obj = NULL;
20386 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20387 0 : PyObject *allow_remaining_obj = NULL;
20388 0 : bool allow_remaining = false;
20389 :
20390 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
20391 : discard_const_p(char *, kwnames),
20392 : &blob.data, &blob_length,
20393 : &bigendian_obj,
20394 : &ndr64_obj,
20395 : &allow_remaining_obj)) {
20396 0 : return NULL;
20397 : }
20398 0 : blob.length = blob_length;
20399 :
20400 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20401 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20402 : }
20403 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20404 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20405 : }
20406 :
20407 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20408 0 : allow_remaining = true;
20409 : }
20410 :
20411 0 : return py_lsa_CreateSecret_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
20412 : }
20413 :
20414 0 : static PyObject *py_lsa_CreateSecret_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20415 : {
20416 : DATA_BLOB blob;
20417 0 : Py_ssize_t blob_length = 0;
20418 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20419 0 : PyObject *bigendian_obj = NULL;
20420 0 : PyObject *ndr64_obj = NULL;
20421 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20422 0 : PyObject *allow_remaining_obj = NULL;
20423 0 : bool allow_remaining = false;
20424 :
20425 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
20426 : discard_const_p(char *, kwnames),
20427 : &blob.data, &blob_length,
20428 : &bigendian_obj,
20429 : &ndr64_obj,
20430 : &allow_remaining_obj)) {
20431 0 : return NULL;
20432 : }
20433 0 : blob.length = blob_length;
20434 :
20435 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20436 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20437 : }
20438 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20439 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20440 : }
20441 :
20442 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20443 0 : allow_remaining = true;
20444 : }
20445 :
20446 0 : return py_lsa_CreateSecret_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
20447 : }
20448 :
20449 0 : static PyObject *py_lsa_CreateSecret_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
20450 : {
20451 0 : const struct ndr_interface_call *call = NULL;
20452 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20453 : PyObject *ret;
20454 : char *retstr;
20455 :
20456 0 : if (ndr_table_lsarpc.num_calls < 17) {
20457 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateSecret_ndr_print");
20458 0 : return NULL;
20459 : }
20460 0 : call = &ndr_table_lsarpc.calls[16];
20461 :
20462 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
20463 0 : ret = PyUnicode_FromString(retstr);
20464 0 : TALLOC_FREE(retstr);
20465 :
20466 0 : return ret;
20467 : }
20468 :
20469 0 : static PyObject *py_lsa_CreateSecret_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20470 : {
20471 0 : return py_lsa_CreateSecret_ndr_print(py_obj, "lsa_CreateSecret_in", NDR_IN);
20472 : }
20473 :
20474 0 : static PyObject *py_lsa_CreateSecret_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20475 : {
20476 0 : return py_lsa_CreateSecret_ndr_print(py_obj, "lsa_CreateSecret_out", NDR_OUT);
20477 : }
20478 :
20479 : static PyMethodDef py_lsa_CreateSecret_methods[] = {
20480 : { "opnum", (PyCFunction)py_lsa_CreateSecret_ndr_opnum, METH_NOARGS|METH_CLASS,
20481 : "lsa.CreateSecret.opnum() -> 16 (0x10) " },
20482 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateSecret_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
20483 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
20484 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateSecret_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
20485 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
20486 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateSecret_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
20487 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
20488 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateSecret_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
20489 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
20490 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateSecret_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
20491 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateSecret_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
20492 : { NULL, NULL, 0, NULL }
20493 : };
20494 :
20495 :
20496 : static PyTypeObject lsa_CreateSecret_Type = {
20497 : PyVarObject_HEAD_INIT(NULL, 0)
20498 : .tp_name = "lsa.CreateSecret",
20499 : .tp_getset = py_lsa_CreateSecret_getsetters,
20500 : .tp_methods = py_lsa_CreateSecret_methods,
20501 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
20502 : .tp_new = py_lsa_CreateSecret_new,
20503 : };
20504 :
20505 1 : static bool pack_py_lsa_CreateSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateSecret *r)
20506 : {
20507 : PyObject *py_handle;
20508 : PyObject *py_name;
20509 : PyObject *py_access_mask;
20510 1 : const char *kwnames[] = {
20511 : "handle", "name", "access_mask", NULL
20512 : };
20513 :
20514 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateSecret", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
20515 0 : return false;
20516 : }
20517 :
20518 1 : if (py_handle == NULL) {
20519 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
20520 0 : return false;
20521 : }
20522 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
20523 1 : if (r->in.handle == NULL) {
20524 0 : PyErr_NoMemory();
20525 0 : return false;
20526 : }
20527 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
20528 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
20529 0 : PyErr_NoMemory();
20530 0 : return false;
20531 : }
20532 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
20533 1 : if (py_name == NULL) {
20534 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
20535 0 : return false;
20536 : }
20537 1 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
20538 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
20539 0 : PyErr_NoMemory();
20540 0 : return false;
20541 : }
20542 1 : r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
20543 1 : if (py_access_mask == NULL) {
20544 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
20545 0 : return false;
20546 : }
20547 : {
20548 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
20549 1 : if (PyLong_Check(py_access_mask)) {
20550 : unsigned long long test_var;
20551 1 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
20552 1 : if (PyErr_Occurred() != NULL) {
20553 0 : return false;
20554 : }
20555 1 : if (test_var > uint_max) {
20556 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20557 : PyLong_Type.tp_name, uint_max, test_var);
20558 0 : return false;
20559 : }
20560 1 : r->in.access_mask = test_var;
20561 : } else {
20562 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20563 : PyLong_Type.tp_name);
20564 0 : return false;
20565 : }
20566 : }
20567 1 : return true;
20568 : }
20569 :
20570 1 : static PyObject *unpack_py_lsa_CreateSecret_args_out(struct lsa_CreateSecret *r)
20571 : {
20572 : PyObject *result;
20573 : PyObject *py_sec_handle;
20574 1 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, r->out.sec_handle, r->out.sec_handle);
20575 1 : result = py_sec_handle;
20576 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
20577 0 : PyErr_SetNTSTATUS(r->out.result);
20578 0 : return NULL;
20579 : }
20580 :
20581 1 : return result;
20582 : }
20583 :
20584 :
20585 0 : static PyObject *py_lsa_OpenAccount_in_get_handle(PyObject *obj, void *closure)
20586 : {
20587 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(obj);
20588 : PyObject *py_handle;
20589 0 : if (object->in.handle == NULL) {
20590 0 : Py_RETURN_NONE;
20591 : }
20592 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
20593 0 : return py_handle;
20594 : }
20595 :
20596 0 : static int py_lsa_OpenAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
20597 : {
20598 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20599 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
20600 0 : if (value == NULL) {
20601 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
20602 0 : return -1;
20603 : }
20604 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
20605 0 : if (object->in.handle == NULL) {
20606 0 : PyErr_NoMemory();
20607 0 : return -1;
20608 : }
20609 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20610 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20611 0 : PyErr_NoMemory();
20612 0 : return -1;
20613 : }
20614 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
20615 0 : return 0;
20616 : }
20617 :
20618 0 : static PyObject *py_lsa_OpenAccount_in_get_sid(PyObject *obj, void *closure)
20619 : {
20620 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(obj);
20621 : PyObject *py_sid;
20622 0 : if (object->in.sid == NULL) {
20623 0 : Py_RETURN_NONE;
20624 : }
20625 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
20626 0 : return py_sid;
20627 : }
20628 :
20629 0 : static int py_lsa_OpenAccount_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
20630 : {
20631 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20632 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
20633 0 : if (value == NULL) {
20634 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
20635 0 : return -1;
20636 : }
20637 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
20638 0 : if (object->in.sid == NULL) {
20639 0 : PyErr_NoMemory();
20640 0 : return -1;
20641 : }
20642 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
20643 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20644 0 : PyErr_NoMemory();
20645 0 : return -1;
20646 : }
20647 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
20648 0 : return 0;
20649 : }
20650 :
20651 0 : static PyObject *py_lsa_OpenAccount_in_get_access_mask(PyObject *obj, void *closure)
20652 : {
20653 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(obj);
20654 : PyObject *py_access_mask;
20655 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
20656 0 : return py_access_mask;
20657 : }
20658 :
20659 0 : static int py_lsa_OpenAccount_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
20660 : {
20661 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20662 0 : if (value == NULL) {
20663 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
20664 0 : return -1;
20665 : }
20666 : {
20667 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
20668 0 : if (PyLong_Check(value)) {
20669 : unsigned long long test_var;
20670 0 : test_var = PyLong_AsUnsignedLongLong(value);
20671 0 : if (PyErr_Occurred() != NULL) {
20672 0 : return -1;
20673 : }
20674 0 : if (test_var > uint_max) {
20675 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20676 : PyLong_Type.tp_name, uint_max, test_var);
20677 0 : return -1;
20678 : }
20679 0 : object->in.access_mask = test_var;
20680 : } else {
20681 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20682 : PyLong_Type.tp_name);
20683 0 : return -1;
20684 : }
20685 : }
20686 0 : return 0;
20687 : }
20688 :
20689 0 : static PyObject *py_lsa_OpenAccount_out_get_acct_handle(PyObject *obj, void *closure)
20690 : {
20691 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(obj);
20692 : PyObject *py_acct_handle;
20693 0 : if (object->out.acct_handle == NULL) {
20694 0 : Py_RETURN_NONE;
20695 : }
20696 0 : py_acct_handle = pytalloc_reference_ex(policy_handle_Type, object->out.acct_handle, object->out.acct_handle);
20697 0 : return py_acct_handle;
20698 : }
20699 :
20700 0 : static int py_lsa_OpenAccount_out_set_acct_handle(PyObject *py_obj, PyObject *value, void *closure)
20701 : {
20702 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20703 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.acct_handle));
20704 0 : if (value == NULL) {
20705 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.acct_handle");
20706 0 : return -1;
20707 : }
20708 0 : object->out.acct_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.acct_handle);
20709 0 : if (object->out.acct_handle == NULL) {
20710 0 : PyErr_NoMemory();
20711 0 : return -1;
20712 : }
20713 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20714 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20715 0 : PyErr_NoMemory();
20716 0 : return -1;
20717 : }
20718 0 : object->out.acct_handle = (struct policy_handle *)pytalloc_get_ptr(value);
20719 0 : return 0;
20720 : }
20721 :
20722 0 : static PyObject *py_lsa_OpenAccount_get_result(PyObject *obj, void *closure)
20723 : {
20724 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(obj);
20725 : PyObject *py_result;
20726 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
20727 0 : return py_result;
20728 : }
20729 :
20730 0 : static int py_lsa_OpenAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
20731 : {
20732 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20733 0 : if (value == NULL) {
20734 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
20735 0 : return -1;
20736 : }
20737 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
20738 0 : return 0;
20739 : }
20740 :
20741 : static PyGetSetDef py_lsa_OpenAccount_getsetters[] = {
20742 : {
20743 : .name = discard_const_p(char, "in_handle"),
20744 : .get = py_lsa_OpenAccount_in_get_handle,
20745 : .set = py_lsa_OpenAccount_in_set_handle,
20746 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20747 : },
20748 : {
20749 : .name = discard_const_p(char, "in_sid"),
20750 : .get = py_lsa_OpenAccount_in_get_sid,
20751 : .set = py_lsa_OpenAccount_in_set_sid,
20752 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
20753 : },
20754 : {
20755 : .name = discard_const_p(char, "in_access_mask"),
20756 : .get = py_lsa_OpenAccount_in_get_access_mask,
20757 : .set = py_lsa_OpenAccount_in_set_access_mask,
20758 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AccountAccessMask")
20759 : },
20760 : {
20761 : .name = discard_const_p(char, "out_acct_handle"),
20762 : .get = py_lsa_OpenAccount_out_get_acct_handle,
20763 : .set = py_lsa_OpenAccount_out_set_acct_handle,
20764 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20765 : },
20766 : {
20767 : .name = discard_const_p(char, "result"),
20768 : .get = py_lsa_OpenAccount_get_result,
20769 : .set = py_lsa_OpenAccount_set_result,
20770 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
20771 : },
20772 : { .name = NULL }
20773 : };
20774 :
20775 0 : static PyObject *py_lsa_OpenAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20776 : {
20777 0 : PyObject *self = pytalloc_new(struct lsa_OpenAccount, type);
20778 0 : struct lsa_OpenAccount *_self = (struct lsa_OpenAccount *)pytalloc_get_ptr(self);
20779 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
20780 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
20781 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
20782 0 : _self->out.acct_handle = talloc_zero(mem_ctx, struct policy_handle);
20783 0 : return self;
20784 : }
20785 :
20786 0 : static PyObject *py_lsa_OpenAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
20787 : {
20788 :
20789 :
20790 0 : return PyLong_FromLong(17);
20791 : }
20792 :
20793 0 : static PyObject *py_lsa_OpenAccount_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
20794 : {
20795 0 : const struct ndr_interface_call *call = NULL;
20796 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20797 0 : PyObject *ret = NULL;
20798 0 : struct ndr_push *push = NULL;
20799 : DATA_BLOB blob;
20800 : enum ndr_err_code err;
20801 :
20802 0 : if (ndr_table_lsarpc.num_calls < 18) {
20803 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenAccount_ndr_pack");
20804 0 : return NULL;
20805 : }
20806 0 : call = &ndr_table_lsarpc.calls[17];
20807 :
20808 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
20809 0 : if (push == NULL) {
20810 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20811 0 : return NULL;
20812 : }
20813 :
20814 0 : push->flags |= ndr_push_flags;
20815 :
20816 0 : err = call->ndr_push(push, ndr_inout_flags, object);
20817 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20818 0 : TALLOC_FREE(push);
20819 0 : PyErr_SetNdrError(err);
20820 0 : return NULL;
20821 : }
20822 0 : blob = ndr_push_blob(push);
20823 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
20824 0 : TALLOC_FREE(push);
20825 0 : return ret;
20826 : }
20827 :
20828 0 : static PyObject *py_lsa_OpenAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20829 : {
20830 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20831 0 : PyObject *bigendian_obj = NULL;
20832 0 : PyObject *ndr64_obj = NULL;
20833 0 : uint32_t ndr_push_flags = 0;
20834 :
20835 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
20836 : discard_const_p(char *, kwnames),
20837 : &bigendian_obj,
20838 : &ndr64_obj)) {
20839 0 : return NULL;
20840 : }
20841 :
20842 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20843 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20844 : }
20845 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20846 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20847 : }
20848 :
20849 0 : return py_lsa_OpenAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
20850 : }
20851 :
20852 0 : static PyObject *py_lsa_OpenAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20853 : {
20854 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20855 0 : PyObject *bigendian_obj = NULL;
20856 0 : PyObject *ndr64_obj = NULL;
20857 0 : uint32_t ndr_push_flags = 0;
20858 :
20859 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
20860 : discard_const_p(char *, kwnames),
20861 : &bigendian_obj,
20862 : &ndr64_obj)) {
20863 0 : return NULL;
20864 : }
20865 :
20866 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20867 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20868 : }
20869 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20870 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20871 : }
20872 :
20873 0 : return py_lsa_OpenAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
20874 : }
20875 :
20876 0 : static PyObject *py_lsa_OpenAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
20877 : {
20878 0 : const struct ndr_interface_call *call = NULL;
20879 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20880 0 : struct ndr_pull *pull = NULL;
20881 : enum ndr_err_code err;
20882 :
20883 0 : if (ndr_table_lsarpc.num_calls < 18) {
20884 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenAccount_ndr_unpack");
20885 0 : return NULL;
20886 : }
20887 0 : call = &ndr_table_lsarpc.calls[17];
20888 :
20889 0 : pull = ndr_pull_init_blob(blob, object);
20890 0 : if (pull == NULL) {
20891 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20892 0 : return NULL;
20893 : }
20894 :
20895 0 : pull->flags |= ndr_pull_flags;
20896 :
20897 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
20898 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20899 0 : TALLOC_FREE(pull);
20900 0 : PyErr_SetNdrError(err);
20901 0 : return NULL;
20902 : }
20903 0 : if (!allow_remaining) {
20904 : uint32_t highest_ofs;
20905 :
20906 0 : if (pull->offset > pull->relative_highest_offset) {
20907 0 : highest_ofs = pull->offset;
20908 : } else {
20909 0 : highest_ofs = pull->relative_highest_offset;
20910 : }
20911 0 : if (highest_ofs < pull->data_size) {
20912 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
20913 : "not all bytes consumed ofs[%u] size[%u]",
20914 : highest_ofs, pull->data_size);
20915 0 : TALLOC_FREE(pull);
20916 0 : PyErr_SetNdrError(err);
20917 0 : return NULL;
20918 : }
20919 : }
20920 :
20921 0 : TALLOC_FREE(pull);
20922 0 : Py_RETURN_NONE;
20923 : }
20924 :
20925 0 : static PyObject *py_lsa_OpenAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20926 : {
20927 : DATA_BLOB blob;
20928 0 : Py_ssize_t blob_length = 0;
20929 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20930 0 : PyObject *bigendian_obj = NULL;
20931 0 : PyObject *ndr64_obj = NULL;
20932 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20933 0 : PyObject *allow_remaining_obj = NULL;
20934 0 : bool allow_remaining = false;
20935 :
20936 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
20937 : discard_const_p(char *, kwnames),
20938 : &blob.data, &blob_length,
20939 : &bigendian_obj,
20940 : &ndr64_obj,
20941 : &allow_remaining_obj)) {
20942 0 : return NULL;
20943 : }
20944 0 : blob.length = blob_length;
20945 :
20946 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20947 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20948 : }
20949 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20950 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20951 : }
20952 :
20953 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20954 0 : allow_remaining = true;
20955 : }
20956 :
20957 0 : return py_lsa_OpenAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
20958 : }
20959 :
20960 0 : static PyObject *py_lsa_OpenAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20961 : {
20962 : DATA_BLOB blob;
20963 0 : Py_ssize_t blob_length = 0;
20964 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20965 0 : PyObject *bigendian_obj = NULL;
20966 0 : PyObject *ndr64_obj = NULL;
20967 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20968 0 : PyObject *allow_remaining_obj = NULL;
20969 0 : bool allow_remaining = false;
20970 :
20971 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
20972 : discard_const_p(char *, kwnames),
20973 : &blob.data, &blob_length,
20974 : &bigendian_obj,
20975 : &ndr64_obj,
20976 : &allow_remaining_obj)) {
20977 0 : return NULL;
20978 : }
20979 0 : blob.length = blob_length;
20980 :
20981 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20982 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20983 : }
20984 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20985 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20986 : }
20987 :
20988 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20989 0 : allow_remaining = true;
20990 : }
20991 :
20992 0 : return py_lsa_OpenAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
20993 : }
20994 :
20995 0 : static PyObject *py_lsa_OpenAccount_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
20996 : {
20997 0 : const struct ndr_interface_call *call = NULL;
20998 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20999 : PyObject *ret;
21000 : char *retstr;
21001 :
21002 0 : if (ndr_table_lsarpc.num_calls < 18) {
21003 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenAccount_ndr_print");
21004 0 : return NULL;
21005 : }
21006 0 : call = &ndr_table_lsarpc.calls[17];
21007 :
21008 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21009 0 : ret = PyUnicode_FromString(retstr);
21010 0 : TALLOC_FREE(retstr);
21011 :
21012 0 : return ret;
21013 : }
21014 :
21015 0 : static PyObject *py_lsa_OpenAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21016 : {
21017 0 : return py_lsa_OpenAccount_ndr_print(py_obj, "lsa_OpenAccount_in", NDR_IN);
21018 : }
21019 :
21020 0 : static PyObject *py_lsa_OpenAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21021 : {
21022 0 : return py_lsa_OpenAccount_ndr_print(py_obj, "lsa_OpenAccount_out", NDR_OUT);
21023 : }
21024 :
21025 : static PyMethodDef py_lsa_OpenAccount_methods[] = {
21026 : { "opnum", (PyCFunction)py_lsa_OpenAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
21027 : "lsa.OpenAccount.opnum() -> 17 (0x11) " },
21028 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21029 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21030 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21031 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21032 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21033 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21034 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21035 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21036 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21037 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21038 : { NULL, NULL, 0, NULL }
21039 : };
21040 :
21041 :
21042 : static PyTypeObject lsa_OpenAccount_Type = {
21043 : PyVarObject_HEAD_INIT(NULL, 0)
21044 : .tp_name = "lsa.OpenAccount",
21045 : .tp_getset = py_lsa_OpenAccount_getsetters,
21046 : .tp_methods = py_lsa_OpenAccount_methods,
21047 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21048 : .tp_new = py_lsa_OpenAccount_new,
21049 : };
21050 :
21051 0 : static bool pack_py_lsa_OpenAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenAccount *r)
21052 : {
21053 : PyObject *py_handle;
21054 : PyObject *py_sid;
21055 : PyObject *py_access_mask;
21056 0 : const char *kwnames[] = {
21057 : "handle", "sid", "access_mask", NULL
21058 : };
21059 :
21060 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenAccount", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
21061 0 : return false;
21062 : }
21063 :
21064 0 : if (py_handle == NULL) {
21065 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
21066 0 : return false;
21067 : }
21068 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
21069 0 : if (r->in.handle == NULL) {
21070 0 : PyErr_NoMemory();
21071 0 : return false;
21072 : }
21073 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
21074 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
21075 0 : PyErr_NoMemory();
21076 0 : return false;
21077 : }
21078 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
21079 0 : if (py_sid == NULL) {
21080 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
21081 0 : return false;
21082 : }
21083 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
21084 0 : if (r->in.sid == NULL) {
21085 0 : PyErr_NoMemory();
21086 0 : return false;
21087 : }
21088 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
21089 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
21090 0 : PyErr_NoMemory();
21091 0 : return false;
21092 : }
21093 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
21094 0 : if (py_access_mask == NULL) {
21095 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
21096 0 : return false;
21097 : }
21098 : {
21099 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
21100 0 : if (PyLong_Check(py_access_mask)) {
21101 : unsigned long long test_var;
21102 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
21103 0 : if (PyErr_Occurred() != NULL) {
21104 0 : return false;
21105 : }
21106 0 : if (test_var > uint_max) {
21107 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21108 : PyLong_Type.tp_name, uint_max, test_var);
21109 0 : return false;
21110 : }
21111 0 : r->in.access_mask = test_var;
21112 : } else {
21113 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21114 : PyLong_Type.tp_name);
21115 0 : return false;
21116 : }
21117 : }
21118 0 : return true;
21119 : }
21120 :
21121 0 : static PyObject *unpack_py_lsa_OpenAccount_args_out(struct lsa_OpenAccount *r)
21122 : {
21123 : PyObject *result;
21124 : PyObject *py_acct_handle;
21125 0 : py_acct_handle = pytalloc_reference_ex(policy_handle_Type, r->out.acct_handle, r->out.acct_handle);
21126 0 : result = py_acct_handle;
21127 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
21128 0 : PyErr_SetNTSTATUS(r->out.result);
21129 0 : return NULL;
21130 : }
21131 :
21132 0 : return result;
21133 : }
21134 :
21135 :
21136 0 : static PyObject *py_lsa_EnumPrivsAccount_in_get_handle(PyObject *obj, void *closure)
21137 : {
21138 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(obj);
21139 : PyObject *py_handle;
21140 0 : if (object->in.handle == NULL) {
21141 0 : Py_RETURN_NONE;
21142 : }
21143 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
21144 0 : return py_handle;
21145 : }
21146 :
21147 0 : static int py_lsa_EnumPrivsAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
21148 : {
21149 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(py_obj);
21150 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
21151 0 : if (value == NULL) {
21152 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
21153 0 : return -1;
21154 : }
21155 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
21156 0 : if (object->in.handle == NULL) {
21157 0 : PyErr_NoMemory();
21158 0 : return -1;
21159 : }
21160 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
21161 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21162 0 : PyErr_NoMemory();
21163 0 : return -1;
21164 : }
21165 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
21166 0 : return 0;
21167 : }
21168 :
21169 0 : static PyObject *py_lsa_EnumPrivsAccount_out_get_privs(PyObject *obj, void *closure)
21170 : {
21171 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(obj);
21172 : PyObject *py_privs;
21173 0 : if (object->out.privs == NULL) {
21174 0 : Py_RETURN_NONE;
21175 : }
21176 0 : if (*object->out.privs == NULL) {
21177 0 : py_privs = Py_None;
21178 0 : Py_INCREF(py_privs);
21179 : } else {
21180 0 : py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, *object->out.privs, *object->out.privs);
21181 : }
21182 0 : return py_privs;
21183 : }
21184 :
21185 0 : static int py_lsa_EnumPrivsAccount_out_set_privs(PyObject *py_obj, PyObject *value, void *closure)
21186 : {
21187 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(py_obj);
21188 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.privs));
21189 0 : if (value == NULL) {
21190 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.privs");
21191 0 : return -1;
21192 : }
21193 0 : object->out.privs = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.privs);
21194 0 : if (object->out.privs == NULL) {
21195 0 : PyErr_NoMemory();
21196 0 : return -1;
21197 : }
21198 0 : if (value == Py_None) {
21199 0 : *object->out.privs = NULL;
21200 : } else {
21201 0 : *object->out.privs = NULL;
21202 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, value, return -1;);
21203 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21204 0 : PyErr_NoMemory();
21205 0 : return -1;
21206 : }
21207 0 : *object->out.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(value);
21208 : }
21209 0 : return 0;
21210 : }
21211 :
21212 0 : static PyObject *py_lsa_EnumPrivsAccount_get_result(PyObject *obj, void *closure)
21213 : {
21214 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(obj);
21215 : PyObject *py_result;
21216 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
21217 0 : return py_result;
21218 : }
21219 :
21220 0 : static int py_lsa_EnumPrivsAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
21221 : {
21222 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(py_obj);
21223 0 : if (value == NULL) {
21224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
21225 0 : return -1;
21226 : }
21227 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
21228 0 : return 0;
21229 : }
21230 :
21231 : static PyGetSetDef py_lsa_EnumPrivsAccount_getsetters[] = {
21232 : {
21233 : .name = discard_const_p(char, "in_handle"),
21234 : .get = py_lsa_EnumPrivsAccount_in_get_handle,
21235 : .set = py_lsa_EnumPrivsAccount_in_set_handle,
21236 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
21237 : },
21238 : {
21239 : .name = discard_const_p(char, "out_privs"),
21240 : .get = py_lsa_EnumPrivsAccount_out_get_privs,
21241 : .set = py_lsa_EnumPrivsAccount_out_set_privs,
21242 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivilegeSet")
21243 : },
21244 : {
21245 : .name = discard_const_p(char, "result"),
21246 : .get = py_lsa_EnumPrivsAccount_get_result,
21247 : .set = py_lsa_EnumPrivsAccount_set_result,
21248 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
21249 : },
21250 : { .name = NULL }
21251 : };
21252 :
21253 0 : static PyObject *py_lsa_EnumPrivsAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21254 : {
21255 0 : PyObject *self = pytalloc_new(struct lsa_EnumPrivsAccount, type);
21256 0 : struct lsa_EnumPrivsAccount *_self = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(self);
21257 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
21258 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
21259 : /* a pointer to a NULL pointer */
21260 0 : _self->out.privs = talloc_zero(mem_ctx, struct lsa_PrivilegeSet *);
21261 0 : return self;
21262 : }
21263 :
21264 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
21265 : {
21266 :
21267 :
21268 0 : return PyLong_FromLong(18);
21269 : }
21270 :
21271 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
21272 : {
21273 0 : const struct ndr_interface_call *call = NULL;
21274 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(py_obj);
21275 0 : PyObject *ret = NULL;
21276 0 : struct ndr_push *push = NULL;
21277 : DATA_BLOB blob;
21278 : enum ndr_err_code err;
21279 :
21280 0 : if (ndr_table_lsarpc.num_calls < 19) {
21281 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivsAccount_ndr_pack");
21282 0 : return NULL;
21283 : }
21284 0 : call = &ndr_table_lsarpc.calls[18];
21285 :
21286 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
21287 0 : if (push == NULL) {
21288 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21289 0 : return NULL;
21290 : }
21291 :
21292 0 : push->flags |= ndr_push_flags;
21293 :
21294 0 : err = call->ndr_push(push, ndr_inout_flags, object);
21295 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21296 0 : TALLOC_FREE(push);
21297 0 : PyErr_SetNdrError(err);
21298 0 : return NULL;
21299 : }
21300 0 : blob = ndr_push_blob(push);
21301 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
21302 0 : TALLOC_FREE(push);
21303 0 : return ret;
21304 : }
21305 :
21306 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21307 : {
21308 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21309 0 : PyObject *bigendian_obj = NULL;
21310 0 : PyObject *ndr64_obj = NULL;
21311 0 : uint32_t ndr_push_flags = 0;
21312 :
21313 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
21314 : discard_const_p(char *, kwnames),
21315 : &bigendian_obj,
21316 : &ndr64_obj)) {
21317 0 : return NULL;
21318 : }
21319 :
21320 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21321 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21322 : }
21323 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21324 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21325 : }
21326 :
21327 0 : return py_lsa_EnumPrivsAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
21328 : }
21329 :
21330 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21331 : {
21332 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21333 0 : PyObject *bigendian_obj = NULL;
21334 0 : PyObject *ndr64_obj = NULL;
21335 0 : uint32_t ndr_push_flags = 0;
21336 :
21337 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
21338 : discard_const_p(char *, kwnames),
21339 : &bigendian_obj,
21340 : &ndr64_obj)) {
21341 0 : return NULL;
21342 : }
21343 :
21344 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21345 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21346 : }
21347 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21348 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21349 : }
21350 :
21351 0 : return py_lsa_EnumPrivsAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
21352 : }
21353 :
21354 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
21355 : {
21356 0 : const struct ndr_interface_call *call = NULL;
21357 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(py_obj);
21358 0 : struct ndr_pull *pull = NULL;
21359 : enum ndr_err_code err;
21360 :
21361 0 : if (ndr_table_lsarpc.num_calls < 19) {
21362 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivsAccount_ndr_unpack");
21363 0 : return NULL;
21364 : }
21365 0 : call = &ndr_table_lsarpc.calls[18];
21366 :
21367 0 : pull = ndr_pull_init_blob(blob, object);
21368 0 : if (pull == NULL) {
21369 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21370 0 : return NULL;
21371 : }
21372 :
21373 0 : pull->flags |= ndr_pull_flags;
21374 :
21375 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
21376 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21377 0 : TALLOC_FREE(pull);
21378 0 : PyErr_SetNdrError(err);
21379 0 : return NULL;
21380 : }
21381 0 : if (!allow_remaining) {
21382 : uint32_t highest_ofs;
21383 :
21384 0 : if (pull->offset > pull->relative_highest_offset) {
21385 0 : highest_ofs = pull->offset;
21386 : } else {
21387 0 : highest_ofs = pull->relative_highest_offset;
21388 : }
21389 0 : if (highest_ofs < pull->data_size) {
21390 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
21391 : "not all bytes consumed ofs[%u] size[%u]",
21392 : highest_ofs, pull->data_size);
21393 0 : TALLOC_FREE(pull);
21394 0 : PyErr_SetNdrError(err);
21395 0 : return NULL;
21396 : }
21397 : }
21398 :
21399 0 : TALLOC_FREE(pull);
21400 0 : Py_RETURN_NONE;
21401 : }
21402 :
21403 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21404 : {
21405 : DATA_BLOB blob;
21406 0 : Py_ssize_t blob_length = 0;
21407 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21408 0 : PyObject *bigendian_obj = NULL;
21409 0 : PyObject *ndr64_obj = NULL;
21410 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21411 0 : PyObject *allow_remaining_obj = NULL;
21412 0 : bool allow_remaining = false;
21413 :
21414 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
21415 : discard_const_p(char *, kwnames),
21416 : &blob.data, &blob_length,
21417 : &bigendian_obj,
21418 : &ndr64_obj,
21419 : &allow_remaining_obj)) {
21420 0 : return NULL;
21421 : }
21422 0 : blob.length = blob_length;
21423 :
21424 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21425 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21426 : }
21427 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21428 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21429 : }
21430 :
21431 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21432 0 : allow_remaining = true;
21433 : }
21434 :
21435 0 : return py_lsa_EnumPrivsAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
21436 : }
21437 :
21438 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21439 : {
21440 : DATA_BLOB blob;
21441 0 : Py_ssize_t blob_length = 0;
21442 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21443 0 : PyObject *bigendian_obj = NULL;
21444 0 : PyObject *ndr64_obj = NULL;
21445 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21446 0 : PyObject *allow_remaining_obj = NULL;
21447 0 : bool allow_remaining = false;
21448 :
21449 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
21450 : discard_const_p(char *, kwnames),
21451 : &blob.data, &blob_length,
21452 : &bigendian_obj,
21453 : &ndr64_obj,
21454 : &allow_remaining_obj)) {
21455 0 : return NULL;
21456 : }
21457 0 : blob.length = blob_length;
21458 :
21459 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21460 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21461 : }
21462 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21463 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21464 : }
21465 :
21466 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21467 0 : allow_remaining = true;
21468 : }
21469 :
21470 0 : return py_lsa_EnumPrivsAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
21471 : }
21472 :
21473 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
21474 : {
21475 0 : const struct ndr_interface_call *call = NULL;
21476 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(py_obj);
21477 : PyObject *ret;
21478 : char *retstr;
21479 :
21480 0 : if (ndr_table_lsarpc.num_calls < 19) {
21481 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivsAccount_ndr_print");
21482 0 : return NULL;
21483 : }
21484 0 : call = &ndr_table_lsarpc.calls[18];
21485 :
21486 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21487 0 : ret = PyUnicode_FromString(retstr);
21488 0 : TALLOC_FREE(retstr);
21489 :
21490 0 : return ret;
21491 : }
21492 :
21493 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21494 : {
21495 0 : return py_lsa_EnumPrivsAccount_ndr_print(py_obj, "lsa_EnumPrivsAccount_in", NDR_IN);
21496 : }
21497 :
21498 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21499 : {
21500 0 : return py_lsa_EnumPrivsAccount_ndr_print(py_obj, "lsa_EnumPrivsAccount_out", NDR_OUT);
21501 : }
21502 :
21503 : static PyMethodDef py_lsa_EnumPrivsAccount_methods[] = {
21504 : { "opnum", (PyCFunction)py_lsa_EnumPrivsAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
21505 : "lsa.EnumPrivsAccount.opnum() -> 18 (0x12) " },
21506 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivsAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21507 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21508 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivsAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21509 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21510 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivsAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21511 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21512 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivsAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21513 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21514 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumPrivsAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21515 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumPrivsAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21516 : { NULL, NULL, 0, NULL }
21517 : };
21518 :
21519 :
21520 : static PyTypeObject lsa_EnumPrivsAccount_Type = {
21521 : PyVarObject_HEAD_INIT(NULL, 0)
21522 : .tp_name = "lsa.EnumPrivsAccount",
21523 : .tp_getset = py_lsa_EnumPrivsAccount_getsetters,
21524 : .tp_methods = py_lsa_EnumPrivsAccount_methods,
21525 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21526 : .tp_new = py_lsa_EnumPrivsAccount_new,
21527 : };
21528 :
21529 0 : static bool pack_py_lsa_EnumPrivsAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumPrivsAccount *r)
21530 : {
21531 : PyObject *py_handle;
21532 0 : const char *kwnames[] = {
21533 : "handle", NULL
21534 : };
21535 :
21536 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_EnumPrivsAccount", discard_const_p(char *, kwnames), &py_handle)) {
21537 0 : return false;
21538 : }
21539 :
21540 0 : if (py_handle == NULL) {
21541 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
21542 0 : return false;
21543 : }
21544 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
21545 0 : if (r->in.handle == NULL) {
21546 0 : PyErr_NoMemory();
21547 0 : return false;
21548 : }
21549 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
21550 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
21551 0 : PyErr_NoMemory();
21552 0 : return false;
21553 : }
21554 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
21555 0 : return true;
21556 : }
21557 :
21558 0 : static PyObject *unpack_py_lsa_EnumPrivsAccount_args_out(struct lsa_EnumPrivsAccount *r)
21559 : {
21560 : PyObject *result;
21561 : PyObject *py_privs;
21562 0 : if (*r->out.privs == NULL) {
21563 0 : py_privs = Py_None;
21564 0 : Py_INCREF(py_privs);
21565 : } else {
21566 0 : py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, *r->out.privs, *r->out.privs);
21567 : }
21568 0 : result = py_privs;
21569 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
21570 0 : PyErr_SetNTSTATUS(r->out.result);
21571 0 : return NULL;
21572 : }
21573 :
21574 0 : return result;
21575 : }
21576 :
21577 :
21578 0 : static PyObject *py_lsa_AddPrivilegesToAccount_in_get_handle(PyObject *obj, void *closure)
21579 : {
21580 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(obj);
21581 : PyObject *py_handle;
21582 0 : if (object->in.handle == NULL) {
21583 0 : Py_RETURN_NONE;
21584 : }
21585 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
21586 0 : return py_handle;
21587 : }
21588 :
21589 0 : static int py_lsa_AddPrivilegesToAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
21590 : {
21591 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(py_obj);
21592 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
21593 0 : if (value == NULL) {
21594 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
21595 0 : return -1;
21596 : }
21597 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
21598 0 : if (object->in.handle == NULL) {
21599 0 : PyErr_NoMemory();
21600 0 : return -1;
21601 : }
21602 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
21603 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21604 0 : PyErr_NoMemory();
21605 0 : return -1;
21606 : }
21607 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
21608 0 : return 0;
21609 : }
21610 :
21611 0 : static PyObject *py_lsa_AddPrivilegesToAccount_in_get_privs(PyObject *obj, void *closure)
21612 : {
21613 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(obj);
21614 : PyObject *py_privs;
21615 0 : if (object->in.privs == NULL) {
21616 0 : Py_RETURN_NONE;
21617 : }
21618 0 : py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, object->in.privs, object->in.privs);
21619 0 : return py_privs;
21620 : }
21621 :
21622 0 : static int py_lsa_AddPrivilegesToAccount_in_set_privs(PyObject *py_obj, PyObject *value, void *closure)
21623 : {
21624 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(py_obj);
21625 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.privs));
21626 0 : if (value == NULL) {
21627 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.privs");
21628 0 : return -1;
21629 : }
21630 0 : object->in.privs = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.privs);
21631 0 : if (object->in.privs == NULL) {
21632 0 : PyErr_NoMemory();
21633 0 : return -1;
21634 : }
21635 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, value, return -1;);
21636 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21637 0 : PyErr_NoMemory();
21638 0 : return -1;
21639 : }
21640 0 : object->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(value);
21641 0 : return 0;
21642 : }
21643 :
21644 0 : static PyObject *py_lsa_AddPrivilegesToAccount_get_result(PyObject *obj, void *closure)
21645 : {
21646 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(obj);
21647 : PyObject *py_result;
21648 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
21649 0 : return py_result;
21650 : }
21651 :
21652 0 : static int py_lsa_AddPrivilegesToAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
21653 : {
21654 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(py_obj);
21655 0 : if (value == NULL) {
21656 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
21657 0 : return -1;
21658 : }
21659 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
21660 0 : return 0;
21661 : }
21662 :
21663 : static PyGetSetDef py_lsa_AddPrivilegesToAccount_getsetters[] = {
21664 : {
21665 : .name = discard_const_p(char, "in_handle"),
21666 : .get = py_lsa_AddPrivilegesToAccount_in_get_handle,
21667 : .set = py_lsa_AddPrivilegesToAccount_in_set_handle,
21668 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
21669 : },
21670 : {
21671 : .name = discard_const_p(char, "in_privs"),
21672 : .get = py_lsa_AddPrivilegesToAccount_in_get_privs,
21673 : .set = py_lsa_AddPrivilegesToAccount_in_set_privs,
21674 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivilegeSet")
21675 : },
21676 : {
21677 : .name = discard_const_p(char, "result"),
21678 : .get = py_lsa_AddPrivilegesToAccount_get_result,
21679 : .set = py_lsa_AddPrivilegesToAccount_set_result,
21680 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
21681 : },
21682 : { .name = NULL }
21683 : };
21684 :
21685 0 : static PyObject *py_lsa_AddPrivilegesToAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21686 : {
21687 0 : PyObject *self = pytalloc_new(struct lsa_AddPrivilegesToAccount, type);
21688 0 : struct lsa_AddPrivilegesToAccount *_self = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(self);
21689 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
21690 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
21691 0 : _self->in.privs = talloc_zero(mem_ctx, struct lsa_PrivilegeSet);
21692 0 : return self;
21693 : }
21694 :
21695 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
21696 : {
21697 :
21698 :
21699 0 : return PyLong_FromLong(19);
21700 : }
21701 :
21702 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
21703 : {
21704 0 : const struct ndr_interface_call *call = NULL;
21705 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(py_obj);
21706 0 : PyObject *ret = NULL;
21707 0 : struct ndr_push *push = NULL;
21708 : DATA_BLOB blob;
21709 : enum ndr_err_code err;
21710 :
21711 0 : if (ndr_table_lsarpc.num_calls < 20) {
21712 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddPrivilegesToAccount_ndr_pack");
21713 0 : return NULL;
21714 : }
21715 0 : call = &ndr_table_lsarpc.calls[19];
21716 :
21717 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
21718 0 : if (push == NULL) {
21719 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21720 0 : return NULL;
21721 : }
21722 :
21723 0 : push->flags |= ndr_push_flags;
21724 :
21725 0 : err = call->ndr_push(push, ndr_inout_flags, object);
21726 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21727 0 : TALLOC_FREE(push);
21728 0 : PyErr_SetNdrError(err);
21729 0 : return NULL;
21730 : }
21731 0 : blob = ndr_push_blob(push);
21732 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
21733 0 : TALLOC_FREE(push);
21734 0 : return ret;
21735 : }
21736 :
21737 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21738 : {
21739 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21740 0 : PyObject *bigendian_obj = NULL;
21741 0 : PyObject *ndr64_obj = NULL;
21742 0 : uint32_t ndr_push_flags = 0;
21743 :
21744 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
21745 : discard_const_p(char *, kwnames),
21746 : &bigendian_obj,
21747 : &ndr64_obj)) {
21748 0 : return NULL;
21749 : }
21750 :
21751 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21752 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21753 : }
21754 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21755 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21756 : }
21757 :
21758 0 : return py_lsa_AddPrivilegesToAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
21759 : }
21760 :
21761 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21762 : {
21763 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21764 0 : PyObject *bigendian_obj = NULL;
21765 0 : PyObject *ndr64_obj = NULL;
21766 0 : uint32_t ndr_push_flags = 0;
21767 :
21768 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
21769 : discard_const_p(char *, kwnames),
21770 : &bigendian_obj,
21771 : &ndr64_obj)) {
21772 0 : return NULL;
21773 : }
21774 :
21775 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21776 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21777 : }
21778 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21779 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21780 : }
21781 :
21782 0 : return py_lsa_AddPrivilegesToAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
21783 : }
21784 :
21785 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
21786 : {
21787 0 : const struct ndr_interface_call *call = NULL;
21788 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(py_obj);
21789 0 : struct ndr_pull *pull = NULL;
21790 : enum ndr_err_code err;
21791 :
21792 0 : if (ndr_table_lsarpc.num_calls < 20) {
21793 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddPrivilegesToAccount_ndr_unpack");
21794 0 : return NULL;
21795 : }
21796 0 : call = &ndr_table_lsarpc.calls[19];
21797 :
21798 0 : pull = ndr_pull_init_blob(blob, object);
21799 0 : if (pull == NULL) {
21800 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21801 0 : return NULL;
21802 : }
21803 :
21804 0 : pull->flags |= ndr_pull_flags;
21805 :
21806 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
21807 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21808 0 : TALLOC_FREE(pull);
21809 0 : PyErr_SetNdrError(err);
21810 0 : return NULL;
21811 : }
21812 0 : if (!allow_remaining) {
21813 : uint32_t highest_ofs;
21814 :
21815 0 : if (pull->offset > pull->relative_highest_offset) {
21816 0 : highest_ofs = pull->offset;
21817 : } else {
21818 0 : highest_ofs = pull->relative_highest_offset;
21819 : }
21820 0 : if (highest_ofs < pull->data_size) {
21821 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
21822 : "not all bytes consumed ofs[%u] size[%u]",
21823 : highest_ofs, pull->data_size);
21824 0 : TALLOC_FREE(pull);
21825 0 : PyErr_SetNdrError(err);
21826 0 : return NULL;
21827 : }
21828 : }
21829 :
21830 0 : TALLOC_FREE(pull);
21831 0 : Py_RETURN_NONE;
21832 : }
21833 :
21834 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21835 : {
21836 : DATA_BLOB blob;
21837 0 : Py_ssize_t blob_length = 0;
21838 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21839 0 : PyObject *bigendian_obj = NULL;
21840 0 : PyObject *ndr64_obj = NULL;
21841 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21842 0 : PyObject *allow_remaining_obj = NULL;
21843 0 : bool allow_remaining = false;
21844 :
21845 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
21846 : discard_const_p(char *, kwnames),
21847 : &blob.data, &blob_length,
21848 : &bigendian_obj,
21849 : &ndr64_obj,
21850 : &allow_remaining_obj)) {
21851 0 : return NULL;
21852 : }
21853 0 : blob.length = blob_length;
21854 :
21855 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21856 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21857 : }
21858 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21859 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21860 : }
21861 :
21862 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21863 0 : allow_remaining = true;
21864 : }
21865 :
21866 0 : return py_lsa_AddPrivilegesToAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
21867 : }
21868 :
21869 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21870 : {
21871 : DATA_BLOB blob;
21872 0 : Py_ssize_t blob_length = 0;
21873 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21874 0 : PyObject *bigendian_obj = NULL;
21875 0 : PyObject *ndr64_obj = NULL;
21876 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21877 0 : PyObject *allow_remaining_obj = NULL;
21878 0 : bool allow_remaining = false;
21879 :
21880 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
21881 : discard_const_p(char *, kwnames),
21882 : &blob.data, &blob_length,
21883 : &bigendian_obj,
21884 : &ndr64_obj,
21885 : &allow_remaining_obj)) {
21886 0 : return NULL;
21887 : }
21888 0 : blob.length = blob_length;
21889 :
21890 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21891 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21892 : }
21893 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21894 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21895 : }
21896 :
21897 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21898 0 : allow_remaining = true;
21899 : }
21900 :
21901 0 : return py_lsa_AddPrivilegesToAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
21902 : }
21903 :
21904 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
21905 : {
21906 0 : const struct ndr_interface_call *call = NULL;
21907 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(py_obj);
21908 : PyObject *ret;
21909 : char *retstr;
21910 :
21911 0 : if (ndr_table_lsarpc.num_calls < 20) {
21912 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddPrivilegesToAccount_ndr_print");
21913 0 : return NULL;
21914 : }
21915 0 : call = &ndr_table_lsarpc.calls[19];
21916 :
21917 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21918 0 : ret = PyUnicode_FromString(retstr);
21919 0 : TALLOC_FREE(retstr);
21920 :
21921 0 : return ret;
21922 : }
21923 :
21924 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21925 : {
21926 0 : return py_lsa_AddPrivilegesToAccount_ndr_print(py_obj, "lsa_AddPrivilegesToAccount_in", NDR_IN);
21927 : }
21928 :
21929 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21930 : {
21931 0 : return py_lsa_AddPrivilegesToAccount_ndr_print(py_obj, "lsa_AddPrivilegesToAccount_out", NDR_OUT);
21932 : }
21933 :
21934 : static PyMethodDef py_lsa_AddPrivilegesToAccount_methods[] = {
21935 : { "opnum", (PyCFunction)py_lsa_AddPrivilegesToAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
21936 : "lsa.AddPrivilegesToAccount.opnum() -> 19 (0x13) " },
21937 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddPrivilegesToAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21938 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21939 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddPrivilegesToAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21940 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21941 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddPrivilegesToAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21942 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21943 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddPrivilegesToAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21944 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21945 : { "__ndr_print_in__", (PyCFunction)py_lsa_AddPrivilegesToAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21946 : { "__ndr_print_out__", (PyCFunction)py_lsa_AddPrivilegesToAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21947 : { NULL, NULL, 0, NULL }
21948 : };
21949 :
21950 :
21951 : static PyTypeObject lsa_AddPrivilegesToAccount_Type = {
21952 : PyVarObject_HEAD_INIT(NULL, 0)
21953 : .tp_name = "lsa.AddPrivilegesToAccount",
21954 : .tp_getset = py_lsa_AddPrivilegesToAccount_getsetters,
21955 : .tp_methods = py_lsa_AddPrivilegesToAccount_methods,
21956 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21957 : .tp_new = py_lsa_AddPrivilegesToAccount_new,
21958 : };
21959 :
21960 0 : static bool pack_py_lsa_AddPrivilegesToAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_AddPrivilegesToAccount *r)
21961 : {
21962 : PyObject *py_handle;
21963 : PyObject *py_privs;
21964 0 : const char *kwnames[] = {
21965 : "handle", "privs", NULL
21966 : };
21967 :
21968 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_AddPrivilegesToAccount", discard_const_p(char *, kwnames), &py_handle, &py_privs)) {
21969 0 : return false;
21970 : }
21971 :
21972 0 : if (py_handle == NULL) {
21973 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
21974 0 : return false;
21975 : }
21976 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
21977 0 : if (r->in.handle == NULL) {
21978 0 : PyErr_NoMemory();
21979 0 : return false;
21980 : }
21981 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
21982 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
21983 0 : PyErr_NoMemory();
21984 0 : return false;
21985 : }
21986 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
21987 0 : if (py_privs == NULL) {
21988 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.privs");
21989 0 : return false;
21990 : }
21991 0 : r->in.privs = talloc_ptrtype(r, r->in.privs);
21992 0 : if (r->in.privs == NULL) {
21993 0 : PyErr_NoMemory();
21994 0 : return false;
21995 : }
21996 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, py_privs, return false;);
21997 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_privs)) == NULL) {
21998 0 : PyErr_NoMemory();
21999 0 : return false;
22000 : }
22001 0 : r->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_privs);
22002 0 : return true;
22003 : }
22004 :
22005 0 : static PyObject *unpack_py_lsa_AddPrivilegesToAccount_args_out(struct lsa_AddPrivilegesToAccount *r)
22006 : {
22007 : PyObject *result;
22008 0 : result = Py_None;
22009 0 : Py_INCREF(result);
22010 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
22011 0 : PyErr_SetNTSTATUS(r->out.result);
22012 0 : return NULL;
22013 : }
22014 :
22015 0 : return result;
22016 : }
22017 :
22018 :
22019 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_in_get_handle(PyObject *obj, void *closure)
22020 : {
22021 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(obj);
22022 : PyObject *py_handle;
22023 0 : if (object->in.handle == NULL) {
22024 0 : Py_RETURN_NONE;
22025 : }
22026 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
22027 0 : return py_handle;
22028 : }
22029 :
22030 0 : static int py_lsa_RemovePrivilegesFromAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
22031 : {
22032 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22033 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
22034 0 : if (value == NULL) {
22035 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
22036 0 : return -1;
22037 : }
22038 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
22039 0 : if (object->in.handle == NULL) {
22040 0 : PyErr_NoMemory();
22041 0 : return -1;
22042 : }
22043 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
22044 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22045 0 : PyErr_NoMemory();
22046 0 : return -1;
22047 : }
22048 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
22049 0 : return 0;
22050 : }
22051 :
22052 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_in_get_remove_all(PyObject *obj, void *closure)
22053 : {
22054 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(obj);
22055 : PyObject *py_remove_all;
22056 0 : py_remove_all = PyLong_FromLong((uint16_t)object->in.remove_all);
22057 0 : return py_remove_all;
22058 : }
22059 :
22060 0 : static int py_lsa_RemovePrivilegesFromAccount_in_set_remove_all(PyObject *py_obj, PyObject *value, void *closure)
22061 : {
22062 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22063 0 : if (value == NULL) {
22064 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.remove_all");
22065 0 : return -1;
22066 : }
22067 : {
22068 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.remove_all));
22069 0 : if (PyLong_Check(value)) {
22070 : unsigned long long test_var;
22071 0 : test_var = PyLong_AsUnsignedLongLong(value);
22072 0 : if (PyErr_Occurred() != NULL) {
22073 0 : return -1;
22074 : }
22075 0 : if (test_var > uint_max) {
22076 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22077 : PyLong_Type.tp_name, uint_max, test_var);
22078 0 : return -1;
22079 : }
22080 0 : object->in.remove_all = test_var;
22081 : } else {
22082 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22083 : PyLong_Type.tp_name);
22084 0 : return -1;
22085 : }
22086 : }
22087 0 : return 0;
22088 : }
22089 :
22090 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_in_get_privs(PyObject *obj, void *closure)
22091 : {
22092 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(obj);
22093 : PyObject *py_privs;
22094 0 : if (object->in.privs == NULL) {
22095 0 : Py_RETURN_NONE;
22096 : }
22097 0 : if (object->in.privs == NULL) {
22098 0 : py_privs = Py_None;
22099 0 : Py_INCREF(py_privs);
22100 : } else {
22101 0 : py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, object->in.privs, object->in.privs);
22102 : }
22103 0 : return py_privs;
22104 : }
22105 :
22106 0 : static int py_lsa_RemovePrivilegesFromAccount_in_set_privs(PyObject *py_obj, PyObject *value, void *closure)
22107 : {
22108 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22109 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.privs));
22110 0 : if (value == NULL) {
22111 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.privs");
22112 0 : return -1;
22113 : }
22114 0 : if (value == Py_None) {
22115 0 : object->in.privs = NULL;
22116 : } else {
22117 0 : object->in.privs = NULL;
22118 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, value, return -1;);
22119 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22120 0 : PyErr_NoMemory();
22121 0 : return -1;
22122 : }
22123 0 : object->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(value);
22124 : }
22125 0 : return 0;
22126 : }
22127 :
22128 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_get_result(PyObject *obj, void *closure)
22129 : {
22130 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(obj);
22131 : PyObject *py_result;
22132 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
22133 0 : return py_result;
22134 : }
22135 :
22136 0 : static int py_lsa_RemovePrivilegesFromAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
22137 : {
22138 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22139 0 : if (value == NULL) {
22140 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
22141 0 : return -1;
22142 : }
22143 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
22144 0 : return 0;
22145 : }
22146 :
22147 : static PyGetSetDef py_lsa_RemovePrivilegesFromAccount_getsetters[] = {
22148 : {
22149 : .name = discard_const_p(char, "in_handle"),
22150 : .get = py_lsa_RemovePrivilegesFromAccount_in_get_handle,
22151 : .set = py_lsa_RemovePrivilegesFromAccount_in_set_handle,
22152 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22153 : },
22154 : {
22155 : .name = discard_const_p(char, "in_remove_all"),
22156 : .get = py_lsa_RemovePrivilegesFromAccount_in_get_remove_all,
22157 : .set = py_lsa_RemovePrivilegesFromAccount_in_set_remove_all,
22158 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
22159 : },
22160 : {
22161 : .name = discard_const_p(char, "in_privs"),
22162 : .get = py_lsa_RemovePrivilegesFromAccount_in_get_privs,
22163 : .set = py_lsa_RemovePrivilegesFromAccount_in_set_privs,
22164 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivilegeSet")
22165 : },
22166 : {
22167 : .name = discard_const_p(char, "result"),
22168 : .get = py_lsa_RemovePrivilegesFromAccount_get_result,
22169 : .set = py_lsa_RemovePrivilegesFromAccount_set_result,
22170 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
22171 : },
22172 : { .name = NULL }
22173 : };
22174 :
22175 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22176 : {
22177 0 : PyObject *self = pytalloc_new(struct lsa_RemovePrivilegesFromAccount, type);
22178 0 : struct lsa_RemovePrivilegesFromAccount *_self = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(self);
22179 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
22180 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
22181 0 : return self;
22182 : }
22183 :
22184 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
22185 : {
22186 :
22187 :
22188 0 : return PyLong_FromLong(20);
22189 : }
22190 :
22191 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
22192 : {
22193 0 : const struct ndr_interface_call *call = NULL;
22194 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22195 0 : PyObject *ret = NULL;
22196 0 : struct ndr_push *push = NULL;
22197 : DATA_BLOB blob;
22198 : enum ndr_err_code err;
22199 :
22200 0 : if (ndr_table_lsarpc.num_calls < 21) {
22201 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemovePrivilegesFromAccount_ndr_pack");
22202 0 : return NULL;
22203 : }
22204 0 : call = &ndr_table_lsarpc.calls[20];
22205 :
22206 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
22207 0 : if (push == NULL) {
22208 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22209 0 : return NULL;
22210 : }
22211 :
22212 0 : push->flags |= ndr_push_flags;
22213 :
22214 0 : err = call->ndr_push(push, ndr_inout_flags, object);
22215 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22216 0 : TALLOC_FREE(push);
22217 0 : PyErr_SetNdrError(err);
22218 0 : return NULL;
22219 : }
22220 0 : blob = ndr_push_blob(push);
22221 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
22222 0 : TALLOC_FREE(push);
22223 0 : return ret;
22224 : }
22225 :
22226 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22227 : {
22228 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22229 0 : PyObject *bigendian_obj = NULL;
22230 0 : PyObject *ndr64_obj = NULL;
22231 0 : uint32_t ndr_push_flags = 0;
22232 :
22233 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
22234 : discard_const_p(char *, kwnames),
22235 : &bigendian_obj,
22236 : &ndr64_obj)) {
22237 0 : return NULL;
22238 : }
22239 :
22240 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22241 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22242 : }
22243 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22244 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22245 : }
22246 :
22247 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
22248 : }
22249 :
22250 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22251 : {
22252 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22253 0 : PyObject *bigendian_obj = NULL;
22254 0 : PyObject *ndr64_obj = NULL;
22255 0 : uint32_t ndr_push_flags = 0;
22256 :
22257 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
22258 : discard_const_p(char *, kwnames),
22259 : &bigendian_obj,
22260 : &ndr64_obj)) {
22261 0 : return NULL;
22262 : }
22263 :
22264 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22265 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22266 : }
22267 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22268 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22269 : }
22270 :
22271 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
22272 : }
22273 :
22274 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
22275 : {
22276 0 : const struct ndr_interface_call *call = NULL;
22277 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22278 0 : struct ndr_pull *pull = NULL;
22279 : enum ndr_err_code err;
22280 :
22281 0 : if (ndr_table_lsarpc.num_calls < 21) {
22282 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemovePrivilegesFromAccount_ndr_unpack");
22283 0 : return NULL;
22284 : }
22285 0 : call = &ndr_table_lsarpc.calls[20];
22286 :
22287 0 : pull = ndr_pull_init_blob(blob, object);
22288 0 : if (pull == NULL) {
22289 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22290 0 : return NULL;
22291 : }
22292 :
22293 0 : pull->flags |= ndr_pull_flags;
22294 :
22295 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
22296 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22297 0 : TALLOC_FREE(pull);
22298 0 : PyErr_SetNdrError(err);
22299 0 : return NULL;
22300 : }
22301 0 : if (!allow_remaining) {
22302 : uint32_t highest_ofs;
22303 :
22304 0 : if (pull->offset > pull->relative_highest_offset) {
22305 0 : highest_ofs = pull->offset;
22306 : } else {
22307 0 : highest_ofs = pull->relative_highest_offset;
22308 : }
22309 0 : if (highest_ofs < pull->data_size) {
22310 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
22311 : "not all bytes consumed ofs[%u] size[%u]",
22312 : highest_ofs, pull->data_size);
22313 0 : TALLOC_FREE(pull);
22314 0 : PyErr_SetNdrError(err);
22315 0 : return NULL;
22316 : }
22317 : }
22318 :
22319 0 : TALLOC_FREE(pull);
22320 0 : Py_RETURN_NONE;
22321 : }
22322 :
22323 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22324 : {
22325 : DATA_BLOB blob;
22326 0 : Py_ssize_t blob_length = 0;
22327 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22328 0 : PyObject *bigendian_obj = NULL;
22329 0 : PyObject *ndr64_obj = NULL;
22330 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22331 0 : PyObject *allow_remaining_obj = NULL;
22332 0 : bool allow_remaining = false;
22333 :
22334 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
22335 : discard_const_p(char *, kwnames),
22336 : &blob.data, &blob_length,
22337 : &bigendian_obj,
22338 : &ndr64_obj,
22339 : &allow_remaining_obj)) {
22340 0 : return NULL;
22341 : }
22342 0 : blob.length = blob_length;
22343 :
22344 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22345 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22346 : }
22347 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22348 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22349 : }
22350 :
22351 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22352 0 : allow_remaining = true;
22353 : }
22354 :
22355 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
22356 : }
22357 :
22358 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22359 : {
22360 : DATA_BLOB blob;
22361 0 : Py_ssize_t blob_length = 0;
22362 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22363 0 : PyObject *bigendian_obj = NULL;
22364 0 : PyObject *ndr64_obj = NULL;
22365 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22366 0 : PyObject *allow_remaining_obj = NULL;
22367 0 : bool allow_remaining = false;
22368 :
22369 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
22370 : discard_const_p(char *, kwnames),
22371 : &blob.data, &blob_length,
22372 : &bigendian_obj,
22373 : &ndr64_obj,
22374 : &allow_remaining_obj)) {
22375 0 : return NULL;
22376 : }
22377 0 : blob.length = blob_length;
22378 :
22379 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22380 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22381 : }
22382 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22383 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22384 : }
22385 :
22386 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22387 0 : allow_remaining = true;
22388 : }
22389 :
22390 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
22391 : }
22392 :
22393 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
22394 : {
22395 0 : const struct ndr_interface_call *call = NULL;
22396 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22397 : PyObject *ret;
22398 : char *retstr;
22399 :
22400 0 : if (ndr_table_lsarpc.num_calls < 21) {
22401 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemovePrivilegesFromAccount_ndr_print");
22402 0 : return NULL;
22403 : }
22404 0 : call = &ndr_table_lsarpc.calls[20];
22405 :
22406 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
22407 0 : ret = PyUnicode_FromString(retstr);
22408 0 : TALLOC_FREE(retstr);
22409 :
22410 0 : return ret;
22411 : }
22412 :
22413 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22414 : {
22415 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_print(py_obj, "lsa_RemovePrivilegesFromAccount_in", NDR_IN);
22416 : }
22417 :
22418 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22419 : {
22420 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_print(py_obj, "lsa_RemovePrivilegesFromAccount_out", NDR_OUT);
22421 : }
22422 :
22423 : static PyMethodDef py_lsa_RemovePrivilegesFromAccount_methods[] = {
22424 : { "opnum", (PyCFunction)py_lsa_RemovePrivilegesFromAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
22425 : "lsa.RemovePrivilegesFromAccount.opnum() -> 20 (0x14) " },
22426 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemovePrivilegesFromAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
22427 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
22428 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemovePrivilegesFromAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
22429 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
22430 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemovePrivilegesFromAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
22431 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
22432 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemovePrivilegesFromAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
22433 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
22434 : { "__ndr_print_in__", (PyCFunction)py_lsa_RemovePrivilegesFromAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
22435 : { "__ndr_print_out__", (PyCFunction)py_lsa_RemovePrivilegesFromAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
22436 : { NULL, NULL, 0, NULL }
22437 : };
22438 :
22439 :
22440 : static PyTypeObject lsa_RemovePrivilegesFromAccount_Type = {
22441 : PyVarObject_HEAD_INIT(NULL, 0)
22442 : .tp_name = "lsa.RemovePrivilegesFromAccount",
22443 : .tp_getset = py_lsa_RemovePrivilegesFromAccount_getsetters,
22444 : .tp_methods = py_lsa_RemovePrivilegesFromAccount_methods,
22445 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
22446 : .tp_new = py_lsa_RemovePrivilegesFromAccount_new,
22447 : };
22448 :
22449 0 : static bool pack_py_lsa_RemovePrivilegesFromAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_RemovePrivilegesFromAccount *r)
22450 : {
22451 : PyObject *py_handle;
22452 : PyObject *py_remove_all;
22453 : PyObject *py_privs;
22454 0 : const char *kwnames[] = {
22455 : "handle", "remove_all", "privs", NULL
22456 : };
22457 :
22458 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_RemovePrivilegesFromAccount", discard_const_p(char *, kwnames), &py_handle, &py_remove_all, &py_privs)) {
22459 0 : return false;
22460 : }
22461 :
22462 0 : if (py_handle == NULL) {
22463 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
22464 0 : return false;
22465 : }
22466 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
22467 0 : if (r->in.handle == NULL) {
22468 0 : PyErr_NoMemory();
22469 0 : return false;
22470 : }
22471 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
22472 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
22473 0 : PyErr_NoMemory();
22474 0 : return false;
22475 : }
22476 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
22477 0 : if (py_remove_all == NULL) {
22478 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.remove_all");
22479 0 : return false;
22480 : }
22481 : {
22482 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.remove_all));
22483 0 : if (PyLong_Check(py_remove_all)) {
22484 : unsigned long long test_var;
22485 0 : test_var = PyLong_AsUnsignedLongLong(py_remove_all);
22486 0 : if (PyErr_Occurred() != NULL) {
22487 0 : return false;
22488 : }
22489 0 : if (test_var > uint_max) {
22490 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22491 : PyLong_Type.tp_name, uint_max, test_var);
22492 0 : return false;
22493 : }
22494 0 : r->in.remove_all = test_var;
22495 : } else {
22496 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22497 : PyLong_Type.tp_name);
22498 0 : return false;
22499 : }
22500 : }
22501 0 : if (py_privs == NULL) {
22502 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.privs");
22503 0 : return false;
22504 : }
22505 0 : if (py_privs == Py_None) {
22506 0 : r->in.privs = NULL;
22507 : } else {
22508 0 : r->in.privs = NULL;
22509 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, py_privs, return false;);
22510 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_privs)) == NULL) {
22511 0 : PyErr_NoMemory();
22512 0 : return false;
22513 : }
22514 0 : r->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_privs);
22515 : }
22516 0 : return true;
22517 : }
22518 :
22519 0 : static PyObject *unpack_py_lsa_RemovePrivilegesFromAccount_args_out(struct lsa_RemovePrivilegesFromAccount *r)
22520 : {
22521 : PyObject *result;
22522 0 : result = Py_None;
22523 0 : Py_INCREF(result);
22524 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
22525 0 : PyErr_SetNTSTATUS(r->out.result);
22526 0 : return NULL;
22527 : }
22528 :
22529 0 : return result;
22530 : }
22531 :
22532 :
22533 0 : static PyObject *py_lsa_GetSystemAccessAccount_in_get_handle(PyObject *obj, void *closure)
22534 : {
22535 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(obj);
22536 : PyObject *py_handle;
22537 0 : if (object->in.handle == NULL) {
22538 0 : Py_RETURN_NONE;
22539 : }
22540 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
22541 0 : return py_handle;
22542 : }
22543 :
22544 0 : static int py_lsa_GetSystemAccessAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
22545 : {
22546 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22547 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
22548 0 : if (value == NULL) {
22549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
22550 0 : return -1;
22551 : }
22552 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
22553 0 : if (object->in.handle == NULL) {
22554 0 : PyErr_NoMemory();
22555 0 : return -1;
22556 : }
22557 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
22558 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22559 0 : PyErr_NoMemory();
22560 0 : return -1;
22561 : }
22562 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
22563 0 : return 0;
22564 : }
22565 :
22566 0 : static PyObject *py_lsa_GetSystemAccessAccount_out_get_access_mask(PyObject *obj, void *closure)
22567 : {
22568 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(obj);
22569 : PyObject *py_access_mask;
22570 0 : if (object->out.access_mask == NULL) {
22571 0 : Py_RETURN_NONE;
22572 : }
22573 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)*object->out.access_mask);
22574 0 : return py_access_mask;
22575 : }
22576 :
22577 0 : static int py_lsa_GetSystemAccessAccount_out_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
22578 : {
22579 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22580 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.access_mask));
22581 0 : if (value == NULL) {
22582 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.access_mask");
22583 0 : return -1;
22584 : }
22585 0 : object->out.access_mask = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.access_mask);
22586 0 : if (object->out.access_mask == NULL) {
22587 0 : PyErr_NoMemory();
22588 0 : return -1;
22589 : }
22590 : {
22591 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.access_mask));
22592 0 : if (PyLong_Check(value)) {
22593 : unsigned long long test_var;
22594 0 : test_var = PyLong_AsUnsignedLongLong(value);
22595 0 : if (PyErr_Occurred() != NULL) {
22596 0 : return -1;
22597 : }
22598 0 : if (test_var > uint_max) {
22599 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22600 : PyLong_Type.tp_name, uint_max, test_var);
22601 0 : return -1;
22602 : }
22603 0 : *object->out.access_mask = test_var;
22604 : } else {
22605 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22606 : PyLong_Type.tp_name);
22607 0 : return -1;
22608 : }
22609 : }
22610 0 : return 0;
22611 : }
22612 :
22613 0 : static PyObject *py_lsa_GetSystemAccessAccount_get_result(PyObject *obj, void *closure)
22614 : {
22615 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(obj);
22616 : PyObject *py_result;
22617 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
22618 0 : return py_result;
22619 : }
22620 :
22621 0 : static int py_lsa_GetSystemAccessAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
22622 : {
22623 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22624 0 : if (value == NULL) {
22625 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
22626 0 : return -1;
22627 : }
22628 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
22629 0 : return 0;
22630 : }
22631 :
22632 : static PyGetSetDef py_lsa_GetSystemAccessAccount_getsetters[] = {
22633 : {
22634 : .name = discard_const_p(char, "in_handle"),
22635 : .get = py_lsa_GetSystemAccessAccount_in_get_handle,
22636 : .set = py_lsa_GetSystemAccessAccount_in_set_handle,
22637 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22638 : },
22639 : {
22640 : .name = discard_const_p(char, "out_access_mask"),
22641 : .get = py_lsa_GetSystemAccessAccount_out_get_access_mask,
22642 : .set = py_lsa_GetSystemAccessAccount_out_set_access_mask,
22643 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AccountAccessMask")
22644 : },
22645 : {
22646 : .name = discard_const_p(char, "result"),
22647 : .get = py_lsa_GetSystemAccessAccount_get_result,
22648 : .set = py_lsa_GetSystemAccessAccount_set_result,
22649 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
22650 : },
22651 : { .name = NULL }
22652 : };
22653 :
22654 0 : static PyObject *py_lsa_GetSystemAccessAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22655 : {
22656 0 : PyObject *self = pytalloc_new(struct lsa_GetSystemAccessAccount, type);
22657 0 : struct lsa_GetSystemAccessAccount *_self = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(self);
22658 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
22659 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
22660 0 : _self->out.access_mask = talloc_zero(mem_ctx, uint32_t);
22661 0 : return self;
22662 : }
22663 :
22664 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
22665 : {
22666 :
22667 :
22668 0 : return PyLong_FromLong(23);
22669 : }
22670 :
22671 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
22672 : {
22673 0 : const struct ndr_interface_call *call = NULL;
22674 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22675 0 : PyObject *ret = NULL;
22676 0 : struct ndr_push *push = NULL;
22677 : DATA_BLOB blob;
22678 : enum ndr_err_code err;
22679 :
22680 0 : if (ndr_table_lsarpc.num_calls < 24) {
22681 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetSystemAccessAccount_ndr_pack");
22682 0 : return NULL;
22683 : }
22684 0 : call = &ndr_table_lsarpc.calls[23];
22685 :
22686 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
22687 0 : if (push == NULL) {
22688 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22689 0 : return NULL;
22690 : }
22691 :
22692 0 : push->flags |= ndr_push_flags;
22693 :
22694 0 : err = call->ndr_push(push, ndr_inout_flags, object);
22695 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22696 0 : TALLOC_FREE(push);
22697 0 : PyErr_SetNdrError(err);
22698 0 : return NULL;
22699 : }
22700 0 : blob = ndr_push_blob(push);
22701 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
22702 0 : TALLOC_FREE(push);
22703 0 : return ret;
22704 : }
22705 :
22706 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22707 : {
22708 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22709 0 : PyObject *bigendian_obj = NULL;
22710 0 : PyObject *ndr64_obj = NULL;
22711 0 : uint32_t ndr_push_flags = 0;
22712 :
22713 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
22714 : discard_const_p(char *, kwnames),
22715 : &bigendian_obj,
22716 : &ndr64_obj)) {
22717 0 : return NULL;
22718 : }
22719 :
22720 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22721 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22722 : }
22723 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22724 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22725 : }
22726 :
22727 0 : return py_lsa_GetSystemAccessAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
22728 : }
22729 :
22730 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22731 : {
22732 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22733 0 : PyObject *bigendian_obj = NULL;
22734 0 : PyObject *ndr64_obj = NULL;
22735 0 : uint32_t ndr_push_flags = 0;
22736 :
22737 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
22738 : discard_const_p(char *, kwnames),
22739 : &bigendian_obj,
22740 : &ndr64_obj)) {
22741 0 : return NULL;
22742 : }
22743 :
22744 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22745 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22746 : }
22747 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22748 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22749 : }
22750 :
22751 0 : return py_lsa_GetSystemAccessAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
22752 : }
22753 :
22754 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
22755 : {
22756 0 : const struct ndr_interface_call *call = NULL;
22757 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22758 0 : struct ndr_pull *pull = NULL;
22759 : enum ndr_err_code err;
22760 :
22761 0 : if (ndr_table_lsarpc.num_calls < 24) {
22762 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetSystemAccessAccount_ndr_unpack");
22763 0 : return NULL;
22764 : }
22765 0 : call = &ndr_table_lsarpc.calls[23];
22766 :
22767 0 : pull = ndr_pull_init_blob(blob, object);
22768 0 : if (pull == NULL) {
22769 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22770 0 : return NULL;
22771 : }
22772 :
22773 0 : pull->flags |= ndr_pull_flags;
22774 :
22775 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
22776 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22777 0 : TALLOC_FREE(pull);
22778 0 : PyErr_SetNdrError(err);
22779 0 : return NULL;
22780 : }
22781 0 : if (!allow_remaining) {
22782 : uint32_t highest_ofs;
22783 :
22784 0 : if (pull->offset > pull->relative_highest_offset) {
22785 0 : highest_ofs = pull->offset;
22786 : } else {
22787 0 : highest_ofs = pull->relative_highest_offset;
22788 : }
22789 0 : if (highest_ofs < pull->data_size) {
22790 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
22791 : "not all bytes consumed ofs[%u] size[%u]",
22792 : highest_ofs, pull->data_size);
22793 0 : TALLOC_FREE(pull);
22794 0 : PyErr_SetNdrError(err);
22795 0 : return NULL;
22796 : }
22797 : }
22798 :
22799 0 : TALLOC_FREE(pull);
22800 0 : Py_RETURN_NONE;
22801 : }
22802 :
22803 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22804 : {
22805 : DATA_BLOB blob;
22806 0 : Py_ssize_t blob_length = 0;
22807 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22808 0 : PyObject *bigendian_obj = NULL;
22809 0 : PyObject *ndr64_obj = NULL;
22810 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22811 0 : PyObject *allow_remaining_obj = NULL;
22812 0 : bool allow_remaining = false;
22813 :
22814 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
22815 : discard_const_p(char *, kwnames),
22816 : &blob.data, &blob_length,
22817 : &bigendian_obj,
22818 : &ndr64_obj,
22819 : &allow_remaining_obj)) {
22820 0 : return NULL;
22821 : }
22822 0 : blob.length = blob_length;
22823 :
22824 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22825 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22826 : }
22827 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22828 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22829 : }
22830 :
22831 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22832 0 : allow_remaining = true;
22833 : }
22834 :
22835 0 : return py_lsa_GetSystemAccessAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
22836 : }
22837 :
22838 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22839 : {
22840 : DATA_BLOB blob;
22841 0 : Py_ssize_t blob_length = 0;
22842 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22843 0 : PyObject *bigendian_obj = NULL;
22844 0 : PyObject *ndr64_obj = NULL;
22845 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22846 0 : PyObject *allow_remaining_obj = NULL;
22847 0 : bool allow_remaining = false;
22848 :
22849 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
22850 : discard_const_p(char *, kwnames),
22851 : &blob.data, &blob_length,
22852 : &bigendian_obj,
22853 : &ndr64_obj,
22854 : &allow_remaining_obj)) {
22855 0 : return NULL;
22856 : }
22857 0 : blob.length = blob_length;
22858 :
22859 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22860 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22861 : }
22862 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22863 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22864 : }
22865 :
22866 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22867 0 : allow_remaining = true;
22868 : }
22869 :
22870 0 : return py_lsa_GetSystemAccessAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
22871 : }
22872 :
22873 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
22874 : {
22875 0 : const struct ndr_interface_call *call = NULL;
22876 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22877 : PyObject *ret;
22878 : char *retstr;
22879 :
22880 0 : if (ndr_table_lsarpc.num_calls < 24) {
22881 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetSystemAccessAccount_ndr_print");
22882 0 : return NULL;
22883 : }
22884 0 : call = &ndr_table_lsarpc.calls[23];
22885 :
22886 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
22887 0 : ret = PyUnicode_FromString(retstr);
22888 0 : TALLOC_FREE(retstr);
22889 :
22890 0 : return ret;
22891 : }
22892 :
22893 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22894 : {
22895 0 : return py_lsa_GetSystemAccessAccount_ndr_print(py_obj, "lsa_GetSystemAccessAccount_in", NDR_IN);
22896 : }
22897 :
22898 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22899 : {
22900 0 : return py_lsa_GetSystemAccessAccount_ndr_print(py_obj, "lsa_GetSystemAccessAccount_out", NDR_OUT);
22901 : }
22902 :
22903 : static PyMethodDef py_lsa_GetSystemAccessAccount_methods[] = {
22904 : { "opnum", (PyCFunction)py_lsa_GetSystemAccessAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
22905 : "lsa.GetSystemAccessAccount.opnum() -> 23 (0x17) " },
22906 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetSystemAccessAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
22907 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
22908 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetSystemAccessAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
22909 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
22910 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetSystemAccessAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
22911 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
22912 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetSystemAccessAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
22913 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
22914 : { "__ndr_print_in__", (PyCFunction)py_lsa_GetSystemAccessAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
22915 : { "__ndr_print_out__", (PyCFunction)py_lsa_GetSystemAccessAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
22916 : { NULL, NULL, 0, NULL }
22917 : };
22918 :
22919 :
22920 : static PyTypeObject lsa_GetSystemAccessAccount_Type = {
22921 : PyVarObject_HEAD_INIT(NULL, 0)
22922 : .tp_name = "lsa.GetSystemAccessAccount",
22923 : .tp_getset = py_lsa_GetSystemAccessAccount_getsetters,
22924 : .tp_methods = py_lsa_GetSystemAccessAccount_methods,
22925 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
22926 : .tp_new = py_lsa_GetSystemAccessAccount_new,
22927 : };
22928 :
22929 0 : static bool pack_py_lsa_GetSystemAccessAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_GetSystemAccessAccount *r)
22930 : {
22931 : PyObject *py_handle;
22932 0 : const char *kwnames[] = {
22933 : "handle", NULL
22934 : };
22935 :
22936 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_GetSystemAccessAccount", discard_const_p(char *, kwnames), &py_handle)) {
22937 0 : return false;
22938 : }
22939 :
22940 0 : if (py_handle == NULL) {
22941 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
22942 0 : return false;
22943 : }
22944 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
22945 0 : if (r->in.handle == NULL) {
22946 0 : PyErr_NoMemory();
22947 0 : return false;
22948 : }
22949 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
22950 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
22951 0 : PyErr_NoMemory();
22952 0 : return false;
22953 : }
22954 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
22955 0 : return true;
22956 : }
22957 :
22958 0 : static PyObject *unpack_py_lsa_GetSystemAccessAccount_args_out(struct lsa_GetSystemAccessAccount *r)
22959 : {
22960 : PyObject *result;
22961 : PyObject *py_access_mask;
22962 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)*r->out.access_mask);
22963 0 : result = py_access_mask;
22964 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
22965 0 : PyErr_SetNTSTATUS(r->out.result);
22966 0 : return NULL;
22967 : }
22968 :
22969 0 : return result;
22970 : }
22971 :
22972 :
22973 0 : static PyObject *py_lsa_SetSystemAccessAccount_in_get_handle(PyObject *obj, void *closure)
22974 : {
22975 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(obj);
22976 : PyObject *py_handle;
22977 0 : if (object->in.handle == NULL) {
22978 0 : Py_RETURN_NONE;
22979 : }
22980 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
22981 0 : return py_handle;
22982 : }
22983 :
22984 0 : static int py_lsa_SetSystemAccessAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
22985 : {
22986 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22987 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
22988 0 : if (value == NULL) {
22989 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
22990 0 : return -1;
22991 : }
22992 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
22993 0 : if (object->in.handle == NULL) {
22994 0 : PyErr_NoMemory();
22995 0 : return -1;
22996 : }
22997 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
22998 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22999 0 : PyErr_NoMemory();
23000 0 : return -1;
23001 : }
23002 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
23003 0 : return 0;
23004 : }
23005 :
23006 0 : static PyObject *py_lsa_SetSystemAccessAccount_in_get_access_mask(PyObject *obj, void *closure)
23007 : {
23008 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(obj);
23009 : PyObject *py_access_mask;
23010 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
23011 0 : return py_access_mask;
23012 : }
23013 :
23014 0 : static int py_lsa_SetSystemAccessAccount_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
23015 : {
23016 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
23017 0 : if (value == NULL) {
23018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
23019 0 : return -1;
23020 : }
23021 : {
23022 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
23023 0 : if (PyLong_Check(value)) {
23024 : unsigned long long test_var;
23025 0 : test_var = PyLong_AsUnsignedLongLong(value);
23026 0 : if (PyErr_Occurred() != NULL) {
23027 0 : return -1;
23028 : }
23029 0 : if (test_var > uint_max) {
23030 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23031 : PyLong_Type.tp_name, uint_max, test_var);
23032 0 : return -1;
23033 : }
23034 0 : object->in.access_mask = test_var;
23035 : } else {
23036 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23037 : PyLong_Type.tp_name);
23038 0 : return -1;
23039 : }
23040 : }
23041 0 : return 0;
23042 : }
23043 :
23044 0 : static PyObject *py_lsa_SetSystemAccessAccount_get_result(PyObject *obj, void *closure)
23045 : {
23046 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(obj);
23047 : PyObject *py_result;
23048 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
23049 0 : return py_result;
23050 : }
23051 :
23052 0 : static int py_lsa_SetSystemAccessAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
23053 : {
23054 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
23055 0 : if (value == NULL) {
23056 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
23057 0 : return -1;
23058 : }
23059 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
23060 0 : return 0;
23061 : }
23062 :
23063 : static PyGetSetDef py_lsa_SetSystemAccessAccount_getsetters[] = {
23064 : {
23065 : .name = discard_const_p(char, "in_handle"),
23066 : .get = py_lsa_SetSystemAccessAccount_in_get_handle,
23067 : .set = py_lsa_SetSystemAccessAccount_in_set_handle,
23068 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
23069 : },
23070 : {
23071 : .name = discard_const_p(char, "in_access_mask"),
23072 : .get = py_lsa_SetSystemAccessAccount_in_get_access_mask,
23073 : .set = py_lsa_SetSystemAccessAccount_in_set_access_mask,
23074 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AccountAccessMask")
23075 : },
23076 : {
23077 : .name = discard_const_p(char, "result"),
23078 : .get = py_lsa_SetSystemAccessAccount_get_result,
23079 : .set = py_lsa_SetSystemAccessAccount_set_result,
23080 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
23081 : },
23082 : { .name = NULL }
23083 : };
23084 :
23085 0 : static PyObject *py_lsa_SetSystemAccessAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23086 : {
23087 0 : PyObject *self = pytalloc_new(struct lsa_SetSystemAccessAccount, type);
23088 0 : struct lsa_SetSystemAccessAccount *_self = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(self);
23089 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
23090 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
23091 0 : return self;
23092 : }
23093 :
23094 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
23095 : {
23096 :
23097 :
23098 0 : return PyLong_FromLong(24);
23099 : }
23100 :
23101 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
23102 : {
23103 0 : const struct ndr_interface_call *call = NULL;
23104 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
23105 0 : PyObject *ret = NULL;
23106 0 : struct ndr_push *push = NULL;
23107 : DATA_BLOB blob;
23108 : enum ndr_err_code err;
23109 :
23110 0 : if (ndr_table_lsarpc.num_calls < 25) {
23111 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSystemAccessAccount_ndr_pack");
23112 0 : return NULL;
23113 : }
23114 0 : call = &ndr_table_lsarpc.calls[24];
23115 :
23116 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
23117 0 : if (push == NULL) {
23118 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23119 0 : return NULL;
23120 : }
23121 :
23122 0 : push->flags |= ndr_push_flags;
23123 :
23124 0 : err = call->ndr_push(push, ndr_inout_flags, object);
23125 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23126 0 : TALLOC_FREE(push);
23127 0 : PyErr_SetNdrError(err);
23128 0 : return NULL;
23129 : }
23130 0 : blob = ndr_push_blob(push);
23131 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
23132 0 : TALLOC_FREE(push);
23133 0 : return ret;
23134 : }
23135 :
23136 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23137 : {
23138 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23139 0 : PyObject *bigendian_obj = NULL;
23140 0 : PyObject *ndr64_obj = NULL;
23141 0 : uint32_t ndr_push_flags = 0;
23142 :
23143 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
23144 : discard_const_p(char *, kwnames),
23145 : &bigendian_obj,
23146 : &ndr64_obj)) {
23147 0 : return NULL;
23148 : }
23149 :
23150 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23151 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23152 : }
23153 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23154 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23155 : }
23156 :
23157 0 : return py_lsa_SetSystemAccessAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
23158 : }
23159 :
23160 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23161 : {
23162 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23163 0 : PyObject *bigendian_obj = NULL;
23164 0 : PyObject *ndr64_obj = NULL;
23165 0 : uint32_t ndr_push_flags = 0;
23166 :
23167 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
23168 : discard_const_p(char *, kwnames),
23169 : &bigendian_obj,
23170 : &ndr64_obj)) {
23171 0 : return NULL;
23172 : }
23173 :
23174 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23175 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23176 : }
23177 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23178 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23179 : }
23180 :
23181 0 : return py_lsa_SetSystemAccessAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
23182 : }
23183 :
23184 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
23185 : {
23186 0 : const struct ndr_interface_call *call = NULL;
23187 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
23188 0 : struct ndr_pull *pull = NULL;
23189 : enum ndr_err_code err;
23190 :
23191 0 : if (ndr_table_lsarpc.num_calls < 25) {
23192 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSystemAccessAccount_ndr_unpack");
23193 0 : return NULL;
23194 : }
23195 0 : call = &ndr_table_lsarpc.calls[24];
23196 :
23197 0 : pull = ndr_pull_init_blob(blob, object);
23198 0 : if (pull == NULL) {
23199 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23200 0 : return NULL;
23201 : }
23202 :
23203 0 : pull->flags |= ndr_pull_flags;
23204 :
23205 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
23206 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23207 0 : TALLOC_FREE(pull);
23208 0 : PyErr_SetNdrError(err);
23209 0 : return NULL;
23210 : }
23211 0 : if (!allow_remaining) {
23212 : uint32_t highest_ofs;
23213 :
23214 0 : if (pull->offset > pull->relative_highest_offset) {
23215 0 : highest_ofs = pull->offset;
23216 : } else {
23217 0 : highest_ofs = pull->relative_highest_offset;
23218 : }
23219 0 : if (highest_ofs < pull->data_size) {
23220 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
23221 : "not all bytes consumed ofs[%u] size[%u]",
23222 : highest_ofs, pull->data_size);
23223 0 : TALLOC_FREE(pull);
23224 0 : PyErr_SetNdrError(err);
23225 0 : return NULL;
23226 : }
23227 : }
23228 :
23229 0 : TALLOC_FREE(pull);
23230 0 : Py_RETURN_NONE;
23231 : }
23232 :
23233 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23234 : {
23235 : DATA_BLOB blob;
23236 0 : Py_ssize_t blob_length = 0;
23237 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23238 0 : PyObject *bigendian_obj = NULL;
23239 0 : PyObject *ndr64_obj = NULL;
23240 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23241 0 : PyObject *allow_remaining_obj = NULL;
23242 0 : bool allow_remaining = false;
23243 :
23244 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
23245 : discard_const_p(char *, kwnames),
23246 : &blob.data, &blob_length,
23247 : &bigendian_obj,
23248 : &ndr64_obj,
23249 : &allow_remaining_obj)) {
23250 0 : return NULL;
23251 : }
23252 0 : blob.length = blob_length;
23253 :
23254 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23255 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23256 : }
23257 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23258 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23259 : }
23260 :
23261 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23262 0 : allow_remaining = true;
23263 : }
23264 :
23265 0 : return py_lsa_SetSystemAccessAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
23266 : }
23267 :
23268 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23269 : {
23270 : DATA_BLOB blob;
23271 0 : Py_ssize_t blob_length = 0;
23272 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23273 0 : PyObject *bigendian_obj = NULL;
23274 0 : PyObject *ndr64_obj = NULL;
23275 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23276 0 : PyObject *allow_remaining_obj = NULL;
23277 0 : bool allow_remaining = false;
23278 :
23279 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
23280 : discard_const_p(char *, kwnames),
23281 : &blob.data, &blob_length,
23282 : &bigendian_obj,
23283 : &ndr64_obj,
23284 : &allow_remaining_obj)) {
23285 0 : return NULL;
23286 : }
23287 0 : blob.length = blob_length;
23288 :
23289 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23290 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23291 : }
23292 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23293 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23294 : }
23295 :
23296 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23297 0 : allow_remaining = true;
23298 : }
23299 :
23300 0 : return py_lsa_SetSystemAccessAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
23301 : }
23302 :
23303 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
23304 : {
23305 0 : const struct ndr_interface_call *call = NULL;
23306 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
23307 : PyObject *ret;
23308 : char *retstr;
23309 :
23310 0 : if (ndr_table_lsarpc.num_calls < 25) {
23311 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSystemAccessAccount_ndr_print");
23312 0 : return NULL;
23313 : }
23314 0 : call = &ndr_table_lsarpc.calls[24];
23315 :
23316 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
23317 0 : ret = PyUnicode_FromString(retstr);
23318 0 : TALLOC_FREE(retstr);
23319 :
23320 0 : return ret;
23321 : }
23322 :
23323 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23324 : {
23325 0 : return py_lsa_SetSystemAccessAccount_ndr_print(py_obj, "lsa_SetSystemAccessAccount_in", NDR_IN);
23326 : }
23327 :
23328 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23329 : {
23330 0 : return py_lsa_SetSystemAccessAccount_ndr_print(py_obj, "lsa_SetSystemAccessAccount_out", NDR_OUT);
23331 : }
23332 :
23333 : static PyMethodDef py_lsa_SetSystemAccessAccount_methods[] = {
23334 : { "opnum", (PyCFunction)py_lsa_SetSystemAccessAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
23335 : "lsa.SetSystemAccessAccount.opnum() -> 24 (0x18) " },
23336 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSystemAccessAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
23337 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
23338 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSystemAccessAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
23339 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
23340 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSystemAccessAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
23341 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
23342 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSystemAccessAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
23343 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
23344 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetSystemAccessAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
23345 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetSystemAccessAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
23346 : { NULL, NULL, 0, NULL }
23347 : };
23348 :
23349 :
23350 : static PyTypeObject lsa_SetSystemAccessAccount_Type = {
23351 : PyVarObject_HEAD_INIT(NULL, 0)
23352 : .tp_name = "lsa.SetSystemAccessAccount",
23353 : .tp_getset = py_lsa_SetSystemAccessAccount_getsetters,
23354 : .tp_methods = py_lsa_SetSystemAccessAccount_methods,
23355 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23356 : .tp_new = py_lsa_SetSystemAccessAccount_new,
23357 : };
23358 :
23359 0 : static bool pack_py_lsa_SetSystemAccessAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSystemAccessAccount *r)
23360 : {
23361 : PyObject *py_handle;
23362 : PyObject *py_access_mask;
23363 0 : const char *kwnames[] = {
23364 : "handle", "access_mask", NULL
23365 : };
23366 :
23367 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_SetSystemAccessAccount", discard_const_p(char *, kwnames), &py_handle, &py_access_mask)) {
23368 0 : return false;
23369 : }
23370 :
23371 0 : if (py_handle == NULL) {
23372 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
23373 0 : return false;
23374 : }
23375 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
23376 0 : if (r->in.handle == NULL) {
23377 0 : PyErr_NoMemory();
23378 0 : return false;
23379 : }
23380 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
23381 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
23382 0 : PyErr_NoMemory();
23383 0 : return false;
23384 : }
23385 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
23386 0 : if (py_access_mask == NULL) {
23387 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
23388 0 : return false;
23389 : }
23390 : {
23391 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
23392 0 : if (PyLong_Check(py_access_mask)) {
23393 : unsigned long long test_var;
23394 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
23395 0 : if (PyErr_Occurred() != NULL) {
23396 0 : return false;
23397 : }
23398 0 : if (test_var > uint_max) {
23399 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23400 : PyLong_Type.tp_name, uint_max, test_var);
23401 0 : return false;
23402 : }
23403 0 : r->in.access_mask = test_var;
23404 : } else {
23405 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23406 : PyLong_Type.tp_name);
23407 0 : return false;
23408 : }
23409 : }
23410 0 : return true;
23411 : }
23412 :
23413 0 : static PyObject *unpack_py_lsa_SetSystemAccessAccount_args_out(struct lsa_SetSystemAccessAccount *r)
23414 : {
23415 : PyObject *result;
23416 0 : result = Py_None;
23417 0 : Py_INCREF(result);
23418 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
23419 0 : PyErr_SetNTSTATUS(r->out.result);
23420 0 : return NULL;
23421 : }
23422 :
23423 0 : return result;
23424 : }
23425 :
23426 :
23427 0 : static PyObject *py_lsa_OpenTrustedDomain_in_get_handle(PyObject *obj, void *closure)
23428 : {
23429 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(obj);
23430 : PyObject *py_handle;
23431 0 : if (object->in.handle == NULL) {
23432 0 : Py_RETURN_NONE;
23433 : }
23434 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
23435 0 : return py_handle;
23436 : }
23437 :
23438 0 : static int py_lsa_OpenTrustedDomain_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
23439 : {
23440 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23441 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
23442 0 : if (value == NULL) {
23443 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
23444 0 : return -1;
23445 : }
23446 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
23447 0 : if (object->in.handle == NULL) {
23448 0 : PyErr_NoMemory();
23449 0 : return -1;
23450 : }
23451 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
23452 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23453 0 : PyErr_NoMemory();
23454 0 : return -1;
23455 : }
23456 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
23457 0 : return 0;
23458 : }
23459 :
23460 0 : static PyObject *py_lsa_OpenTrustedDomain_in_get_sid(PyObject *obj, void *closure)
23461 : {
23462 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(obj);
23463 : PyObject *py_sid;
23464 0 : if (object->in.sid == NULL) {
23465 0 : Py_RETURN_NONE;
23466 : }
23467 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
23468 0 : return py_sid;
23469 : }
23470 :
23471 0 : static int py_lsa_OpenTrustedDomain_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
23472 : {
23473 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23474 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
23475 0 : if (value == NULL) {
23476 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
23477 0 : return -1;
23478 : }
23479 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
23480 0 : if (object->in.sid == NULL) {
23481 0 : PyErr_NoMemory();
23482 0 : return -1;
23483 : }
23484 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
23485 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23486 0 : PyErr_NoMemory();
23487 0 : return -1;
23488 : }
23489 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
23490 0 : return 0;
23491 : }
23492 :
23493 0 : static PyObject *py_lsa_OpenTrustedDomain_in_get_access_mask(PyObject *obj, void *closure)
23494 : {
23495 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(obj);
23496 : PyObject *py_access_mask;
23497 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
23498 0 : return py_access_mask;
23499 : }
23500 :
23501 0 : static int py_lsa_OpenTrustedDomain_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
23502 : {
23503 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23504 0 : if (value == NULL) {
23505 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
23506 0 : return -1;
23507 : }
23508 : {
23509 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
23510 0 : if (PyLong_Check(value)) {
23511 : unsigned long long test_var;
23512 0 : test_var = PyLong_AsUnsignedLongLong(value);
23513 0 : if (PyErr_Occurred() != NULL) {
23514 0 : return -1;
23515 : }
23516 0 : if (test_var > uint_max) {
23517 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23518 : PyLong_Type.tp_name, uint_max, test_var);
23519 0 : return -1;
23520 : }
23521 0 : object->in.access_mask = test_var;
23522 : } else {
23523 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23524 : PyLong_Type.tp_name);
23525 0 : return -1;
23526 : }
23527 : }
23528 0 : return 0;
23529 : }
23530 :
23531 0 : static PyObject *py_lsa_OpenTrustedDomain_out_get_trustdom_handle(PyObject *obj, void *closure)
23532 : {
23533 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(obj);
23534 : PyObject *py_trustdom_handle;
23535 0 : if (object->out.trustdom_handle == NULL) {
23536 0 : Py_RETURN_NONE;
23537 : }
23538 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
23539 0 : return py_trustdom_handle;
23540 : }
23541 :
23542 0 : static int py_lsa_OpenTrustedDomain_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
23543 : {
23544 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23545 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
23546 0 : if (value == NULL) {
23547 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trustdom_handle");
23548 0 : return -1;
23549 : }
23550 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
23551 0 : if (object->out.trustdom_handle == NULL) {
23552 0 : PyErr_NoMemory();
23553 0 : return -1;
23554 : }
23555 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
23556 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23557 0 : PyErr_NoMemory();
23558 0 : return -1;
23559 : }
23560 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
23561 0 : return 0;
23562 : }
23563 :
23564 0 : static PyObject *py_lsa_OpenTrustedDomain_get_result(PyObject *obj, void *closure)
23565 : {
23566 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(obj);
23567 : PyObject *py_result;
23568 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
23569 0 : return py_result;
23570 : }
23571 :
23572 0 : static int py_lsa_OpenTrustedDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
23573 : {
23574 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23575 0 : if (value == NULL) {
23576 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
23577 0 : return -1;
23578 : }
23579 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
23580 0 : return 0;
23581 : }
23582 :
23583 : static PyGetSetDef py_lsa_OpenTrustedDomain_getsetters[] = {
23584 : {
23585 : .name = discard_const_p(char, "in_handle"),
23586 : .get = py_lsa_OpenTrustedDomain_in_get_handle,
23587 : .set = py_lsa_OpenTrustedDomain_in_set_handle,
23588 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
23589 : },
23590 : {
23591 : .name = discard_const_p(char, "in_sid"),
23592 : .get = py_lsa_OpenTrustedDomain_in_get_sid,
23593 : .set = py_lsa_OpenTrustedDomain_in_set_sid,
23594 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
23595 : },
23596 : {
23597 : .name = discard_const_p(char, "in_access_mask"),
23598 : .get = py_lsa_OpenTrustedDomain_in_get_access_mask,
23599 : .set = py_lsa_OpenTrustedDomain_in_set_access_mask,
23600 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
23601 : },
23602 : {
23603 : .name = discard_const_p(char, "out_trustdom_handle"),
23604 : .get = py_lsa_OpenTrustedDomain_out_get_trustdom_handle,
23605 : .set = py_lsa_OpenTrustedDomain_out_set_trustdom_handle,
23606 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
23607 : },
23608 : {
23609 : .name = discard_const_p(char, "result"),
23610 : .get = py_lsa_OpenTrustedDomain_get_result,
23611 : .set = py_lsa_OpenTrustedDomain_set_result,
23612 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
23613 : },
23614 : { .name = NULL }
23615 : };
23616 :
23617 0 : static PyObject *py_lsa_OpenTrustedDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23618 : {
23619 0 : PyObject *self = pytalloc_new(struct lsa_OpenTrustedDomain, type);
23620 0 : struct lsa_OpenTrustedDomain *_self = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(self);
23621 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
23622 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
23623 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
23624 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
23625 0 : return self;
23626 : }
23627 :
23628 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
23629 : {
23630 :
23631 :
23632 0 : return PyLong_FromLong(25);
23633 : }
23634 :
23635 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
23636 : {
23637 0 : const struct ndr_interface_call *call = NULL;
23638 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23639 0 : PyObject *ret = NULL;
23640 0 : struct ndr_push *push = NULL;
23641 : DATA_BLOB blob;
23642 : enum ndr_err_code err;
23643 :
23644 0 : if (ndr_table_lsarpc.num_calls < 26) {
23645 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomain_ndr_pack");
23646 0 : return NULL;
23647 : }
23648 0 : call = &ndr_table_lsarpc.calls[25];
23649 :
23650 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
23651 0 : if (push == NULL) {
23652 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23653 0 : return NULL;
23654 : }
23655 :
23656 0 : push->flags |= ndr_push_flags;
23657 :
23658 0 : err = call->ndr_push(push, ndr_inout_flags, object);
23659 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23660 0 : TALLOC_FREE(push);
23661 0 : PyErr_SetNdrError(err);
23662 0 : return NULL;
23663 : }
23664 0 : blob = ndr_push_blob(push);
23665 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
23666 0 : TALLOC_FREE(push);
23667 0 : return ret;
23668 : }
23669 :
23670 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23671 : {
23672 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23673 0 : PyObject *bigendian_obj = NULL;
23674 0 : PyObject *ndr64_obj = NULL;
23675 0 : uint32_t ndr_push_flags = 0;
23676 :
23677 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
23678 : discard_const_p(char *, kwnames),
23679 : &bigendian_obj,
23680 : &ndr64_obj)) {
23681 0 : return NULL;
23682 : }
23683 :
23684 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23685 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23686 : }
23687 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23688 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23689 : }
23690 :
23691 0 : return py_lsa_OpenTrustedDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
23692 : }
23693 :
23694 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23695 : {
23696 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23697 0 : PyObject *bigendian_obj = NULL;
23698 0 : PyObject *ndr64_obj = NULL;
23699 0 : uint32_t ndr_push_flags = 0;
23700 :
23701 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
23702 : discard_const_p(char *, kwnames),
23703 : &bigendian_obj,
23704 : &ndr64_obj)) {
23705 0 : return NULL;
23706 : }
23707 :
23708 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23709 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23710 : }
23711 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23712 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23713 : }
23714 :
23715 0 : return py_lsa_OpenTrustedDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
23716 : }
23717 :
23718 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
23719 : {
23720 0 : const struct ndr_interface_call *call = NULL;
23721 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23722 0 : struct ndr_pull *pull = NULL;
23723 : enum ndr_err_code err;
23724 :
23725 0 : if (ndr_table_lsarpc.num_calls < 26) {
23726 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomain_ndr_unpack");
23727 0 : return NULL;
23728 : }
23729 0 : call = &ndr_table_lsarpc.calls[25];
23730 :
23731 0 : pull = ndr_pull_init_blob(blob, object);
23732 0 : if (pull == NULL) {
23733 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23734 0 : return NULL;
23735 : }
23736 :
23737 0 : pull->flags |= ndr_pull_flags;
23738 :
23739 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
23740 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23741 0 : TALLOC_FREE(pull);
23742 0 : PyErr_SetNdrError(err);
23743 0 : return NULL;
23744 : }
23745 0 : if (!allow_remaining) {
23746 : uint32_t highest_ofs;
23747 :
23748 0 : if (pull->offset > pull->relative_highest_offset) {
23749 0 : highest_ofs = pull->offset;
23750 : } else {
23751 0 : highest_ofs = pull->relative_highest_offset;
23752 : }
23753 0 : if (highest_ofs < pull->data_size) {
23754 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
23755 : "not all bytes consumed ofs[%u] size[%u]",
23756 : highest_ofs, pull->data_size);
23757 0 : TALLOC_FREE(pull);
23758 0 : PyErr_SetNdrError(err);
23759 0 : return NULL;
23760 : }
23761 : }
23762 :
23763 0 : TALLOC_FREE(pull);
23764 0 : Py_RETURN_NONE;
23765 : }
23766 :
23767 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23768 : {
23769 : DATA_BLOB blob;
23770 0 : Py_ssize_t blob_length = 0;
23771 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23772 0 : PyObject *bigendian_obj = NULL;
23773 0 : PyObject *ndr64_obj = NULL;
23774 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23775 0 : PyObject *allow_remaining_obj = NULL;
23776 0 : bool allow_remaining = false;
23777 :
23778 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
23779 : discard_const_p(char *, kwnames),
23780 : &blob.data, &blob_length,
23781 : &bigendian_obj,
23782 : &ndr64_obj,
23783 : &allow_remaining_obj)) {
23784 0 : return NULL;
23785 : }
23786 0 : blob.length = blob_length;
23787 :
23788 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23789 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23790 : }
23791 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23792 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23793 : }
23794 :
23795 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23796 0 : allow_remaining = true;
23797 : }
23798 :
23799 0 : return py_lsa_OpenTrustedDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
23800 : }
23801 :
23802 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23803 : {
23804 : DATA_BLOB blob;
23805 0 : Py_ssize_t blob_length = 0;
23806 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23807 0 : PyObject *bigendian_obj = NULL;
23808 0 : PyObject *ndr64_obj = NULL;
23809 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23810 0 : PyObject *allow_remaining_obj = NULL;
23811 0 : bool allow_remaining = false;
23812 :
23813 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
23814 : discard_const_p(char *, kwnames),
23815 : &blob.data, &blob_length,
23816 : &bigendian_obj,
23817 : &ndr64_obj,
23818 : &allow_remaining_obj)) {
23819 0 : return NULL;
23820 : }
23821 0 : blob.length = blob_length;
23822 :
23823 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23824 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23825 : }
23826 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23827 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23828 : }
23829 :
23830 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23831 0 : allow_remaining = true;
23832 : }
23833 :
23834 0 : return py_lsa_OpenTrustedDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
23835 : }
23836 :
23837 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
23838 : {
23839 0 : const struct ndr_interface_call *call = NULL;
23840 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23841 : PyObject *ret;
23842 : char *retstr;
23843 :
23844 0 : if (ndr_table_lsarpc.num_calls < 26) {
23845 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomain_ndr_print");
23846 0 : return NULL;
23847 : }
23848 0 : call = &ndr_table_lsarpc.calls[25];
23849 :
23850 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
23851 0 : ret = PyUnicode_FromString(retstr);
23852 0 : TALLOC_FREE(retstr);
23853 :
23854 0 : return ret;
23855 : }
23856 :
23857 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23858 : {
23859 0 : return py_lsa_OpenTrustedDomain_ndr_print(py_obj, "lsa_OpenTrustedDomain_in", NDR_IN);
23860 : }
23861 :
23862 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23863 : {
23864 0 : return py_lsa_OpenTrustedDomain_ndr_print(py_obj, "lsa_OpenTrustedDomain_out", NDR_OUT);
23865 : }
23866 :
23867 : static PyMethodDef py_lsa_OpenTrustedDomain_methods[] = {
23868 : { "opnum", (PyCFunction)py_lsa_OpenTrustedDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
23869 : "lsa.OpenTrustedDomain.opnum() -> 25 (0x19) " },
23870 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
23871 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
23872 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
23873 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
23874 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
23875 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
23876 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
23877 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
23878 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenTrustedDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
23879 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenTrustedDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
23880 : { NULL, NULL, 0, NULL }
23881 : };
23882 :
23883 :
23884 : static PyTypeObject lsa_OpenTrustedDomain_Type = {
23885 : PyVarObject_HEAD_INIT(NULL, 0)
23886 : .tp_name = "lsa.OpenTrustedDomain",
23887 : .tp_getset = py_lsa_OpenTrustedDomain_getsetters,
23888 : .tp_methods = py_lsa_OpenTrustedDomain_methods,
23889 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23890 : .tp_new = py_lsa_OpenTrustedDomain_new,
23891 : };
23892 :
23893 0 : static bool pack_py_lsa_OpenTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenTrustedDomain *r)
23894 : {
23895 : PyObject *py_handle;
23896 : PyObject *py_sid;
23897 : PyObject *py_access_mask;
23898 0 : const char *kwnames[] = {
23899 : "handle", "sid", "access_mask", NULL
23900 : };
23901 :
23902 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenTrustedDomain", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
23903 0 : return false;
23904 : }
23905 :
23906 0 : if (py_handle == NULL) {
23907 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
23908 0 : return false;
23909 : }
23910 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
23911 0 : if (r->in.handle == NULL) {
23912 0 : PyErr_NoMemory();
23913 0 : return false;
23914 : }
23915 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
23916 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
23917 0 : PyErr_NoMemory();
23918 0 : return false;
23919 : }
23920 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
23921 0 : if (py_sid == NULL) {
23922 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
23923 0 : return false;
23924 : }
23925 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
23926 0 : if (r->in.sid == NULL) {
23927 0 : PyErr_NoMemory();
23928 0 : return false;
23929 : }
23930 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
23931 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
23932 0 : PyErr_NoMemory();
23933 0 : return false;
23934 : }
23935 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
23936 0 : if (py_access_mask == NULL) {
23937 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
23938 0 : return false;
23939 : }
23940 : {
23941 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
23942 0 : if (PyLong_Check(py_access_mask)) {
23943 : unsigned long long test_var;
23944 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
23945 0 : if (PyErr_Occurred() != NULL) {
23946 0 : return false;
23947 : }
23948 0 : if (test_var > uint_max) {
23949 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23950 : PyLong_Type.tp_name, uint_max, test_var);
23951 0 : return false;
23952 : }
23953 0 : r->in.access_mask = test_var;
23954 : } else {
23955 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23956 : PyLong_Type.tp_name);
23957 0 : return false;
23958 : }
23959 : }
23960 0 : return true;
23961 : }
23962 :
23963 0 : static PyObject *unpack_py_lsa_OpenTrustedDomain_args_out(struct lsa_OpenTrustedDomain *r)
23964 : {
23965 : PyObject *result;
23966 : PyObject *py_trustdom_handle;
23967 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
23968 0 : result = py_trustdom_handle;
23969 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
23970 0 : PyErr_SetNTSTATUS(r->out.result);
23971 0 : return NULL;
23972 : }
23973 :
23974 0 : return result;
23975 : }
23976 :
23977 :
23978 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_in_get_trustdom_handle(PyObject *obj, void *closure)
23979 : {
23980 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(obj);
23981 : PyObject *py_trustdom_handle;
23982 0 : if (object->in.trustdom_handle == NULL) {
23983 0 : Py_RETURN_NONE;
23984 : }
23985 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->in.trustdom_handle, object->in.trustdom_handle);
23986 0 : return py_trustdom_handle;
23987 : }
23988 :
23989 0 : static int py_lsa_QueryTrustedDomainInfo_in_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
23990 : {
23991 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
23992 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trustdom_handle));
23993 0 : if (value == NULL) {
23994 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trustdom_handle");
23995 0 : return -1;
23996 : }
23997 0 : object->in.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trustdom_handle);
23998 0 : if (object->in.trustdom_handle == NULL) {
23999 0 : PyErr_NoMemory();
24000 0 : return -1;
24001 : }
24002 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
24003 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24004 0 : PyErr_NoMemory();
24005 0 : return -1;
24006 : }
24007 0 : object->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
24008 0 : return 0;
24009 : }
24010 :
24011 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_in_get_level(PyObject *obj, void *closure)
24012 : {
24013 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(obj);
24014 : PyObject *py_level;
24015 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
24016 0 : return py_level;
24017 : }
24018 :
24019 0 : static int py_lsa_QueryTrustedDomainInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
24020 : {
24021 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
24022 0 : if (value == NULL) {
24023 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
24024 0 : return -1;
24025 : }
24026 : {
24027 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
24028 0 : if (PyLong_Check(value)) {
24029 : unsigned long long test_var;
24030 0 : test_var = PyLong_AsUnsignedLongLong(value);
24031 0 : if (PyErr_Occurred() != NULL) {
24032 0 : return -1;
24033 : }
24034 0 : if (test_var > uint_max) {
24035 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24036 : PyLong_Type.tp_name, uint_max, test_var);
24037 0 : return -1;
24038 : }
24039 0 : object->in.level = test_var;
24040 : } else {
24041 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24042 : PyLong_Type.tp_name);
24043 0 : return -1;
24044 : }
24045 : }
24046 0 : return 0;
24047 : }
24048 :
24049 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_out_get_info(PyObject *obj, void *closure)
24050 : {
24051 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(obj);
24052 : PyObject *py_info;
24053 0 : if (object->out.info == NULL) {
24054 0 : Py_RETURN_NONE;
24055 : }
24056 0 : if (*object->out.info == NULL) {
24057 0 : py_info = Py_None;
24058 0 : Py_INCREF(py_info);
24059 : } else {
24060 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_TrustedDomainInfo");
24061 0 : if (py_info == NULL) {
24062 0 : return NULL;
24063 : }
24064 : }
24065 0 : return py_info;
24066 : }
24067 :
24068 0 : static int py_lsa_QueryTrustedDomainInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
24069 : {
24070 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
24071 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
24072 0 : if (value == NULL) {
24073 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
24074 0 : return -1;
24075 : }
24076 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
24077 0 : if (object->out.info == NULL) {
24078 0 : PyErr_NoMemory();
24079 0 : return -1;
24080 : }
24081 0 : if (value == Py_None) {
24082 0 : *object->out.info = NULL;
24083 : } else {
24084 0 : *object->out.info = NULL;
24085 : {
24086 : union lsa_TrustedDomainInfo *info_switch_2;
24087 0 : info_switch_2 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union lsa_TrustedDomainInfo");
24088 0 : if (info_switch_2 == NULL) {
24089 0 : return -1;
24090 : }
24091 0 : *object->out.info = info_switch_2;
24092 : }
24093 : }
24094 0 : return 0;
24095 : }
24096 :
24097 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_get_result(PyObject *obj, void *closure)
24098 : {
24099 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(obj);
24100 : PyObject *py_result;
24101 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
24102 0 : return py_result;
24103 : }
24104 :
24105 0 : static int py_lsa_QueryTrustedDomainInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
24106 : {
24107 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
24108 0 : if (value == NULL) {
24109 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
24110 0 : return -1;
24111 : }
24112 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
24113 0 : return 0;
24114 : }
24115 :
24116 : static PyGetSetDef py_lsa_QueryTrustedDomainInfo_getsetters[] = {
24117 : {
24118 : .name = discard_const_p(char, "in_trustdom_handle"),
24119 : .get = py_lsa_QueryTrustedDomainInfo_in_get_trustdom_handle,
24120 : .set = py_lsa_QueryTrustedDomainInfo_in_set_trustdom_handle,
24121 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
24122 : },
24123 : {
24124 : .name = discard_const_p(char, "in_level"),
24125 : .get = py_lsa_QueryTrustedDomainInfo_in_get_level,
24126 : .set = py_lsa_QueryTrustedDomainInfo_in_set_level,
24127 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
24128 : },
24129 : {
24130 : .name = discard_const_p(char, "out_info"),
24131 : .get = py_lsa_QueryTrustedDomainInfo_out_get_info,
24132 : .set = py_lsa_QueryTrustedDomainInfo_out_set_info,
24133 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
24134 : },
24135 : {
24136 : .name = discard_const_p(char, "result"),
24137 : .get = py_lsa_QueryTrustedDomainInfo_get_result,
24138 : .set = py_lsa_QueryTrustedDomainInfo_set_result,
24139 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
24140 : },
24141 : { .name = NULL }
24142 : };
24143 :
24144 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
24145 : {
24146 0 : PyObject *self = pytalloc_new(struct lsa_QueryTrustedDomainInfo, type);
24147 0 : struct lsa_QueryTrustedDomainInfo *_self = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(self);
24148 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
24149 0 : _self->in.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
24150 : /* a pointer to a NULL pointer */
24151 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo *);
24152 0 : return self;
24153 : }
24154 :
24155 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
24156 : {
24157 :
24158 :
24159 0 : return PyLong_FromLong(26);
24160 : }
24161 :
24162 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
24163 : {
24164 0 : const struct ndr_interface_call *call = NULL;
24165 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
24166 0 : PyObject *ret = NULL;
24167 0 : struct ndr_push *push = NULL;
24168 : DATA_BLOB blob;
24169 : enum ndr_err_code err;
24170 :
24171 0 : if (ndr_table_lsarpc.num_calls < 27) {
24172 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfo_ndr_pack");
24173 0 : return NULL;
24174 : }
24175 0 : call = &ndr_table_lsarpc.calls[26];
24176 :
24177 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
24178 0 : if (push == NULL) {
24179 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24180 0 : return NULL;
24181 : }
24182 :
24183 0 : push->flags |= ndr_push_flags;
24184 :
24185 0 : err = call->ndr_push(push, ndr_inout_flags, object);
24186 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24187 0 : TALLOC_FREE(push);
24188 0 : PyErr_SetNdrError(err);
24189 0 : return NULL;
24190 : }
24191 0 : blob = ndr_push_blob(push);
24192 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
24193 0 : TALLOC_FREE(push);
24194 0 : return ret;
24195 : }
24196 :
24197 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24198 : {
24199 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24200 0 : PyObject *bigendian_obj = NULL;
24201 0 : PyObject *ndr64_obj = NULL;
24202 0 : uint32_t ndr_push_flags = 0;
24203 :
24204 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
24205 : discard_const_p(char *, kwnames),
24206 : &bigendian_obj,
24207 : &ndr64_obj)) {
24208 0 : return NULL;
24209 : }
24210 :
24211 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24212 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24213 : }
24214 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24215 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24216 : }
24217 :
24218 0 : return py_lsa_QueryTrustedDomainInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
24219 : }
24220 :
24221 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24222 : {
24223 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24224 0 : PyObject *bigendian_obj = NULL;
24225 0 : PyObject *ndr64_obj = NULL;
24226 0 : uint32_t ndr_push_flags = 0;
24227 :
24228 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
24229 : discard_const_p(char *, kwnames),
24230 : &bigendian_obj,
24231 : &ndr64_obj)) {
24232 0 : return NULL;
24233 : }
24234 :
24235 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24236 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24237 : }
24238 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24239 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24240 : }
24241 :
24242 0 : return py_lsa_QueryTrustedDomainInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
24243 : }
24244 :
24245 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
24246 : {
24247 0 : const struct ndr_interface_call *call = NULL;
24248 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
24249 0 : struct ndr_pull *pull = NULL;
24250 : enum ndr_err_code err;
24251 :
24252 0 : if (ndr_table_lsarpc.num_calls < 27) {
24253 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfo_ndr_unpack");
24254 0 : return NULL;
24255 : }
24256 0 : call = &ndr_table_lsarpc.calls[26];
24257 :
24258 0 : pull = ndr_pull_init_blob(blob, object);
24259 0 : if (pull == NULL) {
24260 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24261 0 : return NULL;
24262 : }
24263 :
24264 0 : pull->flags |= ndr_pull_flags;
24265 :
24266 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
24267 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24268 0 : TALLOC_FREE(pull);
24269 0 : PyErr_SetNdrError(err);
24270 0 : return NULL;
24271 : }
24272 0 : if (!allow_remaining) {
24273 : uint32_t highest_ofs;
24274 :
24275 0 : if (pull->offset > pull->relative_highest_offset) {
24276 0 : highest_ofs = pull->offset;
24277 : } else {
24278 0 : highest_ofs = pull->relative_highest_offset;
24279 : }
24280 0 : if (highest_ofs < pull->data_size) {
24281 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
24282 : "not all bytes consumed ofs[%u] size[%u]",
24283 : highest_ofs, pull->data_size);
24284 0 : TALLOC_FREE(pull);
24285 0 : PyErr_SetNdrError(err);
24286 0 : return NULL;
24287 : }
24288 : }
24289 :
24290 0 : TALLOC_FREE(pull);
24291 0 : Py_RETURN_NONE;
24292 : }
24293 :
24294 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24295 : {
24296 : DATA_BLOB blob;
24297 0 : Py_ssize_t blob_length = 0;
24298 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24299 0 : PyObject *bigendian_obj = NULL;
24300 0 : PyObject *ndr64_obj = NULL;
24301 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24302 0 : PyObject *allow_remaining_obj = NULL;
24303 0 : bool allow_remaining = false;
24304 :
24305 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
24306 : discard_const_p(char *, kwnames),
24307 : &blob.data, &blob_length,
24308 : &bigendian_obj,
24309 : &ndr64_obj,
24310 : &allow_remaining_obj)) {
24311 0 : return NULL;
24312 : }
24313 0 : blob.length = blob_length;
24314 :
24315 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24316 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24317 : }
24318 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24319 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24320 : }
24321 :
24322 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24323 0 : allow_remaining = true;
24324 : }
24325 :
24326 0 : return py_lsa_QueryTrustedDomainInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
24327 : }
24328 :
24329 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24330 : {
24331 : DATA_BLOB blob;
24332 0 : Py_ssize_t blob_length = 0;
24333 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24334 0 : PyObject *bigendian_obj = NULL;
24335 0 : PyObject *ndr64_obj = NULL;
24336 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24337 0 : PyObject *allow_remaining_obj = NULL;
24338 0 : bool allow_remaining = false;
24339 :
24340 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
24341 : discard_const_p(char *, kwnames),
24342 : &blob.data, &blob_length,
24343 : &bigendian_obj,
24344 : &ndr64_obj,
24345 : &allow_remaining_obj)) {
24346 0 : return NULL;
24347 : }
24348 0 : blob.length = blob_length;
24349 :
24350 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24351 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24352 : }
24353 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24354 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24355 : }
24356 :
24357 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24358 0 : allow_remaining = true;
24359 : }
24360 :
24361 0 : return py_lsa_QueryTrustedDomainInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
24362 : }
24363 :
24364 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
24365 : {
24366 0 : const struct ndr_interface_call *call = NULL;
24367 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
24368 : PyObject *ret;
24369 : char *retstr;
24370 :
24371 0 : if (ndr_table_lsarpc.num_calls < 27) {
24372 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfo_ndr_print");
24373 0 : return NULL;
24374 : }
24375 0 : call = &ndr_table_lsarpc.calls[26];
24376 :
24377 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
24378 0 : ret = PyUnicode_FromString(retstr);
24379 0 : TALLOC_FREE(retstr);
24380 :
24381 0 : return ret;
24382 : }
24383 :
24384 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24385 : {
24386 0 : return py_lsa_QueryTrustedDomainInfo_ndr_print(py_obj, "lsa_QueryTrustedDomainInfo_in", NDR_IN);
24387 : }
24388 :
24389 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24390 : {
24391 0 : return py_lsa_QueryTrustedDomainInfo_ndr_print(py_obj, "lsa_QueryTrustedDomainInfo_out", NDR_OUT);
24392 : }
24393 :
24394 : static PyMethodDef py_lsa_QueryTrustedDomainInfo_methods[] = {
24395 : { "opnum", (PyCFunction)py_lsa_QueryTrustedDomainInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
24396 : "lsa.QueryTrustedDomainInfo.opnum() -> 26 (0x1a) " },
24397 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
24398 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
24399 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
24400 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
24401 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
24402 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
24403 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
24404 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
24405 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryTrustedDomainInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
24406 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryTrustedDomainInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
24407 : { NULL, NULL, 0, NULL }
24408 : };
24409 :
24410 :
24411 : static PyTypeObject lsa_QueryTrustedDomainInfo_Type = {
24412 : PyVarObject_HEAD_INIT(NULL, 0)
24413 : .tp_name = "lsa.QueryTrustedDomainInfo",
24414 : .tp_getset = py_lsa_QueryTrustedDomainInfo_getsetters,
24415 : .tp_methods = py_lsa_QueryTrustedDomainInfo_methods,
24416 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24417 : .tp_new = py_lsa_QueryTrustedDomainInfo_new,
24418 : };
24419 :
24420 0 : static bool pack_py_lsa_QueryTrustedDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfo *r)
24421 : {
24422 : PyObject *py_trustdom_handle;
24423 : PyObject *py_level;
24424 0 : const char *kwnames[] = {
24425 : "trustdom_handle", "level", NULL
24426 : };
24427 :
24428 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryTrustedDomainInfo", discard_const_p(char *, kwnames), &py_trustdom_handle, &py_level)) {
24429 0 : return false;
24430 : }
24431 :
24432 0 : if (py_trustdom_handle == NULL) {
24433 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trustdom_handle");
24434 0 : return false;
24435 : }
24436 0 : r->in.trustdom_handle = talloc_ptrtype(r, r->in.trustdom_handle);
24437 0 : if (r->in.trustdom_handle == NULL) {
24438 0 : PyErr_NoMemory();
24439 0 : return false;
24440 : }
24441 0 : PY_CHECK_TYPE(policy_handle_Type, py_trustdom_handle, return false;);
24442 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trustdom_handle)) == NULL) {
24443 0 : PyErr_NoMemory();
24444 0 : return false;
24445 : }
24446 0 : r->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(py_trustdom_handle);
24447 0 : if (py_level == NULL) {
24448 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
24449 0 : return false;
24450 : }
24451 : {
24452 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
24453 0 : if (PyLong_Check(py_level)) {
24454 : unsigned long long test_var;
24455 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
24456 0 : if (PyErr_Occurred() != NULL) {
24457 0 : return false;
24458 : }
24459 0 : if (test_var > uint_max) {
24460 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24461 : PyLong_Type.tp_name, uint_max, test_var);
24462 0 : return false;
24463 : }
24464 0 : r->in.level = test_var;
24465 : } else {
24466 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24467 : PyLong_Type.tp_name);
24468 0 : return false;
24469 : }
24470 : }
24471 0 : return true;
24472 : }
24473 :
24474 0 : static PyObject *unpack_py_lsa_QueryTrustedDomainInfo_args_out(struct lsa_QueryTrustedDomainInfo *r)
24475 : {
24476 : PyObject *result;
24477 : PyObject *py_info;
24478 0 : if (*r->out.info == NULL) {
24479 0 : py_info = Py_None;
24480 0 : Py_INCREF(py_info);
24481 : } else {
24482 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_TrustedDomainInfo");
24483 0 : if (py_info == NULL) {
24484 0 : return NULL;
24485 : }
24486 : }
24487 0 : result = py_info;
24488 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
24489 0 : PyErr_SetNTSTATUS(r->out.result);
24490 0 : return NULL;
24491 : }
24492 :
24493 0 : return result;
24494 : }
24495 :
24496 :
24497 0 : static PyObject *py_lsa_SetInformationTrustedDomain_in_get_trustdom_handle(PyObject *obj, void *closure)
24498 : {
24499 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(obj);
24500 : PyObject *py_trustdom_handle;
24501 0 : if (object->in.trustdom_handle == NULL) {
24502 0 : Py_RETURN_NONE;
24503 : }
24504 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->in.trustdom_handle, object->in.trustdom_handle);
24505 0 : return py_trustdom_handle;
24506 : }
24507 :
24508 0 : static int py_lsa_SetInformationTrustedDomain_in_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
24509 : {
24510 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24511 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trustdom_handle));
24512 0 : if (value == NULL) {
24513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trustdom_handle");
24514 0 : return -1;
24515 : }
24516 0 : object->in.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trustdom_handle);
24517 0 : if (object->in.trustdom_handle == NULL) {
24518 0 : PyErr_NoMemory();
24519 0 : return -1;
24520 : }
24521 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
24522 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24523 0 : PyErr_NoMemory();
24524 0 : return -1;
24525 : }
24526 0 : object->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
24527 0 : return 0;
24528 : }
24529 :
24530 0 : static PyObject *py_lsa_SetInformationTrustedDomain_in_get_level(PyObject *obj, void *closure)
24531 : {
24532 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(obj);
24533 : PyObject *py_level;
24534 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
24535 0 : return py_level;
24536 : }
24537 :
24538 0 : static int py_lsa_SetInformationTrustedDomain_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
24539 : {
24540 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24541 0 : if (value == NULL) {
24542 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
24543 0 : return -1;
24544 : }
24545 : {
24546 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
24547 0 : if (PyLong_Check(value)) {
24548 : unsigned long long test_var;
24549 0 : test_var = PyLong_AsUnsignedLongLong(value);
24550 0 : if (PyErr_Occurred() != NULL) {
24551 0 : return -1;
24552 : }
24553 0 : if (test_var > uint_max) {
24554 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24555 : PyLong_Type.tp_name, uint_max, test_var);
24556 0 : return -1;
24557 : }
24558 0 : object->in.level = test_var;
24559 : } else {
24560 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24561 : PyLong_Type.tp_name);
24562 0 : return -1;
24563 : }
24564 : }
24565 0 : return 0;
24566 : }
24567 :
24568 0 : static PyObject *py_lsa_SetInformationTrustedDomain_in_get_info(PyObject *obj, void *closure)
24569 : {
24570 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(obj);
24571 : PyObject *py_info;
24572 0 : if (object->in.info == NULL) {
24573 0 : Py_RETURN_NONE;
24574 : }
24575 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, object->in.info, object->in.level, object->in.info, "union lsa_TrustedDomainInfo");
24576 0 : if (py_info == NULL) {
24577 0 : return NULL;
24578 : }
24579 0 : return py_info;
24580 : }
24581 :
24582 0 : static int py_lsa_SetInformationTrustedDomain_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
24583 : {
24584 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24585 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
24586 0 : if (value == NULL) {
24587 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
24588 0 : return -1;
24589 : }
24590 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
24591 0 : if (object->in.info == NULL) {
24592 0 : PyErr_NoMemory();
24593 0 : return -1;
24594 : }
24595 : {
24596 : union lsa_TrustedDomainInfo *info_switch_1;
24597 0 : info_switch_1 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union lsa_TrustedDomainInfo");
24598 0 : if (info_switch_1 == NULL) {
24599 0 : return -1;
24600 : }
24601 0 : object->in.info = info_switch_1;
24602 : }
24603 0 : return 0;
24604 : }
24605 :
24606 0 : static PyObject *py_lsa_SetInformationTrustedDomain_get_result(PyObject *obj, void *closure)
24607 : {
24608 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(obj);
24609 : PyObject *py_result;
24610 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
24611 0 : return py_result;
24612 : }
24613 :
24614 0 : static int py_lsa_SetInformationTrustedDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
24615 : {
24616 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24617 0 : if (value == NULL) {
24618 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
24619 0 : return -1;
24620 : }
24621 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
24622 0 : return 0;
24623 : }
24624 :
24625 : static PyGetSetDef py_lsa_SetInformationTrustedDomain_getsetters[] = {
24626 : {
24627 : .name = discard_const_p(char, "in_trustdom_handle"),
24628 : .get = py_lsa_SetInformationTrustedDomain_in_get_trustdom_handle,
24629 : .set = py_lsa_SetInformationTrustedDomain_in_set_trustdom_handle,
24630 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
24631 : },
24632 : {
24633 : .name = discard_const_p(char, "in_level"),
24634 : .get = py_lsa_SetInformationTrustedDomain_in_get_level,
24635 : .set = py_lsa_SetInformationTrustedDomain_in_set_level,
24636 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
24637 : },
24638 : {
24639 : .name = discard_const_p(char, "in_info"),
24640 : .get = py_lsa_SetInformationTrustedDomain_in_get_info,
24641 : .set = py_lsa_SetInformationTrustedDomain_in_set_info,
24642 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
24643 : },
24644 : {
24645 : .name = discard_const_p(char, "result"),
24646 : .get = py_lsa_SetInformationTrustedDomain_get_result,
24647 : .set = py_lsa_SetInformationTrustedDomain_set_result,
24648 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
24649 : },
24650 : { .name = NULL }
24651 : };
24652 :
24653 0 : static PyObject *py_lsa_SetInformationTrustedDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
24654 : {
24655 0 : PyObject *self = pytalloc_new(struct lsa_SetInformationTrustedDomain, type);
24656 0 : struct lsa_SetInformationTrustedDomain *_self = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(self);
24657 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
24658 0 : _self->in.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
24659 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
24660 0 : return self;
24661 : }
24662 :
24663 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
24664 : {
24665 :
24666 :
24667 0 : return PyLong_FromLong(27);
24668 : }
24669 :
24670 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
24671 : {
24672 0 : const struct ndr_interface_call *call = NULL;
24673 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24674 0 : PyObject *ret = NULL;
24675 0 : struct ndr_push *push = NULL;
24676 : DATA_BLOB blob;
24677 : enum ndr_err_code err;
24678 :
24679 0 : if (ndr_table_lsarpc.num_calls < 28) {
24680 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInformationTrustedDomain_ndr_pack");
24681 0 : return NULL;
24682 : }
24683 0 : call = &ndr_table_lsarpc.calls[27];
24684 :
24685 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
24686 0 : if (push == NULL) {
24687 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24688 0 : return NULL;
24689 : }
24690 :
24691 0 : push->flags |= ndr_push_flags;
24692 :
24693 0 : err = call->ndr_push(push, ndr_inout_flags, object);
24694 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24695 0 : TALLOC_FREE(push);
24696 0 : PyErr_SetNdrError(err);
24697 0 : return NULL;
24698 : }
24699 0 : blob = ndr_push_blob(push);
24700 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
24701 0 : TALLOC_FREE(push);
24702 0 : return ret;
24703 : }
24704 :
24705 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24706 : {
24707 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24708 0 : PyObject *bigendian_obj = NULL;
24709 0 : PyObject *ndr64_obj = NULL;
24710 0 : uint32_t ndr_push_flags = 0;
24711 :
24712 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
24713 : discard_const_p(char *, kwnames),
24714 : &bigendian_obj,
24715 : &ndr64_obj)) {
24716 0 : return NULL;
24717 : }
24718 :
24719 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24720 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24721 : }
24722 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24723 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24724 : }
24725 :
24726 0 : return py_lsa_SetInformationTrustedDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
24727 : }
24728 :
24729 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24730 : {
24731 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24732 0 : PyObject *bigendian_obj = NULL;
24733 0 : PyObject *ndr64_obj = NULL;
24734 0 : uint32_t ndr_push_flags = 0;
24735 :
24736 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
24737 : discard_const_p(char *, kwnames),
24738 : &bigendian_obj,
24739 : &ndr64_obj)) {
24740 0 : return NULL;
24741 : }
24742 :
24743 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24744 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24745 : }
24746 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24747 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24748 : }
24749 :
24750 0 : return py_lsa_SetInformationTrustedDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
24751 : }
24752 :
24753 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
24754 : {
24755 0 : const struct ndr_interface_call *call = NULL;
24756 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24757 0 : struct ndr_pull *pull = NULL;
24758 : enum ndr_err_code err;
24759 :
24760 0 : if (ndr_table_lsarpc.num_calls < 28) {
24761 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInformationTrustedDomain_ndr_unpack");
24762 0 : return NULL;
24763 : }
24764 0 : call = &ndr_table_lsarpc.calls[27];
24765 :
24766 0 : pull = ndr_pull_init_blob(blob, object);
24767 0 : if (pull == NULL) {
24768 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24769 0 : return NULL;
24770 : }
24771 :
24772 0 : pull->flags |= ndr_pull_flags;
24773 :
24774 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
24775 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24776 0 : TALLOC_FREE(pull);
24777 0 : PyErr_SetNdrError(err);
24778 0 : return NULL;
24779 : }
24780 0 : if (!allow_remaining) {
24781 : uint32_t highest_ofs;
24782 :
24783 0 : if (pull->offset > pull->relative_highest_offset) {
24784 0 : highest_ofs = pull->offset;
24785 : } else {
24786 0 : highest_ofs = pull->relative_highest_offset;
24787 : }
24788 0 : if (highest_ofs < pull->data_size) {
24789 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
24790 : "not all bytes consumed ofs[%u] size[%u]",
24791 : highest_ofs, pull->data_size);
24792 0 : TALLOC_FREE(pull);
24793 0 : PyErr_SetNdrError(err);
24794 0 : return NULL;
24795 : }
24796 : }
24797 :
24798 0 : TALLOC_FREE(pull);
24799 0 : Py_RETURN_NONE;
24800 : }
24801 :
24802 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24803 : {
24804 : DATA_BLOB blob;
24805 0 : Py_ssize_t blob_length = 0;
24806 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24807 0 : PyObject *bigendian_obj = NULL;
24808 0 : PyObject *ndr64_obj = NULL;
24809 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24810 0 : PyObject *allow_remaining_obj = NULL;
24811 0 : bool allow_remaining = false;
24812 :
24813 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
24814 : discard_const_p(char *, kwnames),
24815 : &blob.data, &blob_length,
24816 : &bigendian_obj,
24817 : &ndr64_obj,
24818 : &allow_remaining_obj)) {
24819 0 : return NULL;
24820 : }
24821 0 : blob.length = blob_length;
24822 :
24823 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24824 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24825 : }
24826 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24827 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24828 : }
24829 :
24830 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24831 0 : allow_remaining = true;
24832 : }
24833 :
24834 0 : return py_lsa_SetInformationTrustedDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
24835 : }
24836 :
24837 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24838 : {
24839 : DATA_BLOB blob;
24840 0 : Py_ssize_t blob_length = 0;
24841 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24842 0 : PyObject *bigendian_obj = NULL;
24843 0 : PyObject *ndr64_obj = NULL;
24844 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24845 0 : PyObject *allow_remaining_obj = NULL;
24846 0 : bool allow_remaining = false;
24847 :
24848 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
24849 : discard_const_p(char *, kwnames),
24850 : &blob.data, &blob_length,
24851 : &bigendian_obj,
24852 : &ndr64_obj,
24853 : &allow_remaining_obj)) {
24854 0 : return NULL;
24855 : }
24856 0 : blob.length = blob_length;
24857 :
24858 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24859 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24860 : }
24861 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24862 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24863 : }
24864 :
24865 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24866 0 : allow_remaining = true;
24867 : }
24868 :
24869 0 : return py_lsa_SetInformationTrustedDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
24870 : }
24871 :
24872 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
24873 : {
24874 0 : const struct ndr_interface_call *call = NULL;
24875 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24876 : PyObject *ret;
24877 : char *retstr;
24878 :
24879 0 : if (ndr_table_lsarpc.num_calls < 28) {
24880 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInformationTrustedDomain_ndr_print");
24881 0 : return NULL;
24882 : }
24883 0 : call = &ndr_table_lsarpc.calls[27];
24884 :
24885 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
24886 0 : ret = PyUnicode_FromString(retstr);
24887 0 : TALLOC_FREE(retstr);
24888 :
24889 0 : return ret;
24890 : }
24891 :
24892 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24893 : {
24894 0 : return py_lsa_SetInformationTrustedDomain_ndr_print(py_obj, "lsa_SetInformationTrustedDomain_in", NDR_IN);
24895 : }
24896 :
24897 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24898 : {
24899 0 : return py_lsa_SetInformationTrustedDomain_ndr_print(py_obj, "lsa_SetInformationTrustedDomain_out", NDR_OUT);
24900 : }
24901 :
24902 : static PyMethodDef py_lsa_SetInformationTrustedDomain_methods[] = {
24903 : { "opnum", (PyCFunction)py_lsa_SetInformationTrustedDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
24904 : "lsa.SetInformationTrustedDomain.opnum() -> 27 (0x1b) " },
24905 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInformationTrustedDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
24906 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
24907 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInformationTrustedDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
24908 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
24909 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInformationTrustedDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
24910 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
24911 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInformationTrustedDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
24912 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
24913 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetInformationTrustedDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
24914 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetInformationTrustedDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
24915 : { NULL, NULL, 0, NULL }
24916 : };
24917 :
24918 :
24919 : static PyTypeObject lsa_SetInformationTrustedDomain_Type = {
24920 : PyVarObject_HEAD_INIT(NULL, 0)
24921 : .tp_name = "lsa.SetInformationTrustedDomain",
24922 : .tp_getset = py_lsa_SetInformationTrustedDomain_getsetters,
24923 : .tp_methods = py_lsa_SetInformationTrustedDomain_methods,
24924 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24925 : .tp_new = py_lsa_SetInformationTrustedDomain_new,
24926 : };
24927 :
24928 22 : static bool pack_py_lsa_SetInformationTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInformationTrustedDomain *r)
24929 : {
24930 : PyObject *py_trustdom_handle;
24931 : PyObject *py_level;
24932 : PyObject *py_info;
24933 22 : const char *kwnames[] = {
24934 : "trustdom_handle", "level", "info", NULL
24935 : };
24936 :
24937 22 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInformationTrustedDomain", discard_const_p(char *, kwnames), &py_trustdom_handle, &py_level, &py_info)) {
24938 0 : return false;
24939 : }
24940 :
24941 22 : if (py_trustdom_handle == NULL) {
24942 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trustdom_handle");
24943 0 : return false;
24944 : }
24945 22 : r->in.trustdom_handle = talloc_ptrtype(r, r->in.trustdom_handle);
24946 22 : if (r->in.trustdom_handle == NULL) {
24947 0 : PyErr_NoMemory();
24948 0 : return false;
24949 : }
24950 22 : PY_CHECK_TYPE(policy_handle_Type, py_trustdom_handle, return false;);
24951 22 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trustdom_handle)) == NULL) {
24952 0 : PyErr_NoMemory();
24953 0 : return false;
24954 : }
24955 22 : r->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(py_trustdom_handle);
24956 22 : if (py_level == NULL) {
24957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
24958 0 : return false;
24959 : }
24960 : {
24961 22 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
24962 22 : if (PyLong_Check(py_level)) {
24963 : unsigned long long test_var;
24964 22 : test_var = PyLong_AsUnsignedLongLong(py_level);
24965 22 : if (PyErr_Occurred() != NULL) {
24966 0 : return false;
24967 : }
24968 22 : if (test_var > uint_max) {
24969 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24970 : PyLong_Type.tp_name, uint_max, test_var);
24971 0 : return false;
24972 : }
24973 22 : r->in.level = test_var;
24974 : } else {
24975 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24976 : PyLong_Type.tp_name);
24977 0 : return false;
24978 : }
24979 : }
24980 22 : if (py_info == NULL) {
24981 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
24982 0 : return false;
24983 : }
24984 22 : r->in.info = talloc_ptrtype(r, r->in.info);
24985 22 : if (r->in.info == NULL) {
24986 0 : PyErr_NoMemory();
24987 0 : return false;
24988 : }
24989 : {
24990 : union lsa_TrustedDomainInfo *info_switch_1;
24991 22 : info_switch_1 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, r, r->in.level, py_info, "union lsa_TrustedDomainInfo");
24992 22 : if (info_switch_1 == NULL) {
24993 0 : return false;
24994 : }
24995 22 : r->in.info = info_switch_1;
24996 : }
24997 22 : return true;
24998 : }
24999 :
25000 22 : static PyObject *unpack_py_lsa_SetInformationTrustedDomain_args_out(struct lsa_SetInformationTrustedDomain *r)
25001 : {
25002 : PyObject *result;
25003 22 : result = Py_None;
25004 22 : Py_INCREF(result);
25005 22 : if (NT_STATUS_IS_ERR(r->out.result)) {
25006 0 : PyErr_SetNTSTATUS(r->out.result);
25007 0 : return NULL;
25008 : }
25009 :
25010 22 : return result;
25011 : }
25012 :
25013 :
25014 0 : static PyObject *py_lsa_OpenSecret_in_get_handle(PyObject *obj, void *closure)
25015 : {
25016 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(obj);
25017 : PyObject *py_handle;
25018 0 : if (object->in.handle == NULL) {
25019 0 : Py_RETURN_NONE;
25020 : }
25021 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
25022 0 : return py_handle;
25023 : }
25024 :
25025 0 : static int py_lsa_OpenSecret_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
25026 : {
25027 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25028 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
25029 0 : if (value == NULL) {
25030 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
25031 0 : return -1;
25032 : }
25033 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
25034 0 : if (object->in.handle == NULL) {
25035 0 : PyErr_NoMemory();
25036 0 : return -1;
25037 : }
25038 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25039 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25040 0 : PyErr_NoMemory();
25041 0 : return -1;
25042 : }
25043 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
25044 0 : return 0;
25045 : }
25046 :
25047 0 : static PyObject *py_lsa_OpenSecret_in_get_name(PyObject *obj, void *closure)
25048 : {
25049 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(obj);
25050 : PyObject *py_name;
25051 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->in.name);
25052 0 : return py_name;
25053 : }
25054 :
25055 0 : static int py_lsa_OpenSecret_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
25056 : {
25057 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25058 0 : if (value == NULL) {
25059 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
25060 0 : return -1;
25061 : }
25062 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
25063 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25064 0 : PyErr_NoMemory();
25065 0 : return -1;
25066 : }
25067 0 : object->in.name = *(struct lsa_String *)pytalloc_get_ptr(value);
25068 0 : return 0;
25069 : }
25070 :
25071 0 : static PyObject *py_lsa_OpenSecret_in_get_access_mask(PyObject *obj, void *closure)
25072 : {
25073 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(obj);
25074 : PyObject *py_access_mask;
25075 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
25076 0 : return py_access_mask;
25077 : }
25078 :
25079 0 : static int py_lsa_OpenSecret_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
25080 : {
25081 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25082 0 : if (value == NULL) {
25083 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
25084 0 : return -1;
25085 : }
25086 : {
25087 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
25088 0 : if (PyLong_Check(value)) {
25089 : unsigned long long test_var;
25090 0 : test_var = PyLong_AsUnsignedLongLong(value);
25091 0 : if (PyErr_Occurred() != NULL) {
25092 0 : return -1;
25093 : }
25094 0 : if (test_var > uint_max) {
25095 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25096 : PyLong_Type.tp_name, uint_max, test_var);
25097 0 : return -1;
25098 : }
25099 0 : object->in.access_mask = test_var;
25100 : } else {
25101 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25102 : PyLong_Type.tp_name);
25103 0 : return -1;
25104 : }
25105 : }
25106 0 : return 0;
25107 : }
25108 :
25109 0 : static PyObject *py_lsa_OpenSecret_out_get_sec_handle(PyObject *obj, void *closure)
25110 : {
25111 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(obj);
25112 : PyObject *py_sec_handle;
25113 0 : if (object->out.sec_handle == NULL) {
25114 0 : Py_RETURN_NONE;
25115 : }
25116 0 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, object->out.sec_handle, object->out.sec_handle);
25117 0 : return py_sec_handle;
25118 : }
25119 :
25120 0 : static int py_lsa_OpenSecret_out_set_sec_handle(PyObject *py_obj, PyObject *value, void *closure)
25121 : {
25122 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25123 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sec_handle));
25124 0 : if (value == NULL) {
25125 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sec_handle");
25126 0 : return -1;
25127 : }
25128 0 : object->out.sec_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sec_handle);
25129 0 : if (object->out.sec_handle == NULL) {
25130 0 : PyErr_NoMemory();
25131 0 : return -1;
25132 : }
25133 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25134 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25135 0 : PyErr_NoMemory();
25136 0 : return -1;
25137 : }
25138 0 : object->out.sec_handle = (struct policy_handle *)pytalloc_get_ptr(value);
25139 0 : return 0;
25140 : }
25141 :
25142 0 : static PyObject *py_lsa_OpenSecret_get_result(PyObject *obj, void *closure)
25143 : {
25144 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(obj);
25145 : PyObject *py_result;
25146 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
25147 0 : return py_result;
25148 : }
25149 :
25150 0 : static int py_lsa_OpenSecret_set_result(PyObject *py_obj, PyObject *value, void *closure)
25151 : {
25152 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25153 0 : if (value == NULL) {
25154 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
25155 0 : return -1;
25156 : }
25157 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
25158 0 : return 0;
25159 : }
25160 :
25161 : static PyGetSetDef py_lsa_OpenSecret_getsetters[] = {
25162 : {
25163 : .name = discard_const_p(char, "in_handle"),
25164 : .get = py_lsa_OpenSecret_in_get_handle,
25165 : .set = py_lsa_OpenSecret_in_set_handle,
25166 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25167 : },
25168 : {
25169 : .name = discard_const_p(char, "in_name"),
25170 : .get = py_lsa_OpenSecret_in_get_name,
25171 : .set = py_lsa_OpenSecret_in_set_name,
25172 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
25173 : },
25174 : {
25175 : .name = discard_const_p(char, "in_access_mask"),
25176 : .get = py_lsa_OpenSecret_in_get_access_mask,
25177 : .set = py_lsa_OpenSecret_in_set_access_mask,
25178 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SecretAccessMask")
25179 : },
25180 : {
25181 : .name = discard_const_p(char, "out_sec_handle"),
25182 : .get = py_lsa_OpenSecret_out_get_sec_handle,
25183 : .set = py_lsa_OpenSecret_out_set_sec_handle,
25184 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25185 : },
25186 : {
25187 : .name = discard_const_p(char, "result"),
25188 : .get = py_lsa_OpenSecret_get_result,
25189 : .set = py_lsa_OpenSecret_set_result,
25190 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
25191 : },
25192 : { .name = NULL }
25193 : };
25194 :
25195 0 : static PyObject *py_lsa_OpenSecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25196 : {
25197 0 : PyObject *self = pytalloc_new(struct lsa_OpenSecret, type);
25198 0 : struct lsa_OpenSecret *_self = (struct lsa_OpenSecret *)pytalloc_get_ptr(self);
25199 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
25200 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
25201 0 : _self->out.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
25202 0 : return self;
25203 : }
25204 :
25205 0 : static PyObject *py_lsa_OpenSecret_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
25206 : {
25207 :
25208 :
25209 0 : return PyLong_FromLong(28);
25210 : }
25211 :
25212 0 : static PyObject *py_lsa_OpenSecret_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
25213 : {
25214 0 : const struct ndr_interface_call *call = NULL;
25215 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25216 0 : PyObject *ret = NULL;
25217 0 : struct ndr_push *push = NULL;
25218 : DATA_BLOB blob;
25219 : enum ndr_err_code err;
25220 :
25221 0 : if (ndr_table_lsarpc.num_calls < 29) {
25222 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenSecret_ndr_pack");
25223 0 : return NULL;
25224 : }
25225 0 : call = &ndr_table_lsarpc.calls[28];
25226 :
25227 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
25228 0 : if (push == NULL) {
25229 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25230 0 : return NULL;
25231 : }
25232 :
25233 0 : push->flags |= ndr_push_flags;
25234 :
25235 0 : err = call->ndr_push(push, ndr_inout_flags, object);
25236 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25237 0 : TALLOC_FREE(push);
25238 0 : PyErr_SetNdrError(err);
25239 0 : return NULL;
25240 : }
25241 0 : blob = ndr_push_blob(push);
25242 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
25243 0 : TALLOC_FREE(push);
25244 0 : return ret;
25245 : }
25246 :
25247 0 : static PyObject *py_lsa_OpenSecret_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25248 : {
25249 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25250 0 : PyObject *bigendian_obj = NULL;
25251 0 : PyObject *ndr64_obj = NULL;
25252 0 : uint32_t ndr_push_flags = 0;
25253 :
25254 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
25255 : discard_const_p(char *, kwnames),
25256 : &bigendian_obj,
25257 : &ndr64_obj)) {
25258 0 : return NULL;
25259 : }
25260 :
25261 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25262 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25263 : }
25264 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25265 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25266 : }
25267 :
25268 0 : return py_lsa_OpenSecret_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
25269 : }
25270 :
25271 0 : static PyObject *py_lsa_OpenSecret_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25272 : {
25273 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25274 0 : PyObject *bigendian_obj = NULL;
25275 0 : PyObject *ndr64_obj = NULL;
25276 0 : uint32_t ndr_push_flags = 0;
25277 :
25278 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
25279 : discard_const_p(char *, kwnames),
25280 : &bigendian_obj,
25281 : &ndr64_obj)) {
25282 0 : return NULL;
25283 : }
25284 :
25285 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25286 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25287 : }
25288 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25289 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25290 : }
25291 :
25292 0 : return py_lsa_OpenSecret_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
25293 : }
25294 :
25295 0 : static PyObject *py_lsa_OpenSecret_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
25296 : {
25297 0 : const struct ndr_interface_call *call = NULL;
25298 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25299 0 : struct ndr_pull *pull = NULL;
25300 : enum ndr_err_code err;
25301 :
25302 0 : if (ndr_table_lsarpc.num_calls < 29) {
25303 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenSecret_ndr_unpack");
25304 0 : return NULL;
25305 : }
25306 0 : call = &ndr_table_lsarpc.calls[28];
25307 :
25308 0 : pull = ndr_pull_init_blob(blob, object);
25309 0 : if (pull == NULL) {
25310 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25311 0 : return NULL;
25312 : }
25313 :
25314 0 : pull->flags |= ndr_pull_flags;
25315 :
25316 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
25317 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25318 0 : TALLOC_FREE(pull);
25319 0 : PyErr_SetNdrError(err);
25320 0 : return NULL;
25321 : }
25322 0 : if (!allow_remaining) {
25323 : uint32_t highest_ofs;
25324 :
25325 0 : if (pull->offset > pull->relative_highest_offset) {
25326 0 : highest_ofs = pull->offset;
25327 : } else {
25328 0 : highest_ofs = pull->relative_highest_offset;
25329 : }
25330 0 : if (highest_ofs < pull->data_size) {
25331 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
25332 : "not all bytes consumed ofs[%u] size[%u]",
25333 : highest_ofs, pull->data_size);
25334 0 : TALLOC_FREE(pull);
25335 0 : PyErr_SetNdrError(err);
25336 0 : return NULL;
25337 : }
25338 : }
25339 :
25340 0 : TALLOC_FREE(pull);
25341 0 : Py_RETURN_NONE;
25342 : }
25343 :
25344 0 : static PyObject *py_lsa_OpenSecret_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25345 : {
25346 : DATA_BLOB blob;
25347 0 : Py_ssize_t blob_length = 0;
25348 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25349 0 : PyObject *bigendian_obj = NULL;
25350 0 : PyObject *ndr64_obj = NULL;
25351 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25352 0 : PyObject *allow_remaining_obj = NULL;
25353 0 : bool allow_remaining = false;
25354 :
25355 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
25356 : discard_const_p(char *, kwnames),
25357 : &blob.data, &blob_length,
25358 : &bigendian_obj,
25359 : &ndr64_obj,
25360 : &allow_remaining_obj)) {
25361 0 : return NULL;
25362 : }
25363 0 : blob.length = blob_length;
25364 :
25365 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25366 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25367 : }
25368 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25369 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25370 : }
25371 :
25372 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25373 0 : allow_remaining = true;
25374 : }
25375 :
25376 0 : return py_lsa_OpenSecret_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
25377 : }
25378 :
25379 0 : static PyObject *py_lsa_OpenSecret_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25380 : {
25381 : DATA_BLOB blob;
25382 0 : Py_ssize_t blob_length = 0;
25383 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25384 0 : PyObject *bigendian_obj = NULL;
25385 0 : PyObject *ndr64_obj = NULL;
25386 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25387 0 : PyObject *allow_remaining_obj = NULL;
25388 0 : bool allow_remaining = false;
25389 :
25390 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
25391 : discard_const_p(char *, kwnames),
25392 : &blob.data, &blob_length,
25393 : &bigendian_obj,
25394 : &ndr64_obj,
25395 : &allow_remaining_obj)) {
25396 0 : return NULL;
25397 : }
25398 0 : blob.length = blob_length;
25399 :
25400 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25401 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25402 : }
25403 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25404 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25405 : }
25406 :
25407 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25408 0 : allow_remaining = true;
25409 : }
25410 :
25411 0 : return py_lsa_OpenSecret_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
25412 : }
25413 :
25414 0 : static PyObject *py_lsa_OpenSecret_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
25415 : {
25416 0 : const struct ndr_interface_call *call = NULL;
25417 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25418 : PyObject *ret;
25419 : char *retstr;
25420 :
25421 0 : if (ndr_table_lsarpc.num_calls < 29) {
25422 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenSecret_ndr_print");
25423 0 : return NULL;
25424 : }
25425 0 : call = &ndr_table_lsarpc.calls[28];
25426 :
25427 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
25428 0 : ret = PyUnicode_FromString(retstr);
25429 0 : TALLOC_FREE(retstr);
25430 :
25431 0 : return ret;
25432 : }
25433 :
25434 0 : static PyObject *py_lsa_OpenSecret_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25435 : {
25436 0 : return py_lsa_OpenSecret_ndr_print(py_obj, "lsa_OpenSecret_in", NDR_IN);
25437 : }
25438 :
25439 0 : static PyObject *py_lsa_OpenSecret_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25440 : {
25441 0 : return py_lsa_OpenSecret_ndr_print(py_obj, "lsa_OpenSecret_out", NDR_OUT);
25442 : }
25443 :
25444 : static PyMethodDef py_lsa_OpenSecret_methods[] = {
25445 : { "opnum", (PyCFunction)py_lsa_OpenSecret_ndr_opnum, METH_NOARGS|METH_CLASS,
25446 : "lsa.OpenSecret.opnum() -> 28 (0x1c) " },
25447 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenSecret_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
25448 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
25449 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenSecret_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
25450 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
25451 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenSecret_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
25452 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
25453 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenSecret_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
25454 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
25455 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenSecret_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
25456 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenSecret_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
25457 : { NULL, NULL, 0, NULL }
25458 : };
25459 :
25460 :
25461 : static PyTypeObject lsa_OpenSecret_Type = {
25462 : PyVarObject_HEAD_INIT(NULL, 0)
25463 : .tp_name = "lsa.OpenSecret",
25464 : .tp_getset = py_lsa_OpenSecret_getsetters,
25465 : .tp_methods = py_lsa_OpenSecret_methods,
25466 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25467 : .tp_new = py_lsa_OpenSecret_new,
25468 : };
25469 :
25470 0 : static bool pack_py_lsa_OpenSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenSecret *r)
25471 : {
25472 : PyObject *py_handle;
25473 : PyObject *py_name;
25474 : PyObject *py_access_mask;
25475 0 : const char *kwnames[] = {
25476 : "handle", "name", "access_mask", NULL
25477 : };
25478 :
25479 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenSecret", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
25480 0 : return false;
25481 : }
25482 :
25483 0 : if (py_handle == NULL) {
25484 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
25485 0 : return false;
25486 : }
25487 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
25488 0 : if (r->in.handle == NULL) {
25489 0 : PyErr_NoMemory();
25490 0 : return false;
25491 : }
25492 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
25493 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
25494 0 : PyErr_NoMemory();
25495 0 : return false;
25496 : }
25497 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
25498 0 : if (py_name == NULL) {
25499 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
25500 0 : return false;
25501 : }
25502 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
25503 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
25504 0 : PyErr_NoMemory();
25505 0 : return false;
25506 : }
25507 0 : r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
25508 0 : if (py_access_mask == NULL) {
25509 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
25510 0 : return false;
25511 : }
25512 : {
25513 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
25514 0 : if (PyLong_Check(py_access_mask)) {
25515 : unsigned long long test_var;
25516 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
25517 0 : if (PyErr_Occurred() != NULL) {
25518 0 : return false;
25519 : }
25520 0 : if (test_var > uint_max) {
25521 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25522 : PyLong_Type.tp_name, uint_max, test_var);
25523 0 : return false;
25524 : }
25525 0 : r->in.access_mask = test_var;
25526 : } else {
25527 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25528 : PyLong_Type.tp_name);
25529 0 : return false;
25530 : }
25531 : }
25532 0 : return true;
25533 : }
25534 :
25535 0 : static PyObject *unpack_py_lsa_OpenSecret_args_out(struct lsa_OpenSecret *r)
25536 : {
25537 : PyObject *result;
25538 : PyObject *py_sec_handle;
25539 0 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, r->out.sec_handle, r->out.sec_handle);
25540 0 : result = py_sec_handle;
25541 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
25542 0 : PyErr_SetNTSTATUS(r->out.result);
25543 0 : return NULL;
25544 : }
25545 :
25546 0 : return result;
25547 : }
25548 :
25549 :
25550 0 : static PyObject *py_lsa_SetSecret_in_get_sec_handle(PyObject *obj, void *closure)
25551 : {
25552 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(obj);
25553 : PyObject *py_sec_handle;
25554 0 : if (object->in.sec_handle == NULL) {
25555 0 : Py_RETURN_NONE;
25556 : }
25557 0 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, object->in.sec_handle, object->in.sec_handle);
25558 0 : return py_sec_handle;
25559 : }
25560 :
25561 0 : static int py_lsa_SetSecret_in_set_sec_handle(PyObject *py_obj, PyObject *value, void *closure)
25562 : {
25563 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25564 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sec_handle));
25565 0 : if (value == NULL) {
25566 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sec_handle");
25567 0 : return -1;
25568 : }
25569 0 : object->in.sec_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sec_handle);
25570 0 : if (object->in.sec_handle == NULL) {
25571 0 : PyErr_NoMemory();
25572 0 : return -1;
25573 : }
25574 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25575 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25576 0 : PyErr_NoMemory();
25577 0 : return -1;
25578 : }
25579 0 : object->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(value);
25580 0 : return 0;
25581 : }
25582 :
25583 0 : static PyObject *py_lsa_SetSecret_in_get_new_val(PyObject *obj, void *closure)
25584 : {
25585 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(obj);
25586 : PyObject *py_new_val;
25587 0 : if (object->in.new_val == NULL) {
25588 0 : Py_RETURN_NONE;
25589 : }
25590 0 : if (object->in.new_val == NULL) {
25591 0 : py_new_val = Py_None;
25592 0 : Py_INCREF(py_new_val);
25593 : } else {
25594 0 : py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->in.new_val, object->in.new_val);
25595 : }
25596 0 : return py_new_val;
25597 : }
25598 :
25599 0 : static int py_lsa_SetSecret_in_set_new_val(PyObject *py_obj, PyObject *value, void *closure)
25600 : {
25601 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25602 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_val));
25603 0 : if (value == NULL) {
25604 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_val");
25605 0 : return -1;
25606 : }
25607 0 : if (value == Py_None) {
25608 0 : object->in.new_val = NULL;
25609 : } else {
25610 0 : object->in.new_val = NULL;
25611 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
25612 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25613 0 : PyErr_NoMemory();
25614 0 : return -1;
25615 : }
25616 0 : object->in.new_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
25617 : }
25618 0 : return 0;
25619 : }
25620 :
25621 0 : static PyObject *py_lsa_SetSecret_in_get_old_val(PyObject *obj, void *closure)
25622 : {
25623 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(obj);
25624 : PyObject *py_old_val;
25625 0 : if (object->in.old_val == NULL) {
25626 0 : Py_RETURN_NONE;
25627 : }
25628 0 : if (object->in.old_val == NULL) {
25629 0 : py_old_val = Py_None;
25630 0 : Py_INCREF(py_old_val);
25631 : } else {
25632 0 : py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->in.old_val, object->in.old_val);
25633 : }
25634 0 : return py_old_val;
25635 : }
25636 :
25637 0 : static int py_lsa_SetSecret_in_set_old_val(PyObject *py_obj, PyObject *value, void *closure)
25638 : {
25639 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25640 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.old_val));
25641 0 : if (value == NULL) {
25642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.old_val");
25643 0 : return -1;
25644 : }
25645 0 : if (value == Py_None) {
25646 0 : object->in.old_val = NULL;
25647 : } else {
25648 0 : object->in.old_val = NULL;
25649 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
25650 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25651 0 : PyErr_NoMemory();
25652 0 : return -1;
25653 : }
25654 0 : object->in.old_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
25655 : }
25656 0 : return 0;
25657 : }
25658 :
25659 0 : static PyObject *py_lsa_SetSecret_get_result(PyObject *obj, void *closure)
25660 : {
25661 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(obj);
25662 : PyObject *py_result;
25663 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
25664 0 : return py_result;
25665 : }
25666 :
25667 0 : static int py_lsa_SetSecret_set_result(PyObject *py_obj, PyObject *value, void *closure)
25668 : {
25669 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25670 0 : if (value == NULL) {
25671 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
25672 0 : return -1;
25673 : }
25674 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
25675 0 : return 0;
25676 : }
25677 :
25678 : static PyGetSetDef py_lsa_SetSecret_getsetters[] = {
25679 : {
25680 : .name = discard_const_p(char, "in_sec_handle"),
25681 : .get = py_lsa_SetSecret_in_get_sec_handle,
25682 : .set = py_lsa_SetSecret_in_set_sec_handle,
25683 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25684 : },
25685 : {
25686 : .name = discard_const_p(char, "in_new_val"),
25687 : .get = py_lsa_SetSecret_in_get_new_val,
25688 : .set = py_lsa_SetSecret_in_set_new_val,
25689 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
25690 : },
25691 : {
25692 : .name = discard_const_p(char, "in_old_val"),
25693 : .get = py_lsa_SetSecret_in_get_old_val,
25694 : .set = py_lsa_SetSecret_in_set_old_val,
25695 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
25696 : },
25697 : {
25698 : .name = discard_const_p(char, "result"),
25699 : .get = py_lsa_SetSecret_get_result,
25700 : .set = py_lsa_SetSecret_set_result,
25701 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
25702 : },
25703 : { .name = NULL }
25704 : };
25705 :
25706 0 : static PyObject *py_lsa_SetSecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25707 : {
25708 0 : PyObject *self = pytalloc_new(struct lsa_SetSecret, type);
25709 0 : struct lsa_SetSecret *_self = (struct lsa_SetSecret *)pytalloc_get_ptr(self);
25710 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
25711 0 : _self->in.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
25712 0 : return self;
25713 : }
25714 :
25715 0 : static PyObject *py_lsa_SetSecret_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
25716 : {
25717 :
25718 :
25719 0 : return PyLong_FromLong(29);
25720 : }
25721 :
25722 0 : static PyObject *py_lsa_SetSecret_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
25723 : {
25724 0 : const struct ndr_interface_call *call = NULL;
25725 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25726 0 : PyObject *ret = NULL;
25727 0 : struct ndr_push *push = NULL;
25728 : DATA_BLOB blob;
25729 : enum ndr_err_code err;
25730 :
25731 0 : if (ndr_table_lsarpc.num_calls < 30) {
25732 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecret_ndr_pack");
25733 0 : return NULL;
25734 : }
25735 0 : call = &ndr_table_lsarpc.calls[29];
25736 :
25737 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
25738 0 : if (push == NULL) {
25739 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25740 0 : return NULL;
25741 : }
25742 :
25743 0 : push->flags |= ndr_push_flags;
25744 :
25745 0 : err = call->ndr_push(push, ndr_inout_flags, object);
25746 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25747 0 : TALLOC_FREE(push);
25748 0 : PyErr_SetNdrError(err);
25749 0 : return NULL;
25750 : }
25751 0 : blob = ndr_push_blob(push);
25752 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
25753 0 : TALLOC_FREE(push);
25754 0 : return ret;
25755 : }
25756 :
25757 0 : static PyObject *py_lsa_SetSecret_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25758 : {
25759 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25760 0 : PyObject *bigendian_obj = NULL;
25761 0 : PyObject *ndr64_obj = NULL;
25762 0 : uint32_t ndr_push_flags = 0;
25763 :
25764 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
25765 : discard_const_p(char *, kwnames),
25766 : &bigendian_obj,
25767 : &ndr64_obj)) {
25768 0 : return NULL;
25769 : }
25770 :
25771 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25772 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25773 : }
25774 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25775 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25776 : }
25777 :
25778 0 : return py_lsa_SetSecret_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
25779 : }
25780 :
25781 0 : static PyObject *py_lsa_SetSecret_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25782 : {
25783 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25784 0 : PyObject *bigendian_obj = NULL;
25785 0 : PyObject *ndr64_obj = NULL;
25786 0 : uint32_t ndr_push_flags = 0;
25787 :
25788 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
25789 : discard_const_p(char *, kwnames),
25790 : &bigendian_obj,
25791 : &ndr64_obj)) {
25792 0 : return NULL;
25793 : }
25794 :
25795 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25796 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25797 : }
25798 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25799 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25800 : }
25801 :
25802 0 : return py_lsa_SetSecret_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
25803 : }
25804 :
25805 0 : static PyObject *py_lsa_SetSecret_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
25806 : {
25807 0 : const struct ndr_interface_call *call = NULL;
25808 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25809 0 : struct ndr_pull *pull = NULL;
25810 : enum ndr_err_code err;
25811 :
25812 0 : if (ndr_table_lsarpc.num_calls < 30) {
25813 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecret_ndr_unpack");
25814 0 : return NULL;
25815 : }
25816 0 : call = &ndr_table_lsarpc.calls[29];
25817 :
25818 0 : pull = ndr_pull_init_blob(blob, object);
25819 0 : if (pull == NULL) {
25820 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25821 0 : return NULL;
25822 : }
25823 :
25824 0 : pull->flags |= ndr_pull_flags;
25825 :
25826 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
25827 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25828 0 : TALLOC_FREE(pull);
25829 0 : PyErr_SetNdrError(err);
25830 0 : return NULL;
25831 : }
25832 0 : if (!allow_remaining) {
25833 : uint32_t highest_ofs;
25834 :
25835 0 : if (pull->offset > pull->relative_highest_offset) {
25836 0 : highest_ofs = pull->offset;
25837 : } else {
25838 0 : highest_ofs = pull->relative_highest_offset;
25839 : }
25840 0 : if (highest_ofs < pull->data_size) {
25841 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
25842 : "not all bytes consumed ofs[%u] size[%u]",
25843 : highest_ofs, pull->data_size);
25844 0 : TALLOC_FREE(pull);
25845 0 : PyErr_SetNdrError(err);
25846 0 : return NULL;
25847 : }
25848 : }
25849 :
25850 0 : TALLOC_FREE(pull);
25851 0 : Py_RETURN_NONE;
25852 : }
25853 :
25854 0 : static PyObject *py_lsa_SetSecret_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25855 : {
25856 : DATA_BLOB blob;
25857 0 : Py_ssize_t blob_length = 0;
25858 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25859 0 : PyObject *bigendian_obj = NULL;
25860 0 : PyObject *ndr64_obj = NULL;
25861 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25862 0 : PyObject *allow_remaining_obj = NULL;
25863 0 : bool allow_remaining = false;
25864 :
25865 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
25866 : discard_const_p(char *, kwnames),
25867 : &blob.data, &blob_length,
25868 : &bigendian_obj,
25869 : &ndr64_obj,
25870 : &allow_remaining_obj)) {
25871 0 : return NULL;
25872 : }
25873 0 : blob.length = blob_length;
25874 :
25875 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25876 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25877 : }
25878 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25879 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25880 : }
25881 :
25882 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25883 0 : allow_remaining = true;
25884 : }
25885 :
25886 0 : return py_lsa_SetSecret_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
25887 : }
25888 :
25889 0 : static PyObject *py_lsa_SetSecret_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25890 : {
25891 : DATA_BLOB blob;
25892 0 : Py_ssize_t blob_length = 0;
25893 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25894 0 : PyObject *bigendian_obj = NULL;
25895 0 : PyObject *ndr64_obj = NULL;
25896 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25897 0 : PyObject *allow_remaining_obj = NULL;
25898 0 : bool allow_remaining = false;
25899 :
25900 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
25901 : discard_const_p(char *, kwnames),
25902 : &blob.data, &blob_length,
25903 : &bigendian_obj,
25904 : &ndr64_obj,
25905 : &allow_remaining_obj)) {
25906 0 : return NULL;
25907 : }
25908 0 : blob.length = blob_length;
25909 :
25910 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25911 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25912 : }
25913 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25914 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25915 : }
25916 :
25917 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25918 0 : allow_remaining = true;
25919 : }
25920 :
25921 0 : return py_lsa_SetSecret_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
25922 : }
25923 :
25924 0 : static PyObject *py_lsa_SetSecret_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
25925 : {
25926 0 : const struct ndr_interface_call *call = NULL;
25927 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25928 : PyObject *ret;
25929 : char *retstr;
25930 :
25931 0 : if (ndr_table_lsarpc.num_calls < 30) {
25932 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecret_ndr_print");
25933 0 : return NULL;
25934 : }
25935 0 : call = &ndr_table_lsarpc.calls[29];
25936 :
25937 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
25938 0 : ret = PyUnicode_FromString(retstr);
25939 0 : TALLOC_FREE(retstr);
25940 :
25941 0 : return ret;
25942 : }
25943 :
25944 0 : static PyObject *py_lsa_SetSecret_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25945 : {
25946 0 : return py_lsa_SetSecret_ndr_print(py_obj, "lsa_SetSecret_in", NDR_IN);
25947 : }
25948 :
25949 0 : static PyObject *py_lsa_SetSecret_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25950 : {
25951 0 : return py_lsa_SetSecret_ndr_print(py_obj, "lsa_SetSecret_out", NDR_OUT);
25952 : }
25953 :
25954 : static PyMethodDef py_lsa_SetSecret_methods[] = {
25955 : { "opnum", (PyCFunction)py_lsa_SetSecret_ndr_opnum, METH_NOARGS|METH_CLASS,
25956 : "lsa.SetSecret.opnum() -> 29 (0x1d) " },
25957 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecret_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
25958 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
25959 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecret_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
25960 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
25961 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecret_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
25962 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
25963 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecret_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
25964 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
25965 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetSecret_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
25966 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetSecret_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
25967 : { NULL, NULL, 0, NULL }
25968 : };
25969 :
25970 :
25971 : static PyTypeObject lsa_SetSecret_Type = {
25972 : PyVarObject_HEAD_INIT(NULL, 0)
25973 : .tp_name = "lsa.SetSecret",
25974 : .tp_getset = py_lsa_SetSecret_getsetters,
25975 : .tp_methods = py_lsa_SetSecret_methods,
25976 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25977 : .tp_new = py_lsa_SetSecret_new,
25978 : };
25979 :
25980 0 : static bool pack_py_lsa_SetSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSecret *r)
25981 : {
25982 : PyObject *py_sec_handle;
25983 : PyObject *py_new_val;
25984 : PyObject *py_old_val;
25985 0 : const char *kwnames[] = {
25986 : "sec_handle", "new_val", "old_val", NULL
25987 : };
25988 :
25989 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetSecret", discard_const_p(char *, kwnames), &py_sec_handle, &py_new_val, &py_old_val)) {
25990 0 : return false;
25991 : }
25992 :
25993 0 : if (py_sec_handle == NULL) {
25994 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sec_handle");
25995 0 : return false;
25996 : }
25997 0 : r->in.sec_handle = talloc_ptrtype(r, r->in.sec_handle);
25998 0 : if (r->in.sec_handle == NULL) {
25999 0 : PyErr_NoMemory();
26000 0 : return false;
26001 : }
26002 0 : PY_CHECK_TYPE(policy_handle_Type, py_sec_handle, return false;);
26003 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sec_handle)) == NULL) {
26004 0 : PyErr_NoMemory();
26005 0 : return false;
26006 : }
26007 0 : r->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(py_sec_handle);
26008 0 : if (py_new_val == NULL) {
26009 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_val");
26010 0 : return false;
26011 : }
26012 0 : if (py_new_val == Py_None) {
26013 0 : r->in.new_val = NULL;
26014 : } else {
26015 0 : r->in.new_val = NULL;
26016 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_new_val, return false;);
26017 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_val)) == NULL) {
26018 0 : PyErr_NoMemory();
26019 0 : return false;
26020 : }
26021 0 : r->in.new_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_new_val);
26022 : }
26023 0 : if (py_old_val == NULL) {
26024 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.old_val");
26025 0 : return false;
26026 : }
26027 0 : if (py_old_val == Py_None) {
26028 0 : r->in.old_val = NULL;
26029 : } else {
26030 0 : r->in.old_val = NULL;
26031 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_old_val, return false;);
26032 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_val)) == NULL) {
26033 0 : PyErr_NoMemory();
26034 0 : return false;
26035 : }
26036 0 : r->in.old_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_old_val);
26037 : }
26038 0 : return true;
26039 : }
26040 :
26041 0 : static PyObject *unpack_py_lsa_SetSecret_args_out(struct lsa_SetSecret *r)
26042 : {
26043 : PyObject *result;
26044 0 : result = Py_None;
26045 0 : Py_INCREF(result);
26046 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
26047 0 : PyErr_SetNTSTATUS(r->out.result);
26048 0 : return NULL;
26049 : }
26050 :
26051 0 : return result;
26052 : }
26053 :
26054 :
26055 0 : static PyObject *py_lsa_QuerySecret_in_get_sec_handle(PyObject *obj, void *closure)
26056 : {
26057 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26058 : PyObject *py_sec_handle;
26059 0 : if (object->in.sec_handle == NULL) {
26060 0 : Py_RETURN_NONE;
26061 : }
26062 0 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, object->in.sec_handle, object->in.sec_handle);
26063 0 : return py_sec_handle;
26064 : }
26065 :
26066 0 : static int py_lsa_QuerySecret_in_set_sec_handle(PyObject *py_obj, PyObject *value, void *closure)
26067 : {
26068 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26069 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sec_handle));
26070 0 : if (value == NULL) {
26071 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sec_handle");
26072 0 : return -1;
26073 : }
26074 0 : object->in.sec_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sec_handle);
26075 0 : if (object->in.sec_handle == NULL) {
26076 0 : PyErr_NoMemory();
26077 0 : return -1;
26078 : }
26079 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
26080 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26081 0 : PyErr_NoMemory();
26082 0 : return -1;
26083 : }
26084 0 : object->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(value);
26085 0 : return 0;
26086 : }
26087 :
26088 0 : static PyObject *py_lsa_QuerySecret_in_get_new_val(PyObject *obj, void *closure)
26089 : {
26090 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26091 : PyObject *py_new_val;
26092 0 : if (object->in.new_val == NULL) {
26093 0 : Py_RETURN_NONE;
26094 : }
26095 0 : if (object->in.new_val == NULL) {
26096 0 : py_new_val = Py_None;
26097 0 : Py_INCREF(py_new_val);
26098 : } else {
26099 0 : py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, object->in.new_val, object->in.new_val);
26100 : }
26101 0 : return py_new_val;
26102 : }
26103 :
26104 0 : static int py_lsa_QuerySecret_in_set_new_val(PyObject *py_obj, PyObject *value, void *closure)
26105 : {
26106 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26107 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_val));
26108 0 : if (value == NULL) {
26109 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_val");
26110 0 : return -1;
26111 : }
26112 0 : if (value == Py_None) {
26113 0 : object->in.new_val = NULL;
26114 : } else {
26115 0 : object->in.new_val = NULL;
26116 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, value, return -1;);
26117 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26118 0 : PyErr_NoMemory();
26119 0 : return -1;
26120 : }
26121 0 : object->in.new_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(value);
26122 : }
26123 0 : return 0;
26124 : }
26125 :
26126 0 : static PyObject *py_lsa_QuerySecret_out_get_new_val(PyObject *obj, void *closure)
26127 : {
26128 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26129 : PyObject *py_new_val;
26130 0 : if (object->out.new_val == NULL) {
26131 0 : Py_RETURN_NONE;
26132 : }
26133 0 : if (object->out.new_val == NULL) {
26134 0 : py_new_val = Py_None;
26135 0 : Py_INCREF(py_new_val);
26136 : } else {
26137 0 : py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, object->out.new_val, object->out.new_val);
26138 : }
26139 0 : return py_new_val;
26140 : }
26141 :
26142 0 : static int py_lsa_QuerySecret_out_set_new_val(PyObject *py_obj, PyObject *value, void *closure)
26143 : {
26144 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26145 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.new_val));
26146 0 : if (value == NULL) {
26147 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.new_val");
26148 0 : return -1;
26149 : }
26150 0 : if (value == Py_None) {
26151 0 : object->out.new_val = NULL;
26152 : } else {
26153 0 : object->out.new_val = NULL;
26154 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, value, return -1;);
26155 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26156 0 : PyErr_NoMemory();
26157 0 : return -1;
26158 : }
26159 0 : object->out.new_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(value);
26160 : }
26161 0 : return 0;
26162 : }
26163 :
26164 0 : static PyObject *py_lsa_QuerySecret_in_get_new_mtime(PyObject *obj, void *closure)
26165 : {
26166 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26167 : PyObject *py_new_mtime;
26168 0 : if (object->in.new_mtime == NULL) {
26169 0 : Py_RETURN_NONE;
26170 : }
26171 0 : if (object->in.new_mtime == NULL) {
26172 0 : py_new_mtime = Py_None;
26173 0 : Py_INCREF(py_new_mtime);
26174 : } else {
26175 0 : py_new_mtime = PyLong_FromUnsignedLongLong(*object->in.new_mtime);
26176 : }
26177 0 : return py_new_mtime;
26178 : }
26179 :
26180 0 : static int py_lsa_QuerySecret_in_set_new_mtime(PyObject *py_obj, PyObject *value, void *closure)
26181 : {
26182 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26183 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_mtime));
26184 0 : if (value == NULL) {
26185 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_mtime");
26186 0 : return -1;
26187 : }
26188 0 : if (value == Py_None) {
26189 0 : object->in.new_mtime = NULL;
26190 : } else {
26191 0 : object->in.new_mtime = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.new_mtime);
26192 0 : if (object->in.new_mtime == NULL) {
26193 0 : PyErr_NoMemory();
26194 0 : return -1;
26195 : }
26196 : {
26197 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.new_mtime));
26198 0 : if (PyLong_Check(value)) {
26199 : unsigned long long test_var;
26200 0 : test_var = PyLong_AsUnsignedLongLong(value);
26201 0 : if (PyErr_Occurred() != NULL) {
26202 0 : return -1;
26203 : }
26204 0 : if (test_var > uint_max) {
26205 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26206 : PyLong_Type.tp_name, uint_max, test_var);
26207 0 : return -1;
26208 : }
26209 0 : *object->in.new_mtime = test_var;
26210 : } else {
26211 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26212 : PyLong_Type.tp_name);
26213 0 : return -1;
26214 : }
26215 : }
26216 : }
26217 0 : return 0;
26218 : }
26219 :
26220 0 : static PyObject *py_lsa_QuerySecret_out_get_new_mtime(PyObject *obj, void *closure)
26221 : {
26222 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26223 : PyObject *py_new_mtime;
26224 0 : if (object->out.new_mtime == NULL) {
26225 0 : Py_RETURN_NONE;
26226 : }
26227 0 : if (object->out.new_mtime == NULL) {
26228 0 : py_new_mtime = Py_None;
26229 0 : Py_INCREF(py_new_mtime);
26230 : } else {
26231 0 : py_new_mtime = PyLong_FromUnsignedLongLong(*object->out.new_mtime);
26232 : }
26233 0 : return py_new_mtime;
26234 : }
26235 :
26236 0 : static int py_lsa_QuerySecret_out_set_new_mtime(PyObject *py_obj, PyObject *value, void *closure)
26237 : {
26238 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26239 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.new_mtime));
26240 0 : if (value == NULL) {
26241 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.new_mtime");
26242 0 : return -1;
26243 : }
26244 0 : if (value == Py_None) {
26245 0 : object->out.new_mtime = NULL;
26246 : } else {
26247 0 : object->out.new_mtime = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.new_mtime);
26248 0 : if (object->out.new_mtime == NULL) {
26249 0 : PyErr_NoMemory();
26250 0 : return -1;
26251 : }
26252 : {
26253 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.new_mtime));
26254 0 : if (PyLong_Check(value)) {
26255 : unsigned long long test_var;
26256 0 : test_var = PyLong_AsUnsignedLongLong(value);
26257 0 : if (PyErr_Occurred() != NULL) {
26258 0 : return -1;
26259 : }
26260 0 : if (test_var > uint_max) {
26261 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26262 : PyLong_Type.tp_name, uint_max, test_var);
26263 0 : return -1;
26264 : }
26265 0 : *object->out.new_mtime = test_var;
26266 : } else {
26267 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26268 : PyLong_Type.tp_name);
26269 0 : return -1;
26270 : }
26271 : }
26272 : }
26273 0 : return 0;
26274 : }
26275 :
26276 0 : static PyObject *py_lsa_QuerySecret_in_get_old_val(PyObject *obj, void *closure)
26277 : {
26278 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26279 : PyObject *py_old_val;
26280 0 : if (object->in.old_val == NULL) {
26281 0 : Py_RETURN_NONE;
26282 : }
26283 0 : if (object->in.old_val == NULL) {
26284 0 : py_old_val = Py_None;
26285 0 : Py_INCREF(py_old_val);
26286 : } else {
26287 0 : py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, object->in.old_val, object->in.old_val);
26288 : }
26289 0 : return py_old_val;
26290 : }
26291 :
26292 0 : static int py_lsa_QuerySecret_in_set_old_val(PyObject *py_obj, PyObject *value, void *closure)
26293 : {
26294 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26295 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.old_val));
26296 0 : if (value == NULL) {
26297 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.old_val");
26298 0 : return -1;
26299 : }
26300 0 : if (value == Py_None) {
26301 0 : object->in.old_val = NULL;
26302 : } else {
26303 0 : object->in.old_val = NULL;
26304 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, value, return -1;);
26305 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26306 0 : PyErr_NoMemory();
26307 0 : return -1;
26308 : }
26309 0 : object->in.old_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(value);
26310 : }
26311 0 : return 0;
26312 : }
26313 :
26314 0 : static PyObject *py_lsa_QuerySecret_out_get_old_val(PyObject *obj, void *closure)
26315 : {
26316 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26317 : PyObject *py_old_val;
26318 0 : if (object->out.old_val == NULL) {
26319 0 : Py_RETURN_NONE;
26320 : }
26321 0 : if (object->out.old_val == NULL) {
26322 0 : py_old_val = Py_None;
26323 0 : Py_INCREF(py_old_val);
26324 : } else {
26325 0 : py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, object->out.old_val, object->out.old_val);
26326 : }
26327 0 : return py_old_val;
26328 : }
26329 :
26330 0 : static int py_lsa_QuerySecret_out_set_old_val(PyObject *py_obj, PyObject *value, void *closure)
26331 : {
26332 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26333 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.old_val));
26334 0 : if (value == NULL) {
26335 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.old_val");
26336 0 : return -1;
26337 : }
26338 0 : if (value == Py_None) {
26339 0 : object->out.old_val = NULL;
26340 : } else {
26341 0 : object->out.old_val = NULL;
26342 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, value, return -1;);
26343 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26344 0 : PyErr_NoMemory();
26345 0 : return -1;
26346 : }
26347 0 : object->out.old_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(value);
26348 : }
26349 0 : return 0;
26350 : }
26351 :
26352 0 : static PyObject *py_lsa_QuerySecret_in_get_old_mtime(PyObject *obj, void *closure)
26353 : {
26354 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26355 : PyObject *py_old_mtime;
26356 0 : if (object->in.old_mtime == NULL) {
26357 0 : Py_RETURN_NONE;
26358 : }
26359 0 : if (object->in.old_mtime == NULL) {
26360 0 : py_old_mtime = Py_None;
26361 0 : Py_INCREF(py_old_mtime);
26362 : } else {
26363 0 : py_old_mtime = PyLong_FromUnsignedLongLong(*object->in.old_mtime);
26364 : }
26365 0 : return py_old_mtime;
26366 : }
26367 :
26368 0 : static int py_lsa_QuerySecret_in_set_old_mtime(PyObject *py_obj, PyObject *value, void *closure)
26369 : {
26370 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26371 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.old_mtime));
26372 0 : if (value == NULL) {
26373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.old_mtime");
26374 0 : return -1;
26375 : }
26376 0 : if (value == Py_None) {
26377 0 : object->in.old_mtime = NULL;
26378 : } else {
26379 0 : object->in.old_mtime = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.old_mtime);
26380 0 : if (object->in.old_mtime == NULL) {
26381 0 : PyErr_NoMemory();
26382 0 : return -1;
26383 : }
26384 : {
26385 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.old_mtime));
26386 0 : if (PyLong_Check(value)) {
26387 : unsigned long long test_var;
26388 0 : test_var = PyLong_AsUnsignedLongLong(value);
26389 0 : if (PyErr_Occurred() != NULL) {
26390 0 : return -1;
26391 : }
26392 0 : if (test_var > uint_max) {
26393 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26394 : PyLong_Type.tp_name, uint_max, test_var);
26395 0 : return -1;
26396 : }
26397 0 : *object->in.old_mtime = test_var;
26398 : } else {
26399 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26400 : PyLong_Type.tp_name);
26401 0 : return -1;
26402 : }
26403 : }
26404 : }
26405 0 : return 0;
26406 : }
26407 :
26408 0 : static PyObject *py_lsa_QuerySecret_out_get_old_mtime(PyObject *obj, void *closure)
26409 : {
26410 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26411 : PyObject *py_old_mtime;
26412 0 : if (object->out.old_mtime == NULL) {
26413 0 : Py_RETURN_NONE;
26414 : }
26415 0 : if (object->out.old_mtime == NULL) {
26416 0 : py_old_mtime = Py_None;
26417 0 : Py_INCREF(py_old_mtime);
26418 : } else {
26419 0 : py_old_mtime = PyLong_FromUnsignedLongLong(*object->out.old_mtime);
26420 : }
26421 0 : return py_old_mtime;
26422 : }
26423 :
26424 0 : static int py_lsa_QuerySecret_out_set_old_mtime(PyObject *py_obj, PyObject *value, void *closure)
26425 : {
26426 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26427 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.old_mtime));
26428 0 : if (value == NULL) {
26429 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.old_mtime");
26430 0 : return -1;
26431 : }
26432 0 : if (value == Py_None) {
26433 0 : object->out.old_mtime = NULL;
26434 : } else {
26435 0 : object->out.old_mtime = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.old_mtime);
26436 0 : if (object->out.old_mtime == NULL) {
26437 0 : PyErr_NoMemory();
26438 0 : return -1;
26439 : }
26440 : {
26441 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.old_mtime));
26442 0 : if (PyLong_Check(value)) {
26443 : unsigned long long test_var;
26444 0 : test_var = PyLong_AsUnsignedLongLong(value);
26445 0 : if (PyErr_Occurred() != NULL) {
26446 0 : return -1;
26447 : }
26448 0 : if (test_var > uint_max) {
26449 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26450 : PyLong_Type.tp_name, uint_max, test_var);
26451 0 : return -1;
26452 : }
26453 0 : *object->out.old_mtime = test_var;
26454 : } else {
26455 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26456 : PyLong_Type.tp_name);
26457 0 : return -1;
26458 : }
26459 : }
26460 : }
26461 0 : return 0;
26462 : }
26463 :
26464 0 : static PyObject *py_lsa_QuerySecret_get_result(PyObject *obj, void *closure)
26465 : {
26466 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26467 : PyObject *py_result;
26468 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
26469 0 : return py_result;
26470 : }
26471 :
26472 0 : static int py_lsa_QuerySecret_set_result(PyObject *py_obj, PyObject *value, void *closure)
26473 : {
26474 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26475 0 : if (value == NULL) {
26476 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
26477 0 : return -1;
26478 : }
26479 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
26480 0 : return 0;
26481 : }
26482 :
26483 : static PyGetSetDef py_lsa_QuerySecret_getsetters[] = {
26484 : {
26485 : .name = discard_const_p(char, "in_sec_handle"),
26486 : .get = py_lsa_QuerySecret_in_get_sec_handle,
26487 : .set = py_lsa_QuerySecret_in_set_sec_handle,
26488 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
26489 : },
26490 : {
26491 : .name = discard_const_p(char, "in_new_val"),
26492 : .get = py_lsa_QuerySecret_in_get_new_val,
26493 : .set = py_lsa_QuerySecret_in_set_new_val,
26494 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF_PTR")
26495 : },
26496 : {
26497 : .name = discard_const_p(char, "out_new_val"),
26498 : .get = py_lsa_QuerySecret_out_get_new_val,
26499 : .set = py_lsa_QuerySecret_out_set_new_val,
26500 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF_PTR")
26501 : },
26502 : {
26503 : .name = discard_const_p(char, "in_new_mtime"),
26504 : .get = py_lsa_QuerySecret_in_get_new_mtime,
26505 : .set = py_lsa_QuerySecret_in_set_new_mtime,
26506 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
26507 : },
26508 : {
26509 : .name = discard_const_p(char, "out_new_mtime"),
26510 : .get = py_lsa_QuerySecret_out_get_new_mtime,
26511 : .set = py_lsa_QuerySecret_out_set_new_mtime,
26512 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
26513 : },
26514 : {
26515 : .name = discard_const_p(char, "in_old_val"),
26516 : .get = py_lsa_QuerySecret_in_get_old_val,
26517 : .set = py_lsa_QuerySecret_in_set_old_val,
26518 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF_PTR")
26519 : },
26520 : {
26521 : .name = discard_const_p(char, "out_old_val"),
26522 : .get = py_lsa_QuerySecret_out_get_old_val,
26523 : .set = py_lsa_QuerySecret_out_set_old_val,
26524 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF_PTR")
26525 : },
26526 : {
26527 : .name = discard_const_p(char, "in_old_mtime"),
26528 : .get = py_lsa_QuerySecret_in_get_old_mtime,
26529 : .set = py_lsa_QuerySecret_in_set_old_mtime,
26530 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
26531 : },
26532 : {
26533 : .name = discard_const_p(char, "out_old_mtime"),
26534 : .get = py_lsa_QuerySecret_out_get_old_mtime,
26535 : .set = py_lsa_QuerySecret_out_set_old_mtime,
26536 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
26537 : },
26538 : {
26539 : .name = discard_const_p(char, "result"),
26540 : .get = py_lsa_QuerySecret_get_result,
26541 : .set = py_lsa_QuerySecret_set_result,
26542 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
26543 : },
26544 : { .name = NULL }
26545 : };
26546 :
26547 0 : static PyObject *py_lsa_QuerySecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
26548 : {
26549 0 : PyObject *self = pytalloc_new(struct lsa_QuerySecret, type);
26550 0 : struct lsa_QuerySecret *_self = (struct lsa_QuerySecret *)pytalloc_get_ptr(self);
26551 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
26552 0 : _self->in.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
26553 0 : return self;
26554 : }
26555 :
26556 0 : static PyObject *py_lsa_QuerySecret_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
26557 : {
26558 :
26559 :
26560 0 : return PyLong_FromLong(30);
26561 : }
26562 :
26563 0 : static PyObject *py_lsa_QuerySecret_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
26564 : {
26565 0 : const struct ndr_interface_call *call = NULL;
26566 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26567 0 : PyObject *ret = NULL;
26568 0 : struct ndr_push *push = NULL;
26569 : DATA_BLOB blob;
26570 : enum ndr_err_code err;
26571 :
26572 0 : if (ndr_table_lsarpc.num_calls < 31) {
26573 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecret_ndr_pack");
26574 0 : return NULL;
26575 : }
26576 0 : call = &ndr_table_lsarpc.calls[30];
26577 :
26578 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
26579 0 : if (push == NULL) {
26580 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26581 0 : return NULL;
26582 : }
26583 :
26584 0 : push->flags |= ndr_push_flags;
26585 :
26586 0 : err = call->ndr_push(push, ndr_inout_flags, object);
26587 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26588 0 : TALLOC_FREE(push);
26589 0 : PyErr_SetNdrError(err);
26590 0 : return NULL;
26591 : }
26592 0 : blob = ndr_push_blob(push);
26593 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
26594 0 : TALLOC_FREE(push);
26595 0 : return ret;
26596 : }
26597 :
26598 0 : static PyObject *py_lsa_QuerySecret_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26599 : {
26600 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26601 0 : PyObject *bigendian_obj = NULL;
26602 0 : PyObject *ndr64_obj = NULL;
26603 0 : uint32_t ndr_push_flags = 0;
26604 :
26605 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
26606 : discard_const_p(char *, kwnames),
26607 : &bigendian_obj,
26608 : &ndr64_obj)) {
26609 0 : return NULL;
26610 : }
26611 :
26612 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26613 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26614 : }
26615 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26616 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26617 : }
26618 :
26619 0 : return py_lsa_QuerySecret_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
26620 : }
26621 :
26622 0 : static PyObject *py_lsa_QuerySecret_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26623 : {
26624 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26625 0 : PyObject *bigendian_obj = NULL;
26626 0 : PyObject *ndr64_obj = NULL;
26627 0 : uint32_t ndr_push_flags = 0;
26628 :
26629 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
26630 : discard_const_p(char *, kwnames),
26631 : &bigendian_obj,
26632 : &ndr64_obj)) {
26633 0 : return NULL;
26634 : }
26635 :
26636 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26637 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26638 : }
26639 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26640 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26641 : }
26642 :
26643 0 : return py_lsa_QuerySecret_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
26644 : }
26645 :
26646 0 : static PyObject *py_lsa_QuerySecret_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
26647 : {
26648 0 : const struct ndr_interface_call *call = NULL;
26649 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26650 0 : struct ndr_pull *pull = NULL;
26651 : enum ndr_err_code err;
26652 :
26653 0 : if (ndr_table_lsarpc.num_calls < 31) {
26654 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecret_ndr_unpack");
26655 0 : return NULL;
26656 : }
26657 0 : call = &ndr_table_lsarpc.calls[30];
26658 :
26659 0 : pull = ndr_pull_init_blob(blob, object);
26660 0 : if (pull == NULL) {
26661 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26662 0 : return NULL;
26663 : }
26664 :
26665 0 : pull->flags |= ndr_pull_flags;
26666 :
26667 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
26668 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26669 0 : TALLOC_FREE(pull);
26670 0 : PyErr_SetNdrError(err);
26671 0 : return NULL;
26672 : }
26673 0 : if (!allow_remaining) {
26674 : uint32_t highest_ofs;
26675 :
26676 0 : if (pull->offset > pull->relative_highest_offset) {
26677 0 : highest_ofs = pull->offset;
26678 : } else {
26679 0 : highest_ofs = pull->relative_highest_offset;
26680 : }
26681 0 : if (highest_ofs < pull->data_size) {
26682 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
26683 : "not all bytes consumed ofs[%u] size[%u]",
26684 : highest_ofs, pull->data_size);
26685 0 : TALLOC_FREE(pull);
26686 0 : PyErr_SetNdrError(err);
26687 0 : return NULL;
26688 : }
26689 : }
26690 :
26691 0 : TALLOC_FREE(pull);
26692 0 : Py_RETURN_NONE;
26693 : }
26694 :
26695 0 : static PyObject *py_lsa_QuerySecret_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26696 : {
26697 : DATA_BLOB blob;
26698 0 : Py_ssize_t blob_length = 0;
26699 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26700 0 : PyObject *bigendian_obj = NULL;
26701 0 : PyObject *ndr64_obj = NULL;
26702 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26703 0 : PyObject *allow_remaining_obj = NULL;
26704 0 : bool allow_remaining = false;
26705 :
26706 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
26707 : discard_const_p(char *, kwnames),
26708 : &blob.data, &blob_length,
26709 : &bigendian_obj,
26710 : &ndr64_obj,
26711 : &allow_remaining_obj)) {
26712 0 : return NULL;
26713 : }
26714 0 : blob.length = blob_length;
26715 :
26716 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26717 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26718 : }
26719 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26720 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26721 : }
26722 :
26723 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26724 0 : allow_remaining = true;
26725 : }
26726 :
26727 0 : return py_lsa_QuerySecret_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
26728 : }
26729 :
26730 0 : static PyObject *py_lsa_QuerySecret_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26731 : {
26732 : DATA_BLOB blob;
26733 0 : Py_ssize_t blob_length = 0;
26734 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26735 0 : PyObject *bigendian_obj = NULL;
26736 0 : PyObject *ndr64_obj = NULL;
26737 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26738 0 : PyObject *allow_remaining_obj = NULL;
26739 0 : bool allow_remaining = false;
26740 :
26741 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
26742 : discard_const_p(char *, kwnames),
26743 : &blob.data, &blob_length,
26744 : &bigendian_obj,
26745 : &ndr64_obj,
26746 : &allow_remaining_obj)) {
26747 0 : return NULL;
26748 : }
26749 0 : blob.length = blob_length;
26750 :
26751 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26752 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26753 : }
26754 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26755 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26756 : }
26757 :
26758 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26759 0 : allow_remaining = true;
26760 : }
26761 :
26762 0 : return py_lsa_QuerySecret_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
26763 : }
26764 :
26765 0 : static PyObject *py_lsa_QuerySecret_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
26766 : {
26767 0 : const struct ndr_interface_call *call = NULL;
26768 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26769 : PyObject *ret;
26770 : char *retstr;
26771 :
26772 0 : if (ndr_table_lsarpc.num_calls < 31) {
26773 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecret_ndr_print");
26774 0 : return NULL;
26775 : }
26776 0 : call = &ndr_table_lsarpc.calls[30];
26777 :
26778 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
26779 0 : ret = PyUnicode_FromString(retstr);
26780 0 : TALLOC_FREE(retstr);
26781 :
26782 0 : return ret;
26783 : }
26784 :
26785 0 : static PyObject *py_lsa_QuerySecret_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26786 : {
26787 0 : return py_lsa_QuerySecret_ndr_print(py_obj, "lsa_QuerySecret_in", NDR_IN);
26788 : }
26789 :
26790 0 : static PyObject *py_lsa_QuerySecret_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26791 : {
26792 0 : return py_lsa_QuerySecret_ndr_print(py_obj, "lsa_QuerySecret_out", NDR_OUT);
26793 : }
26794 :
26795 : static PyMethodDef py_lsa_QuerySecret_methods[] = {
26796 : { "opnum", (PyCFunction)py_lsa_QuerySecret_ndr_opnum, METH_NOARGS|METH_CLASS,
26797 : "lsa.QuerySecret.opnum() -> 30 (0x1e) " },
26798 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecret_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
26799 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
26800 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecret_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
26801 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
26802 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecret_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
26803 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
26804 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecret_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
26805 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
26806 : { "__ndr_print_in__", (PyCFunction)py_lsa_QuerySecret_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
26807 : { "__ndr_print_out__", (PyCFunction)py_lsa_QuerySecret_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
26808 : { NULL, NULL, 0, NULL }
26809 : };
26810 :
26811 :
26812 : static PyTypeObject lsa_QuerySecret_Type = {
26813 : PyVarObject_HEAD_INIT(NULL, 0)
26814 : .tp_name = "lsa.QuerySecret",
26815 : .tp_getset = py_lsa_QuerySecret_getsetters,
26816 : .tp_methods = py_lsa_QuerySecret_methods,
26817 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
26818 : .tp_new = py_lsa_QuerySecret_new,
26819 : };
26820 :
26821 0 : static bool pack_py_lsa_QuerySecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_QuerySecret *r)
26822 : {
26823 : PyObject *py_sec_handle;
26824 : PyObject *py_new_val;
26825 : PyObject *py_new_mtime;
26826 : PyObject *py_old_val;
26827 : PyObject *py_old_mtime;
26828 0 : const char *kwnames[] = {
26829 : "sec_handle", "new_val", "new_mtime", "old_val", "old_mtime", NULL
26830 : };
26831 :
26832 0 : 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)) {
26833 0 : return false;
26834 : }
26835 :
26836 0 : if (py_sec_handle == NULL) {
26837 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sec_handle");
26838 0 : return false;
26839 : }
26840 0 : r->in.sec_handle = talloc_ptrtype(r, r->in.sec_handle);
26841 0 : if (r->in.sec_handle == NULL) {
26842 0 : PyErr_NoMemory();
26843 0 : return false;
26844 : }
26845 0 : PY_CHECK_TYPE(policy_handle_Type, py_sec_handle, return false;);
26846 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sec_handle)) == NULL) {
26847 0 : PyErr_NoMemory();
26848 0 : return false;
26849 : }
26850 0 : r->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(py_sec_handle);
26851 0 : if (py_new_val == NULL) {
26852 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_val");
26853 0 : return false;
26854 : }
26855 0 : if (py_new_val == Py_None) {
26856 0 : r->in.new_val = NULL;
26857 : } else {
26858 0 : r->in.new_val = NULL;
26859 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, py_new_val, return false;);
26860 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_val)) == NULL) {
26861 0 : PyErr_NoMemory();
26862 0 : return false;
26863 : }
26864 0 : r->in.new_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(py_new_val);
26865 : }
26866 0 : if (py_new_mtime == NULL) {
26867 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_mtime");
26868 0 : return false;
26869 : }
26870 0 : if (py_new_mtime == Py_None) {
26871 0 : r->in.new_mtime = NULL;
26872 : } else {
26873 0 : r->in.new_mtime = talloc_ptrtype(r, r->in.new_mtime);
26874 0 : if (r->in.new_mtime == NULL) {
26875 0 : PyErr_NoMemory();
26876 0 : return false;
26877 : }
26878 : {
26879 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.new_mtime));
26880 0 : if (PyLong_Check(py_new_mtime)) {
26881 : unsigned long long test_var;
26882 0 : test_var = PyLong_AsUnsignedLongLong(py_new_mtime);
26883 0 : if (PyErr_Occurred() != NULL) {
26884 0 : return false;
26885 : }
26886 0 : if (test_var > uint_max) {
26887 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26888 : PyLong_Type.tp_name, uint_max, test_var);
26889 0 : return false;
26890 : }
26891 0 : *r->in.new_mtime = test_var;
26892 : } else {
26893 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26894 : PyLong_Type.tp_name);
26895 0 : return false;
26896 : }
26897 : }
26898 : }
26899 0 : if (py_old_val == NULL) {
26900 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.old_val");
26901 0 : return false;
26902 : }
26903 0 : if (py_old_val == Py_None) {
26904 0 : r->in.old_val = NULL;
26905 : } else {
26906 0 : r->in.old_val = NULL;
26907 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, py_old_val, return false;);
26908 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_val)) == NULL) {
26909 0 : PyErr_NoMemory();
26910 0 : return false;
26911 : }
26912 0 : r->in.old_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(py_old_val);
26913 : }
26914 0 : if (py_old_mtime == NULL) {
26915 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.old_mtime");
26916 0 : return false;
26917 : }
26918 0 : if (py_old_mtime == Py_None) {
26919 0 : r->in.old_mtime = NULL;
26920 : } else {
26921 0 : r->in.old_mtime = talloc_ptrtype(r, r->in.old_mtime);
26922 0 : if (r->in.old_mtime == NULL) {
26923 0 : PyErr_NoMemory();
26924 0 : return false;
26925 : }
26926 : {
26927 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.old_mtime));
26928 0 : if (PyLong_Check(py_old_mtime)) {
26929 : unsigned long long test_var;
26930 0 : test_var = PyLong_AsUnsignedLongLong(py_old_mtime);
26931 0 : if (PyErr_Occurred() != NULL) {
26932 0 : return false;
26933 : }
26934 0 : if (test_var > uint_max) {
26935 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26936 : PyLong_Type.tp_name, uint_max, test_var);
26937 0 : return false;
26938 : }
26939 0 : *r->in.old_mtime = test_var;
26940 : } else {
26941 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26942 : PyLong_Type.tp_name);
26943 0 : return false;
26944 : }
26945 : }
26946 : }
26947 0 : return true;
26948 : }
26949 :
26950 0 : static PyObject *unpack_py_lsa_QuerySecret_args_out(struct lsa_QuerySecret *r)
26951 : {
26952 : PyObject *result;
26953 : PyObject *py_new_val;
26954 : PyObject *py_new_mtime;
26955 : PyObject *py_old_val;
26956 : PyObject *py_old_mtime;
26957 0 : result = PyTuple_New(4);
26958 0 : if (r->out.new_val == NULL) {
26959 0 : py_new_val = Py_None;
26960 0 : Py_INCREF(py_new_val);
26961 : } else {
26962 0 : py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, r->out.new_val, r->out.new_val);
26963 : }
26964 0 : PyTuple_SetItem(result, 0, py_new_val);
26965 0 : if (r->out.new_mtime == NULL) {
26966 0 : py_new_mtime = Py_None;
26967 0 : Py_INCREF(py_new_mtime);
26968 : } else {
26969 0 : py_new_mtime = PyLong_FromUnsignedLongLong(*r->out.new_mtime);
26970 : }
26971 0 : PyTuple_SetItem(result, 1, py_new_mtime);
26972 0 : if (r->out.old_val == NULL) {
26973 0 : py_old_val = Py_None;
26974 0 : Py_INCREF(py_old_val);
26975 : } else {
26976 0 : py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, r->out.old_val, r->out.old_val);
26977 : }
26978 0 : PyTuple_SetItem(result, 2, py_old_val);
26979 0 : if (r->out.old_mtime == NULL) {
26980 0 : py_old_mtime = Py_None;
26981 0 : Py_INCREF(py_old_mtime);
26982 : } else {
26983 0 : py_old_mtime = PyLong_FromUnsignedLongLong(*r->out.old_mtime);
26984 : }
26985 0 : PyTuple_SetItem(result, 3, py_old_mtime);
26986 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
26987 0 : PyErr_SetNTSTATUS(r->out.result);
26988 0 : return NULL;
26989 : }
26990 :
26991 0 : return result;
26992 : }
26993 :
26994 :
26995 0 : static PyObject *py_lsa_LookupPrivValue_in_get_handle(PyObject *obj, void *closure)
26996 : {
26997 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(obj);
26998 : PyObject *py_handle;
26999 0 : if (object->in.handle == NULL) {
27000 0 : Py_RETURN_NONE;
27001 : }
27002 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
27003 0 : return py_handle;
27004 : }
27005 :
27006 0 : static int py_lsa_LookupPrivValue_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
27007 : {
27008 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27009 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
27010 0 : if (value == NULL) {
27011 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
27012 0 : return -1;
27013 : }
27014 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
27015 0 : if (object->in.handle == NULL) {
27016 0 : PyErr_NoMemory();
27017 0 : return -1;
27018 : }
27019 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
27020 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27021 0 : PyErr_NoMemory();
27022 0 : return -1;
27023 : }
27024 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
27025 0 : return 0;
27026 : }
27027 :
27028 0 : static PyObject *py_lsa_LookupPrivValue_in_get_name(PyObject *obj, void *closure)
27029 : {
27030 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(obj);
27031 : PyObject *py_name;
27032 0 : if (object->in.name == NULL) {
27033 0 : Py_RETURN_NONE;
27034 : }
27035 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
27036 0 : return py_name;
27037 : }
27038 :
27039 0 : static int py_lsa_LookupPrivValue_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
27040 : {
27041 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27042 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
27043 0 : if (value == NULL) {
27044 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
27045 0 : return -1;
27046 : }
27047 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
27048 0 : if (object->in.name == NULL) {
27049 0 : PyErr_NoMemory();
27050 0 : return -1;
27051 : }
27052 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
27053 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27054 0 : PyErr_NoMemory();
27055 0 : return -1;
27056 : }
27057 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
27058 0 : return 0;
27059 : }
27060 :
27061 0 : static PyObject *py_lsa_LookupPrivValue_out_get_luid(PyObject *obj, void *closure)
27062 : {
27063 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(obj);
27064 : PyObject *py_luid;
27065 0 : if (object->out.luid == NULL) {
27066 0 : Py_RETURN_NONE;
27067 : }
27068 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, object->out.luid, object->out.luid);
27069 0 : return py_luid;
27070 : }
27071 :
27072 0 : static int py_lsa_LookupPrivValue_out_set_luid(PyObject *py_obj, PyObject *value, void *closure)
27073 : {
27074 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27075 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.luid));
27076 0 : if (value == NULL) {
27077 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.luid");
27078 0 : return -1;
27079 : }
27080 0 : object->out.luid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.luid);
27081 0 : if (object->out.luid == NULL) {
27082 0 : PyErr_NoMemory();
27083 0 : return -1;
27084 : }
27085 0 : PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
27086 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27087 0 : PyErr_NoMemory();
27088 0 : return -1;
27089 : }
27090 0 : object->out.luid = (struct lsa_LUID *)pytalloc_get_ptr(value);
27091 0 : return 0;
27092 : }
27093 :
27094 0 : static PyObject *py_lsa_LookupPrivValue_get_result(PyObject *obj, void *closure)
27095 : {
27096 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(obj);
27097 : PyObject *py_result;
27098 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
27099 0 : return py_result;
27100 : }
27101 :
27102 0 : static int py_lsa_LookupPrivValue_set_result(PyObject *py_obj, PyObject *value, void *closure)
27103 : {
27104 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27105 0 : if (value == NULL) {
27106 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
27107 0 : return -1;
27108 : }
27109 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
27110 0 : return 0;
27111 : }
27112 :
27113 : static PyGetSetDef py_lsa_LookupPrivValue_getsetters[] = {
27114 : {
27115 : .name = discard_const_p(char, "in_handle"),
27116 : .get = py_lsa_LookupPrivValue_in_get_handle,
27117 : .set = py_lsa_LookupPrivValue_in_set_handle,
27118 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
27119 : },
27120 : {
27121 : .name = discard_const_p(char, "in_name"),
27122 : .get = py_lsa_LookupPrivValue_in_get_name,
27123 : .set = py_lsa_LookupPrivValue_in_set_name,
27124 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
27125 : },
27126 : {
27127 : .name = discard_const_p(char, "out_luid"),
27128 : .get = py_lsa_LookupPrivValue_out_get_luid,
27129 : .set = py_lsa_LookupPrivValue_out_set_luid,
27130 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUID")
27131 : },
27132 : {
27133 : .name = discard_const_p(char, "result"),
27134 : .get = py_lsa_LookupPrivValue_get_result,
27135 : .set = py_lsa_LookupPrivValue_set_result,
27136 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
27137 : },
27138 : { .name = NULL }
27139 : };
27140 :
27141 0 : static PyObject *py_lsa_LookupPrivValue_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
27142 : {
27143 0 : PyObject *self = pytalloc_new(struct lsa_LookupPrivValue, type);
27144 0 : struct lsa_LookupPrivValue *_self = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(self);
27145 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
27146 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
27147 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
27148 0 : _self->out.luid = talloc_zero(mem_ctx, struct lsa_LUID);
27149 0 : return self;
27150 : }
27151 :
27152 0 : static PyObject *py_lsa_LookupPrivValue_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
27153 : {
27154 :
27155 :
27156 0 : return PyLong_FromLong(31);
27157 : }
27158 :
27159 0 : static PyObject *py_lsa_LookupPrivValue_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
27160 : {
27161 0 : const struct ndr_interface_call *call = NULL;
27162 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27163 0 : PyObject *ret = NULL;
27164 0 : struct ndr_push *push = NULL;
27165 : DATA_BLOB blob;
27166 : enum ndr_err_code err;
27167 :
27168 0 : if (ndr_table_lsarpc.num_calls < 32) {
27169 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivValue_ndr_pack");
27170 0 : return NULL;
27171 : }
27172 0 : call = &ndr_table_lsarpc.calls[31];
27173 :
27174 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
27175 0 : if (push == NULL) {
27176 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27177 0 : return NULL;
27178 : }
27179 :
27180 0 : push->flags |= ndr_push_flags;
27181 :
27182 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27183 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27184 0 : TALLOC_FREE(push);
27185 0 : PyErr_SetNdrError(err);
27186 0 : return NULL;
27187 : }
27188 0 : blob = ndr_push_blob(push);
27189 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27190 0 : TALLOC_FREE(push);
27191 0 : return ret;
27192 : }
27193 :
27194 0 : static PyObject *py_lsa_LookupPrivValue_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27195 : {
27196 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27197 0 : PyObject *bigendian_obj = NULL;
27198 0 : PyObject *ndr64_obj = NULL;
27199 0 : uint32_t ndr_push_flags = 0;
27200 :
27201 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27202 : discard_const_p(char *, kwnames),
27203 : &bigendian_obj,
27204 : &ndr64_obj)) {
27205 0 : return NULL;
27206 : }
27207 :
27208 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27209 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27210 : }
27211 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27212 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27213 : }
27214 :
27215 0 : return py_lsa_LookupPrivValue_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
27216 : }
27217 :
27218 0 : static PyObject *py_lsa_LookupPrivValue_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27219 : {
27220 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27221 0 : PyObject *bigendian_obj = NULL;
27222 0 : PyObject *ndr64_obj = NULL;
27223 0 : uint32_t ndr_push_flags = 0;
27224 :
27225 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
27226 : discard_const_p(char *, kwnames),
27227 : &bigendian_obj,
27228 : &ndr64_obj)) {
27229 0 : return NULL;
27230 : }
27231 :
27232 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27233 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27234 : }
27235 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27236 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27237 : }
27238 :
27239 0 : return py_lsa_LookupPrivValue_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
27240 : }
27241 :
27242 0 : static PyObject *py_lsa_LookupPrivValue_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
27243 : {
27244 0 : const struct ndr_interface_call *call = NULL;
27245 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27246 0 : struct ndr_pull *pull = NULL;
27247 : enum ndr_err_code err;
27248 :
27249 0 : if (ndr_table_lsarpc.num_calls < 32) {
27250 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivValue_ndr_unpack");
27251 0 : return NULL;
27252 : }
27253 0 : call = &ndr_table_lsarpc.calls[31];
27254 :
27255 0 : pull = ndr_pull_init_blob(blob, object);
27256 0 : if (pull == NULL) {
27257 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27258 0 : return NULL;
27259 : }
27260 :
27261 0 : pull->flags |= ndr_pull_flags;
27262 :
27263 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
27264 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27265 0 : TALLOC_FREE(pull);
27266 0 : PyErr_SetNdrError(err);
27267 0 : return NULL;
27268 : }
27269 0 : if (!allow_remaining) {
27270 : uint32_t highest_ofs;
27271 :
27272 0 : if (pull->offset > pull->relative_highest_offset) {
27273 0 : highest_ofs = pull->offset;
27274 : } else {
27275 0 : highest_ofs = pull->relative_highest_offset;
27276 : }
27277 0 : if (highest_ofs < pull->data_size) {
27278 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
27279 : "not all bytes consumed ofs[%u] size[%u]",
27280 : highest_ofs, pull->data_size);
27281 0 : TALLOC_FREE(pull);
27282 0 : PyErr_SetNdrError(err);
27283 0 : return NULL;
27284 : }
27285 : }
27286 :
27287 0 : TALLOC_FREE(pull);
27288 0 : Py_RETURN_NONE;
27289 : }
27290 :
27291 0 : static PyObject *py_lsa_LookupPrivValue_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27292 : {
27293 : DATA_BLOB blob;
27294 0 : Py_ssize_t blob_length = 0;
27295 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27296 0 : PyObject *bigendian_obj = NULL;
27297 0 : PyObject *ndr64_obj = NULL;
27298 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27299 0 : PyObject *allow_remaining_obj = NULL;
27300 0 : bool allow_remaining = false;
27301 :
27302 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
27303 : discard_const_p(char *, kwnames),
27304 : &blob.data, &blob_length,
27305 : &bigendian_obj,
27306 : &ndr64_obj,
27307 : &allow_remaining_obj)) {
27308 0 : return NULL;
27309 : }
27310 0 : blob.length = blob_length;
27311 :
27312 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27313 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27314 : }
27315 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27316 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27317 : }
27318 :
27319 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27320 0 : allow_remaining = true;
27321 : }
27322 :
27323 0 : return py_lsa_LookupPrivValue_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
27324 : }
27325 :
27326 0 : static PyObject *py_lsa_LookupPrivValue_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27327 : {
27328 : DATA_BLOB blob;
27329 0 : Py_ssize_t blob_length = 0;
27330 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27331 0 : PyObject *bigendian_obj = NULL;
27332 0 : PyObject *ndr64_obj = NULL;
27333 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27334 0 : PyObject *allow_remaining_obj = NULL;
27335 0 : bool allow_remaining = false;
27336 :
27337 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
27338 : discard_const_p(char *, kwnames),
27339 : &blob.data, &blob_length,
27340 : &bigendian_obj,
27341 : &ndr64_obj,
27342 : &allow_remaining_obj)) {
27343 0 : return NULL;
27344 : }
27345 0 : blob.length = blob_length;
27346 :
27347 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27348 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27349 : }
27350 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27351 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27352 : }
27353 :
27354 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27355 0 : allow_remaining = true;
27356 : }
27357 :
27358 0 : return py_lsa_LookupPrivValue_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
27359 : }
27360 :
27361 0 : static PyObject *py_lsa_LookupPrivValue_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
27362 : {
27363 0 : const struct ndr_interface_call *call = NULL;
27364 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27365 : PyObject *ret;
27366 : char *retstr;
27367 :
27368 0 : if (ndr_table_lsarpc.num_calls < 32) {
27369 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivValue_ndr_print");
27370 0 : return NULL;
27371 : }
27372 0 : call = &ndr_table_lsarpc.calls[31];
27373 :
27374 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
27375 0 : ret = PyUnicode_FromString(retstr);
27376 0 : TALLOC_FREE(retstr);
27377 :
27378 0 : return ret;
27379 : }
27380 :
27381 0 : static PyObject *py_lsa_LookupPrivValue_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27382 : {
27383 0 : return py_lsa_LookupPrivValue_ndr_print(py_obj, "lsa_LookupPrivValue_in", NDR_IN);
27384 : }
27385 :
27386 0 : static PyObject *py_lsa_LookupPrivValue_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27387 : {
27388 0 : return py_lsa_LookupPrivValue_ndr_print(py_obj, "lsa_LookupPrivValue_out", NDR_OUT);
27389 : }
27390 :
27391 : static PyMethodDef py_lsa_LookupPrivValue_methods[] = {
27392 : { "opnum", (PyCFunction)py_lsa_LookupPrivValue_ndr_opnum, METH_NOARGS|METH_CLASS,
27393 : "lsa.LookupPrivValue.opnum() -> 31 (0x1f) " },
27394 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivValue_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
27395 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
27396 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivValue_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
27397 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
27398 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivValue_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
27399 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
27400 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivValue_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
27401 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
27402 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupPrivValue_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
27403 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupPrivValue_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
27404 : { NULL, NULL, 0, NULL }
27405 : };
27406 :
27407 :
27408 : static PyTypeObject lsa_LookupPrivValue_Type = {
27409 : PyVarObject_HEAD_INIT(NULL, 0)
27410 : .tp_name = "lsa.LookupPrivValue",
27411 : .tp_getset = py_lsa_LookupPrivValue_getsetters,
27412 : .tp_methods = py_lsa_LookupPrivValue_methods,
27413 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
27414 : .tp_new = py_lsa_LookupPrivValue_new,
27415 : };
27416 :
27417 0 : static bool pack_py_lsa_LookupPrivValue_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivValue *r)
27418 : {
27419 : PyObject *py_handle;
27420 : PyObject *py_name;
27421 0 : const char *kwnames[] = {
27422 : "handle", "name", NULL
27423 : };
27424 :
27425 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_LookupPrivValue", discard_const_p(char *, kwnames), &py_handle, &py_name)) {
27426 0 : return false;
27427 : }
27428 :
27429 0 : if (py_handle == NULL) {
27430 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
27431 0 : return false;
27432 : }
27433 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
27434 0 : if (r->in.handle == NULL) {
27435 0 : PyErr_NoMemory();
27436 0 : return false;
27437 : }
27438 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
27439 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
27440 0 : PyErr_NoMemory();
27441 0 : return false;
27442 : }
27443 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
27444 0 : if (py_name == NULL) {
27445 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
27446 0 : return false;
27447 : }
27448 0 : r->in.name = talloc_ptrtype(r, r->in.name);
27449 0 : if (r->in.name == NULL) {
27450 0 : PyErr_NoMemory();
27451 0 : return false;
27452 : }
27453 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
27454 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
27455 0 : PyErr_NoMemory();
27456 0 : return false;
27457 : }
27458 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
27459 0 : return true;
27460 : }
27461 :
27462 0 : static PyObject *unpack_py_lsa_LookupPrivValue_args_out(struct lsa_LookupPrivValue *r)
27463 : {
27464 : PyObject *result;
27465 : PyObject *py_luid;
27466 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, r->out.luid, r->out.luid);
27467 0 : result = py_luid;
27468 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
27469 0 : PyErr_SetNTSTATUS(r->out.result);
27470 0 : return NULL;
27471 : }
27472 :
27473 0 : return result;
27474 : }
27475 :
27476 :
27477 0 : static PyObject *py_lsa_LookupPrivName_in_get_handle(PyObject *obj, void *closure)
27478 : {
27479 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(obj);
27480 : PyObject *py_handle;
27481 0 : if (object->in.handle == NULL) {
27482 0 : Py_RETURN_NONE;
27483 : }
27484 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
27485 0 : return py_handle;
27486 : }
27487 :
27488 0 : static int py_lsa_LookupPrivName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
27489 : {
27490 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27491 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
27492 0 : if (value == NULL) {
27493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
27494 0 : return -1;
27495 : }
27496 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
27497 0 : if (object->in.handle == NULL) {
27498 0 : PyErr_NoMemory();
27499 0 : return -1;
27500 : }
27501 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
27502 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27503 0 : PyErr_NoMemory();
27504 0 : return -1;
27505 : }
27506 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
27507 0 : return 0;
27508 : }
27509 :
27510 0 : static PyObject *py_lsa_LookupPrivName_in_get_luid(PyObject *obj, void *closure)
27511 : {
27512 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(obj);
27513 : PyObject *py_luid;
27514 0 : if (object->in.luid == NULL) {
27515 0 : Py_RETURN_NONE;
27516 : }
27517 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, object->in.luid, object->in.luid);
27518 0 : return py_luid;
27519 : }
27520 :
27521 0 : static int py_lsa_LookupPrivName_in_set_luid(PyObject *py_obj, PyObject *value, void *closure)
27522 : {
27523 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27524 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.luid));
27525 0 : if (value == NULL) {
27526 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.luid");
27527 0 : return -1;
27528 : }
27529 0 : object->in.luid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.luid);
27530 0 : if (object->in.luid == NULL) {
27531 0 : PyErr_NoMemory();
27532 0 : return -1;
27533 : }
27534 0 : PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
27535 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27536 0 : PyErr_NoMemory();
27537 0 : return -1;
27538 : }
27539 0 : object->in.luid = (struct lsa_LUID *)pytalloc_get_ptr(value);
27540 0 : return 0;
27541 : }
27542 :
27543 0 : static PyObject *py_lsa_LookupPrivName_out_get_name(PyObject *obj, void *closure)
27544 : {
27545 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(obj);
27546 : PyObject *py_name;
27547 0 : if (object->out.name == NULL) {
27548 0 : Py_RETURN_NONE;
27549 : }
27550 0 : if (*object->out.name == NULL) {
27551 0 : py_name = Py_None;
27552 0 : Py_INCREF(py_name);
27553 : } else {
27554 0 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *object->out.name, *object->out.name);
27555 : }
27556 0 : return py_name;
27557 : }
27558 :
27559 0 : static int py_lsa_LookupPrivName_out_set_name(PyObject *py_obj, PyObject *value, void *closure)
27560 : {
27561 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27562 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.name));
27563 0 : if (value == NULL) {
27564 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.name");
27565 0 : return -1;
27566 : }
27567 0 : object->out.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.name);
27568 0 : if (object->out.name == NULL) {
27569 0 : PyErr_NoMemory();
27570 0 : return -1;
27571 : }
27572 0 : if (value == Py_None) {
27573 0 : *object->out.name = NULL;
27574 : } else {
27575 0 : *object->out.name = NULL;
27576 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
27577 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27578 0 : PyErr_NoMemory();
27579 0 : return -1;
27580 : }
27581 0 : *object->out.name = (struct lsa_StringLarge *)pytalloc_get_ptr(value);
27582 : }
27583 0 : return 0;
27584 : }
27585 :
27586 0 : static PyObject *py_lsa_LookupPrivName_get_result(PyObject *obj, void *closure)
27587 : {
27588 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(obj);
27589 : PyObject *py_result;
27590 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
27591 0 : return py_result;
27592 : }
27593 :
27594 0 : static int py_lsa_LookupPrivName_set_result(PyObject *py_obj, PyObject *value, void *closure)
27595 : {
27596 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27597 0 : if (value == NULL) {
27598 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
27599 0 : return -1;
27600 : }
27601 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
27602 0 : return 0;
27603 : }
27604 :
27605 : static PyGetSetDef py_lsa_LookupPrivName_getsetters[] = {
27606 : {
27607 : .name = discard_const_p(char, "in_handle"),
27608 : .get = py_lsa_LookupPrivName_in_get_handle,
27609 : .set = py_lsa_LookupPrivName_in_set_handle,
27610 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
27611 : },
27612 : {
27613 : .name = discard_const_p(char, "in_luid"),
27614 : .get = py_lsa_LookupPrivName_in_get_luid,
27615 : .set = py_lsa_LookupPrivName_in_set_luid,
27616 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUID")
27617 : },
27618 : {
27619 : .name = discard_const_p(char, "out_name"),
27620 : .get = py_lsa_LookupPrivName_out_get_name,
27621 : .set = py_lsa_LookupPrivName_out_set_name,
27622 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
27623 : },
27624 : {
27625 : .name = discard_const_p(char, "result"),
27626 : .get = py_lsa_LookupPrivName_get_result,
27627 : .set = py_lsa_LookupPrivName_set_result,
27628 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
27629 : },
27630 : { .name = NULL }
27631 : };
27632 :
27633 0 : static PyObject *py_lsa_LookupPrivName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
27634 : {
27635 0 : PyObject *self = pytalloc_new(struct lsa_LookupPrivName, type);
27636 0 : struct lsa_LookupPrivName *_self = (struct lsa_LookupPrivName *)pytalloc_get_ptr(self);
27637 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
27638 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
27639 0 : _self->in.luid = talloc_zero(mem_ctx, struct lsa_LUID);
27640 : /* a pointer to a NULL pointer */
27641 0 : _self->out.name = talloc_zero(mem_ctx, struct lsa_StringLarge *);
27642 0 : return self;
27643 : }
27644 :
27645 0 : static PyObject *py_lsa_LookupPrivName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
27646 : {
27647 :
27648 :
27649 0 : return PyLong_FromLong(32);
27650 : }
27651 :
27652 0 : static PyObject *py_lsa_LookupPrivName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
27653 : {
27654 0 : const struct ndr_interface_call *call = NULL;
27655 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27656 0 : PyObject *ret = NULL;
27657 0 : struct ndr_push *push = NULL;
27658 : DATA_BLOB blob;
27659 : enum ndr_err_code err;
27660 :
27661 0 : if (ndr_table_lsarpc.num_calls < 33) {
27662 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivName_ndr_pack");
27663 0 : return NULL;
27664 : }
27665 0 : call = &ndr_table_lsarpc.calls[32];
27666 :
27667 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
27668 0 : if (push == NULL) {
27669 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27670 0 : return NULL;
27671 : }
27672 :
27673 0 : push->flags |= ndr_push_flags;
27674 :
27675 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27676 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27677 0 : TALLOC_FREE(push);
27678 0 : PyErr_SetNdrError(err);
27679 0 : return NULL;
27680 : }
27681 0 : blob = ndr_push_blob(push);
27682 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27683 0 : TALLOC_FREE(push);
27684 0 : return ret;
27685 : }
27686 :
27687 0 : static PyObject *py_lsa_LookupPrivName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27688 : {
27689 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27690 0 : PyObject *bigendian_obj = NULL;
27691 0 : PyObject *ndr64_obj = NULL;
27692 0 : uint32_t ndr_push_flags = 0;
27693 :
27694 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27695 : discard_const_p(char *, kwnames),
27696 : &bigendian_obj,
27697 : &ndr64_obj)) {
27698 0 : return NULL;
27699 : }
27700 :
27701 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27702 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27703 : }
27704 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27705 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27706 : }
27707 :
27708 0 : return py_lsa_LookupPrivName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
27709 : }
27710 :
27711 0 : static PyObject *py_lsa_LookupPrivName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27712 : {
27713 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27714 0 : PyObject *bigendian_obj = NULL;
27715 0 : PyObject *ndr64_obj = NULL;
27716 0 : uint32_t ndr_push_flags = 0;
27717 :
27718 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
27719 : discard_const_p(char *, kwnames),
27720 : &bigendian_obj,
27721 : &ndr64_obj)) {
27722 0 : return NULL;
27723 : }
27724 :
27725 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27726 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27727 : }
27728 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27729 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27730 : }
27731 :
27732 0 : return py_lsa_LookupPrivName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
27733 : }
27734 :
27735 0 : static PyObject *py_lsa_LookupPrivName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
27736 : {
27737 0 : const struct ndr_interface_call *call = NULL;
27738 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27739 0 : struct ndr_pull *pull = NULL;
27740 : enum ndr_err_code err;
27741 :
27742 0 : if (ndr_table_lsarpc.num_calls < 33) {
27743 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivName_ndr_unpack");
27744 0 : return NULL;
27745 : }
27746 0 : call = &ndr_table_lsarpc.calls[32];
27747 :
27748 0 : pull = ndr_pull_init_blob(blob, object);
27749 0 : if (pull == NULL) {
27750 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27751 0 : return NULL;
27752 : }
27753 :
27754 0 : pull->flags |= ndr_pull_flags;
27755 :
27756 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
27757 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27758 0 : TALLOC_FREE(pull);
27759 0 : PyErr_SetNdrError(err);
27760 0 : return NULL;
27761 : }
27762 0 : if (!allow_remaining) {
27763 : uint32_t highest_ofs;
27764 :
27765 0 : if (pull->offset > pull->relative_highest_offset) {
27766 0 : highest_ofs = pull->offset;
27767 : } else {
27768 0 : highest_ofs = pull->relative_highest_offset;
27769 : }
27770 0 : if (highest_ofs < pull->data_size) {
27771 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
27772 : "not all bytes consumed ofs[%u] size[%u]",
27773 : highest_ofs, pull->data_size);
27774 0 : TALLOC_FREE(pull);
27775 0 : PyErr_SetNdrError(err);
27776 0 : return NULL;
27777 : }
27778 : }
27779 :
27780 0 : TALLOC_FREE(pull);
27781 0 : Py_RETURN_NONE;
27782 : }
27783 :
27784 0 : static PyObject *py_lsa_LookupPrivName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27785 : {
27786 : DATA_BLOB blob;
27787 0 : Py_ssize_t blob_length = 0;
27788 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27789 0 : PyObject *bigendian_obj = NULL;
27790 0 : PyObject *ndr64_obj = NULL;
27791 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27792 0 : PyObject *allow_remaining_obj = NULL;
27793 0 : bool allow_remaining = false;
27794 :
27795 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
27796 : discard_const_p(char *, kwnames),
27797 : &blob.data, &blob_length,
27798 : &bigendian_obj,
27799 : &ndr64_obj,
27800 : &allow_remaining_obj)) {
27801 0 : return NULL;
27802 : }
27803 0 : blob.length = blob_length;
27804 :
27805 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27806 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27807 : }
27808 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27809 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27810 : }
27811 :
27812 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27813 0 : allow_remaining = true;
27814 : }
27815 :
27816 0 : return py_lsa_LookupPrivName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
27817 : }
27818 :
27819 0 : static PyObject *py_lsa_LookupPrivName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27820 : {
27821 : DATA_BLOB blob;
27822 0 : Py_ssize_t blob_length = 0;
27823 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27824 0 : PyObject *bigendian_obj = NULL;
27825 0 : PyObject *ndr64_obj = NULL;
27826 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27827 0 : PyObject *allow_remaining_obj = NULL;
27828 0 : bool allow_remaining = false;
27829 :
27830 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
27831 : discard_const_p(char *, kwnames),
27832 : &blob.data, &blob_length,
27833 : &bigendian_obj,
27834 : &ndr64_obj,
27835 : &allow_remaining_obj)) {
27836 0 : return NULL;
27837 : }
27838 0 : blob.length = blob_length;
27839 :
27840 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27841 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27842 : }
27843 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27844 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27845 : }
27846 :
27847 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27848 0 : allow_remaining = true;
27849 : }
27850 :
27851 0 : return py_lsa_LookupPrivName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
27852 : }
27853 :
27854 0 : static PyObject *py_lsa_LookupPrivName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
27855 : {
27856 0 : const struct ndr_interface_call *call = NULL;
27857 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27858 : PyObject *ret;
27859 : char *retstr;
27860 :
27861 0 : if (ndr_table_lsarpc.num_calls < 33) {
27862 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivName_ndr_print");
27863 0 : return NULL;
27864 : }
27865 0 : call = &ndr_table_lsarpc.calls[32];
27866 :
27867 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
27868 0 : ret = PyUnicode_FromString(retstr);
27869 0 : TALLOC_FREE(retstr);
27870 :
27871 0 : return ret;
27872 : }
27873 :
27874 0 : static PyObject *py_lsa_LookupPrivName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27875 : {
27876 0 : return py_lsa_LookupPrivName_ndr_print(py_obj, "lsa_LookupPrivName_in", NDR_IN);
27877 : }
27878 :
27879 0 : static PyObject *py_lsa_LookupPrivName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27880 : {
27881 0 : return py_lsa_LookupPrivName_ndr_print(py_obj, "lsa_LookupPrivName_out", NDR_OUT);
27882 : }
27883 :
27884 : static PyMethodDef py_lsa_LookupPrivName_methods[] = {
27885 : { "opnum", (PyCFunction)py_lsa_LookupPrivName_ndr_opnum, METH_NOARGS|METH_CLASS,
27886 : "lsa.LookupPrivName.opnum() -> 32 (0x20) " },
27887 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
27888 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
27889 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
27890 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
27891 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
27892 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
27893 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
27894 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
27895 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupPrivName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
27896 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupPrivName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
27897 : { NULL, NULL, 0, NULL }
27898 : };
27899 :
27900 :
27901 : static PyTypeObject lsa_LookupPrivName_Type = {
27902 : PyVarObject_HEAD_INIT(NULL, 0)
27903 : .tp_name = "lsa.LookupPrivName",
27904 : .tp_getset = py_lsa_LookupPrivName_getsetters,
27905 : .tp_methods = py_lsa_LookupPrivName_methods,
27906 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
27907 : .tp_new = py_lsa_LookupPrivName_new,
27908 : };
27909 :
27910 0 : static bool pack_py_lsa_LookupPrivName_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivName *r)
27911 : {
27912 : PyObject *py_handle;
27913 : PyObject *py_luid;
27914 0 : const char *kwnames[] = {
27915 : "handle", "luid", NULL
27916 : };
27917 :
27918 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_LookupPrivName", discard_const_p(char *, kwnames), &py_handle, &py_luid)) {
27919 0 : return false;
27920 : }
27921 :
27922 0 : if (py_handle == NULL) {
27923 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
27924 0 : return false;
27925 : }
27926 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
27927 0 : if (r->in.handle == NULL) {
27928 0 : PyErr_NoMemory();
27929 0 : return false;
27930 : }
27931 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
27932 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
27933 0 : PyErr_NoMemory();
27934 0 : return false;
27935 : }
27936 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
27937 0 : if (py_luid == NULL) {
27938 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.luid");
27939 0 : return false;
27940 : }
27941 0 : r->in.luid = talloc_ptrtype(r, r->in.luid);
27942 0 : if (r->in.luid == NULL) {
27943 0 : PyErr_NoMemory();
27944 0 : return false;
27945 : }
27946 0 : PY_CHECK_TYPE(&lsa_LUID_Type, py_luid, return false;);
27947 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_luid)) == NULL) {
27948 0 : PyErr_NoMemory();
27949 0 : return false;
27950 : }
27951 0 : r->in.luid = (struct lsa_LUID *)pytalloc_get_ptr(py_luid);
27952 0 : return true;
27953 : }
27954 :
27955 0 : static PyObject *unpack_py_lsa_LookupPrivName_args_out(struct lsa_LookupPrivName *r)
27956 : {
27957 : PyObject *result;
27958 : PyObject *py_name;
27959 0 : if (*r->out.name == NULL) {
27960 0 : py_name = Py_None;
27961 0 : Py_INCREF(py_name);
27962 : } else {
27963 0 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *r->out.name, *r->out.name);
27964 : }
27965 0 : result = py_name;
27966 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
27967 0 : PyErr_SetNTSTATUS(r->out.result);
27968 0 : return NULL;
27969 : }
27970 :
27971 0 : return result;
27972 : }
27973 :
27974 :
27975 0 : static PyObject *py_lsa_LookupPrivDisplayName_in_get_handle(PyObject *obj, void *closure)
27976 : {
27977 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
27978 : PyObject *py_handle;
27979 0 : if (object->in.handle == NULL) {
27980 0 : Py_RETURN_NONE;
27981 : }
27982 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
27983 0 : return py_handle;
27984 : }
27985 :
27986 0 : static int py_lsa_LookupPrivDisplayName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
27987 : {
27988 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
27989 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
27990 0 : if (value == NULL) {
27991 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
27992 0 : return -1;
27993 : }
27994 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
27995 0 : if (object->in.handle == NULL) {
27996 0 : PyErr_NoMemory();
27997 0 : return -1;
27998 : }
27999 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28000 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28001 0 : PyErr_NoMemory();
28002 0 : return -1;
28003 : }
28004 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
28005 0 : return 0;
28006 : }
28007 :
28008 0 : static PyObject *py_lsa_LookupPrivDisplayName_in_get_name(PyObject *obj, void *closure)
28009 : {
28010 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
28011 : PyObject *py_name;
28012 0 : if (object->in.name == NULL) {
28013 0 : Py_RETURN_NONE;
28014 : }
28015 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
28016 0 : return py_name;
28017 : }
28018 :
28019 0 : static int py_lsa_LookupPrivDisplayName_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
28020 : {
28021 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28022 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
28023 0 : if (value == NULL) {
28024 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
28025 0 : return -1;
28026 : }
28027 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
28028 0 : if (object->in.name == NULL) {
28029 0 : PyErr_NoMemory();
28030 0 : return -1;
28031 : }
28032 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
28033 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28034 0 : PyErr_NoMemory();
28035 0 : return -1;
28036 : }
28037 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
28038 0 : return 0;
28039 : }
28040 :
28041 0 : static PyObject *py_lsa_LookupPrivDisplayName_in_get_language_id(PyObject *obj, void *closure)
28042 : {
28043 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
28044 : PyObject *py_language_id;
28045 0 : py_language_id = PyLong_FromLong((uint16_t)object->in.language_id);
28046 0 : return py_language_id;
28047 : }
28048 :
28049 0 : static int py_lsa_LookupPrivDisplayName_in_set_language_id(PyObject *py_obj, PyObject *value, void *closure)
28050 : {
28051 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28052 0 : if (value == NULL) {
28053 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.language_id");
28054 0 : return -1;
28055 : }
28056 : {
28057 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.language_id));
28058 0 : if (PyLong_Check(value)) {
28059 : unsigned long long test_var;
28060 0 : test_var = PyLong_AsUnsignedLongLong(value);
28061 0 : if (PyErr_Occurred() != NULL) {
28062 0 : return -1;
28063 : }
28064 0 : if (test_var > uint_max) {
28065 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28066 : PyLong_Type.tp_name, uint_max, test_var);
28067 0 : return -1;
28068 : }
28069 0 : object->in.language_id = test_var;
28070 : } else {
28071 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28072 : PyLong_Type.tp_name);
28073 0 : return -1;
28074 : }
28075 : }
28076 0 : return 0;
28077 : }
28078 :
28079 0 : static PyObject *py_lsa_LookupPrivDisplayName_in_get_language_id_sys(PyObject *obj, void *closure)
28080 : {
28081 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
28082 : PyObject *py_language_id_sys;
28083 0 : py_language_id_sys = PyLong_FromLong((uint16_t)object->in.language_id_sys);
28084 0 : return py_language_id_sys;
28085 : }
28086 :
28087 0 : static int py_lsa_LookupPrivDisplayName_in_set_language_id_sys(PyObject *py_obj, PyObject *value, void *closure)
28088 : {
28089 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28090 0 : if (value == NULL) {
28091 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.language_id_sys");
28092 0 : return -1;
28093 : }
28094 : {
28095 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.language_id_sys));
28096 0 : if (PyLong_Check(value)) {
28097 : unsigned long long test_var;
28098 0 : test_var = PyLong_AsUnsignedLongLong(value);
28099 0 : if (PyErr_Occurred() != NULL) {
28100 0 : return -1;
28101 : }
28102 0 : if (test_var > uint_max) {
28103 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28104 : PyLong_Type.tp_name, uint_max, test_var);
28105 0 : return -1;
28106 : }
28107 0 : object->in.language_id_sys = test_var;
28108 : } else {
28109 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28110 : PyLong_Type.tp_name);
28111 0 : return -1;
28112 : }
28113 : }
28114 0 : return 0;
28115 : }
28116 :
28117 0 : static PyObject *py_lsa_LookupPrivDisplayName_out_get_disp_name(PyObject *obj, void *closure)
28118 : {
28119 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
28120 : PyObject *py_disp_name;
28121 0 : if (object->out.disp_name == NULL) {
28122 0 : Py_RETURN_NONE;
28123 : }
28124 0 : if (*object->out.disp_name == NULL) {
28125 0 : py_disp_name = Py_None;
28126 0 : Py_INCREF(py_disp_name);
28127 : } else {
28128 0 : py_disp_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *object->out.disp_name, *object->out.disp_name);
28129 : }
28130 0 : return py_disp_name;
28131 : }
28132 :
28133 0 : static int py_lsa_LookupPrivDisplayName_out_set_disp_name(PyObject *py_obj, PyObject *value, void *closure)
28134 : {
28135 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28136 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.disp_name));
28137 0 : if (value == NULL) {
28138 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.disp_name");
28139 0 : return -1;
28140 : }
28141 0 : object->out.disp_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.disp_name);
28142 0 : if (object->out.disp_name == NULL) {
28143 0 : PyErr_NoMemory();
28144 0 : return -1;
28145 : }
28146 0 : if (value == Py_None) {
28147 0 : *object->out.disp_name = NULL;
28148 : } else {
28149 0 : *object->out.disp_name = NULL;
28150 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
28151 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28152 0 : PyErr_NoMemory();
28153 0 : return -1;
28154 : }
28155 0 : *object->out.disp_name = (struct lsa_StringLarge *)pytalloc_get_ptr(value);
28156 : }
28157 0 : return 0;
28158 : }
28159 :
28160 0 : static PyObject *py_lsa_LookupPrivDisplayName_out_get_returned_language_id(PyObject *obj, void *closure)
28161 : {
28162 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
28163 : PyObject *py_returned_language_id;
28164 0 : if (object->out.returned_language_id == NULL) {
28165 0 : Py_RETURN_NONE;
28166 : }
28167 0 : py_returned_language_id = PyLong_FromLong((uint16_t)*object->out.returned_language_id);
28168 0 : return py_returned_language_id;
28169 : }
28170 :
28171 0 : static int py_lsa_LookupPrivDisplayName_out_set_returned_language_id(PyObject *py_obj, PyObject *value, void *closure)
28172 : {
28173 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28174 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.returned_language_id));
28175 0 : if (value == NULL) {
28176 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.returned_language_id");
28177 0 : return -1;
28178 : }
28179 0 : object->out.returned_language_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.returned_language_id);
28180 0 : if (object->out.returned_language_id == NULL) {
28181 0 : PyErr_NoMemory();
28182 0 : return -1;
28183 : }
28184 : {
28185 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.returned_language_id));
28186 0 : if (PyLong_Check(value)) {
28187 : unsigned long long test_var;
28188 0 : test_var = PyLong_AsUnsignedLongLong(value);
28189 0 : if (PyErr_Occurred() != NULL) {
28190 0 : return -1;
28191 : }
28192 0 : if (test_var > uint_max) {
28193 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28194 : PyLong_Type.tp_name, uint_max, test_var);
28195 0 : return -1;
28196 : }
28197 0 : *object->out.returned_language_id = test_var;
28198 : } else {
28199 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28200 : PyLong_Type.tp_name);
28201 0 : return -1;
28202 : }
28203 : }
28204 0 : return 0;
28205 : }
28206 :
28207 0 : static PyObject *py_lsa_LookupPrivDisplayName_get_result(PyObject *obj, void *closure)
28208 : {
28209 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
28210 : PyObject *py_result;
28211 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
28212 0 : return py_result;
28213 : }
28214 :
28215 0 : static int py_lsa_LookupPrivDisplayName_set_result(PyObject *py_obj, PyObject *value, void *closure)
28216 : {
28217 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28218 0 : if (value == NULL) {
28219 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
28220 0 : return -1;
28221 : }
28222 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
28223 0 : return 0;
28224 : }
28225 :
28226 : static PyGetSetDef py_lsa_LookupPrivDisplayName_getsetters[] = {
28227 : {
28228 : .name = discard_const_p(char, "in_handle"),
28229 : .get = py_lsa_LookupPrivDisplayName_in_get_handle,
28230 : .set = py_lsa_LookupPrivDisplayName_in_set_handle,
28231 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
28232 : },
28233 : {
28234 : .name = discard_const_p(char, "in_name"),
28235 : .get = py_lsa_LookupPrivDisplayName_in_get_name,
28236 : .set = py_lsa_LookupPrivDisplayName_in_set_name,
28237 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
28238 : },
28239 : {
28240 : .name = discard_const_p(char, "in_language_id"),
28241 : .get = py_lsa_LookupPrivDisplayName_in_get_language_id,
28242 : .set = py_lsa_LookupPrivDisplayName_in_set_language_id,
28243 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
28244 : },
28245 : {
28246 : .name = discard_const_p(char, "in_language_id_sys"),
28247 : .get = py_lsa_LookupPrivDisplayName_in_get_language_id_sys,
28248 : .set = py_lsa_LookupPrivDisplayName_in_set_language_id_sys,
28249 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
28250 : },
28251 : {
28252 : .name = discard_const_p(char, "out_disp_name"),
28253 : .get = py_lsa_LookupPrivDisplayName_out_get_disp_name,
28254 : .set = py_lsa_LookupPrivDisplayName_out_set_disp_name,
28255 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
28256 : },
28257 : {
28258 : .name = discard_const_p(char, "out_returned_language_id"),
28259 : .get = py_lsa_LookupPrivDisplayName_out_get_returned_language_id,
28260 : .set = py_lsa_LookupPrivDisplayName_out_set_returned_language_id,
28261 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
28262 : },
28263 : {
28264 : .name = discard_const_p(char, "result"),
28265 : .get = py_lsa_LookupPrivDisplayName_get_result,
28266 : .set = py_lsa_LookupPrivDisplayName_set_result,
28267 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
28268 : },
28269 : { .name = NULL }
28270 : };
28271 :
28272 0 : static PyObject *py_lsa_LookupPrivDisplayName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
28273 : {
28274 0 : PyObject *self = pytalloc_new(struct lsa_LookupPrivDisplayName, type);
28275 0 : struct lsa_LookupPrivDisplayName *_self = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(self);
28276 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
28277 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
28278 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
28279 : /* a pointer to a NULL pointer */
28280 0 : _self->out.disp_name = talloc_zero(mem_ctx, struct lsa_StringLarge *);
28281 0 : _self->out.returned_language_id = talloc_zero(mem_ctx, uint16_t);
28282 0 : return self;
28283 : }
28284 :
28285 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
28286 : {
28287 :
28288 :
28289 0 : return PyLong_FromLong(33);
28290 : }
28291 :
28292 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
28293 : {
28294 0 : const struct ndr_interface_call *call = NULL;
28295 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28296 0 : PyObject *ret = NULL;
28297 0 : struct ndr_push *push = NULL;
28298 : DATA_BLOB blob;
28299 : enum ndr_err_code err;
28300 :
28301 0 : if (ndr_table_lsarpc.num_calls < 34) {
28302 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivDisplayName_ndr_pack");
28303 0 : return NULL;
28304 : }
28305 0 : call = &ndr_table_lsarpc.calls[33];
28306 :
28307 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
28308 0 : if (push == NULL) {
28309 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28310 0 : return NULL;
28311 : }
28312 :
28313 0 : push->flags |= ndr_push_flags;
28314 :
28315 0 : err = call->ndr_push(push, ndr_inout_flags, object);
28316 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28317 0 : TALLOC_FREE(push);
28318 0 : PyErr_SetNdrError(err);
28319 0 : return NULL;
28320 : }
28321 0 : blob = ndr_push_blob(push);
28322 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
28323 0 : TALLOC_FREE(push);
28324 0 : return ret;
28325 : }
28326 :
28327 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28328 : {
28329 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28330 0 : PyObject *bigendian_obj = NULL;
28331 0 : PyObject *ndr64_obj = NULL;
28332 0 : uint32_t ndr_push_flags = 0;
28333 :
28334 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
28335 : discard_const_p(char *, kwnames),
28336 : &bigendian_obj,
28337 : &ndr64_obj)) {
28338 0 : return NULL;
28339 : }
28340 :
28341 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28342 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28343 : }
28344 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28345 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28346 : }
28347 :
28348 0 : return py_lsa_LookupPrivDisplayName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
28349 : }
28350 :
28351 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28352 : {
28353 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28354 0 : PyObject *bigendian_obj = NULL;
28355 0 : PyObject *ndr64_obj = NULL;
28356 0 : uint32_t ndr_push_flags = 0;
28357 :
28358 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
28359 : discard_const_p(char *, kwnames),
28360 : &bigendian_obj,
28361 : &ndr64_obj)) {
28362 0 : return NULL;
28363 : }
28364 :
28365 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28366 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28367 : }
28368 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28369 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28370 : }
28371 :
28372 0 : return py_lsa_LookupPrivDisplayName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
28373 : }
28374 :
28375 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
28376 : {
28377 0 : const struct ndr_interface_call *call = NULL;
28378 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28379 0 : struct ndr_pull *pull = NULL;
28380 : enum ndr_err_code err;
28381 :
28382 0 : if (ndr_table_lsarpc.num_calls < 34) {
28383 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivDisplayName_ndr_unpack");
28384 0 : return NULL;
28385 : }
28386 0 : call = &ndr_table_lsarpc.calls[33];
28387 :
28388 0 : pull = ndr_pull_init_blob(blob, object);
28389 0 : if (pull == NULL) {
28390 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28391 0 : return NULL;
28392 : }
28393 :
28394 0 : pull->flags |= ndr_pull_flags;
28395 :
28396 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
28397 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28398 0 : TALLOC_FREE(pull);
28399 0 : PyErr_SetNdrError(err);
28400 0 : return NULL;
28401 : }
28402 0 : if (!allow_remaining) {
28403 : uint32_t highest_ofs;
28404 :
28405 0 : if (pull->offset > pull->relative_highest_offset) {
28406 0 : highest_ofs = pull->offset;
28407 : } else {
28408 0 : highest_ofs = pull->relative_highest_offset;
28409 : }
28410 0 : if (highest_ofs < pull->data_size) {
28411 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
28412 : "not all bytes consumed ofs[%u] size[%u]",
28413 : highest_ofs, pull->data_size);
28414 0 : TALLOC_FREE(pull);
28415 0 : PyErr_SetNdrError(err);
28416 0 : return NULL;
28417 : }
28418 : }
28419 :
28420 0 : TALLOC_FREE(pull);
28421 0 : Py_RETURN_NONE;
28422 : }
28423 :
28424 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28425 : {
28426 : DATA_BLOB blob;
28427 0 : Py_ssize_t blob_length = 0;
28428 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28429 0 : PyObject *bigendian_obj = NULL;
28430 0 : PyObject *ndr64_obj = NULL;
28431 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28432 0 : PyObject *allow_remaining_obj = NULL;
28433 0 : bool allow_remaining = false;
28434 :
28435 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
28436 : discard_const_p(char *, kwnames),
28437 : &blob.data, &blob_length,
28438 : &bigendian_obj,
28439 : &ndr64_obj,
28440 : &allow_remaining_obj)) {
28441 0 : return NULL;
28442 : }
28443 0 : blob.length = blob_length;
28444 :
28445 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28446 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28447 : }
28448 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28449 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28450 : }
28451 :
28452 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28453 0 : allow_remaining = true;
28454 : }
28455 :
28456 0 : return py_lsa_LookupPrivDisplayName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
28457 : }
28458 :
28459 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28460 : {
28461 : DATA_BLOB blob;
28462 0 : Py_ssize_t blob_length = 0;
28463 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28464 0 : PyObject *bigendian_obj = NULL;
28465 0 : PyObject *ndr64_obj = NULL;
28466 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28467 0 : PyObject *allow_remaining_obj = NULL;
28468 0 : bool allow_remaining = false;
28469 :
28470 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
28471 : discard_const_p(char *, kwnames),
28472 : &blob.data, &blob_length,
28473 : &bigendian_obj,
28474 : &ndr64_obj,
28475 : &allow_remaining_obj)) {
28476 0 : return NULL;
28477 : }
28478 0 : blob.length = blob_length;
28479 :
28480 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28481 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28482 : }
28483 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28484 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28485 : }
28486 :
28487 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28488 0 : allow_remaining = true;
28489 : }
28490 :
28491 0 : return py_lsa_LookupPrivDisplayName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
28492 : }
28493 :
28494 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
28495 : {
28496 0 : const struct ndr_interface_call *call = NULL;
28497 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28498 : PyObject *ret;
28499 : char *retstr;
28500 :
28501 0 : if (ndr_table_lsarpc.num_calls < 34) {
28502 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivDisplayName_ndr_print");
28503 0 : return NULL;
28504 : }
28505 0 : call = &ndr_table_lsarpc.calls[33];
28506 :
28507 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
28508 0 : ret = PyUnicode_FromString(retstr);
28509 0 : TALLOC_FREE(retstr);
28510 :
28511 0 : return ret;
28512 : }
28513 :
28514 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28515 : {
28516 0 : return py_lsa_LookupPrivDisplayName_ndr_print(py_obj, "lsa_LookupPrivDisplayName_in", NDR_IN);
28517 : }
28518 :
28519 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28520 : {
28521 0 : return py_lsa_LookupPrivDisplayName_ndr_print(py_obj, "lsa_LookupPrivDisplayName_out", NDR_OUT);
28522 : }
28523 :
28524 : static PyMethodDef py_lsa_LookupPrivDisplayName_methods[] = {
28525 : { "opnum", (PyCFunction)py_lsa_LookupPrivDisplayName_ndr_opnum, METH_NOARGS|METH_CLASS,
28526 : "lsa.LookupPrivDisplayName.opnum() -> 33 (0x21) " },
28527 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivDisplayName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
28528 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
28529 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivDisplayName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
28530 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
28531 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivDisplayName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
28532 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
28533 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivDisplayName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
28534 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
28535 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupPrivDisplayName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
28536 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupPrivDisplayName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
28537 : { NULL, NULL, 0, NULL }
28538 : };
28539 :
28540 :
28541 : static PyTypeObject lsa_LookupPrivDisplayName_Type = {
28542 : PyVarObject_HEAD_INIT(NULL, 0)
28543 : .tp_name = "lsa.LookupPrivDisplayName",
28544 : .tp_getset = py_lsa_LookupPrivDisplayName_getsetters,
28545 : .tp_methods = py_lsa_LookupPrivDisplayName_methods,
28546 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
28547 : .tp_new = py_lsa_LookupPrivDisplayName_new,
28548 : };
28549 :
28550 0 : static bool pack_py_lsa_LookupPrivDisplayName_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivDisplayName *r)
28551 : {
28552 : PyObject *py_handle;
28553 : PyObject *py_name;
28554 : PyObject *py_language_id;
28555 : PyObject *py_language_id_sys;
28556 0 : const char *kwnames[] = {
28557 : "handle", "name", "language_id", "language_id_sys", NULL
28558 : };
28559 :
28560 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_LookupPrivDisplayName", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_language_id, &py_language_id_sys)) {
28561 0 : return false;
28562 : }
28563 :
28564 0 : if (py_handle == NULL) {
28565 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
28566 0 : return false;
28567 : }
28568 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
28569 0 : if (r->in.handle == NULL) {
28570 0 : PyErr_NoMemory();
28571 0 : return false;
28572 : }
28573 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
28574 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
28575 0 : PyErr_NoMemory();
28576 0 : return false;
28577 : }
28578 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
28579 0 : if (py_name == NULL) {
28580 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
28581 0 : return false;
28582 : }
28583 0 : r->in.name = talloc_ptrtype(r, r->in.name);
28584 0 : if (r->in.name == NULL) {
28585 0 : PyErr_NoMemory();
28586 0 : return false;
28587 : }
28588 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
28589 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
28590 0 : PyErr_NoMemory();
28591 0 : return false;
28592 : }
28593 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
28594 0 : if (py_language_id == NULL) {
28595 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.language_id");
28596 0 : return false;
28597 : }
28598 : {
28599 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.language_id));
28600 0 : if (PyLong_Check(py_language_id)) {
28601 : unsigned long long test_var;
28602 0 : test_var = PyLong_AsUnsignedLongLong(py_language_id);
28603 0 : if (PyErr_Occurred() != NULL) {
28604 0 : return false;
28605 : }
28606 0 : if (test_var > uint_max) {
28607 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28608 : PyLong_Type.tp_name, uint_max, test_var);
28609 0 : return false;
28610 : }
28611 0 : r->in.language_id = test_var;
28612 : } else {
28613 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28614 : PyLong_Type.tp_name);
28615 0 : return false;
28616 : }
28617 : }
28618 0 : if (py_language_id_sys == NULL) {
28619 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.language_id_sys");
28620 0 : return false;
28621 : }
28622 : {
28623 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.language_id_sys));
28624 0 : if (PyLong_Check(py_language_id_sys)) {
28625 : unsigned long long test_var;
28626 0 : test_var = PyLong_AsUnsignedLongLong(py_language_id_sys);
28627 0 : if (PyErr_Occurred() != NULL) {
28628 0 : return false;
28629 : }
28630 0 : if (test_var > uint_max) {
28631 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28632 : PyLong_Type.tp_name, uint_max, test_var);
28633 0 : return false;
28634 : }
28635 0 : r->in.language_id_sys = test_var;
28636 : } else {
28637 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28638 : PyLong_Type.tp_name);
28639 0 : return false;
28640 : }
28641 : }
28642 0 : return true;
28643 : }
28644 :
28645 0 : static PyObject *unpack_py_lsa_LookupPrivDisplayName_args_out(struct lsa_LookupPrivDisplayName *r)
28646 : {
28647 : PyObject *result;
28648 : PyObject *py_disp_name;
28649 : PyObject *py_returned_language_id;
28650 0 : result = PyTuple_New(2);
28651 0 : if (*r->out.disp_name == NULL) {
28652 0 : py_disp_name = Py_None;
28653 0 : Py_INCREF(py_disp_name);
28654 : } else {
28655 0 : py_disp_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *r->out.disp_name, *r->out.disp_name);
28656 : }
28657 0 : PyTuple_SetItem(result, 0, py_disp_name);
28658 0 : py_returned_language_id = PyLong_FromLong((uint16_t)*r->out.returned_language_id);
28659 0 : PyTuple_SetItem(result, 1, py_returned_language_id);
28660 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
28661 0 : PyErr_SetNTSTATUS(r->out.result);
28662 0 : return NULL;
28663 : }
28664 :
28665 0 : return result;
28666 : }
28667 :
28668 :
28669 0 : static PyObject *py_lsa_DeleteObject_in_get_handle(PyObject *obj, void *closure)
28670 : {
28671 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(obj);
28672 : PyObject *py_handle;
28673 0 : if (object->in.handle == NULL) {
28674 0 : Py_RETURN_NONE;
28675 : }
28676 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
28677 0 : return py_handle;
28678 : }
28679 :
28680 0 : static int py_lsa_DeleteObject_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
28681 : {
28682 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(py_obj);
28683 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
28684 0 : if (value == NULL) {
28685 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
28686 0 : return -1;
28687 : }
28688 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
28689 0 : if (object->in.handle == NULL) {
28690 0 : PyErr_NoMemory();
28691 0 : return -1;
28692 : }
28693 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28694 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28695 0 : PyErr_NoMemory();
28696 0 : return -1;
28697 : }
28698 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
28699 0 : return 0;
28700 : }
28701 :
28702 0 : static PyObject *py_lsa_DeleteObject_out_get_handle(PyObject *obj, void *closure)
28703 : {
28704 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(obj);
28705 : PyObject *py_handle;
28706 0 : if (object->out.handle == NULL) {
28707 0 : Py_RETURN_NONE;
28708 : }
28709 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
28710 0 : return py_handle;
28711 : }
28712 :
28713 0 : static int py_lsa_DeleteObject_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
28714 : {
28715 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(py_obj);
28716 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
28717 0 : if (value == NULL) {
28718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
28719 0 : return -1;
28720 : }
28721 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
28722 0 : if (object->out.handle == NULL) {
28723 0 : PyErr_NoMemory();
28724 0 : return -1;
28725 : }
28726 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28727 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28728 0 : PyErr_NoMemory();
28729 0 : return -1;
28730 : }
28731 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
28732 0 : return 0;
28733 : }
28734 :
28735 0 : static PyObject *py_lsa_DeleteObject_get_result(PyObject *obj, void *closure)
28736 : {
28737 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(obj);
28738 : PyObject *py_result;
28739 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
28740 0 : return py_result;
28741 : }
28742 :
28743 0 : static int py_lsa_DeleteObject_set_result(PyObject *py_obj, PyObject *value, void *closure)
28744 : {
28745 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(py_obj);
28746 0 : if (value == NULL) {
28747 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
28748 0 : return -1;
28749 : }
28750 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
28751 0 : return 0;
28752 : }
28753 :
28754 : static PyGetSetDef py_lsa_DeleteObject_getsetters[] = {
28755 : {
28756 : .name = discard_const_p(char, "in_handle"),
28757 : .get = py_lsa_DeleteObject_in_get_handle,
28758 : .set = py_lsa_DeleteObject_in_set_handle,
28759 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
28760 : },
28761 : {
28762 : .name = discard_const_p(char, "out_handle"),
28763 : .get = py_lsa_DeleteObject_out_get_handle,
28764 : .set = py_lsa_DeleteObject_out_set_handle,
28765 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
28766 : },
28767 : {
28768 : .name = discard_const_p(char, "result"),
28769 : .get = py_lsa_DeleteObject_get_result,
28770 : .set = py_lsa_DeleteObject_set_result,
28771 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
28772 : },
28773 : { .name = NULL }
28774 : };
28775 :
28776 0 : static PyObject *py_lsa_DeleteObject_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
28777 : {
28778 0 : PyObject *self = pytalloc_new(struct lsa_DeleteObject, type);
28779 0 : struct lsa_DeleteObject *_self = (struct lsa_DeleteObject *)pytalloc_get_ptr(self);
28780 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
28781 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
28782 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
28783 0 : return self;
28784 : }
28785 :
28786 0 : static PyObject *py_lsa_DeleteObject_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
28787 : {
28788 :
28789 :
28790 0 : return PyLong_FromLong(34);
28791 : }
28792 :
28793 0 : static PyObject *py_lsa_DeleteObject_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
28794 : {
28795 0 : const struct ndr_interface_call *call = NULL;
28796 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(py_obj);
28797 0 : PyObject *ret = NULL;
28798 0 : struct ndr_push *push = NULL;
28799 : DATA_BLOB blob;
28800 : enum ndr_err_code err;
28801 :
28802 0 : if (ndr_table_lsarpc.num_calls < 35) {
28803 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteObject_ndr_pack");
28804 0 : return NULL;
28805 : }
28806 0 : call = &ndr_table_lsarpc.calls[34];
28807 :
28808 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
28809 0 : if (push == NULL) {
28810 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28811 0 : return NULL;
28812 : }
28813 :
28814 0 : push->flags |= ndr_push_flags;
28815 :
28816 0 : err = call->ndr_push(push, ndr_inout_flags, object);
28817 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28818 0 : TALLOC_FREE(push);
28819 0 : PyErr_SetNdrError(err);
28820 0 : return NULL;
28821 : }
28822 0 : blob = ndr_push_blob(push);
28823 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
28824 0 : TALLOC_FREE(push);
28825 0 : return ret;
28826 : }
28827 :
28828 0 : static PyObject *py_lsa_DeleteObject_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28829 : {
28830 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28831 0 : PyObject *bigendian_obj = NULL;
28832 0 : PyObject *ndr64_obj = NULL;
28833 0 : uint32_t ndr_push_flags = 0;
28834 :
28835 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
28836 : discard_const_p(char *, kwnames),
28837 : &bigendian_obj,
28838 : &ndr64_obj)) {
28839 0 : return NULL;
28840 : }
28841 :
28842 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28843 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28844 : }
28845 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28846 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28847 : }
28848 :
28849 0 : return py_lsa_DeleteObject_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
28850 : }
28851 :
28852 0 : static PyObject *py_lsa_DeleteObject_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28853 : {
28854 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28855 0 : PyObject *bigendian_obj = NULL;
28856 0 : PyObject *ndr64_obj = NULL;
28857 0 : uint32_t ndr_push_flags = 0;
28858 :
28859 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
28860 : discard_const_p(char *, kwnames),
28861 : &bigendian_obj,
28862 : &ndr64_obj)) {
28863 0 : return NULL;
28864 : }
28865 :
28866 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28867 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28868 : }
28869 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28870 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28871 : }
28872 :
28873 0 : return py_lsa_DeleteObject_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
28874 : }
28875 :
28876 0 : static PyObject *py_lsa_DeleteObject_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
28877 : {
28878 0 : const struct ndr_interface_call *call = NULL;
28879 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(py_obj);
28880 0 : struct ndr_pull *pull = NULL;
28881 : enum ndr_err_code err;
28882 :
28883 0 : if (ndr_table_lsarpc.num_calls < 35) {
28884 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteObject_ndr_unpack");
28885 0 : return NULL;
28886 : }
28887 0 : call = &ndr_table_lsarpc.calls[34];
28888 :
28889 0 : pull = ndr_pull_init_blob(blob, object);
28890 0 : if (pull == NULL) {
28891 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28892 0 : return NULL;
28893 : }
28894 :
28895 0 : pull->flags |= ndr_pull_flags;
28896 :
28897 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
28898 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28899 0 : TALLOC_FREE(pull);
28900 0 : PyErr_SetNdrError(err);
28901 0 : return NULL;
28902 : }
28903 0 : if (!allow_remaining) {
28904 : uint32_t highest_ofs;
28905 :
28906 0 : if (pull->offset > pull->relative_highest_offset) {
28907 0 : highest_ofs = pull->offset;
28908 : } else {
28909 0 : highest_ofs = pull->relative_highest_offset;
28910 : }
28911 0 : if (highest_ofs < pull->data_size) {
28912 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
28913 : "not all bytes consumed ofs[%u] size[%u]",
28914 : highest_ofs, pull->data_size);
28915 0 : TALLOC_FREE(pull);
28916 0 : PyErr_SetNdrError(err);
28917 0 : return NULL;
28918 : }
28919 : }
28920 :
28921 0 : TALLOC_FREE(pull);
28922 0 : Py_RETURN_NONE;
28923 : }
28924 :
28925 0 : static PyObject *py_lsa_DeleteObject_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28926 : {
28927 : DATA_BLOB blob;
28928 0 : Py_ssize_t blob_length = 0;
28929 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28930 0 : PyObject *bigendian_obj = NULL;
28931 0 : PyObject *ndr64_obj = NULL;
28932 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28933 0 : PyObject *allow_remaining_obj = NULL;
28934 0 : bool allow_remaining = false;
28935 :
28936 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
28937 : discard_const_p(char *, kwnames),
28938 : &blob.data, &blob_length,
28939 : &bigendian_obj,
28940 : &ndr64_obj,
28941 : &allow_remaining_obj)) {
28942 0 : return NULL;
28943 : }
28944 0 : blob.length = blob_length;
28945 :
28946 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28947 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28948 : }
28949 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28950 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28951 : }
28952 :
28953 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28954 0 : allow_remaining = true;
28955 : }
28956 :
28957 0 : return py_lsa_DeleteObject_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
28958 : }
28959 :
28960 0 : static PyObject *py_lsa_DeleteObject_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28961 : {
28962 : DATA_BLOB blob;
28963 0 : Py_ssize_t blob_length = 0;
28964 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28965 0 : PyObject *bigendian_obj = NULL;
28966 0 : PyObject *ndr64_obj = NULL;
28967 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28968 0 : PyObject *allow_remaining_obj = NULL;
28969 0 : bool allow_remaining = false;
28970 :
28971 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
28972 : discard_const_p(char *, kwnames),
28973 : &blob.data, &blob_length,
28974 : &bigendian_obj,
28975 : &ndr64_obj,
28976 : &allow_remaining_obj)) {
28977 0 : return NULL;
28978 : }
28979 0 : blob.length = blob_length;
28980 :
28981 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28982 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28983 : }
28984 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28985 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28986 : }
28987 :
28988 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28989 0 : allow_remaining = true;
28990 : }
28991 :
28992 0 : return py_lsa_DeleteObject_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
28993 : }
28994 :
28995 0 : static PyObject *py_lsa_DeleteObject_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
28996 : {
28997 0 : const struct ndr_interface_call *call = NULL;
28998 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(py_obj);
28999 : PyObject *ret;
29000 : char *retstr;
29001 :
29002 0 : if (ndr_table_lsarpc.num_calls < 35) {
29003 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteObject_ndr_print");
29004 0 : return NULL;
29005 : }
29006 0 : call = &ndr_table_lsarpc.calls[34];
29007 :
29008 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29009 0 : ret = PyUnicode_FromString(retstr);
29010 0 : TALLOC_FREE(retstr);
29011 :
29012 0 : return ret;
29013 : }
29014 :
29015 0 : static PyObject *py_lsa_DeleteObject_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29016 : {
29017 0 : return py_lsa_DeleteObject_ndr_print(py_obj, "lsa_DeleteObject_in", NDR_IN);
29018 : }
29019 :
29020 0 : static PyObject *py_lsa_DeleteObject_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29021 : {
29022 0 : return py_lsa_DeleteObject_ndr_print(py_obj, "lsa_DeleteObject_out", NDR_OUT);
29023 : }
29024 :
29025 : static PyMethodDef py_lsa_DeleteObject_methods[] = {
29026 : { "opnum", (PyCFunction)py_lsa_DeleteObject_ndr_opnum, METH_NOARGS|METH_CLASS,
29027 : "lsa.DeleteObject.opnum() -> 34 (0x22) " },
29028 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteObject_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29029 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29030 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteObject_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29031 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29032 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteObject_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29033 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29034 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteObject_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29035 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29036 : { "__ndr_print_in__", (PyCFunction)py_lsa_DeleteObject_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29037 : { "__ndr_print_out__", (PyCFunction)py_lsa_DeleteObject_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29038 : { NULL, NULL, 0, NULL }
29039 : };
29040 :
29041 :
29042 : static PyTypeObject lsa_DeleteObject_Type = {
29043 : PyVarObject_HEAD_INIT(NULL, 0)
29044 : .tp_name = "lsa.DeleteObject",
29045 : .tp_getset = py_lsa_DeleteObject_getsetters,
29046 : .tp_methods = py_lsa_DeleteObject_methods,
29047 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
29048 : .tp_new = py_lsa_DeleteObject_new,
29049 : };
29050 :
29051 0 : static bool pack_py_lsa_DeleteObject_args_in(PyObject *args, PyObject *kwargs, struct lsa_DeleteObject *r)
29052 : {
29053 : PyObject *py_handle;
29054 0 : const char *kwnames[] = {
29055 : "handle", NULL
29056 : };
29057 :
29058 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_DeleteObject", discard_const_p(char *, kwnames), &py_handle)) {
29059 0 : return false;
29060 : }
29061 :
29062 0 : if (py_handle == NULL) {
29063 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
29064 0 : return false;
29065 : }
29066 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
29067 0 : if (r->in.handle == NULL) {
29068 0 : PyErr_NoMemory();
29069 0 : return false;
29070 : }
29071 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
29072 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
29073 0 : PyErr_NoMemory();
29074 0 : return false;
29075 : }
29076 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
29077 0 : return true;
29078 : }
29079 :
29080 0 : static PyObject *unpack_py_lsa_DeleteObject_args_out(struct lsa_DeleteObject *r)
29081 : {
29082 : PyObject *result;
29083 : PyObject *py_handle;
29084 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
29085 0 : result = py_handle;
29086 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
29087 0 : PyErr_SetNTSTATUS(r->out.result);
29088 0 : return NULL;
29089 : }
29090 :
29091 0 : return result;
29092 : }
29093 :
29094 :
29095 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_in_get_handle(PyObject *obj, void *closure)
29096 : {
29097 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(obj);
29098 : PyObject *py_handle;
29099 0 : if (object->in.handle == NULL) {
29100 0 : Py_RETURN_NONE;
29101 : }
29102 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
29103 0 : return py_handle;
29104 : }
29105 :
29106 0 : static int py_lsa_EnumAccountsWithUserRight_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
29107 : {
29108 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29109 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
29110 0 : if (value == NULL) {
29111 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
29112 0 : return -1;
29113 : }
29114 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
29115 0 : if (object->in.handle == NULL) {
29116 0 : PyErr_NoMemory();
29117 0 : return -1;
29118 : }
29119 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
29120 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29121 0 : PyErr_NoMemory();
29122 0 : return -1;
29123 : }
29124 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
29125 0 : return 0;
29126 : }
29127 :
29128 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_in_get_name(PyObject *obj, void *closure)
29129 : {
29130 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(obj);
29131 : PyObject *py_name;
29132 0 : if (object->in.name == NULL) {
29133 0 : Py_RETURN_NONE;
29134 : }
29135 0 : if (object->in.name == NULL) {
29136 0 : py_name = Py_None;
29137 0 : Py_INCREF(py_name);
29138 : } else {
29139 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
29140 : }
29141 0 : return py_name;
29142 : }
29143 :
29144 0 : static int py_lsa_EnumAccountsWithUserRight_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
29145 : {
29146 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29147 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
29148 0 : if (value == NULL) {
29149 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
29150 0 : return -1;
29151 : }
29152 0 : if (value == Py_None) {
29153 0 : object->in.name = NULL;
29154 : } else {
29155 0 : object->in.name = NULL;
29156 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
29157 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29158 0 : PyErr_NoMemory();
29159 0 : return -1;
29160 : }
29161 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
29162 : }
29163 0 : return 0;
29164 : }
29165 :
29166 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_out_get_sids(PyObject *obj, void *closure)
29167 : {
29168 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(obj);
29169 : PyObject *py_sids;
29170 0 : if (object->out.sids == NULL) {
29171 0 : Py_RETURN_NONE;
29172 : }
29173 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->out.sids, object->out.sids);
29174 0 : return py_sids;
29175 : }
29176 :
29177 0 : static int py_lsa_EnumAccountsWithUserRight_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
29178 : {
29179 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29180 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
29181 0 : if (value == NULL) {
29182 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
29183 0 : return -1;
29184 : }
29185 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
29186 0 : if (object->out.sids == NULL) {
29187 0 : PyErr_NoMemory();
29188 0 : return -1;
29189 : }
29190 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
29191 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29192 0 : PyErr_NoMemory();
29193 0 : return -1;
29194 : }
29195 0 : object->out.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
29196 0 : return 0;
29197 : }
29198 :
29199 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_get_result(PyObject *obj, void *closure)
29200 : {
29201 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(obj);
29202 : PyObject *py_result;
29203 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
29204 0 : return py_result;
29205 : }
29206 :
29207 0 : static int py_lsa_EnumAccountsWithUserRight_set_result(PyObject *py_obj, PyObject *value, void *closure)
29208 : {
29209 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29210 0 : if (value == NULL) {
29211 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
29212 0 : return -1;
29213 : }
29214 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
29215 0 : return 0;
29216 : }
29217 :
29218 : static PyGetSetDef py_lsa_EnumAccountsWithUserRight_getsetters[] = {
29219 : {
29220 : .name = discard_const_p(char, "in_handle"),
29221 : .get = py_lsa_EnumAccountsWithUserRight_in_get_handle,
29222 : .set = py_lsa_EnumAccountsWithUserRight_in_set_handle,
29223 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
29224 : },
29225 : {
29226 : .name = discard_const_p(char, "in_name"),
29227 : .get = py_lsa_EnumAccountsWithUserRight_in_get_name,
29228 : .set = py_lsa_EnumAccountsWithUserRight_in_set_name,
29229 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
29230 : },
29231 : {
29232 : .name = discard_const_p(char, "out_sids"),
29233 : .get = py_lsa_EnumAccountsWithUserRight_out_get_sids,
29234 : .set = py_lsa_EnumAccountsWithUserRight_out_set_sids,
29235 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
29236 : },
29237 : {
29238 : .name = discard_const_p(char, "result"),
29239 : .get = py_lsa_EnumAccountsWithUserRight_get_result,
29240 : .set = py_lsa_EnumAccountsWithUserRight_set_result,
29241 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
29242 : },
29243 : { .name = NULL }
29244 : };
29245 :
29246 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
29247 : {
29248 0 : PyObject *self = pytalloc_new(struct lsa_EnumAccountsWithUserRight, type);
29249 0 : struct lsa_EnumAccountsWithUserRight *_self = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(self);
29250 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
29251 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
29252 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
29253 0 : return self;
29254 : }
29255 :
29256 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
29257 : {
29258 :
29259 :
29260 0 : return PyLong_FromLong(35);
29261 : }
29262 :
29263 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
29264 : {
29265 0 : const struct ndr_interface_call *call = NULL;
29266 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29267 0 : PyObject *ret = NULL;
29268 0 : struct ndr_push *push = NULL;
29269 : DATA_BLOB blob;
29270 : enum ndr_err_code err;
29271 :
29272 0 : if (ndr_table_lsarpc.num_calls < 36) {
29273 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountsWithUserRight_ndr_pack");
29274 0 : return NULL;
29275 : }
29276 0 : call = &ndr_table_lsarpc.calls[35];
29277 :
29278 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
29279 0 : if (push == NULL) {
29280 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29281 0 : return NULL;
29282 : }
29283 :
29284 0 : push->flags |= ndr_push_flags;
29285 :
29286 0 : err = call->ndr_push(push, ndr_inout_flags, object);
29287 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29288 0 : TALLOC_FREE(push);
29289 0 : PyErr_SetNdrError(err);
29290 0 : return NULL;
29291 : }
29292 0 : blob = ndr_push_blob(push);
29293 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
29294 0 : TALLOC_FREE(push);
29295 0 : return ret;
29296 : }
29297 :
29298 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29299 : {
29300 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29301 0 : PyObject *bigendian_obj = NULL;
29302 0 : PyObject *ndr64_obj = NULL;
29303 0 : uint32_t ndr_push_flags = 0;
29304 :
29305 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
29306 : discard_const_p(char *, kwnames),
29307 : &bigendian_obj,
29308 : &ndr64_obj)) {
29309 0 : return NULL;
29310 : }
29311 :
29312 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29313 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29314 : }
29315 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29316 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29317 : }
29318 :
29319 0 : return py_lsa_EnumAccountsWithUserRight_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
29320 : }
29321 :
29322 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29323 : {
29324 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29325 0 : PyObject *bigendian_obj = NULL;
29326 0 : PyObject *ndr64_obj = NULL;
29327 0 : uint32_t ndr_push_flags = 0;
29328 :
29329 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
29330 : discard_const_p(char *, kwnames),
29331 : &bigendian_obj,
29332 : &ndr64_obj)) {
29333 0 : return NULL;
29334 : }
29335 :
29336 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29337 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29338 : }
29339 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29340 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29341 : }
29342 :
29343 0 : return py_lsa_EnumAccountsWithUserRight_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
29344 : }
29345 :
29346 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
29347 : {
29348 0 : const struct ndr_interface_call *call = NULL;
29349 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29350 0 : struct ndr_pull *pull = NULL;
29351 : enum ndr_err_code err;
29352 :
29353 0 : if (ndr_table_lsarpc.num_calls < 36) {
29354 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountsWithUserRight_ndr_unpack");
29355 0 : return NULL;
29356 : }
29357 0 : call = &ndr_table_lsarpc.calls[35];
29358 :
29359 0 : pull = ndr_pull_init_blob(blob, object);
29360 0 : if (pull == NULL) {
29361 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29362 0 : return NULL;
29363 : }
29364 :
29365 0 : pull->flags |= ndr_pull_flags;
29366 :
29367 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
29368 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29369 0 : TALLOC_FREE(pull);
29370 0 : PyErr_SetNdrError(err);
29371 0 : return NULL;
29372 : }
29373 0 : if (!allow_remaining) {
29374 : uint32_t highest_ofs;
29375 :
29376 0 : if (pull->offset > pull->relative_highest_offset) {
29377 0 : highest_ofs = pull->offset;
29378 : } else {
29379 0 : highest_ofs = pull->relative_highest_offset;
29380 : }
29381 0 : if (highest_ofs < pull->data_size) {
29382 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
29383 : "not all bytes consumed ofs[%u] size[%u]",
29384 : highest_ofs, pull->data_size);
29385 0 : TALLOC_FREE(pull);
29386 0 : PyErr_SetNdrError(err);
29387 0 : return NULL;
29388 : }
29389 : }
29390 :
29391 0 : TALLOC_FREE(pull);
29392 0 : Py_RETURN_NONE;
29393 : }
29394 :
29395 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29396 : {
29397 : DATA_BLOB blob;
29398 0 : Py_ssize_t blob_length = 0;
29399 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29400 0 : PyObject *bigendian_obj = NULL;
29401 0 : PyObject *ndr64_obj = NULL;
29402 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29403 0 : PyObject *allow_remaining_obj = NULL;
29404 0 : bool allow_remaining = false;
29405 :
29406 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
29407 : discard_const_p(char *, kwnames),
29408 : &blob.data, &blob_length,
29409 : &bigendian_obj,
29410 : &ndr64_obj,
29411 : &allow_remaining_obj)) {
29412 0 : return NULL;
29413 : }
29414 0 : blob.length = blob_length;
29415 :
29416 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29417 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29418 : }
29419 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29420 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29421 : }
29422 :
29423 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29424 0 : allow_remaining = true;
29425 : }
29426 :
29427 0 : return py_lsa_EnumAccountsWithUserRight_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
29428 : }
29429 :
29430 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29431 : {
29432 : DATA_BLOB blob;
29433 0 : Py_ssize_t blob_length = 0;
29434 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29435 0 : PyObject *bigendian_obj = NULL;
29436 0 : PyObject *ndr64_obj = NULL;
29437 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29438 0 : PyObject *allow_remaining_obj = NULL;
29439 0 : bool allow_remaining = false;
29440 :
29441 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
29442 : discard_const_p(char *, kwnames),
29443 : &blob.data, &blob_length,
29444 : &bigendian_obj,
29445 : &ndr64_obj,
29446 : &allow_remaining_obj)) {
29447 0 : return NULL;
29448 : }
29449 0 : blob.length = blob_length;
29450 :
29451 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29452 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29453 : }
29454 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29455 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29456 : }
29457 :
29458 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29459 0 : allow_remaining = true;
29460 : }
29461 :
29462 0 : return py_lsa_EnumAccountsWithUserRight_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
29463 : }
29464 :
29465 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
29466 : {
29467 0 : const struct ndr_interface_call *call = NULL;
29468 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29469 : PyObject *ret;
29470 : char *retstr;
29471 :
29472 0 : if (ndr_table_lsarpc.num_calls < 36) {
29473 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountsWithUserRight_ndr_print");
29474 0 : return NULL;
29475 : }
29476 0 : call = &ndr_table_lsarpc.calls[35];
29477 :
29478 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29479 0 : ret = PyUnicode_FromString(retstr);
29480 0 : TALLOC_FREE(retstr);
29481 :
29482 0 : return ret;
29483 : }
29484 :
29485 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29486 : {
29487 0 : return py_lsa_EnumAccountsWithUserRight_ndr_print(py_obj, "lsa_EnumAccountsWithUserRight_in", NDR_IN);
29488 : }
29489 :
29490 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29491 : {
29492 0 : return py_lsa_EnumAccountsWithUserRight_ndr_print(py_obj, "lsa_EnumAccountsWithUserRight_out", NDR_OUT);
29493 : }
29494 :
29495 : static PyMethodDef py_lsa_EnumAccountsWithUserRight_methods[] = {
29496 : { "opnum", (PyCFunction)py_lsa_EnumAccountsWithUserRight_ndr_opnum, METH_NOARGS|METH_CLASS,
29497 : "lsa.EnumAccountsWithUserRight.opnum() -> 35 (0x23) " },
29498 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountsWithUserRight_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29499 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29500 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountsWithUserRight_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29501 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29502 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountsWithUserRight_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29503 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29504 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountsWithUserRight_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29505 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29506 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumAccountsWithUserRight_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29507 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumAccountsWithUserRight_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29508 : { NULL, NULL, 0, NULL }
29509 : };
29510 :
29511 :
29512 : static PyTypeObject lsa_EnumAccountsWithUserRight_Type = {
29513 : PyVarObject_HEAD_INIT(NULL, 0)
29514 : .tp_name = "lsa.EnumAccountsWithUserRight",
29515 : .tp_getset = py_lsa_EnumAccountsWithUserRight_getsetters,
29516 : .tp_methods = py_lsa_EnumAccountsWithUserRight_methods,
29517 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
29518 : .tp_new = py_lsa_EnumAccountsWithUserRight_new,
29519 : };
29520 :
29521 0 : static bool pack_py_lsa_EnumAccountsWithUserRight_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccountsWithUserRight *r)
29522 : {
29523 : PyObject *py_handle;
29524 : PyObject *py_name;
29525 0 : const char *kwnames[] = {
29526 : "handle", "name", NULL
29527 : };
29528 :
29529 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_EnumAccountsWithUserRight", discard_const_p(char *, kwnames), &py_handle, &py_name)) {
29530 0 : return false;
29531 : }
29532 :
29533 0 : if (py_handle == NULL) {
29534 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
29535 0 : return false;
29536 : }
29537 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
29538 0 : if (r->in.handle == NULL) {
29539 0 : PyErr_NoMemory();
29540 0 : return false;
29541 : }
29542 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
29543 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
29544 0 : PyErr_NoMemory();
29545 0 : return false;
29546 : }
29547 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
29548 0 : if (py_name == NULL) {
29549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
29550 0 : return false;
29551 : }
29552 0 : if (py_name == Py_None) {
29553 0 : r->in.name = NULL;
29554 : } else {
29555 0 : r->in.name = NULL;
29556 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
29557 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
29558 0 : PyErr_NoMemory();
29559 0 : return false;
29560 : }
29561 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
29562 : }
29563 0 : return true;
29564 : }
29565 :
29566 0 : static PyObject *unpack_py_lsa_EnumAccountsWithUserRight_args_out(struct lsa_EnumAccountsWithUserRight *r)
29567 : {
29568 : PyObject *result;
29569 : PyObject *py_sids;
29570 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, r->out.sids, r->out.sids);
29571 0 : result = py_sids;
29572 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
29573 0 : PyErr_SetNTSTATUS(r->out.result);
29574 0 : return NULL;
29575 : }
29576 :
29577 0 : return result;
29578 : }
29579 :
29580 :
29581 0 : static PyObject *py_lsa_EnumAccountRights_in_get_handle(PyObject *obj, void *closure)
29582 : {
29583 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(obj);
29584 : PyObject *py_handle;
29585 0 : if (object->in.handle == NULL) {
29586 0 : Py_RETURN_NONE;
29587 : }
29588 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
29589 0 : return py_handle;
29590 : }
29591 :
29592 0 : static int py_lsa_EnumAccountRights_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
29593 : {
29594 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29595 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
29596 0 : if (value == NULL) {
29597 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
29598 0 : return -1;
29599 : }
29600 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
29601 0 : if (object->in.handle == NULL) {
29602 0 : PyErr_NoMemory();
29603 0 : return -1;
29604 : }
29605 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
29606 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29607 0 : PyErr_NoMemory();
29608 0 : return -1;
29609 : }
29610 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
29611 0 : return 0;
29612 : }
29613 :
29614 0 : static PyObject *py_lsa_EnumAccountRights_in_get_sid(PyObject *obj, void *closure)
29615 : {
29616 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(obj);
29617 : PyObject *py_sid;
29618 0 : if (object->in.sid == NULL) {
29619 0 : Py_RETURN_NONE;
29620 : }
29621 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
29622 0 : return py_sid;
29623 : }
29624 :
29625 0 : static int py_lsa_EnumAccountRights_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
29626 : {
29627 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29628 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
29629 0 : if (value == NULL) {
29630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
29631 0 : return -1;
29632 : }
29633 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
29634 0 : if (object->in.sid == NULL) {
29635 0 : PyErr_NoMemory();
29636 0 : return -1;
29637 : }
29638 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
29639 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29640 0 : PyErr_NoMemory();
29641 0 : return -1;
29642 : }
29643 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
29644 0 : return 0;
29645 : }
29646 :
29647 0 : static PyObject *py_lsa_EnumAccountRights_out_get_rights(PyObject *obj, void *closure)
29648 : {
29649 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(obj);
29650 : PyObject *py_rights;
29651 0 : if (object->out.rights == NULL) {
29652 0 : Py_RETURN_NONE;
29653 : }
29654 0 : py_rights = pytalloc_reference_ex(&lsa_RightSet_Type, object->out.rights, object->out.rights);
29655 0 : return py_rights;
29656 : }
29657 :
29658 0 : static int py_lsa_EnumAccountRights_out_set_rights(PyObject *py_obj, PyObject *value, void *closure)
29659 : {
29660 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29661 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rights));
29662 0 : if (value == NULL) {
29663 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rights");
29664 0 : return -1;
29665 : }
29666 0 : object->out.rights = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rights);
29667 0 : if (object->out.rights == NULL) {
29668 0 : PyErr_NoMemory();
29669 0 : return -1;
29670 : }
29671 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, value, return -1;);
29672 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29673 0 : PyErr_NoMemory();
29674 0 : return -1;
29675 : }
29676 0 : object->out.rights = (struct lsa_RightSet *)pytalloc_get_ptr(value);
29677 0 : return 0;
29678 : }
29679 :
29680 0 : static PyObject *py_lsa_EnumAccountRights_get_result(PyObject *obj, void *closure)
29681 : {
29682 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(obj);
29683 : PyObject *py_result;
29684 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
29685 0 : return py_result;
29686 : }
29687 :
29688 0 : static int py_lsa_EnumAccountRights_set_result(PyObject *py_obj, PyObject *value, void *closure)
29689 : {
29690 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29691 0 : if (value == NULL) {
29692 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
29693 0 : return -1;
29694 : }
29695 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
29696 0 : return 0;
29697 : }
29698 :
29699 : static PyGetSetDef py_lsa_EnumAccountRights_getsetters[] = {
29700 : {
29701 : .name = discard_const_p(char, "in_handle"),
29702 : .get = py_lsa_EnumAccountRights_in_get_handle,
29703 : .set = py_lsa_EnumAccountRights_in_set_handle,
29704 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
29705 : },
29706 : {
29707 : .name = discard_const_p(char, "in_sid"),
29708 : .get = py_lsa_EnumAccountRights_in_get_sid,
29709 : .set = py_lsa_EnumAccountRights_in_set_sid,
29710 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
29711 : },
29712 : {
29713 : .name = discard_const_p(char, "out_rights"),
29714 : .get = py_lsa_EnumAccountRights_out_get_rights,
29715 : .set = py_lsa_EnumAccountRights_out_set_rights,
29716 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RightSet")
29717 : },
29718 : {
29719 : .name = discard_const_p(char, "result"),
29720 : .get = py_lsa_EnumAccountRights_get_result,
29721 : .set = py_lsa_EnumAccountRights_set_result,
29722 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
29723 : },
29724 : { .name = NULL }
29725 : };
29726 :
29727 0 : static PyObject *py_lsa_EnumAccountRights_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
29728 : {
29729 0 : PyObject *self = pytalloc_new(struct lsa_EnumAccountRights, type);
29730 0 : struct lsa_EnumAccountRights *_self = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(self);
29731 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
29732 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
29733 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
29734 0 : _self->out.rights = talloc_zero(mem_ctx, struct lsa_RightSet);
29735 0 : return self;
29736 : }
29737 :
29738 0 : static PyObject *py_lsa_EnumAccountRights_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
29739 : {
29740 :
29741 :
29742 0 : return PyLong_FromLong(36);
29743 : }
29744 :
29745 0 : static PyObject *py_lsa_EnumAccountRights_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
29746 : {
29747 0 : const struct ndr_interface_call *call = NULL;
29748 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29749 0 : PyObject *ret = NULL;
29750 0 : struct ndr_push *push = NULL;
29751 : DATA_BLOB blob;
29752 : enum ndr_err_code err;
29753 :
29754 0 : if (ndr_table_lsarpc.num_calls < 37) {
29755 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountRights_ndr_pack");
29756 0 : return NULL;
29757 : }
29758 0 : call = &ndr_table_lsarpc.calls[36];
29759 :
29760 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
29761 0 : if (push == NULL) {
29762 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29763 0 : return NULL;
29764 : }
29765 :
29766 0 : push->flags |= ndr_push_flags;
29767 :
29768 0 : err = call->ndr_push(push, ndr_inout_flags, object);
29769 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29770 0 : TALLOC_FREE(push);
29771 0 : PyErr_SetNdrError(err);
29772 0 : return NULL;
29773 : }
29774 0 : blob = ndr_push_blob(push);
29775 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
29776 0 : TALLOC_FREE(push);
29777 0 : return ret;
29778 : }
29779 :
29780 0 : static PyObject *py_lsa_EnumAccountRights_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29781 : {
29782 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29783 0 : PyObject *bigendian_obj = NULL;
29784 0 : PyObject *ndr64_obj = NULL;
29785 0 : uint32_t ndr_push_flags = 0;
29786 :
29787 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
29788 : discard_const_p(char *, kwnames),
29789 : &bigendian_obj,
29790 : &ndr64_obj)) {
29791 0 : return NULL;
29792 : }
29793 :
29794 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29795 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29796 : }
29797 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29798 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29799 : }
29800 :
29801 0 : return py_lsa_EnumAccountRights_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
29802 : }
29803 :
29804 0 : static PyObject *py_lsa_EnumAccountRights_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29805 : {
29806 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29807 0 : PyObject *bigendian_obj = NULL;
29808 0 : PyObject *ndr64_obj = NULL;
29809 0 : uint32_t ndr_push_flags = 0;
29810 :
29811 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
29812 : discard_const_p(char *, kwnames),
29813 : &bigendian_obj,
29814 : &ndr64_obj)) {
29815 0 : return NULL;
29816 : }
29817 :
29818 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29819 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29820 : }
29821 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29822 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29823 : }
29824 :
29825 0 : return py_lsa_EnumAccountRights_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
29826 : }
29827 :
29828 0 : static PyObject *py_lsa_EnumAccountRights_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
29829 : {
29830 0 : const struct ndr_interface_call *call = NULL;
29831 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29832 0 : struct ndr_pull *pull = NULL;
29833 : enum ndr_err_code err;
29834 :
29835 0 : if (ndr_table_lsarpc.num_calls < 37) {
29836 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountRights_ndr_unpack");
29837 0 : return NULL;
29838 : }
29839 0 : call = &ndr_table_lsarpc.calls[36];
29840 :
29841 0 : pull = ndr_pull_init_blob(blob, object);
29842 0 : if (pull == NULL) {
29843 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29844 0 : return NULL;
29845 : }
29846 :
29847 0 : pull->flags |= ndr_pull_flags;
29848 :
29849 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
29850 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29851 0 : TALLOC_FREE(pull);
29852 0 : PyErr_SetNdrError(err);
29853 0 : return NULL;
29854 : }
29855 0 : if (!allow_remaining) {
29856 : uint32_t highest_ofs;
29857 :
29858 0 : if (pull->offset > pull->relative_highest_offset) {
29859 0 : highest_ofs = pull->offset;
29860 : } else {
29861 0 : highest_ofs = pull->relative_highest_offset;
29862 : }
29863 0 : if (highest_ofs < pull->data_size) {
29864 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
29865 : "not all bytes consumed ofs[%u] size[%u]",
29866 : highest_ofs, pull->data_size);
29867 0 : TALLOC_FREE(pull);
29868 0 : PyErr_SetNdrError(err);
29869 0 : return NULL;
29870 : }
29871 : }
29872 :
29873 0 : TALLOC_FREE(pull);
29874 0 : Py_RETURN_NONE;
29875 : }
29876 :
29877 0 : static PyObject *py_lsa_EnumAccountRights_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29878 : {
29879 : DATA_BLOB blob;
29880 0 : Py_ssize_t blob_length = 0;
29881 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29882 0 : PyObject *bigendian_obj = NULL;
29883 0 : PyObject *ndr64_obj = NULL;
29884 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29885 0 : PyObject *allow_remaining_obj = NULL;
29886 0 : bool allow_remaining = false;
29887 :
29888 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
29889 : discard_const_p(char *, kwnames),
29890 : &blob.data, &blob_length,
29891 : &bigendian_obj,
29892 : &ndr64_obj,
29893 : &allow_remaining_obj)) {
29894 0 : return NULL;
29895 : }
29896 0 : blob.length = blob_length;
29897 :
29898 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29899 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29900 : }
29901 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29902 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29903 : }
29904 :
29905 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29906 0 : allow_remaining = true;
29907 : }
29908 :
29909 0 : return py_lsa_EnumAccountRights_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
29910 : }
29911 :
29912 0 : static PyObject *py_lsa_EnumAccountRights_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29913 : {
29914 : DATA_BLOB blob;
29915 0 : Py_ssize_t blob_length = 0;
29916 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29917 0 : PyObject *bigendian_obj = NULL;
29918 0 : PyObject *ndr64_obj = NULL;
29919 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29920 0 : PyObject *allow_remaining_obj = NULL;
29921 0 : bool allow_remaining = false;
29922 :
29923 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
29924 : discard_const_p(char *, kwnames),
29925 : &blob.data, &blob_length,
29926 : &bigendian_obj,
29927 : &ndr64_obj,
29928 : &allow_remaining_obj)) {
29929 0 : return NULL;
29930 : }
29931 0 : blob.length = blob_length;
29932 :
29933 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29934 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29935 : }
29936 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29937 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29938 : }
29939 :
29940 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29941 0 : allow_remaining = true;
29942 : }
29943 :
29944 0 : return py_lsa_EnumAccountRights_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
29945 : }
29946 :
29947 0 : static PyObject *py_lsa_EnumAccountRights_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
29948 : {
29949 0 : const struct ndr_interface_call *call = NULL;
29950 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29951 : PyObject *ret;
29952 : char *retstr;
29953 :
29954 0 : if (ndr_table_lsarpc.num_calls < 37) {
29955 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountRights_ndr_print");
29956 0 : return NULL;
29957 : }
29958 0 : call = &ndr_table_lsarpc.calls[36];
29959 :
29960 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29961 0 : ret = PyUnicode_FromString(retstr);
29962 0 : TALLOC_FREE(retstr);
29963 :
29964 0 : return ret;
29965 : }
29966 :
29967 0 : static PyObject *py_lsa_EnumAccountRights_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29968 : {
29969 0 : return py_lsa_EnumAccountRights_ndr_print(py_obj, "lsa_EnumAccountRights_in", NDR_IN);
29970 : }
29971 :
29972 0 : static PyObject *py_lsa_EnumAccountRights_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29973 : {
29974 0 : return py_lsa_EnumAccountRights_ndr_print(py_obj, "lsa_EnumAccountRights_out", NDR_OUT);
29975 : }
29976 :
29977 : static PyMethodDef py_lsa_EnumAccountRights_methods[] = {
29978 : { "opnum", (PyCFunction)py_lsa_EnumAccountRights_ndr_opnum, METH_NOARGS|METH_CLASS,
29979 : "lsa.EnumAccountRights.opnum() -> 36 (0x24) " },
29980 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountRights_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29981 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29982 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountRights_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29983 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29984 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountRights_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29985 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29986 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountRights_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29987 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29988 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumAccountRights_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29989 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumAccountRights_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29990 : { NULL, NULL, 0, NULL }
29991 : };
29992 :
29993 :
29994 : static PyTypeObject lsa_EnumAccountRights_Type = {
29995 : PyVarObject_HEAD_INIT(NULL, 0)
29996 : .tp_name = "lsa.EnumAccountRights",
29997 : .tp_getset = py_lsa_EnumAccountRights_getsetters,
29998 : .tp_methods = py_lsa_EnumAccountRights_methods,
29999 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
30000 : .tp_new = py_lsa_EnumAccountRights_new,
30001 : };
30002 :
30003 0 : static bool pack_py_lsa_EnumAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccountRights *r)
30004 : {
30005 : PyObject *py_handle;
30006 : PyObject *py_sid;
30007 0 : const char *kwnames[] = {
30008 : "handle", "sid", NULL
30009 : };
30010 :
30011 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_EnumAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid)) {
30012 0 : return false;
30013 : }
30014 :
30015 0 : if (py_handle == NULL) {
30016 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
30017 0 : return false;
30018 : }
30019 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
30020 0 : if (r->in.handle == NULL) {
30021 0 : PyErr_NoMemory();
30022 0 : return false;
30023 : }
30024 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
30025 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
30026 0 : PyErr_NoMemory();
30027 0 : return false;
30028 : }
30029 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
30030 0 : if (py_sid == NULL) {
30031 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
30032 0 : return false;
30033 : }
30034 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
30035 0 : if (r->in.sid == NULL) {
30036 0 : PyErr_NoMemory();
30037 0 : return false;
30038 : }
30039 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
30040 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
30041 0 : PyErr_NoMemory();
30042 0 : return false;
30043 : }
30044 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
30045 0 : return true;
30046 : }
30047 :
30048 0 : static PyObject *unpack_py_lsa_EnumAccountRights_args_out(struct lsa_EnumAccountRights *r)
30049 : {
30050 : PyObject *result;
30051 : PyObject *py_rights;
30052 0 : py_rights = pytalloc_reference_ex(&lsa_RightSet_Type, r->out.rights, r->out.rights);
30053 0 : result = py_rights;
30054 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
30055 0 : PyErr_SetNTSTATUS(r->out.result);
30056 0 : return NULL;
30057 : }
30058 :
30059 0 : return result;
30060 : }
30061 :
30062 :
30063 0 : static PyObject *py_lsa_AddAccountRights_in_get_handle(PyObject *obj, void *closure)
30064 : {
30065 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(obj);
30066 : PyObject *py_handle;
30067 0 : if (object->in.handle == NULL) {
30068 0 : Py_RETURN_NONE;
30069 : }
30070 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
30071 0 : return py_handle;
30072 : }
30073 :
30074 0 : static int py_lsa_AddAccountRights_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
30075 : {
30076 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30077 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
30078 0 : if (value == NULL) {
30079 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
30080 0 : return -1;
30081 : }
30082 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
30083 0 : if (object->in.handle == NULL) {
30084 0 : PyErr_NoMemory();
30085 0 : return -1;
30086 : }
30087 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
30088 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30089 0 : PyErr_NoMemory();
30090 0 : return -1;
30091 : }
30092 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
30093 0 : return 0;
30094 : }
30095 :
30096 0 : static PyObject *py_lsa_AddAccountRights_in_get_sid(PyObject *obj, void *closure)
30097 : {
30098 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(obj);
30099 : PyObject *py_sid;
30100 0 : if (object->in.sid == NULL) {
30101 0 : Py_RETURN_NONE;
30102 : }
30103 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
30104 0 : return py_sid;
30105 : }
30106 :
30107 0 : static int py_lsa_AddAccountRights_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
30108 : {
30109 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30110 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
30111 0 : if (value == NULL) {
30112 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
30113 0 : return -1;
30114 : }
30115 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
30116 0 : if (object->in.sid == NULL) {
30117 0 : PyErr_NoMemory();
30118 0 : return -1;
30119 : }
30120 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
30121 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30122 0 : PyErr_NoMemory();
30123 0 : return -1;
30124 : }
30125 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
30126 0 : return 0;
30127 : }
30128 :
30129 0 : static PyObject *py_lsa_AddAccountRights_in_get_rights(PyObject *obj, void *closure)
30130 : {
30131 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(obj);
30132 : PyObject *py_rights;
30133 0 : if (object->in.rights == NULL) {
30134 0 : Py_RETURN_NONE;
30135 : }
30136 0 : py_rights = pytalloc_reference_ex(&lsa_RightSet_Type, object->in.rights, object->in.rights);
30137 0 : return py_rights;
30138 : }
30139 :
30140 0 : static int py_lsa_AddAccountRights_in_set_rights(PyObject *py_obj, PyObject *value, void *closure)
30141 : {
30142 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30143 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.rights));
30144 0 : if (value == NULL) {
30145 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rights");
30146 0 : return -1;
30147 : }
30148 0 : object->in.rights = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.rights);
30149 0 : if (object->in.rights == NULL) {
30150 0 : PyErr_NoMemory();
30151 0 : return -1;
30152 : }
30153 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, value, return -1;);
30154 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30155 0 : PyErr_NoMemory();
30156 0 : return -1;
30157 : }
30158 0 : object->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(value);
30159 0 : return 0;
30160 : }
30161 :
30162 0 : static PyObject *py_lsa_AddAccountRights_get_result(PyObject *obj, void *closure)
30163 : {
30164 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(obj);
30165 : PyObject *py_result;
30166 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
30167 0 : return py_result;
30168 : }
30169 :
30170 0 : static int py_lsa_AddAccountRights_set_result(PyObject *py_obj, PyObject *value, void *closure)
30171 : {
30172 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30173 0 : if (value == NULL) {
30174 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
30175 0 : return -1;
30176 : }
30177 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
30178 0 : return 0;
30179 : }
30180 :
30181 : static PyGetSetDef py_lsa_AddAccountRights_getsetters[] = {
30182 : {
30183 : .name = discard_const_p(char, "in_handle"),
30184 : .get = py_lsa_AddAccountRights_in_get_handle,
30185 : .set = py_lsa_AddAccountRights_in_set_handle,
30186 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
30187 : },
30188 : {
30189 : .name = discard_const_p(char, "in_sid"),
30190 : .get = py_lsa_AddAccountRights_in_get_sid,
30191 : .set = py_lsa_AddAccountRights_in_set_sid,
30192 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
30193 : },
30194 : {
30195 : .name = discard_const_p(char, "in_rights"),
30196 : .get = py_lsa_AddAccountRights_in_get_rights,
30197 : .set = py_lsa_AddAccountRights_in_set_rights,
30198 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RightSet")
30199 : },
30200 : {
30201 : .name = discard_const_p(char, "result"),
30202 : .get = py_lsa_AddAccountRights_get_result,
30203 : .set = py_lsa_AddAccountRights_set_result,
30204 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
30205 : },
30206 : { .name = NULL }
30207 : };
30208 :
30209 0 : static PyObject *py_lsa_AddAccountRights_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30210 : {
30211 0 : PyObject *self = pytalloc_new(struct lsa_AddAccountRights, type);
30212 0 : struct lsa_AddAccountRights *_self = (struct lsa_AddAccountRights *)pytalloc_get_ptr(self);
30213 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30214 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
30215 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
30216 0 : _self->in.rights = talloc_zero(mem_ctx, struct lsa_RightSet);
30217 0 : return self;
30218 : }
30219 :
30220 0 : static PyObject *py_lsa_AddAccountRights_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30221 : {
30222 :
30223 :
30224 0 : return PyLong_FromLong(37);
30225 : }
30226 :
30227 0 : static PyObject *py_lsa_AddAccountRights_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
30228 : {
30229 0 : const struct ndr_interface_call *call = NULL;
30230 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30231 0 : PyObject *ret = NULL;
30232 0 : struct ndr_push *push = NULL;
30233 : DATA_BLOB blob;
30234 : enum ndr_err_code err;
30235 :
30236 0 : if (ndr_table_lsarpc.num_calls < 38) {
30237 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddAccountRights_ndr_pack");
30238 0 : return NULL;
30239 : }
30240 0 : call = &ndr_table_lsarpc.calls[37];
30241 :
30242 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
30243 0 : if (push == NULL) {
30244 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30245 0 : return NULL;
30246 : }
30247 :
30248 0 : push->flags |= ndr_push_flags;
30249 :
30250 0 : err = call->ndr_push(push, ndr_inout_flags, object);
30251 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30252 0 : TALLOC_FREE(push);
30253 0 : PyErr_SetNdrError(err);
30254 0 : return NULL;
30255 : }
30256 0 : blob = ndr_push_blob(push);
30257 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
30258 0 : TALLOC_FREE(push);
30259 0 : return ret;
30260 : }
30261 :
30262 0 : static PyObject *py_lsa_AddAccountRights_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30263 : {
30264 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30265 0 : PyObject *bigendian_obj = NULL;
30266 0 : PyObject *ndr64_obj = NULL;
30267 0 : uint32_t ndr_push_flags = 0;
30268 :
30269 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
30270 : discard_const_p(char *, kwnames),
30271 : &bigendian_obj,
30272 : &ndr64_obj)) {
30273 0 : return NULL;
30274 : }
30275 :
30276 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30277 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30278 : }
30279 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30280 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30281 : }
30282 :
30283 0 : return py_lsa_AddAccountRights_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
30284 : }
30285 :
30286 0 : static PyObject *py_lsa_AddAccountRights_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30287 : {
30288 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30289 0 : PyObject *bigendian_obj = NULL;
30290 0 : PyObject *ndr64_obj = NULL;
30291 0 : uint32_t ndr_push_flags = 0;
30292 :
30293 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
30294 : discard_const_p(char *, kwnames),
30295 : &bigendian_obj,
30296 : &ndr64_obj)) {
30297 0 : return NULL;
30298 : }
30299 :
30300 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30301 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30302 : }
30303 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30304 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30305 : }
30306 :
30307 0 : return py_lsa_AddAccountRights_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
30308 : }
30309 :
30310 0 : static PyObject *py_lsa_AddAccountRights_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
30311 : {
30312 0 : const struct ndr_interface_call *call = NULL;
30313 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30314 0 : struct ndr_pull *pull = NULL;
30315 : enum ndr_err_code err;
30316 :
30317 0 : if (ndr_table_lsarpc.num_calls < 38) {
30318 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddAccountRights_ndr_unpack");
30319 0 : return NULL;
30320 : }
30321 0 : call = &ndr_table_lsarpc.calls[37];
30322 :
30323 0 : pull = ndr_pull_init_blob(blob, object);
30324 0 : if (pull == NULL) {
30325 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30326 0 : return NULL;
30327 : }
30328 :
30329 0 : pull->flags |= ndr_pull_flags;
30330 :
30331 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
30332 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30333 0 : TALLOC_FREE(pull);
30334 0 : PyErr_SetNdrError(err);
30335 0 : return NULL;
30336 : }
30337 0 : if (!allow_remaining) {
30338 : uint32_t highest_ofs;
30339 :
30340 0 : if (pull->offset > pull->relative_highest_offset) {
30341 0 : highest_ofs = pull->offset;
30342 : } else {
30343 0 : highest_ofs = pull->relative_highest_offset;
30344 : }
30345 0 : if (highest_ofs < pull->data_size) {
30346 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
30347 : "not all bytes consumed ofs[%u] size[%u]",
30348 : highest_ofs, pull->data_size);
30349 0 : TALLOC_FREE(pull);
30350 0 : PyErr_SetNdrError(err);
30351 0 : return NULL;
30352 : }
30353 : }
30354 :
30355 0 : TALLOC_FREE(pull);
30356 0 : Py_RETURN_NONE;
30357 : }
30358 :
30359 0 : static PyObject *py_lsa_AddAccountRights_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30360 : {
30361 : DATA_BLOB blob;
30362 0 : Py_ssize_t blob_length = 0;
30363 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30364 0 : PyObject *bigendian_obj = NULL;
30365 0 : PyObject *ndr64_obj = NULL;
30366 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30367 0 : PyObject *allow_remaining_obj = NULL;
30368 0 : bool allow_remaining = false;
30369 :
30370 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
30371 : discard_const_p(char *, kwnames),
30372 : &blob.data, &blob_length,
30373 : &bigendian_obj,
30374 : &ndr64_obj,
30375 : &allow_remaining_obj)) {
30376 0 : return NULL;
30377 : }
30378 0 : blob.length = blob_length;
30379 :
30380 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30381 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30382 : }
30383 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30384 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30385 : }
30386 :
30387 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30388 0 : allow_remaining = true;
30389 : }
30390 :
30391 0 : return py_lsa_AddAccountRights_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
30392 : }
30393 :
30394 0 : static PyObject *py_lsa_AddAccountRights_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30395 : {
30396 : DATA_BLOB blob;
30397 0 : Py_ssize_t blob_length = 0;
30398 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30399 0 : PyObject *bigendian_obj = NULL;
30400 0 : PyObject *ndr64_obj = NULL;
30401 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30402 0 : PyObject *allow_remaining_obj = NULL;
30403 0 : bool allow_remaining = false;
30404 :
30405 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
30406 : discard_const_p(char *, kwnames),
30407 : &blob.data, &blob_length,
30408 : &bigendian_obj,
30409 : &ndr64_obj,
30410 : &allow_remaining_obj)) {
30411 0 : return NULL;
30412 : }
30413 0 : blob.length = blob_length;
30414 :
30415 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30416 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30417 : }
30418 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30419 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30420 : }
30421 :
30422 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30423 0 : allow_remaining = true;
30424 : }
30425 :
30426 0 : return py_lsa_AddAccountRights_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
30427 : }
30428 :
30429 0 : static PyObject *py_lsa_AddAccountRights_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
30430 : {
30431 0 : const struct ndr_interface_call *call = NULL;
30432 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30433 : PyObject *ret;
30434 : char *retstr;
30435 :
30436 0 : if (ndr_table_lsarpc.num_calls < 38) {
30437 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddAccountRights_ndr_print");
30438 0 : return NULL;
30439 : }
30440 0 : call = &ndr_table_lsarpc.calls[37];
30441 :
30442 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
30443 0 : ret = PyUnicode_FromString(retstr);
30444 0 : TALLOC_FREE(retstr);
30445 :
30446 0 : return ret;
30447 : }
30448 :
30449 0 : static PyObject *py_lsa_AddAccountRights_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30450 : {
30451 0 : return py_lsa_AddAccountRights_ndr_print(py_obj, "lsa_AddAccountRights_in", NDR_IN);
30452 : }
30453 :
30454 0 : static PyObject *py_lsa_AddAccountRights_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30455 : {
30456 0 : return py_lsa_AddAccountRights_ndr_print(py_obj, "lsa_AddAccountRights_out", NDR_OUT);
30457 : }
30458 :
30459 : static PyMethodDef py_lsa_AddAccountRights_methods[] = {
30460 : { "opnum", (PyCFunction)py_lsa_AddAccountRights_ndr_opnum, METH_NOARGS|METH_CLASS,
30461 : "lsa.AddAccountRights.opnum() -> 37 (0x25) " },
30462 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddAccountRights_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
30463 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
30464 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddAccountRights_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
30465 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
30466 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddAccountRights_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
30467 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
30468 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddAccountRights_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
30469 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
30470 : { "__ndr_print_in__", (PyCFunction)py_lsa_AddAccountRights_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
30471 : { "__ndr_print_out__", (PyCFunction)py_lsa_AddAccountRights_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
30472 : { NULL, NULL, 0, NULL }
30473 : };
30474 :
30475 :
30476 : static PyTypeObject lsa_AddAccountRights_Type = {
30477 : PyVarObject_HEAD_INIT(NULL, 0)
30478 : .tp_name = "lsa.AddAccountRights",
30479 : .tp_getset = py_lsa_AddAccountRights_getsetters,
30480 : .tp_methods = py_lsa_AddAccountRights_methods,
30481 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
30482 : .tp_new = py_lsa_AddAccountRights_new,
30483 : };
30484 :
30485 0 : static bool pack_py_lsa_AddAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_AddAccountRights *r)
30486 : {
30487 : PyObject *py_handle;
30488 : PyObject *py_sid;
30489 : PyObject *py_rights;
30490 0 : const char *kwnames[] = {
30491 : "handle", "sid", "rights", NULL
30492 : };
30493 :
30494 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_AddAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_rights)) {
30495 0 : return false;
30496 : }
30497 :
30498 0 : if (py_handle == NULL) {
30499 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
30500 0 : return false;
30501 : }
30502 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
30503 0 : if (r->in.handle == NULL) {
30504 0 : PyErr_NoMemory();
30505 0 : return false;
30506 : }
30507 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
30508 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
30509 0 : PyErr_NoMemory();
30510 0 : return false;
30511 : }
30512 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
30513 0 : if (py_sid == NULL) {
30514 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
30515 0 : return false;
30516 : }
30517 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
30518 0 : if (r->in.sid == NULL) {
30519 0 : PyErr_NoMemory();
30520 0 : return false;
30521 : }
30522 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
30523 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
30524 0 : PyErr_NoMemory();
30525 0 : return false;
30526 : }
30527 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
30528 0 : if (py_rights == NULL) {
30529 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rights");
30530 0 : return false;
30531 : }
30532 0 : r->in.rights = talloc_ptrtype(r, r->in.rights);
30533 0 : if (r->in.rights == NULL) {
30534 0 : PyErr_NoMemory();
30535 0 : return false;
30536 : }
30537 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, py_rights, return false;);
30538 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_rights)) == NULL) {
30539 0 : PyErr_NoMemory();
30540 0 : return false;
30541 : }
30542 0 : r->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(py_rights);
30543 0 : return true;
30544 : }
30545 :
30546 0 : static PyObject *unpack_py_lsa_AddAccountRights_args_out(struct lsa_AddAccountRights *r)
30547 : {
30548 : PyObject *result;
30549 0 : result = Py_None;
30550 0 : Py_INCREF(result);
30551 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
30552 0 : PyErr_SetNTSTATUS(r->out.result);
30553 0 : return NULL;
30554 : }
30555 :
30556 0 : return result;
30557 : }
30558 :
30559 :
30560 0 : static PyObject *py_lsa_RemoveAccountRights_in_get_handle(PyObject *obj, void *closure)
30561 : {
30562 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(obj);
30563 : PyObject *py_handle;
30564 0 : if (object->in.handle == NULL) {
30565 0 : Py_RETURN_NONE;
30566 : }
30567 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
30568 0 : return py_handle;
30569 : }
30570 :
30571 0 : static int py_lsa_RemoveAccountRights_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
30572 : {
30573 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30574 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
30575 0 : if (value == NULL) {
30576 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
30577 0 : return -1;
30578 : }
30579 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
30580 0 : if (object->in.handle == NULL) {
30581 0 : PyErr_NoMemory();
30582 0 : return -1;
30583 : }
30584 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
30585 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30586 0 : PyErr_NoMemory();
30587 0 : return -1;
30588 : }
30589 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
30590 0 : return 0;
30591 : }
30592 :
30593 0 : static PyObject *py_lsa_RemoveAccountRights_in_get_sid(PyObject *obj, void *closure)
30594 : {
30595 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(obj);
30596 : PyObject *py_sid;
30597 0 : if (object->in.sid == NULL) {
30598 0 : Py_RETURN_NONE;
30599 : }
30600 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
30601 0 : return py_sid;
30602 : }
30603 :
30604 0 : static int py_lsa_RemoveAccountRights_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
30605 : {
30606 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30607 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
30608 0 : if (value == NULL) {
30609 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
30610 0 : return -1;
30611 : }
30612 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
30613 0 : if (object->in.sid == NULL) {
30614 0 : PyErr_NoMemory();
30615 0 : return -1;
30616 : }
30617 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
30618 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30619 0 : PyErr_NoMemory();
30620 0 : return -1;
30621 : }
30622 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
30623 0 : return 0;
30624 : }
30625 :
30626 0 : static PyObject *py_lsa_RemoveAccountRights_in_get_remove_all(PyObject *obj, void *closure)
30627 : {
30628 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(obj);
30629 : PyObject *py_remove_all;
30630 0 : py_remove_all = PyLong_FromLong((uint16_t)object->in.remove_all);
30631 0 : return py_remove_all;
30632 : }
30633 :
30634 0 : static int py_lsa_RemoveAccountRights_in_set_remove_all(PyObject *py_obj, PyObject *value, void *closure)
30635 : {
30636 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30637 0 : if (value == NULL) {
30638 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.remove_all");
30639 0 : return -1;
30640 : }
30641 : {
30642 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.remove_all));
30643 0 : if (PyLong_Check(value)) {
30644 : unsigned long long test_var;
30645 0 : test_var = PyLong_AsUnsignedLongLong(value);
30646 0 : if (PyErr_Occurred() != NULL) {
30647 0 : return -1;
30648 : }
30649 0 : if (test_var > uint_max) {
30650 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30651 : PyLong_Type.tp_name, uint_max, test_var);
30652 0 : return -1;
30653 : }
30654 0 : object->in.remove_all = test_var;
30655 : } else {
30656 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30657 : PyLong_Type.tp_name);
30658 0 : return -1;
30659 : }
30660 : }
30661 0 : return 0;
30662 : }
30663 :
30664 0 : static PyObject *py_lsa_RemoveAccountRights_in_get_rights(PyObject *obj, void *closure)
30665 : {
30666 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(obj);
30667 : PyObject *py_rights;
30668 0 : if (object->in.rights == NULL) {
30669 0 : Py_RETURN_NONE;
30670 : }
30671 0 : py_rights = pytalloc_reference_ex(&lsa_RightSet_Type, object->in.rights, object->in.rights);
30672 0 : return py_rights;
30673 : }
30674 :
30675 0 : static int py_lsa_RemoveAccountRights_in_set_rights(PyObject *py_obj, PyObject *value, void *closure)
30676 : {
30677 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30678 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.rights));
30679 0 : if (value == NULL) {
30680 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rights");
30681 0 : return -1;
30682 : }
30683 0 : object->in.rights = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.rights);
30684 0 : if (object->in.rights == NULL) {
30685 0 : PyErr_NoMemory();
30686 0 : return -1;
30687 : }
30688 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, value, return -1;);
30689 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30690 0 : PyErr_NoMemory();
30691 0 : return -1;
30692 : }
30693 0 : object->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(value);
30694 0 : return 0;
30695 : }
30696 :
30697 0 : static PyObject *py_lsa_RemoveAccountRights_get_result(PyObject *obj, void *closure)
30698 : {
30699 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(obj);
30700 : PyObject *py_result;
30701 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
30702 0 : return py_result;
30703 : }
30704 :
30705 0 : static int py_lsa_RemoveAccountRights_set_result(PyObject *py_obj, PyObject *value, void *closure)
30706 : {
30707 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30708 0 : if (value == NULL) {
30709 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
30710 0 : return -1;
30711 : }
30712 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
30713 0 : return 0;
30714 : }
30715 :
30716 : static PyGetSetDef py_lsa_RemoveAccountRights_getsetters[] = {
30717 : {
30718 : .name = discard_const_p(char, "in_handle"),
30719 : .get = py_lsa_RemoveAccountRights_in_get_handle,
30720 : .set = py_lsa_RemoveAccountRights_in_set_handle,
30721 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
30722 : },
30723 : {
30724 : .name = discard_const_p(char, "in_sid"),
30725 : .get = py_lsa_RemoveAccountRights_in_get_sid,
30726 : .set = py_lsa_RemoveAccountRights_in_set_sid,
30727 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
30728 : },
30729 : {
30730 : .name = discard_const_p(char, "in_remove_all"),
30731 : .get = py_lsa_RemoveAccountRights_in_get_remove_all,
30732 : .set = py_lsa_RemoveAccountRights_in_set_remove_all,
30733 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
30734 : },
30735 : {
30736 : .name = discard_const_p(char, "in_rights"),
30737 : .get = py_lsa_RemoveAccountRights_in_get_rights,
30738 : .set = py_lsa_RemoveAccountRights_in_set_rights,
30739 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RightSet")
30740 : },
30741 : {
30742 : .name = discard_const_p(char, "result"),
30743 : .get = py_lsa_RemoveAccountRights_get_result,
30744 : .set = py_lsa_RemoveAccountRights_set_result,
30745 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
30746 : },
30747 : { .name = NULL }
30748 : };
30749 :
30750 0 : static PyObject *py_lsa_RemoveAccountRights_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30751 : {
30752 0 : PyObject *self = pytalloc_new(struct lsa_RemoveAccountRights, type);
30753 0 : struct lsa_RemoveAccountRights *_self = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(self);
30754 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30755 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
30756 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
30757 0 : _self->in.rights = talloc_zero(mem_ctx, struct lsa_RightSet);
30758 0 : return self;
30759 : }
30760 :
30761 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30762 : {
30763 :
30764 :
30765 0 : return PyLong_FromLong(38);
30766 : }
30767 :
30768 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
30769 : {
30770 0 : const struct ndr_interface_call *call = NULL;
30771 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30772 0 : PyObject *ret = NULL;
30773 0 : struct ndr_push *push = NULL;
30774 : DATA_BLOB blob;
30775 : enum ndr_err_code err;
30776 :
30777 0 : if (ndr_table_lsarpc.num_calls < 39) {
30778 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemoveAccountRights_ndr_pack");
30779 0 : return NULL;
30780 : }
30781 0 : call = &ndr_table_lsarpc.calls[38];
30782 :
30783 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
30784 0 : if (push == NULL) {
30785 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30786 0 : return NULL;
30787 : }
30788 :
30789 0 : push->flags |= ndr_push_flags;
30790 :
30791 0 : err = call->ndr_push(push, ndr_inout_flags, object);
30792 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30793 0 : TALLOC_FREE(push);
30794 0 : PyErr_SetNdrError(err);
30795 0 : return NULL;
30796 : }
30797 0 : blob = ndr_push_blob(push);
30798 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
30799 0 : TALLOC_FREE(push);
30800 0 : return ret;
30801 : }
30802 :
30803 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30804 : {
30805 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30806 0 : PyObject *bigendian_obj = NULL;
30807 0 : PyObject *ndr64_obj = NULL;
30808 0 : uint32_t ndr_push_flags = 0;
30809 :
30810 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
30811 : discard_const_p(char *, kwnames),
30812 : &bigendian_obj,
30813 : &ndr64_obj)) {
30814 0 : return NULL;
30815 : }
30816 :
30817 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30818 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30819 : }
30820 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30821 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30822 : }
30823 :
30824 0 : return py_lsa_RemoveAccountRights_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
30825 : }
30826 :
30827 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30828 : {
30829 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30830 0 : PyObject *bigendian_obj = NULL;
30831 0 : PyObject *ndr64_obj = NULL;
30832 0 : uint32_t ndr_push_flags = 0;
30833 :
30834 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
30835 : discard_const_p(char *, kwnames),
30836 : &bigendian_obj,
30837 : &ndr64_obj)) {
30838 0 : return NULL;
30839 : }
30840 :
30841 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30842 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30843 : }
30844 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30845 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30846 : }
30847 :
30848 0 : return py_lsa_RemoveAccountRights_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
30849 : }
30850 :
30851 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
30852 : {
30853 0 : const struct ndr_interface_call *call = NULL;
30854 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30855 0 : struct ndr_pull *pull = NULL;
30856 : enum ndr_err_code err;
30857 :
30858 0 : if (ndr_table_lsarpc.num_calls < 39) {
30859 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemoveAccountRights_ndr_unpack");
30860 0 : return NULL;
30861 : }
30862 0 : call = &ndr_table_lsarpc.calls[38];
30863 :
30864 0 : pull = ndr_pull_init_blob(blob, object);
30865 0 : if (pull == NULL) {
30866 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30867 0 : return NULL;
30868 : }
30869 :
30870 0 : pull->flags |= ndr_pull_flags;
30871 :
30872 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
30873 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30874 0 : TALLOC_FREE(pull);
30875 0 : PyErr_SetNdrError(err);
30876 0 : return NULL;
30877 : }
30878 0 : if (!allow_remaining) {
30879 : uint32_t highest_ofs;
30880 :
30881 0 : if (pull->offset > pull->relative_highest_offset) {
30882 0 : highest_ofs = pull->offset;
30883 : } else {
30884 0 : highest_ofs = pull->relative_highest_offset;
30885 : }
30886 0 : if (highest_ofs < pull->data_size) {
30887 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
30888 : "not all bytes consumed ofs[%u] size[%u]",
30889 : highest_ofs, pull->data_size);
30890 0 : TALLOC_FREE(pull);
30891 0 : PyErr_SetNdrError(err);
30892 0 : return NULL;
30893 : }
30894 : }
30895 :
30896 0 : TALLOC_FREE(pull);
30897 0 : Py_RETURN_NONE;
30898 : }
30899 :
30900 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30901 : {
30902 : DATA_BLOB blob;
30903 0 : Py_ssize_t blob_length = 0;
30904 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30905 0 : PyObject *bigendian_obj = NULL;
30906 0 : PyObject *ndr64_obj = NULL;
30907 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30908 0 : PyObject *allow_remaining_obj = NULL;
30909 0 : bool allow_remaining = false;
30910 :
30911 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
30912 : discard_const_p(char *, kwnames),
30913 : &blob.data, &blob_length,
30914 : &bigendian_obj,
30915 : &ndr64_obj,
30916 : &allow_remaining_obj)) {
30917 0 : return NULL;
30918 : }
30919 0 : blob.length = blob_length;
30920 :
30921 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30922 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30923 : }
30924 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30925 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30926 : }
30927 :
30928 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30929 0 : allow_remaining = true;
30930 : }
30931 :
30932 0 : return py_lsa_RemoveAccountRights_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
30933 : }
30934 :
30935 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30936 : {
30937 : DATA_BLOB blob;
30938 0 : Py_ssize_t blob_length = 0;
30939 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30940 0 : PyObject *bigendian_obj = NULL;
30941 0 : PyObject *ndr64_obj = NULL;
30942 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30943 0 : PyObject *allow_remaining_obj = NULL;
30944 0 : bool allow_remaining = false;
30945 :
30946 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
30947 : discard_const_p(char *, kwnames),
30948 : &blob.data, &blob_length,
30949 : &bigendian_obj,
30950 : &ndr64_obj,
30951 : &allow_remaining_obj)) {
30952 0 : return NULL;
30953 : }
30954 0 : blob.length = blob_length;
30955 :
30956 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30957 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30958 : }
30959 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30960 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30961 : }
30962 :
30963 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30964 0 : allow_remaining = true;
30965 : }
30966 :
30967 0 : return py_lsa_RemoveAccountRights_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
30968 : }
30969 :
30970 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
30971 : {
30972 0 : const struct ndr_interface_call *call = NULL;
30973 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30974 : PyObject *ret;
30975 : char *retstr;
30976 :
30977 0 : if (ndr_table_lsarpc.num_calls < 39) {
30978 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemoveAccountRights_ndr_print");
30979 0 : return NULL;
30980 : }
30981 0 : call = &ndr_table_lsarpc.calls[38];
30982 :
30983 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
30984 0 : ret = PyUnicode_FromString(retstr);
30985 0 : TALLOC_FREE(retstr);
30986 :
30987 0 : return ret;
30988 : }
30989 :
30990 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30991 : {
30992 0 : return py_lsa_RemoveAccountRights_ndr_print(py_obj, "lsa_RemoveAccountRights_in", NDR_IN);
30993 : }
30994 :
30995 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30996 : {
30997 0 : return py_lsa_RemoveAccountRights_ndr_print(py_obj, "lsa_RemoveAccountRights_out", NDR_OUT);
30998 : }
30999 :
31000 : static PyMethodDef py_lsa_RemoveAccountRights_methods[] = {
31001 : { "opnum", (PyCFunction)py_lsa_RemoveAccountRights_ndr_opnum, METH_NOARGS|METH_CLASS,
31002 : "lsa.RemoveAccountRights.opnum() -> 38 (0x26) " },
31003 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemoveAccountRights_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
31004 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
31005 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemoveAccountRights_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
31006 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
31007 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemoveAccountRights_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
31008 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
31009 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemoveAccountRights_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
31010 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
31011 : { "__ndr_print_in__", (PyCFunction)py_lsa_RemoveAccountRights_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
31012 : { "__ndr_print_out__", (PyCFunction)py_lsa_RemoveAccountRights_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
31013 : { NULL, NULL, 0, NULL }
31014 : };
31015 :
31016 :
31017 : static PyTypeObject lsa_RemoveAccountRights_Type = {
31018 : PyVarObject_HEAD_INIT(NULL, 0)
31019 : .tp_name = "lsa.RemoveAccountRights",
31020 : .tp_getset = py_lsa_RemoveAccountRights_getsetters,
31021 : .tp_methods = py_lsa_RemoveAccountRights_methods,
31022 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
31023 : .tp_new = py_lsa_RemoveAccountRights_new,
31024 : };
31025 :
31026 0 : static bool pack_py_lsa_RemoveAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_RemoveAccountRights *r)
31027 : {
31028 : PyObject *py_handle;
31029 : PyObject *py_sid;
31030 : PyObject *py_remove_all;
31031 : PyObject *py_rights;
31032 0 : const char *kwnames[] = {
31033 : "handle", "sid", "remove_all", "rights", NULL
31034 : };
31035 :
31036 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_RemoveAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_remove_all, &py_rights)) {
31037 0 : return false;
31038 : }
31039 :
31040 0 : if (py_handle == NULL) {
31041 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
31042 0 : return false;
31043 : }
31044 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
31045 0 : if (r->in.handle == NULL) {
31046 0 : PyErr_NoMemory();
31047 0 : return false;
31048 : }
31049 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
31050 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
31051 0 : PyErr_NoMemory();
31052 0 : return false;
31053 : }
31054 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
31055 0 : if (py_sid == NULL) {
31056 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
31057 0 : return false;
31058 : }
31059 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
31060 0 : if (r->in.sid == NULL) {
31061 0 : PyErr_NoMemory();
31062 0 : return false;
31063 : }
31064 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
31065 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
31066 0 : PyErr_NoMemory();
31067 0 : return false;
31068 : }
31069 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
31070 0 : if (py_remove_all == NULL) {
31071 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.remove_all");
31072 0 : return false;
31073 : }
31074 : {
31075 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.remove_all));
31076 0 : if (PyLong_Check(py_remove_all)) {
31077 : unsigned long long test_var;
31078 0 : test_var = PyLong_AsUnsignedLongLong(py_remove_all);
31079 0 : if (PyErr_Occurred() != NULL) {
31080 0 : return false;
31081 : }
31082 0 : if (test_var > uint_max) {
31083 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31084 : PyLong_Type.tp_name, uint_max, test_var);
31085 0 : return false;
31086 : }
31087 0 : r->in.remove_all = test_var;
31088 : } else {
31089 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31090 : PyLong_Type.tp_name);
31091 0 : return false;
31092 : }
31093 : }
31094 0 : if (py_rights == NULL) {
31095 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rights");
31096 0 : return false;
31097 : }
31098 0 : r->in.rights = talloc_ptrtype(r, r->in.rights);
31099 0 : if (r->in.rights == NULL) {
31100 0 : PyErr_NoMemory();
31101 0 : return false;
31102 : }
31103 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, py_rights, return false;);
31104 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_rights)) == NULL) {
31105 0 : PyErr_NoMemory();
31106 0 : return false;
31107 : }
31108 0 : r->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(py_rights);
31109 0 : return true;
31110 : }
31111 :
31112 0 : static PyObject *unpack_py_lsa_RemoveAccountRights_args_out(struct lsa_RemoveAccountRights *r)
31113 : {
31114 : PyObject *result;
31115 0 : result = Py_None;
31116 0 : Py_INCREF(result);
31117 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
31118 0 : PyErr_SetNTSTATUS(r->out.result);
31119 0 : return NULL;
31120 : }
31121 :
31122 0 : return result;
31123 : }
31124 :
31125 :
31126 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_in_get_handle(PyObject *obj, void *closure)
31127 : {
31128 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(obj);
31129 : PyObject *py_handle;
31130 0 : if (object->in.handle == NULL) {
31131 0 : Py_RETURN_NONE;
31132 : }
31133 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
31134 0 : return py_handle;
31135 : }
31136 :
31137 0 : static int py_lsa_QueryTrustedDomainInfoBySid_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
31138 : {
31139 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31140 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
31141 0 : if (value == NULL) {
31142 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
31143 0 : return -1;
31144 : }
31145 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
31146 0 : if (object->in.handle == NULL) {
31147 0 : PyErr_NoMemory();
31148 0 : return -1;
31149 : }
31150 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
31151 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31152 0 : PyErr_NoMemory();
31153 0 : return -1;
31154 : }
31155 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
31156 0 : return 0;
31157 : }
31158 :
31159 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_in_get_dom_sid(PyObject *obj, void *closure)
31160 : {
31161 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(obj);
31162 : PyObject *py_dom_sid;
31163 0 : if (object->in.dom_sid == NULL) {
31164 0 : Py_RETURN_NONE;
31165 : }
31166 0 : py_dom_sid = pytalloc_reference_ex(dom_sid_Type, object->in.dom_sid, object->in.dom_sid);
31167 0 : return py_dom_sid;
31168 : }
31169 :
31170 0 : static int py_lsa_QueryTrustedDomainInfoBySid_in_set_dom_sid(PyObject *py_obj, PyObject *value, void *closure)
31171 : {
31172 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31173 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dom_sid));
31174 0 : if (value == NULL) {
31175 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dom_sid");
31176 0 : return -1;
31177 : }
31178 0 : object->in.dom_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dom_sid);
31179 0 : if (object->in.dom_sid == NULL) {
31180 0 : PyErr_NoMemory();
31181 0 : return -1;
31182 : }
31183 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
31184 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31185 0 : PyErr_NoMemory();
31186 0 : return -1;
31187 : }
31188 0 : object->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(value);
31189 0 : return 0;
31190 : }
31191 :
31192 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_in_get_level(PyObject *obj, void *closure)
31193 : {
31194 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(obj);
31195 : PyObject *py_level;
31196 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
31197 0 : return py_level;
31198 : }
31199 :
31200 0 : static int py_lsa_QueryTrustedDomainInfoBySid_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
31201 : {
31202 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31203 0 : if (value == NULL) {
31204 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
31205 0 : return -1;
31206 : }
31207 : {
31208 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
31209 0 : if (PyLong_Check(value)) {
31210 : unsigned long long test_var;
31211 0 : test_var = PyLong_AsUnsignedLongLong(value);
31212 0 : if (PyErr_Occurred() != NULL) {
31213 0 : return -1;
31214 : }
31215 0 : if (test_var > uint_max) {
31216 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31217 : PyLong_Type.tp_name, uint_max, test_var);
31218 0 : return -1;
31219 : }
31220 0 : object->in.level = test_var;
31221 : } else {
31222 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31223 : PyLong_Type.tp_name);
31224 0 : return -1;
31225 : }
31226 : }
31227 0 : return 0;
31228 : }
31229 :
31230 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_out_get_info(PyObject *obj, void *closure)
31231 : {
31232 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(obj);
31233 : PyObject *py_info;
31234 0 : if (object->out.info == NULL) {
31235 0 : Py_RETURN_NONE;
31236 : }
31237 0 : if (*object->out.info == NULL) {
31238 0 : py_info = Py_None;
31239 0 : Py_INCREF(py_info);
31240 : } else {
31241 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_TrustedDomainInfo");
31242 0 : if (py_info == NULL) {
31243 0 : return NULL;
31244 : }
31245 : }
31246 0 : return py_info;
31247 : }
31248 :
31249 0 : static int py_lsa_QueryTrustedDomainInfoBySid_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
31250 : {
31251 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31252 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
31253 0 : if (value == NULL) {
31254 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
31255 0 : return -1;
31256 : }
31257 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
31258 0 : if (object->out.info == NULL) {
31259 0 : PyErr_NoMemory();
31260 0 : return -1;
31261 : }
31262 0 : if (value == Py_None) {
31263 0 : *object->out.info = NULL;
31264 : } else {
31265 0 : *object->out.info = NULL;
31266 : {
31267 : union lsa_TrustedDomainInfo *info_switch_2;
31268 0 : info_switch_2 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union lsa_TrustedDomainInfo");
31269 0 : if (info_switch_2 == NULL) {
31270 0 : return -1;
31271 : }
31272 0 : *object->out.info = info_switch_2;
31273 : }
31274 : }
31275 0 : return 0;
31276 : }
31277 :
31278 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_get_result(PyObject *obj, void *closure)
31279 : {
31280 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(obj);
31281 : PyObject *py_result;
31282 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
31283 0 : return py_result;
31284 : }
31285 :
31286 0 : static int py_lsa_QueryTrustedDomainInfoBySid_set_result(PyObject *py_obj, PyObject *value, void *closure)
31287 : {
31288 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31289 0 : if (value == NULL) {
31290 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
31291 0 : return -1;
31292 : }
31293 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
31294 0 : return 0;
31295 : }
31296 :
31297 : static PyGetSetDef py_lsa_QueryTrustedDomainInfoBySid_getsetters[] = {
31298 : {
31299 : .name = discard_const_p(char, "in_handle"),
31300 : .get = py_lsa_QueryTrustedDomainInfoBySid_in_get_handle,
31301 : .set = py_lsa_QueryTrustedDomainInfoBySid_in_set_handle,
31302 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
31303 : },
31304 : {
31305 : .name = discard_const_p(char, "in_dom_sid"),
31306 : .get = py_lsa_QueryTrustedDomainInfoBySid_in_get_dom_sid,
31307 : .set = py_lsa_QueryTrustedDomainInfoBySid_in_set_dom_sid,
31308 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
31309 : },
31310 : {
31311 : .name = discard_const_p(char, "in_level"),
31312 : .get = py_lsa_QueryTrustedDomainInfoBySid_in_get_level,
31313 : .set = py_lsa_QueryTrustedDomainInfoBySid_in_set_level,
31314 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
31315 : },
31316 : {
31317 : .name = discard_const_p(char, "out_info"),
31318 : .get = py_lsa_QueryTrustedDomainInfoBySid_out_get_info,
31319 : .set = py_lsa_QueryTrustedDomainInfoBySid_out_set_info,
31320 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
31321 : },
31322 : {
31323 : .name = discard_const_p(char, "result"),
31324 : .get = py_lsa_QueryTrustedDomainInfoBySid_get_result,
31325 : .set = py_lsa_QueryTrustedDomainInfoBySid_set_result,
31326 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
31327 : },
31328 : { .name = NULL }
31329 : };
31330 :
31331 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
31332 : {
31333 0 : PyObject *self = pytalloc_new(struct lsa_QueryTrustedDomainInfoBySid, type);
31334 0 : struct lsa_QueryTrustedDomainInfoBySid *_self = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(self);
31335 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
31336 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
31337 0 : _self->in.dom_sid = talloc_zero(mem_ctx, struct dom_sid2);
31338 : /* a pointer to a NULL pointer */
31339 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo *);
31340 0 : return self;
31341 : }
31342 :
31343 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
31344 : {
31345 :
31346 :
31347 0 : return PyLong_FromLong(39);
31348 : }
31349 :
31350 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
31351 : {
31352 0 : const struct ndr_interface_call *call = NULL;
31353 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31354 0 : PyObject *ret = NULL;
31355 0 : struct ndr_push *push = NULL;
31356 : DATA_BLOB blob;
31357 : enum ndr_err_code err;
31358 :
31359 0 : if (ndr_table_lsarpc.num_calls < 40) {
31360 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoBySid_ndr_pack");
31361 0 : return NULL;
31362 : }
31363 0 : call = &ndr_table_lsarpc.calls[39];
31364 :
31365 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
31366 0 : if (push == NULL) {
31367 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31368 0 : return NULL;
31369 : }
31370 :
31371 0 : push->flags |= ndr_push_flags;
31372 :
31373 0 : err = call->ndr_push(push, ndr_inout_flags, object);
31374 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31375 0 : TALLOC_FREE(push);
31376 0 : PyErr_SetNdrError(err);
31377 0 : return NULL;
31378 : }
31379 0 : blob = ndr_push_blob(push);
31380 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
31381 0 : TALLOC_FREE(push);
31382 0 : return ret;
31383 : }
31384 :
31385 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31386 : {
31387 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31388 0 : PyObject *bigendian_obj = NULL;
31389 0 : PyObject *ndr64_obj = NULL;
31390 0 : uint32_t ndr_push_flags = 0;
31391 :
31392 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
31393 : discard_const_p(char *, kwnames),
31394 : &bigendian_obj,
31395 : &ndr64_obj)) {
31396 0 : return NULL;
31397 : }
31398 :
31399 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31400 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31401 : }
31402 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31403 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31404 : }
31405 :
31406 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
31407 : }
31408 :
31409 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31410 : {
31411 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31412 0 : PyObject *bigendian_obj = NULL;
31413 0 : PyObject *ndr64_obj = NULL;
31414 0 : uint32_t ndr_push_flags = 0;
31415 :
31416 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
31417 : discard_const_p(char *, kwnames),
31418 : &bigendian_obj,
31419 : &ndr64_obj)) {
31420 0 : return NULL;
31421 : }
31422 :
31423 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31424 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31425 : }
31426 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31427 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31428 : }
31429 :
31430 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
31431 : }
31432 :
31433 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
31434 : {
31435 0 : const struct ndr_interface_call *call = NULL;
31436 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31437 0 : struct ndr_pull *pull = NULL;
31438 : enum ndr_err_code err;
31439 :
31440 0 : if (ndr_table_lsarpc.num_calls < 40) {
31441 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack");
31442 0 : return NULL;
31443 : }
31444 0 : call = &ndr_table_lsarpc.calls[39];
31445 :
31446 0 : pull = ndr_pull_init_blob(blob, object);
31447 0 : if (pull == NULL) {
31448 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31449 0 : return NULL;
31450 : }
31451 :
31452 0 : pull->flags |= ndr_pull_flags;
31453 :
31454 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
31455 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31456 0 : TALLOC_FREE(pull);
31457 0 : PyErr_SetNdrError(err);
31458 0 : return NULL;
31459 : }
31460 0 : if (!allow_remaining) {
31461 : uint32_t highest_ofs;
31462 :
31463 0 : if (pull->offset > pull->relative_highest_offset) {
31464 0 : highest_ofs = pull->offset;
31465 : } else {
31466 0 : highest_ofs = pull->relative_highest_offset;
31467 : }
31468 0 : if (highest_ofs < pull->data_size) {
31469 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
31470 : "not all bytes consumed ofs[%u] size[%u]",
31471 : highest_ofs, pull->data_size);
31472 0 : TALLOC_FREE(pull);
31473 0 : PyErr_SetNdrError(err);
31474 0 : return NULL;
31475 : }
31476 : }
31477 :
31478 0 : TALLOC_FREE(pull);
31479 0 : Py_RETURN_NONE;
31480 : }
31481 :
31482 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31483 : {
31484 : DATA_BLOB blob;
31485 0 : Py_ssize_t blob_length = 0;
31486 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31487 0 : PyObject *bigendian_obj = NULL;
31488 0 : PyObject *ndr64_obj = NULL;
31489 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31490 0 : PyObject *allow_remaining_obj = NULL;
31491 0 : bool allow_remaining = false;
31492 :
31493 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
31494 : discard_const_p(char *, kwnames),
31495 : &blob.data, &blob_length,
31496 : &bigendian_obj,
31497 : &ndr64_obj,
31498 : &allow_remaining_obj)) {
31499 0 : return NULL;
31500 : }
31501 0 : blob.length = blob_length;
31502 :
31503 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31504 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31505 : }
31506 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31507 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31508 : }
31509 :
31510 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31511 0 : allow_remaining = true;
31512 : }
31513 :
31514 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
31515 : }
31516 :
31517 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31518 : {
31519 : DATA_BLOB blob;
31520 0 : Py_ssize_t blob_length = 0;
31521 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31522 0 : PyObject *bigendian_obj = NULL;
31523 0 : PyObject *ndr64_obj = NULL;
31524 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31525 0 : PyObject *allow_remaining_obj = NULL;
31526 0 : bool allow_remaining = false;
31527 :
31528 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
31529 : discard_const_p(char *, kwnames),
31530 : &blob.data, &blob_length,
31531 : &bigendian_obj,
31532 : &ndr64_obj,
31533 : &allow_remaining_obj)) {
31534 0 : return NULL;
31535 : }
31536 0 : blob.length = blob_length;
31537 :
31538 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31539 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31540 : }
31541 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31542 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31543 : }
31544 :
31545 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31546 0 : allow_remaining = true;
31547 : }
31548 :
31549 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
31550 : }
31551 :
31552 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
31553 : {
31554 0 : const struct ndr_interface_call *call = NULL;
31555 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31556 : PyObject *ret;
31557 : char *retstr;
31558 :
31559 0 : if (ndr_table_lsarpc.num_calls < 40) {
31560 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoBySid_ndr_print");
31561 0 : return NULL;
31562 : }
31563 0 : call = &ndr_table_lsarpc.calls[39];
31564 :
31565 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
31566 0 : ret = PyUnicode_FromString(retstr);
31567 0 : TALLOC_FREE(retstr);
31568 :
31569 0 : return ret;
31570 : }
31571 :
31572 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31573 : {
31574 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_print(py_obj, "lsa_QueryTrustedDomainInfoBySid_in", NDR_IN);
31575 : }
31576 :
31577 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31578 : {
31579 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_print(py_obj, "lsa_QueryTrustedDomainInfoBySid_out", NDR_OUT);
31580 : }
31581 :
31582 : static PyMethodDef py_lsa_QueryTrustedDomainInfoBySid_methods[] = {
31583 : { "opnum", (PyCFunction)py_lsa_QueryTrustedDomainInfoBySid_ndr_opnum, METH_NOARGS|METH_CLASS,
31584 : "lsa.QueryTrustedDomainInfoBySid.opnum() -> 39 (0x27) " },
31585 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoBySid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
31586 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
31587 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoBySid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
31588 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
31589 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
31590 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
31591 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
31592 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
31593 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryTrustedDomainInfoBySid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
31594 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryTrustedDomainInfoBySid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
31595 : { NULL, NULL, 0, NULL }
31596 : };
31597 :
31598 :
31599 : static PyTypeObject lsa_QueryTrustedDomainInfoBySid_Type = {
31600 : PyVarObject_HEAD_INIT(NULL, 0)
31601 : .tp_name = "lsa.QueryTrustedDomainInfoBySid",
31602 : .tp_getset = py_lsa_QueryTrustedDomainInfoBySid_getsetters,
31603 : .tp_methods = py_lsa_QueryTrustedDomainInfoBySid_methods,
31604 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
31605 : .tp_new = py_lsa_QueryTrustedDomainInfoBySid_new,
31606 : };
31607 :
31608 1 : static bool pack_py_lsa_QueryTrustedDomainInfoBySid_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfoBySid *r)
31609 : {
31610 : PyObject *py_handle;
31611 : PyObject *py_dom_sid;
31612 : PyObject *py_level;
31613 1 : const char *kwnames[] = {
31614 : "handle", "dom_sid", "level", NULL
31615 : };
31616 :
31617 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_QueryTrustedDomainInfoBySid", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid, &py_level)) {
31618 0 : return false;
31619 : }
31620 :
31621 1 : if (py_handle == NULL) {
31622 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
31623 0 : return false;
31624 : }
31625 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
31626 1 : if (r->in.handle == NULL) {
31627 0 : PyErr_NoMemory();
31628 0 : return false;
31629 : }
31630 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
31631 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
31632 0 : PyErr_NoMemory();
31633 0 : return false;
31634 : }
31635 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
31636 1 : if (py_dom_sid == NULL) {
31637 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dom_sid");
31638 0 : return false;
31639 : }
31640 1 : r->in.dom_sid = talloc_ptrtype(r, r->in.dom_sid);
31641 1 : if (r->in.dom_sid == NULL) {
31642 0 : PyErr_NoMemory();
31643 0 : return false;
31644 : }
31645 1 : PY_CHECK_TYPE(dom_sid_Type, py_dom_sid, return false;);
31646 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dom_sid)) == NULL) {
31647 0 : PyErr_NoMemory();
31648 0 : return false;
31649 : }
31650 1 : r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
31651 1 : if (py_level == NULL) {
31652 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
31653 0 : return false;
31654 : }
31655 : {
31656 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
31657 1 : if (PyLong_Check(py_level)) {
31658 : unsigned long long test_var;
31659 1 : test_var = PyLong_AsUnsignedLongLong(py_level);
31660 1 : if (PyErr_Occurred() != NULL) {
31661 0 : return false;
31662 : }
31663 1 : if (test_var > uint_max) {
31664 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31665 : PyLong_Type.tp_name, uint_max, test_var);
31666 0 : return false;
31667 : }
31668 1 : r->in.level = test_var;
31669 : } else {
31670 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31671 : PyLong_Type.tp_name);
31672 0 : return false;
31673 : }
31674 : }
31675 1 : return true;
31676 : }
31677 :
31678 1 : static PyObject *unpack_py_lsa_QueryTrustedDomainInfoBySid_args_out(struct lsa_QueryTrustedDomainInfoBySid *r)
31679 : {
31680 : PyObject *result;
31681 : PyObject *py_info;
31682 1 : if (*r->out.info == NULL) {
31683 1 : py_info = Py_None;
31684 1 : Py_INCREF(py_info);
31685 : } else {
31686 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_TrustedDomainInfo");
31687 0 : if (py_info == NULL) {
31688 0 : return NULL;
31689 : }
31690 : }
31691 1 : result = py_info;
31692 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
31693 1 : PyErr_SetNTSTATUS(r->out.result);
31694 1 : return NULL;
31695 : }
31696 :
31697 0 : return result;
31698 : }
31699 :
31700 :
31701 0 : static PyObject *py_lsa_SetTrustedDomainInfo_in_get_handle(PyObject *obj, void *closure)
31702 : {
31703 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(obj);
31704 : PyObject *py_handle;
31705 0 : if (object->in.handle == NULL) {
31706 0 : Py_RETURN_NONE;
31707 : }
31708 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
31709 0 : return py_handle;
31710 : }
31711 :
31712 0 : static int py_lsa_SetTrustedDomainInfo_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
31713 : {
31714 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
31715 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
31716 0 : if (value == NULL) {
31717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
31718 0 : return -1;
31719 : }
31720 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
31721 0 : if (object->in.handle == NULL) {
31722 0 : PyErr_NoMemory();
31723 0 : return -1;
31724 : }
31725 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
31726 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31727 0 : PyErr_NoMemory();
31728 0 : return -1;
31729 : }
31730 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
31731 0 : return 0;
31732 : }
31733 :
31734 0 : static PyObject *py_lsa_SetTrustedDomainInfo_in_get_dom_sid(PyObject *obj, void *closure)
31735 : {
31736 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(obj);
31737 : PyObject *py_dom_sid;
31738 0 : if (object->in.dom_sid == NULL) {
31739 0 : Py_RETURN_NONE;
31740 : }
31741 0 : py_dom_sid = pytalloc_reference_ex(dom_sid_Type, object->in.dom_sid, object->in.dom_sid);
31742 0 : return py_dom_sid;
31743 : }
31744 :
31745 0 : static int py_lsa_SetTrustedDomainInfo_in_set_dom_sid(PyObject *py_obj, PyObject *value, void *closure)
31746 : {
31747 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
31748 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dom_sid));
31749 0 : if (value == NULL) {
31750 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dom_sid");
31751 0 : return -1;
31752 : }
31753 0 : object->in.dom_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dom_sid);
31754 0 : if (object->in.dom_sid == NULL) {
31755 0 : PyErr_NoMemory();
31756 0 : return -1;
31757 : }
31758 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
31759 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31760 0 : PyErr_NoMemory();
31761 0 : return -1;
31762 : }
31763 0 : object->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(value);
31764 0 : return 0;
31765 : }
31766 :
31767 0 : static PyObject *py_lsa_SetTrustedDomainInfo_in_get_level(PyObject *obj, void *closure)
31768 : {
31769 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(obj);
31770 : PyObject *py_level;
31771 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
31772 0 : return py_level;
31773 : }
31774 :
31775 0 : static int py_lsa_SetTrustedDomainInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
31776 : {
31777 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
31778 0 : if (value == NULL) {
31779 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
31780 0 : return -1;
31781 : }
31782 : {
31783 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
31784 0 : if (PyLong_Check(value)) {
31785 : unsigned long long test_var;
31786 0 : test_var = PyLong_AsUnsignedLongLong(value);
31787 0 : if (PyErr_Occurred() != NULL) {
31788 0 : return -1;
31789 : }
31790 0 : if (test_var > uint_max) {
31791 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31792 : PyLong_Type.tp_name, uint_max, test_var);
31793 0 : return -1;
31794 : }
31795 0 : object->in.level = test_var;
31796 : } else {
31797 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31798 : PyLong_Type.tp_name);
31799 0 : return -1;
31800 : }
31801 : }
31802 0 : return 0;
31803 : }
31804 :
31805 0 : static PyObject *py_lsa_SetTrustedDomainInfo_in_get_info(PyObject *obj, void *closure)
31806 : {
31807 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(obj);
31808 : PyObject *py_info;
31809 0 : if (object->in.info == NULL) {
31810 0 : Py_RETURN_NONE;
31811 : }
31812 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, object->in.info, object->in.level, object->in.info, "union lsa_TrustedDomainInfo");
31813 0 : if (py_info == NULL) {
31814 0 : return NULL;
31815 : }
31816 0 : return py_info;
31817 : }
31818 :
31819 0 : static int py_lsa_SetTrustedDomainInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
31820 : {
31821 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
31822 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
31823 0 : if (value == NULL) {
31824 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
31825 0 : return -1;
31826 : }
31827 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
31828 0 : if (object->in.info == NULL) {
31829 0 : PyErr_NoMemory();
31830 0 : return -1;
31831 : }
31832 : {
31833 : union lsa_TrustedDomainInfo *info_switch_1;
31834 0 : info_switch_1 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union lsa_TrustedDomainInfo");
31835 0 : if (info_switch_1 == NULL) {
31836 0 : return -1;
31837 : }
31838 0 : object->in.info = info_switch_1;
31839 : }
31840 0 : return 0;
31841 : }
31842 :
31843 0 : static PyObject *py_lsa_SetTrustedDomainInfo_get_result(PyObject *obj, void *closure)
31844 : {
31845 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(obj);
31846 : PyObject *py_result;
31847 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
31848 0 : return py_result;
31849 : }
31850 :
31851 0 : static int py_lsa_SetTrustedDomainInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
31852 : {
31853 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
31854 0 : if (value == NULL) {
31855 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
31856 0 : return -1;
31857 : }
31858 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
31859 0 : return 0;
31860 : }
31861 :
31862 : static PyGetSetDef py_lsa_SetTrustedDomainInfo_getsetters[] = {
31863 : {
31864 : .name = discard_const_p(char, "in_handle"),
31865 : .get = py_lsa_SetTrustedDomainInfo_in_get_handle,
31866 : .set = py_lsa_SetTrustedDomainInfo_in_set_handle,
31867 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
31868 : },
31869 : {
31870 : .name = discard_const_p(char, "in_dom_sid"),
31871 : .get = py_lsa_SetTrustedDomainInfo_in_get_dom_sid,
31872 : .set = py_lsa_SetTrustedDomainInfo_in_set_dom_sid,
31873 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
31874 : },
31875 : {
31876 : .name = discard_const_p(char, "in_level"),
31877 : .get = py_lsa_SetTrustedDomainInfo_in_get_level,
31878 : .set = py_lsa_SetTrustedDomainInfo_in_set_level,
31879 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
31880 : },
31881 : {
31882 : .name = discard_const_p(char, "in_info"),
31883 : .get = py_lsa_SetTrustedDomainInfo_in_get_info,
31884 : .set = py_lsa_SetTrustedDomainInfo_in_set_info,
31885 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
31886 : },
31887 : {
31888 : .name = discard_const_p(char, "result"),
31889 : .get = py_lsa_SetTrustedDomainInfo_get_result,
31890 : .set = py_lsa_SetTrustedDomainInfo_set_result,
31891 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
31892 : },
31893 : { .name = NULL }
31894 : };
31895 :
31896 0 : static PyObject *py_lsa_SetTrustedDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
31897 : {
31898 0 : PyObject *self = pytalloc_new(struct lsa_SetTrustedDomainInfo, type);
31899 0 : struct lsa_SetTrustedDomainInfo *_self = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(self);
31900 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
31901 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
31902 0 : _self->in.dom_sid = talloc_zero(mem_ctx, struct dom_sid2);
31903 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
31904 0 : return self;
31905 : }
31906 :
31907 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
31908 : {
31909 :
31910 :
31911 0 : return PyLong_FromLong(40);
31912 : }
31913 :
31914 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
31915 : {
31916 0 : const struct ndr_interface_call *call = NULL;
31917 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
31918 0 : PyObject *ret = NULL;
31919 0 : struct ndr_push *push = NULL;
31920 : DATA_BLOB blob;
31921 : enum ndr_err_code err;
31922 :
31923 0 : if (ndr_table_lsarpc.num_calls < 41) {
31924 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfo_ndr_pack");
31925 0 : return NULL;
31926 : }
31927 0 : call = &ndr_table_lsarpc.calls[40];
31928 :
31929 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
31930 0 : if (push == NULL) {
31931 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31932 0 : return NULL;
31933 : }
31934 :
31935 0 : push->flags |= ndr_push_flags;
31936 :
31937 0 : err = call->ndr_push(push, ndr_inout_flags, object);
31938 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31939 0 : TALLOC_FREE(push);
31940 0 : PyErr_SetNdrError(err);
31941 0 : return NULL;
31942 : }
31943 0 : blob = ndr_push_blob(push);
31944 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
31945 0 : TALLOC_FREE(push);
31946 0 : return ret;
31947 : }
31948 :
31949 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31950 : {
31951 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31952 0 : PyObject *bigendian_obj = NULL;
31953 0 : PyObject *ndr64_obj = NULL;
31954 0 : uint32_t ndr_push_flags = 0;
31955 :
31956 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
31957 : discard_const_p(char *, kwnames),
31958 : &bigendian_obj,
31959 : &ndr64_obj)) {
31960 0 : return NULL;
31961 : }
31962 :
31963 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31964 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31965 : }
31966 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31967 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31968 : }
31969 :
31970 0 : return py_lsa_SetTrustedDomainInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
31971 : }
31972 :
31973 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31974 : {
31975 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31976 0 : PyObject *bigendian_obj = NULL;
31977 0 : PyObject *ndr64_obj = NULL;
31978 0 : uint32_t ndr_push_flags = 0;
31979 :
31980 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
31981 : discard_const_p(char *, kwnames),
31982 : &bigendian_obj,
31983 : &ndr64_obj)) {
31984 0 : return NULL;
31985 : }
31986 :
31987 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31988 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31989 : }
31990 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31991 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31992 : }
31993 :
31994 0 : return py_lsa_SetTrustedDomainInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
31995 : }
31996 :
31997 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
31998 : {
31999 0 : const struct ndr_interface_call *call = NULL;
32000 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
32001 0 : struct ndr_pull *pull = NULL;
32002 : enum ndr_err_code err;
32003 :
32004 0 : if (ndr_table_lsarpc.num_calls < 41) {
32005 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfo_ndr_unpack");
32006 0 : return NULL;
32007 : }
32008 0 : call = &ndr_table_lsarpc.calls[40];
32009 :
32010 0 : pull = ndr_pull_init_blob(blob, object);
32011 0 : if (pull == NULL) {
32012 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32013 0 : return NULL;
32014 : }
32015 :
32016 0 : pull->flags |= ndr_pull_flags;
32017 :
32018 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
32019 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32020 0 : TALLOC_FREE(pull);
32021 0 : PyErr_SetNdrError(err);
32022 0 : return NULL;
32023 : }
32024 0 : if (!allow_remaining) {
32025 : uint32_t highest_ofs;
32026 :
32027 0 : if (pull->offset > pull->relative_highest_offset) {
32028 0 : highest_ofs = pull->offset;
32029 : } else {
32030 0 : highest_ofs = pull->relative_highest_offset;
32031 : }
32032 0 : if (highest_ofs < pull->data_size) {
32033 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
32034 : "not all bytes consumed ofs[%u] size[%u]",
32035 : highest_ofs, pull->data_size);
32036 0 : TALLOC_FREE(pull);
32037 0 : PyErr_SetNdrError(err);
32038 0 : return NULL;
32039 : }
32040 : }
32041 :
32042 0 : TALLOC_FREE(pull);
32043 0 : Py_RETURN_NONE;
32044 : }
32045 :
32046 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32047 : {
32048 : DATA_BLOB blob;
32049 0 : Py_ssize_t blob_length = 0;
32050 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32051 0 : PyObject *bigendian_obj = NULL;
32052 0 : PyObject *ndr64_obj = NULL;
32053 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32054 0 : PyObject *allow_remaining_obj = NULL;
32055 0 : bool allow_remaining = false;
32056 :
32057 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
32058 : discard_const_p(char *, kwnames),
32059 : &blob.data, &blob_length,
32060 : &bigendian_obj,
32061 : &ndr64_obj,
32062 : &allow_remaining_obj)) {
32063 0 : return NULL;
32064 : }
32065 0 : blob.length = blob_length;
32066 :
32067 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32068 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32069 : }
32070 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32071 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32072 : }
32073 :
32074 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32075 0 : allow_remaining = true;
32076 : }
32077 :
32078 0 : return py_lsa_SetTrustedDomainInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
32079 : }
32080 :
32081 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32082 : {
32083 : DATA_BLOB blob;
32084 0 : Py_ssize_t blob_length = 0;
32085 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32086 0 : PyObject *bigendian_obj = NULL;
32087 0 : PyObject *ndr64_obj = NULL;
32088 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32089 0 : PyObject *allow_remaining_obj = NULL;
32090 0 : bool allow_remaining = false;
32091 :
32092 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
32093 : discard_const_p(char *, kwnames),
32094 : &blob.data, &blob_length,
32095 : &bigendian_obj,
32096 : &ndr64_obj,
32097 : &allow_remaining_obj)) {
32098 0 : return NULL;
32099 : }
32100 0 : blob.length = blob_length;
32101 :
32102 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32103 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32104 : }
32105 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32106 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32107 : }
32108 :
32109 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32110 0 : allow_remaining = true;
32111 : }
32112 :
32113 0 : return py_lsa_SetTrustedDomainInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
32114 : }
32115 :
32116 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
32117 : {
32118 0 : const struct ndr_interface_call *call = NULL;
32119 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
32120 : PyObject *ret;
32121 : char *retstr;
32122 :
32123 0 : if (ndr_table_lsarpc.num_calls < 41) {
32124 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfo_ndr_print");
32125 0 : return NULL;
32126 : }
32127 0 : call = &ndr_table_lsarpc.calls[40];
32128 :
32129 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
32130 0 : ret = PyUnicode_FromString(retstr);
32131 0 : TALLOC_FREE(retstr);
32132 :
32133 0 : return ret;
32134 : }
32135 :
32136 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32137 : {
32138 0 : return py_lsa_SetTrustedDomainInfo_ndr_print(py_obj, "lsa_SetTrustedDomainInfo_in", NDR_IN);
32139 : }
32140 :
32141 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32142 : {
32143 0 : return py_lsa_SetTrustedDomainInfo_ndr_print(py_obj, "lsa_SetTrustedDomainInfo_out", NDR_OUT);
32144 : }
32145 :
32146 : static PyMethodDef py_lsa_SetTrustedDomainInfo_methods[] = {
32147 : { "opnum", (PyCFunction)py_lsa_SetTrustedDomainInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
32148 : "lsa.SetTrustedDomainInfo.opnum() -> 40 (0x28) " },
32149 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
32150 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
32151 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
32152 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
32153 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
32154 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
32155 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
32156 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
32157 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetTrustedDomainInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
32158 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetTrustedDomainInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
32159 : { NULL, NULL, 0, NULL }
32160 : };
32161 :
32162 :
32163 : static PyTypeObject lsa_SetTrustedDomainInfo_Type = {
32164 : PyVarObject_HEAD_INIT(NULL, 0)
32165 : .tp_name = "lsa.SetTrustedDomainInfo",
32166 : .tp_getset = py_lsa_SetTrustedDomainInfo_getsetters,
32167 : .tp_methods = py_lsa_SetTrustedDomainInfo_methods,
32168 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
32169 : .tp_new = py_lsa_SetTrustedDomainInfo_new,
32170 : };
32171 :
32172 0 : static bool pack_py_lsa_SetTrustedDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetTrustedDomainInfo *r)
32173 : {
32174 : PyObject *py_handle;
32175 : PyObject *py_dom_sid;
32176 : PyObject *py_level;
32177 : PyObject *py_info;
32178 0 : const char *kwnames[] = {
32179 : "handle", "dom_sid", "level", "info", NULL
32180 : };
32181 :
32182 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_SetTrustedDomainInfo", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid, &py_level, &py_info)) {
32183 0 : return false;
32184 : }
32185 :
32186 0 : if (py_handle == NULL) {
32187 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
32188 0 : return false;
32189 : }
32190 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
32191 0 : if (r->in.handle == NULL) {
32192 0 : PyErr_NoMemory();
32193 0 : return false;
32194 : }
32195 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
32196 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
32197 0 : PyErr_NoMemory();
32198 0 : return false;
32199 : }
32200 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
32201 0 : if (py_dom_sid == NULL) {
32202 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dom_sid");
32203 0 : return false;
32204 : }
32205 0 : r->in.dom_sid = talloc_ptrtype(r, r->in.dom_sid);
32206 0 : if (r->in.dom_sid == NULL) {
32207 0 : PyErr_NoMemory();
32208 0 : return false;
32209 : }
32210 0 : PY_CHECK_TYPE(dom_sid_Type, py_dom_sid, return false;);
32211 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dom_sid)) == NULL) {
32212 0 : PyErr_NoMemory();
32213 0 : return false;
32214 : }
32215 0 : r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
32216 0 : if (py_level == NULL) {
32217 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
32218 0 : return false;
32219 : }
32220 : {
32221 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
32222 0 : if (PyLong_Check(py_level)) {
32223 : unsigned long long test_var;
32224 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
32225 0 : if (PyErr_Occurred() != NULL) {
32226 0 : return false;
32227 : }
32228 0 : if (test_var > uint_max) {
32229 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32230 : PyLong_Type.tp_name, uint_max, test_var);
32231 0 : return false;
32232 : }
32233 0 : r->in.level = test_var;
32234 : } else {
32235 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32236 : PyLong_Type.tp_name);
32237 0 : return false;
32238 : }
32239 : }
32240 0 : if (py_info == NULL) {
32241 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
32242 0 : return false;
32243 : }
32244 0 : r->in.info = talloc_ptrtype(r, r->in.info);
32245 0 : if (r->in.info == NULL) {
32246 0 : PyErr_NoMemory();
32247 0 : return false;
32248 : }
32249 : {
32250 : union lsa_TrustedDomainInfo *info_switch_1;
32251 0 : info_switch_1 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, r, r->in.level, py_info, "union lsa_TrustedDomainInfo");
32252 0 : if (info_switch_1 == NULL) {
32253 0 : return false;
32254 : }
32255 0 : r->in.info = info_switch_1;
32256 : }
32257 0 : return true;
32258 : }
32259 :
32260 0 : static PyObject *unpack_py_lsa_SetTrustedDomainInfo_args_out(struct lsa_SetTrustedDomainInfo *r)
32261 : {
32262 : PyObject *result;
32263 0 : result = Py_None;
32264 0 : Py_INCREF(result);
32265 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
32266 0 : PyErr_SetNTSTATUS(r->out.result);
32267 0 : return NULL;
32268 : }
32269 :
32270 0 : return result;
32271 : }
32272 :
32273 :
32274 0 : static PyObject *py_lsa_DeleteTrustedDomain_in_get_handle(PyObject *obj, void *closure)
32275 : {
32276 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(obj);
32277 : PyObject *py_handle;
32278 0 : if (object->in.handle == NULL) {
32279 0 : Py_RETURN_NONE;
32280 : }
32281 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
32282 0 : return py_handle;
32283 : }
32284 :
32285 0 : static int py_lsa_DeleteTrustedDomain_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
32286 : {
32287 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(py_obj);
32288 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
32289 0 : if (value == NULL) {
32290 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
32291 0 : return -1;
32292 : }
32293 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
32294 0 : if (object->in.handle == NULL) {
32295 0 : PyErr_NoMemory();
32296 0 : return -1;
32297 : }
32298 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
32299 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32300 0 : PyErr_NoMemory();
32301 0 : return -1;
32302 : }
32303 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
32304 0 : return 0;
32305 : }
32306 :
32307 0 : static PyObject *py_lsa_DeleteTrustedDomain_in_get_dom_sid(PyObject *obj, void *closure)
32308 : {
32309 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(obj);
32310 : PyObject *py_dom_sid;
32311 0 : if (object->in.dom_sid == NULL) {
32312 0 : Py_RETURN_NONE;
32313 : }
32314 0 : py_dom_sid = pytalloc_reference_ex(dom_sid_Type, object->in.dom_sid, object->in.dom_sid);
32315 0 : return py_dom_sid;
32316 : }
32317 :
32318 0 : static int py_lsa_DeleteTrustedDomain_in_set_dom_sid(PyObject *py_obj, PyObject *value, void *closure)
32319 : {
32320 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(py_obj);
32321 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dom_sid));
32322 0 : if (value == NULL) {
32323 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dom_sid");
32324 0 : return -1;
32325 : }
32326 0 : object->in.dom_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dom_sid);
32327 0 : if (object->in.dom_sid == NULL) {
32328 0 : PyErr_NoMemory();
32329 0 : return -1;
32330 : }
32331 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
32332 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32333 0 : PyErr_NoMemory();
32334 0 : return -1;
32335 : }
32336 0 : object->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(value);
32337 0 : return 0;
32338 : }
32339 :
32340 0 : static PyObject *py_lsa_DeleteTrustedDomain_get_result(PyObject *obj, void *closure)
32341 : {
32342 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(obj);
32343 : PyObject *py_result;
32344 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
32345 0 : return py_result;
32346 : }
32347 :
32348 0 : static int py_lsa_DeleteTrustedDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
32349 : {
32350 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(py_obj);
32351 0 : if (value == NULL) {
32352 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
32353 0 : return -1;
32354 : }
32355 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
32356 0 : return 0;
32357 : }
32358 :
32359 : static PyGetSetDef py_lsa_DeleteTrustedDomain_getsetters[] = {
32360 : {
32361 : .name = discard_const_p(char, "in_handle"),
32362 : .get = py_lsa_DeleteTrustedDomain_in_get_handle,
32363 : .set = py_lsa_DeleteTrustedDomain_in_set_handle,
32364 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
32365 : },
32366 : {
32367 : .name = discard_const_p(char, "in_dom_sid"),
32368 : .get = py_lsa_DeleteTrustedDomain_in_get_dom_sid,
32369 : .set = py_lsa_DeleteTrustedDomain_in_set_dom_sid,
32370 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
32371 : },
32372 : {
32373 : .name = discard_const_p(char, "result"),
32374 : .get = py_lsa_DeleteTrustedDomain_get_result,
32375 : .set = py_lsa_DeleteTrustedDomain_set_result,
32376 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
32377 : },
32378 : { .name = NULL }
32379 : };
32380 :
32381 0 : static PyObject *py_lsa_DeleteTrustedDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
32382 : {
32383 0 : PyObject *self = pytalloc_new(struct lsa_DeleteTrustedDomain, type);
32384 0 : struct lsa_DeleteTrustedDomain *_self = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(self);
32385 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
32386 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
32387 0 : _self->in.dom_sid = talloc_zero(mem_ctx, struct dom_sid2);
32388 0 : return self;
32389 : }
32390 :
32391 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
32392 : {
32393 :
32394 :
32395 0 : return PyLong_FromLong(41);
32396 : }
32397 :
32398 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
32399 : {
32400 0 : const struct ndr_interface_call *call = NULL;
32401 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(py_obj);
32402 0 : PyObject *ret = NULL;
32403 0 : struct ndr_push *push = NULL;
32404 : DATA_BLOB blob;
32405 : enum ndr_err_code err;
32406 :
32407 0 : if (ndr_table_lsarpc.num_calls < 42) {
32408 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteTrustedDomain_ndr_pack");
32409 0 : return NULL;
32410 : }
32411 0 : call = &ndr_table_lsarpc.calls[41];
32412 :
32413 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
32414 0 : if (push == NULL) {
32415 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32416 0 : return NULL;
32417 : }
32418 :
32419 0 : push->flags |= ndr_push_flags;
32420 :
32421 0 : err = call->ndr_push(push, ndr_inout_flags, object);
32422 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32423 0 : TALLOC_FREE(push);
32424 0 : PyErr_SetNdrError(err);
32425 0 : return NULL;
32426 : }
32427 0 : blob = ndr_push_blob(push);
32428 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
32429 0 : TALLOC_FREE(push);
32430 0 : return ret;
32431 : }
32432 :
32433 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32434 : {
32435 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32436 0 : PyObject *bigendian_obj = NULL;
32437 0 : PyObject *ndr64_obj = NULL;
32438 0 : uint32_t ndr_push_flags = 0;
32439 :
32440 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
32441 : discard_const_p(char *, kwnames),
32442 : &bigendian_obj,
32443 : &ndr64_obj)) {
32444 0 : return NULL;
32445 : }
32446 :
32447 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32448 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32449 : }
32450 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32451 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32452 : }
32453 :
32454 0 : return py_lsa_DeleteTrustedDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
32455 : }
32456 :
32457 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32458 : {
32459 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32460 0 : PyObject *bigendian_obj = NULL;
32461 0 : PyObject *ndr64_obj = NULL;
32462 0 : uint32_t ndr_push_flags = 0;
32463 :
32464 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
32465 : discard_const_p(char *, kwnames),
32466 : &bigendian_obj,
32467 : &ndr64_obj)) {
32468 0 : return NULL;
32469 : }
32470 :
32471 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32472 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32473 : }
32474 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32475 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32476 : }
32477 :
32478 0 : return py_lsa_DeleteTrustedDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
32479 : }
32480 :
32481 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
32482 : {
32483 0 : const struct ndr_interface_call *call = NULL;
32484 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(py_obj);
32485 0 : struct ndr_pull *pull = NULL;
32486 : enum ndr_err_code err;
32487 :
32488 0 : if (ndr_table_lsarpc.num_calls < 42) {
32489 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteTrustedDomain_ndr_unpack");
32490 0 : return NULL;
32491 : }
32492 0 : call = &ndr_table_lsarpc.calls[41];
32493 :
32494 0 : pull = ndr_pull_init_blob(blob, object);
32495 0 : if (pull == NULL) {
32496 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32497 0 : return NULL;
32498 : }
32499 :
32500 0 : pull->flags |= ndr_pull_flags;
32501 :
32502 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
32503 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32504 0 : TALLOC_FREE(pull);
32505 0 : PyErr_SetNdrError(err);
32506 0 : return NULL;
32507 : }
32508 0 : if (!allow_remaining) {
32509 : uint32_t highest_ofs;
32510 :
32511 0 : if (pull->offset > pull->relative_highest_offset) {
32512 0 : highest_ofs = pull->offset;
32513 : } else {
32514 0 : highest_ofs = pull->relative_highest_offset;
32515 : }
32516 0 : if (highest_ofs < pull->data_size) {
32517 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
32518 : "not all bytes consumed ofs[%u] size[%u]",
32519 : highest_ofs, pull->data_size);
32520 0 : TALLOC_FREE(pull);
32521 0 : PyErr_SetNdrError(err);
32522 0 : return NULL;
32523 : }
32524 : }
32525 :
32526 0 : TALLOC_FREE(pull);
32527 0 : Py_RETURN_NONE;
32528 : }
32529 :
32530 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32531 : {
32532 : DATA_BLOB blob;
32533 0 : Py_ssize_t blob_length = 0;
32534 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32535 0 : PyObject *bigendian_obj = NULL;
32536 0 : PyObject *ndr64_obj = NULL;
32537 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32538 0 : PyObject *allow_remaining_obj = NULL;
32539 0 : bool allow_remaining = false;
32540 :
32541 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
32542 : discard_const_p(char *, kwnames),
32543 : &blob.data, &blob_length,
32544 : &bigendian_obj,
32545 : &ndr64_obj,
32546 : &allow_remaining_obj)) {
32547 0 : return NULL;
32548 : }
32549 0 : blob.length = blob_length;
32550 :
32551 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32552 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32553 : }
32554 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32555 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32556 : }
32557 :
32558 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32559 0 : allow_remaining = true;
32560 : }
32561 :
32562 0 : return py_lsa_DeleteTrustedDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
32563 : }
32564 :
32565 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32566 : {
32567 : DATA_BLOB blob;
32568 0 : Py_ssize_t blob_length = 0;
32569 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32570 0 : PyObject *bigendian_obj = NULL;
32571 0 : PyObject *ndr64_obj = NULL;
32572 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32573 0 : PyObject *allow_remaining_obj = NULL;
32574 0 : bool allow_remaining = false;
32575 :
32576 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
32577 : discard_const_p(char *, kwnames),
32578 : &blob.data, &blob_length,
32579 : &bigendian_obj,
32580 : &ndr64_obj,
32581 : &allow_remaining_obj)) {
32582 0 : return NULL;
32583 : }
32584 0 : blob.length = blob_length;
32585 :
32586 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32587 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32588 : }
32589 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32590 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32591 : }
32592 :
32593 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32594 0 : allow_remaining = true;
32595 : }
32596 :
32597 0 : return py_lsa_DeleteTrustedDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
32598 : }
32599 :
32600 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
32601 : {
32602 0 : const struct ndr_interface_call *call = NULL;
32603 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(py_obj);
32604 : PyObject *ret;
32605 : char *retstr;
32606 :
32607 0 : if (ndr_table_lsarpc.num_calls < 42) {
32608 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteTrustedDomain_ndr_print");
32609 0 : return NULL;
32610 : }
32611 0 : call = &ndr_table_lsarpc.calls[41];
32612 :
32613 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
32614 0 : ret = PyUnicode_FromString(retstr);
32615 0 : TALLOC_FREE(retstr);
32616 :
32617 0 : return ret;
32618 : }
32619 :
32620 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32621 : {
32622 0 : return py_lsa_DeleteTrustedDomain_ndr_print(py_obj, "lsa_DeleteTrustedDomain_in", NDR_IN);
32623 : }
32624 :
32625 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32626 : {
32627 0 : return py_lsa_DeleteTrustedDomain_ndr_print(py_obj, "lsa_DeleteTrustedDomain_out", NDR_OUT);
32628 : }
32629 :
32630 : static PyMethodDef py_lsa_DeleteTrustedDomain_methods[] = {
32631 : { "opnum", (PyCFunction)py_lsa_DeleteTrustedDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
32632 : "lsa.DeleteTrustedDomain.opnum() -> 41 (0x29) " },
32633 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteTrustedDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
32634 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
32635 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteTrustedDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
32636 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
32637 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteTrustedDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
32638 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
32639 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteTrustedDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
32640 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
32641 : { "__ndr_print_in__", (PyCFunction)py_lsa_DeleteTrustedDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
32642 : { "__ndr_print_out__", (PyCFunction)py_lsa_DeleteTrustedDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
32643 : { NULL, NULL, 0, NULL }
32644 : };
32645 :
32646 :
32647 : static PyTypeObject lsa_DeleteTrustedDomain_Type = {
32648 : PyVarObject_HEAD_INIT(NULL, 0)
32649 : .tp_name = "lsa.DeleteTrustedDomain",
32650 : .tp_getset = py_lsa_DeleteTrustedDomain_getsetters,
32651 : .tp_methods = py_lsa_DeleteTrustedDomain_methods,
32652 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
32653 : .tp_new = py_lsa_DeleteTrustedDomain_new,
32654 : };
32655 :
32656 0 : static bool pack_py_lsa_DeleteTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_DeleteTrustedDomain *r)
32657 : {
32658 : PyObject *py_handle;
32659 : PyObject *py_dom_sid;
32660 0 : const char *kwnames[] = {
32661 : "handle", "dom_sid", NULL
32662 : };
32663 :
32664 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_DeleteTrustedDomain", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid)) {
32665 0 : return false;
32666 : }
32667 :
32668 0 : if (py_handle == NULL) {
32669 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
32670 0 : return false;
32671 : }
32672 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
32673 0 : if (r->in.handle == NULL) {
32674 0 : PyErr_NoMemory();
32675 0 : return false;
32676 : }
32677 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
32678 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
32679 0 : PyErr_NoMemory();
32680 0 : return false;
32681 : }
32682 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
32683 0 : if (py_dom_sid == NULL) {
32684 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dom_sid");
32685 0 : return false;
32686 : }
32687 0 : r->in.dom_sid = talloc_ptrtype(r, r->in.dom_sid);
32688 0 : if (r->in.dom_sid == NULL) {
32689 0 : PyErr_NoMemory();
32690 0 : return false;
32691 : }
32692 0 : PY_CHECK_TYPE(dom_sid_Type, py_dom_sid, return false;);
32693 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dom_sid)) == NULL) {
32694 0 : PyErr_NoMemory();
32695 0 : return false;
32696 : }
32697 0 : r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
32698 0 : return true;
32699 : }
32700 :
32701 0 : static PyObject *unpack_py_lsa_DeleteTrustedDomain_args_out(struct lsa_DeleteTrustedDomain *r)
32702 : {
32703 : PyObject *result;
32704 0 : result = Py_None;
32705 0 : Py_INCREF(result);
32706 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
32707 0 : PyErr_SetNTSTATUS(r->out.result);
32708 0 : return NULL;
32709 : }
32710 :
32711 0 : return result;
32712 : }
32713 :
32714 :
32715 0 : static PyObject *py_lsa_StorePrivateData_in_get_handle(PyObject *obj, void *closure)
32716 : {
32717 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(obj);
32718 : PyObject *py_handle;
32719 0 : if (object->in.handle == NULL) {
32720 0 : Py_RETURN_NONE;
32721 : }
32722 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
32723 0 : return py_handle;
32724 : }
32725 :
32726 0 : static int py_lsa_StorePrivateData_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
32727 : {
32728 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
32729 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
32730 0 : if (value == NULL) {
32731 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
32732 0 : return -1;
32733 : }
32734 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
32735 0 : if (object->in.handle == NULL) {
32736 0 : PyErr_NoMemory();
32737 0 : return -1;
32738 : }
32739 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
32740 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32741 0 : PyErr_NoMemory();
32742 0 : return -1;
32743 : }
32744 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
32745 0 : return 0;
32746 : }
32747 :
32748 0 : static PyObject *py_lsa_StorePrivateData_in_get_name(PyObject *obj, void *closure)
32749 : {
32750 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(obj);
32751 : PyObject *py_name;
32752 0 : if (object->in.name == NULL) {
32753 0 : Py_RETURN_NONE;
32754 : }
32755 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
32756 0 : return py_name;
32757 : }
32758 :
32759 0 : static int py_lsa_StorePrivateData_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
32760 : {
32761 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
32762 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
32763 0 : if (value == NULL) {
32764 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
32765 0 : return -1;
32766 : }
32767 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
32768 0 : if (object->in.name == NULL) {
32769 0 : PyErr_NoMemory();
32770 0 : return -1;
32771 : }
32772 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
32773 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32774 0 : PyErr_NoMemory();
32775 0 : return -1;
32776 : }
32777 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
32778 0 : return 0;
32779 : }
32780 :
32781 0 : static PyObject *py_lsa_StorePrivateData_in_get_val(PyObject *obj, void *closure)
32782 : {
32783 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(obj);
32784 : PyObject *py_val;
32785 0 : if (object->in.val == NULL) {
32786 0 : Py_RETURN_NONE;
32787 : }
32788 0 : if (object->in.val == NULL) {
32789 0 : py_val = Py_None;
32790 0 : Py_INCREF(py_val);
32791 : } else {
32792 0 : py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->in.val, object->in.val);
32793 : }
32794 0 : return py_val;
32795 : }
32796 :
32797 0 : static int py_lsa_StorePrivateData_in_set_val(PyObject *py_obj, PyObject *value, void *closure)
32798 : {
32799 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
32800 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.val));
32801 0 : if (value == NULL) {
32802 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.val");
32803 0 : return -1;
32804 : }
32805 0 : if (value == Py_None) {
32806 0 : object->in.val = NULL;
32807 : } else {
32808 0 : object->in.val = NULL;
32809 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
32810 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32811 0 : PyErr_NoMemory();
32812 0 : return -1;
32813 : }
32814 0 : object->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
32815 : }
32816 0 : return 0;
32817 : }
32818 :
32819 0 : static PyObject *py_lsa_StorePrivateData_get_result(PyObject *obj, void *closure)
32820 : {
32821 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(obj);
32822 : PyObject *py_result;
32823 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
32824 0 : return py_result;
32825 : }
32826 :
32827 0 : static int py_lsa_StorePrivateData_set_result(PyObject *py_obj, PyObject *value, void *closure)
32828 : {
32829 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
32830 0 : if (value == NULL) {
32831 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
32832 0 : return -1;
32833 : }
32834 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
32835 0 : return 0;
32836 : }
32837 :
32838 : static PyGetSetDef py_lsa_StorePrivateData_getsetters[] = {
32839 : {
32840 : .name = discard_const_p(char, "in_handle"),
32841 : .get = py_lsa_StorePrivateData_in_get_handle,
32842 : .set = py_lsa_StorePrivateData_in_set_handle,
32843 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
32844 : },
32845 : {
32846 : .name = discard_const_p(char, "in_name"),
32847 : .get = py_lsa_StorePrivateData_in_get_name,
32848 : .set = py_lsa_StorePrivateData_in_set_name,
32849 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
32850 : },
32851 : {
32852 : .name = discard_const_p(char, "in_val"),
32853 : .get = py_lsa_StorePrivateData_in_get_val,
32854 : .set = py_lsa_StorePrivateData_in_set_val,
32855 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
32856 : },
32857 : {
32858 : .name = discard_const_p(char, "result"),
32859 : .get = py_lsa_StorePrivateData_get_result,
32860 : .set = py_lsa_StorePrivateData_set_result,
32861 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
32862 : },
32863 : { .name = NULL }
32864 : };
32865 :
32866 0 : static PyObject *py_lsa_StorePrivateData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
32867 : {
32868 0 : PyObject *self = pytalloc_new(struct lsa_StorePrivateData, type);
32869 0 : struct lsa_StorePrivateData *_self = (struct lsa_StorePrivateData *)pytalloc_get_ptr(self);
32870 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
32871 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
32872 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
32873 0 : return self;
32874 : }
32875 :
32876 0 : static PyObject *py_lsa_StorePrivateData_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
32877 : {
32878 :
32879 :
32880 0 : return PyLong_FromLong(42);
32881 : }
32882 :
32883 0 : static PyObject *py_lsa_StorePrivateData_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
32884 : {
32885 0 : const struct ndr_interface_call *call = NULL;
32886 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
32887 0 : PyObject *ret = NULL;
32888 0 : struct ndr_push *push = NULL;
32889 : DATA_BLOB blob;
32890 : enum ndr_err_code err;
32891 :
32892 0 : if (ndr_table_lsarpc.num_calls < 43) {
32893 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_StorePrivateData_ndr_pack");
32894 0 : return NULL;
32895 : }
32896 0 : call = &ndr_table_lsarpc.calls[42];
32897 :
32898 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
32899 0 : if (push == NULL) {
32900 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32901 0 : return NULL;
32902 : }
32903 :
32904 0 : push->flags |= ndr_push_flags;
32905 :
32906 0 : err = call->ndr_push(push, ndr_inout_flags, object);
32907 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32908 0 : TALLOC_FREE(push);
32909 0 : PyErr_SetNdrError(err);
32910 0 : return NULL;
32911 : }
32912 0 : blob = ndr_push_blob(push);
32913 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
32914 0 : TALLOC_FREE(push);
32915 0 : return ret;
32916 : }
32917 :
32918 0 : static PyObject *py_lsa_StorePrivateData_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32919 : {
32920 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32921 0 : PyObject *bigendian_obj = NULL;
32922 0 : PyObject *ndr64_obj = NULL;
32923 0 : uint32_t ndr_push_flags = 0;
32924 :
32925 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
32926 : discard_const_p(char *, kwnames),
32927 : &bigendian_obj,
32928 : &ndr64_obj)) {
32929 0 : return NULL;
32930 : }
32931 :
32932 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32933 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32934 : }
32935 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32936 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32937 : }
32938 :
32939 0 : return py_lsa_StorePrivateData_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
32940 : }
32941 :
32942 0 : static PyObject *py_lsa_StorePrivateData_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32943 : {
32944 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32945 0 : PyObject *bigendian_obj = NULL;
32946 0 : PyObject *ndr64_obj = NULL;
32947 0 : uint32_t ndr_push_flags = 0;
32948 :
32949 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
32950 : discard_const_p(char *, kwnames),
32951 : &bigendian_obj,
32952 : &ndr64_obj)) {
32953 0 : return NULL;
32954 : }
32955 :
32956 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32957 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32958 : }
32959 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32960 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32961 : }
32962 :
32963 0 : return py_lsa_StorePrivateData_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
32964 : }
32965 :
32966 0 : static PyObject *py_lsa_StorePrivateData_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
32967 : {
32968 0 : const struct ndr_interface_call *call = NULL;
32969 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
32970 0 : struct ndr_pull *pull = NULL;
32971 : enum ndr_err_code err;
32972 :
32973 0 : if (ndr_table_lsarpc.num_calls < 43) {
32974 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_StorePrivateData_ndr_unpack");
32975 0 : return NULL;
32976 : }
32977 0 : call = &ndr_table_lsarpc.calls[42];
32978 :
32979 0 : pull = ndr_pull_init_blob(blob, object);
32980 0 : if (pull == NULL) {
32981 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32982 0 : return NULL;
32983 : }
32984 :
32985 0 : pull->flags |= ndr_pull_flags;
32986 :
32987 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
32988 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32989 0 : TALLOC_FREE(pull);
32990 0 : PyErr_SetNdrError(err);
32991 0 : return NULL;
32992 : }
32993 0 : if (!allow_remaining) {
32994 : uint32_t highest_ofs;
32995 :
32996 0 : if (pull->offset > pull->relative_highest_offset) {
32997 0 : highest_ofs = pull->offset;
32998 : } else {
32999 0 : highest_ofs = pull->relative_highest_offset;
33000 : }
33001 0 : if (highest_ofs < pull->data_size) {
33002 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
33003 : "not all bytes consumed ofs[%u] size[%u]",
33004 : highest_ofs, pull->data_size);
33005 0 : TALLOC_FREE(pull);
33006 0 : PyErr_SetNdrError(err);
33007 0 : return NULL;
33008 : }
33009 : }
33010 :
33011 0 : TALLOC_FREE(pull);
33012 0 : Py_RETURN_NONE;
33013 : }
33014 :
33015 0 : static PyObject *py_lsa_StorePrivateData_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33016 : {
33017 : DATA_BLOB blob;
33018 0 : Py_ssize_t blob_length = 0;
33019 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33020 0 : PyObject *bigendian_obj = NULL;
33021 0 : PyObject *ndr64_obj = NULL;
33022 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33023 0 : PyObject *allow_remaining_obj = NULL;
33024 0 : bool allow_remaining = false;
33025 :
33026 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
33027 : discard_const_p(char *, kwnames),
33028 : &blob.data, &blob_length,
33029 : &bigendian_obj,
33030 : &ndr64_obj,
33031 : &allow_remaining_obj)) {
33032 0 : return NULL;
33033 : }
33034 0 : blob.length = blob_length;
33035 :
33036 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33037 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33038 : }
33039 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33040 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33041 : }
33042 :
33043 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33044 0 : allow_remaining = true;
33045 : }
33046 :
33047 0 : return py_lsa_StorePrivateData_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
33048 : }
33049 :
33050 0 : static PyObject *py_lsa_StorePrivateData_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33051 : {
33052 : DATA_BLOB blob;
33053 0 : Py_ssize_t blob_length = 0;
33054 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33055 0 : PyObject *bigendian_obj = NULL;
33056 0 : PyObject *ndr64_obj = NULL;
33057 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33058 0 : PyObject *allow_remaining_obj = NULL;
33059 0 : bool allow_remaining = false;
33060 :
33061 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
33062 : discard_const_p(char *, kwnames),
33063 : &blob.data, &blob_length,
33064 : &bigendian_obj,
33065 : &ndr64_obj,
33066 : &allow_remaining_obj)) {
33067 0 : return NULL;
33068 : }
33069 0 : blob.length = blob_length;
33070 :
33071 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33072 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33073 : }
33074 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33075 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33076 : }
33077 :
33078 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33079 0 : allow_remaining = true;
33080 : }
33081 :
33082 0 : return py_lsa_StorePrivateData_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
33083 : }
33084 :
33085 0 : static PyObject *py_lsa_StorePrivateData_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
33086 : {
33087 0 : const struct ndr_interface_call *call = NULL;
33088 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
33089 : PyObject *ret;
33090 : char *retstr;
33091 :
33092 0 : if (ndr_table_lsarpc.num_calls < 43) {
33093 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_StorePrivateData_ndr_print");
33094 0 : return NULL;
33095 : }
33096 0 : call = &ndr_table_lsarpc.calls[42];
33097 :
33098 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
33099 0 : ret = PyUnicode_FromString(retstr);
33100 0 : TALLOC_FREE(retstr);
33101 :
33102 0 : return ret;
33103 : }
33104 :
33105 0 : static PyObject *py_lsa_StorePrivateData_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33106 : {
33107 0 : return py_lsa_StorePrivateData_ndr_print(py_obj, "lsa_StorePrivateData_in", NDR_IN);
33108 : }
33109 :
33110 0 : static PyObject *py_lsa_StorePrivateData_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33111 : {
33112 0 : return py_lsa_StorePrivateData_ndr_print(py_obj, "lsa_StorePrivateData_out", NDR_OUT);
33113 : }
33114 :
33115 : static PyMethodDef py_lsa_StorePrivateData_methods[] = {
33116 : { "opnum", (PyCFunction)py_lsa_StorePrivateData_ndr_opnum, METH_NOARGS|METH_CLASS,
33117 : "lsa.StorePrivateData.opnum() -> 42 (0x2a) " },
33118 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_StorePrivateData_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
33119 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
33120 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_StorePrivateData_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
33121 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
33122 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_StorePrivateData_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
33123 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
33124 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_StorePrivateData_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
33125 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
33126 : { "__ndr_print_in__", (PyCFunction)py_lsa_StorePrivateData_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
33127 : { "__ndr_print_out__", (PyCFunction)py_lsa_StorePrivateData_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
33128 : { NULL, NULL, 0, NULL }
33129 : };
33130 :
33131 :
33132 : static PyTypeObject lsa_StorePrivateData_Type = {
33133 : PyVarObject_HEAD_INIT(NULL, 0)
33134 : .tp_name = "lsa.StorePrivateData",
33135 : .tp_getset = py_lsa_StorePrivateData_getsetters,
33136 : .tp_methods = py_lsa_StorePrivateData_methods,
33137 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
33138 : .tp_new = py_lsa_StorePrivateData_new,
33139 : };
33140 :
33141 0 : static bool pack_py_lsa_StorePrivateData_args_in(PyObject *args, PyObject *kwargs, struct lsa_StorePrivateData *r)
33142 : {
33143 : PyObject *py_handle;
33144 : PyObject *py_name;
33145 : PyObject *py_val;
33146 0 : const char *kwnames[] = {
33147 : "handle", "name", "val", NULL
33148 : };
33149 :
33150 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_StorePrivateData", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_val)) {
33151 0 : return false;
33152 : }
33153 :
33154 0 : if (py_handle == NULL) {
33155 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
33156 0 : return false;
33157 : }
33158 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
33159 0 : if (r->in.handle == NULL) {
33160 0 : PyErr_NoMemory();
33161 0 : return false;
33162 : }
33163 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
33164 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
33165 0 : PyErr_NoMemory();
33166 0 : return false;
33167 : }
33168 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
33169 0 : if (py_name == NULL) {
33170 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
33171 0 : return false;
33172 : }
33173 0 : r->in.name = talloc_ptrtype(r, r->in.name);
33174 0 : if (r->in.name == NULL) {
33175 0 : PyErr_NoMemory();
33176 0 : return false;
33177 : }
33178 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
33179 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
33180 0 : PyErr_NoMemory();
33181 0 : return false;
33182 : }
33183 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
33184 0 : if (py_val == NULL) {
33185 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.val");
33186 0 : return false;
33187 : }
33188 0 : if (py_val == Py_None) {
33189 0 : r->in.val = NULL;
33190 : } else {
33191 0 : r->in.val = NULL;
33192 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_val, return false;);
33193 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_val)) == NULL) {
33194 0 : PyErr_NoMemory();
33195 0 : return false;
33196 : }
33197 0 : r->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_val);
33198 : }
33199 0 : return true;
33200 : }
33201 :
33202 0 : static PyObject *unpack_py_lsa_StorePrivateData_args_out(struct lsa_StorePrivateData *r)
33203 : {
33204 : PyObject *result;
33205 0 : result = Py_None;
33206 0 : Py_INCREF(result);
33207 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
33208 0 : PyErr_SetNTSTATUS(r->out.result);
33209 0 : return NULL;
33210 : }
33211 :
33212 0 : return result;
33213 : }
33214 :
33215 :
33216 0 : static PyObject *py_lsa_RetrievePrivateData_in_get_handle(PyObject *obj, void *closure)
33217 : {
33218 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(obj);
33219 : PyObject *py_handle;
33220 0 : if (object->in.handle == NULL) {
33221 0 : Py_RETURN_NONE;
33222 : }
33223 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
33224 0 : return py_handle;
33225 : }
33226 :
33227 0 : static int py_lsa_RetrievePrivateData_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
33228 : {
33229 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33230 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
33231 0 : if (value == NULL) {
33232 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
33233 0 : return -1;
33234 : }
33235 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
33236 0 : if (object->in.handle == NULL) {
33237 0 : PyErr_NoMemory();
33238 0 : return -1;
33239 : }
33240 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
33241 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33242 0 : PyErr_NoMemory();
33243 0 : return -1;
33244 : }
33245 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
33246 0 : return 0;
33247 : }
33248 :
33249 0 : static PyObject *py_lsa_RetrievePrivateData_in_get_name(PyObject *obj, void *closure)
33250 : {
33251 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(obj);
33252 : PyObject *py_name;
33253 0 : if (object->in.name == NULL) {
33254 0 : Py_RETURN_NONE;
33255 : }
33256 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
33257 0 : return py_name;
33258 : }
33259 :
33260 0 : static int py_lsa_RetrievePrivateData_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
33261 : {
33262 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33263 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
33264 0 : if (value == NULL) {
33265 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
33266 0 : return -1;
33267 : }
33268 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
33269 0 : if (object->in.name == NULL) {
33270 0 : PyErr_NoMemory();
33271 0 : return -1;
33272 : }
33273 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
33274 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33275 0 : PyErr_NoMemory();
33276 0 : return -1;
33277 : }
33278 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
33279 0 : return 0;
33280 : }
33281 :
33282 0 : static PyObject *py_lsa_RetrievePrivateData_in_get_val(PyObject *obj, void *closure)
33283 : {
33284 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(obj);
33285 : PyObject *py_val;
33286 0 : if (object->in.val == NULL) {
33287 0 : Py_RETURN_NONE;
33288 : }
33289 0 : if (*object->in.val == NULL) {
33290 0 : py_val = Py_None;
33291 0 : Py_INCREF(py_val);
33292 : } else {
33293 0 : py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, *object->in.val, *object->in.val);
33294 : }
33295 0 : return py_val;
33296 : }
33297 :
33298 0 : static int py_lsa_RetrievePrivateData_in_set_val(PyObject *py_obj, PyObject *value, void *closure)
33299 : {
33300 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33301 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.val));
33302 0 : if (value == NULL) {
33303 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.val");
33304 0 : return -1;
33305 : }
33306 0 : object->in.val = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.val);
33307 0 : if (object->in.val == NULL) {
33308 0 : PyErr_NoMemory();
33309 0 : return -1;
33310 : }
33311 0 : if (value == Py_None) {
33312 0 : *object->in.val = NULL;
33313 : } else {
33314 0 : *object->in.val = NULL;
33315 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
33316 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33317 0 : PyErr_NoMemory();
33318 0 : return -1;
33319 : }
33320 0 : *object->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
33321 : }
33322 0 : return 0;
33323 : }
33324 :
33325 0 : static PyObject *py_lsa_RetrievePrivateData_out_get_val(PyObject *obj, void *closure)
33326 : {
33327 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(obj);
33328 : PyObject *py_val;
33329 0 : if (object->out.val == NULL) {
33330 0 : Py_RETURN_NONE;
33331 : }
33332 0 : if (*object->out.val == NULL) {
33333 0 : py_val = Py_None;
33334 0 : Py_INCREF(py_val);
33335 : } else {
33336 0 : py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, *object->out.val, *object->out.val);
33337 : }
33338 0 : return py_val;
33339 : }
33340 :
33341 0 : static int py_lsa_RetrievePrivateData_out_set_val(PyObject *py_obj, PyObject *value, void *closure)
33342 : {
33343 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33344 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.val));
33345 0 : if (value == NULL) {
33346 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.val");
33347 0 : return -1;
33348 : }
33349 0 : object->out.val = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.val);
33350 0 : if (object->out.val == NULL) {
33351 0 : PyErr_NoMemory();
33352 0 : return -1;
33353 : }
33354 0 : if (value == Py_None) {
33355 0 : *object->out.val = NULL;
33356 : } else {
33357 0 : *object->out.val = NULL;
33358 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
33359 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33360 0 : PyErr_NoMemory();
33361 0 : return -1;
33362 : }
33363 0 : *object->out.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
33364 : }
33365 0 : return 0;
33366 : }
33367 :
33368 0 : static PyObject *py_lsa_RetrievePrivateData_get_result(PyObject *obj, void *closure)
33369 : {
33370 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(obj);
33371 : PyObject *py_result;
33372 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
33373 0 : return py_result;
33374 : }
33375 :
33376 0 : static int py_lsa_RetrievePrivateData_set_result(PyObject *py_obj, PyObject *value, void *closure)
33377 : {
33378 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33379 0 : if (value == NULL) {
33380 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
33381 0 : return -1;
33382 : }
33383 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
33384 0 : return 0;
33385 : }
33386 :
33387 : static PyGetSetDef py_lsa_RetrievePrivateData_getsetters[] = {
33388 : {
33389 : .name = discard_const_p(char, "in_handle"),
33390 : .get = py_lsa_RetrievePrivateData_in_get_handle,
33391 : .set = py_lsa_RetrievePrivateData_in_set_handle,
33392 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
33393 : },
33394 : {
33395 : .name = discard_const_p(char, "in_name"),
33396 : .get = py_lsa_RetrievePrivateData_in_get_name,
33397 : .set = py_lsa_RetrievePrivateData_in_set_name,
33398 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
33399 : },
33400 : {
33401 : .name = discard_const_p(char, "in_val"),
33402 : .get = py_lsa_RetrievePrivateData_in_get_val,
33403 : .set = py_lsa_RetrievePrivateData_in_set_val,
33404 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
33405 : },
33406 : {
33407 : .name = discard_const_p(char, "out_val"),
33408 : .get = py_lsa_RetrievePrivateData_out_get_val,
33409 : .set = py_lsa_RetrievePrivateData_out_set_val,
33410 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
33411 : },
33412 : {
33413 : .name = discard_const_p(char, "result"),
33414 : .get = py_lsa_RetrievePrivateData_get_result,
33415 : .set = py_lsa_RetrievePrivateData_set_result,
33416 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
33417 : },
33418 : { .name = NULL }
33419 : };
33420 :
33421 0 : static PyObject *py_lsa_RetrievePrivateData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
33422 : {
33423 0 : PyObject *self = pytalloc_new(struct lsa_RetrievePrivateData, type);
33424 0 : struct lsa_RetrievePrivateData *_self = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(self);
33425 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
33426 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
33427 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
33428 : /* a pointer to a NULL pointer */
33429 0 : _self->in.val = talloc_zero(mem_ctx, struct lsa_DATA_BUF *);
33430 0 : _self->out.val = talloc_zero(mem_ctx, struct lsa_DATA_BUF *);
33431 0 : return self;
33432 : }
33433 :
33434 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
33435 : {
33436 :
33437 :
33438 0 : return PyLong_FromLong(43);
33439 : }
33440 :
33441 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
33442 : {
33443 0 : const struct ndr_interface_call *call = NULL;
33444 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33445 0 : PyObject *ret = NULL;
33446 0 : struct ndr_push *push = NULL;
33447 : DATA_BLOB blob;
33448 : enum ndr_err_code err;
33449 :
33450 0 : if (ndr_table_lsarpc.num_calls < 44) {
33451 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RetrievePrivateData_ndr_pack");
33452 0 : return NULL;
33453 : }
33454 0 : call = &ndr_table_lsarpc.calls[43];
33455 :
33456 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
33457 0 : if (push == NULL) {
33458 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33459 0 : return NULL;
33460 : }
33461 :
33462 0 : push->flags |= ndr_push_flags;
33463 :
33464 0 : err = call->ndr_push(push, ndr_inout_flags, object);
33465 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33466 0 : TALLOC_FREE(push);
33467 0 : PyErr_SetNdrError(err);
33468 0 : return NULL;
33469 : }
33470 0 : blob = ndr_push_blob(push);
33471 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
33472 0 : TALLOC_FREE(push);
33473 0 : return ret;
33474 : }
33475 :
33476 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33477 : {
33478 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33479 0 : PyObject *bigendian_obj = NULL;
33480 0 : PyObject *ndr64_obj = NULL;
33481 0 : uint32_t ndr_push_flags = 0;
33482 :
33483 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
33484 : discard_const_p(char *, kwnames),
33485 : &bigendian_obj,
33486 : &ndr64_obj)) {
33487 0 : return NULL;
33488 : }
33489 :
33490 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33491 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33492 : }
33493 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33494 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33495 : }
33496 :
33497 0 : return py_lsa_RetrievePrivateData_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
33498 : }
33499 :
33500 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33501 : {
33502 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33503 0 : PyObject *bigendian_obj = NULL;
33504 0 : PyObject *ndr64_obj = NULL;
33505 0 : uint32_t ndr_push_flags = 0;
33506 :
33507 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
33508 : discard_const_p(char *, kwnames),
33509 : &bigendian_obj,
33510 : &ndr64_obj)) {
33511 0 : return NULL;
33512 : }
33513 :
33514 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33515 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33516 : }
33517 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33518 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33519 : }
33520 :
33521 0 : return py_lsa_RetrievePrivateData_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
33522 : }
33523 :
33524 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
33525 : {
33526 0 : const struct ndr_interface_call *call = NULL;
33527 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33528 0 : struct ndr_pull *pull = NULL;
33529 : enum ndr_err_code err;
33530 :
33531 0 : if (ndr_table_lsarpc.num_calls < 44) {
33532 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RetrievePrivateData_ndr_unpack");
33533 0 : return NULL;
33534 : }
33535 0 : call = &ndr_table_lsarpc.calls[43];
33536 :
33537 0 : pull = ndr_pull_init_blob(blob, object);
33538 0 : if (pull == NULL) {
33539 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33540 0 : return NULL;
33541 : }
33542 :
33543 0 : pull->flags |= ndr_pull_flags;
33544 :
33545 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
33546 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33547 0 : TALLOC_FREE(pull);
33548 0 : PyErr_SetNdrError(err);
33549 0 : return NULL;
33550 : }
33551 0 : if (!allow_remaining) {
33552 : uint32_t highest_ofs;
33553 :
33554 0 : if (pull->offset > pull->relative_highest_offset) {
33555 0 : highest_ofs = pull->offset;
33556 : } else {
33557 0 : highest_ofs = pull->relative_highest_offset;
33558 : }
33559 0 : if (highest_ofs < pull->data_size) {
33560 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
33561 : "not all bytes consumed ofs[%u] size[%u]",
33562 : highest_ofs, pull->data_size);
33563 0 : TALLOC_FREE(pull);
33564 0 : PyErr_SetNdrError(err);
33565 0 : return NULL;
33566 : }
33567 : }
33568 :
33569 0 : TALLOC_FREE(pull);
33570 0 : Py_RETURN_NONE;
33571 : }
33572 :
33573 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33574 : {
33575 : DATA_BLOB blob;
33576 0 : Py_ssize_t blob_length = 0;
33577 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33578 0 : PyObject *bigendian_obj = NULL;
33579 0 : PyObject *ndr64_obj = NULL;
33580 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33581 0 : PyObject *allow_remaining_obj = NULL;
33582 0 : bool allow_remaining = false;
33583 :
33584 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
33585 : discard_const_p(char *, kwnames),
33586 : &blob.data, &blob_length,
33587 : &bigendian_obj,
33588 : &ndr64_obj,
33589 : &allow_remaining_obj)) {
33590 0 : return NULL;
33591 : }
33592 0 : blob.length = blob_length;
33593 :
33594 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33595 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33596 : }
33597 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33598 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33599 : }
33600 :
33601 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33602 0 : allow_remaining = true;
33603 : }
33604 :
33605 0 : return py_lsa_RetrievePrivateData_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
33606 : }
33607 :
33608 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33609 : {
33610 : DATA_BLOB blob;
33611 0 : Py_ssize_t blob_length = 0;
33612 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33613 0 : PyObject *bigendian_obj = NULL;
33614 0 : PyObject *ndr64_obj = NULL;
33615 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33616 0 : PyObject *allow_remaining_obj = NULL;
33617 0 : bool allow_remaining = false;
33618 :
33619 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
33620 : discard_const_p(char *, kwnames),
33621 : &blob.data, &blob_length,
33622 : &bigendian_obj,
33623 : &ndr64_obj,
33624 : &allow_remaining_obj)) {
33625 0 : return NULL;
33626 : }
33627 0 : blob.length = blob_length;
33628 :
33629 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33630 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33631 : }
33632 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33633 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33634 : }
33635 :
33636 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33637 0 : allow_remaining = true;
33638 : }
33639 :
33640 0 : return py_lsa_RetrievePrivateData_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
33641 : }
33642 :
33643 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
33644 : {
33645 0 : const struct ndr_interface_call *call = NULL;
33646 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33647 : PyObject *ret;
33648 : char *retstr;
33649 :
33650 0 : if (ndr_table_lsarpc.num_calls < 44) {
33651 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RetrievePrivateData_ndr_print");
33652 0 : return NULL;
33653 : }
33654 0 : call = &ndr_table_lsarpc.calls[43];
33655 :
33656 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
33657 0 : ret = PyUnicode_FromString(retstr);
33658 0 : TALLOC_FREE(retstr);
33659 :
33660 0 : return ret;
33661 : }
33662 :
33663 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33664 : {
33665 0 : return py_lsa_RetrievePrivateData_ndr_print(py_obj, "lsa_RetrievePrivateData_in", NDR_IN);
33666 : }
33667 :
33668 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33669 : {
33670 0 : return py_lsa_RetrievePrivateData_ndr_print(py_obj, "lsa_RetrievePrivateData_out", NDR_OUT);
33671 : }
33672 :
33673 : static PyMethodDef py_lsa_RetrievePrivateData_methods[] = {
33674 : { "opnum", (PyCFunction)py_lsa_RetrievePrivateData_ndr_opnum, METH_NOARGS|METH_CLASS,
33675 : "lsa.RetrievePrivateData.opnum() -> 43 (0x2b) " },
33676 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RetrievePrivateData_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
33677 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
33678 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RetrievePrivateData_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
33679 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
33680 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RetrievePrivateData_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
33681 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
33682 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RetrievePrivateData_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
33683 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
33684 : { "__ndr_print_in__", (PyCFunction)py_lsa_RetrievePrivateData_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
33685 : { "__ndr_print_out__", (PyCFunction)py_lsa_RetrievePrivateData_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
33686 : { NULL, NULL, 0, NULL }
33687 : };
33688 :
33689 :
33690 : static PyTypeObject lsa_RetrievePrivateData_Type = {
33691 : PyVarObject_HEAD_INIT(NULL, 0)
33692 : .tp_name = "lsa.RetrievePrivateData",
33693 : .tp_getset = py_lsa_RetrievePrivateData_getsetters,
33694 : .tp_methods = py_lsa_RetrievePrivateData_methods,
33695 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
33696 : .tp_new = py_lsa_RetrievePrivateData_new,
33697 : };
33698 :
33699 0 : static bool pack_py_lsa_RetrievePrivateData_args_in(PyObject *args, PyObject *kwargs, struct lsa_RetrievePrivateData *r)
33700 : {
33701 : PyObject *py_handle;
33702 : PyObject *py_name;
33703 : PyObject *py_val;
33704 0 : const char *kwnames[] = {
33705 : "handle", "name", "val", NULL
33706 : };
33707 :
33708 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_RetrievePrivateData", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_val)) {
33709 0 : return false;
33710 : }
33711 :
33712 0 : if (py_handle == NULL) {
33713 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
33714 0 : return false;
33715 : }
33716 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
33717 0 : if (r->in.handle == NULL) {
33718 0 : PyErr_NoMemory();
33719 0 : return false;
33720 : }
33721 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
33722 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
33723 0 : PyErr_NoMemory();
33724 0 : return false;
33725 : }
33726 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
33727 0 : if (py_name == NULL) {
33728 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
33729 0 : return false;
33730 : }
33731 0 : r->in.name = talloc_ptrtype(r, r->in.name);
33732 0 : if (r->in.name == NULL) {
33733 0 : PyErr_NoMemory();
33734 0 : return false;
33735 : }
33736 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
33737 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
33738 0 : PyErr_NoMemory();
33739 0 : return false;
33740 : }
33741 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
33742 0 : if (py_val == NULL) {
33743 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.val");
33744 0 : return false;
33745 : }
33746 0 : r->in.val = talloc_ptrtype(r, r->in.val);
33747 0 : if (r->in.val == NULL) {
33748 0 : PyErr_NoMemory();
33749 0 : return false;
33750 : }
33751 0 : if (py_val == Py_None) {
33752 0 : *r->in.val = NULL;
33753 : } else {
33754 0 : *r->in.val = NULL;
33755 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_val, return false;);
33756 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_val)) == NULL) {
33757 0 : PyErr_NoMemory();
33758 0 : return false;
33759 : }
33760 0 : *r->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_val);
33761 : }
33762 0 : return true;
33763 : }
33764 :
33765 0 : static PyObject *unpack_py_lsa_RetrievePrivateData_args_out(struct lsa_RetrievePrivateData *r)
33766 : {
33767 : PyObject *result;
33768 : PyObject *py_val;
33769 0 : if (*r->out.val == NULL) {
33770 0 : py_val = Py_None;
33771 0 : Py_INCREF(py_val);
33772 : } else {
33773 0 : py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, *r->out.val, *r->out.val);
33774 : }
33775 0 : result = py_val;
33776 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
33777 0 : PyErr_SetNTSTATUS(r->out.result);
33778 0 : return NULL;
33779 : }
33780 :
33781 0 : return result;
33782 : }
33783 :
33784 :
33785 0 : static PyObject *py_lsa_OpenPolicy2_in_get_system_name(PyObject *obj, void *closure)
33786 : {
33787 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(obj);
33788 : PyObject *py_system_name;
33789 0 : if (object->in.system_name == NULL) {
33790 0 : Py_RETURN_NONE;
33791 : }
33792 0 : if (object->in.system_name == NULL) {
33793 0 : py_system_name = Py_None;
33794 0 : Py_INCREF(py_system_name);
33795 : } else {
33796 0 : if (object->in.system_name == NULL) {
33797 0 : py_system_name = Py_None;
33798 0 : Py_INCREF(py_system_name);
33799 : } else {
33800 0 : py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore");
33801 : }
33802 : }
33803 0 : return py_system_name;
33804 : }
33805 :
33806 0 : static int py_lsa_OpenPolicy2_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
33807 : {
33808 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
33809 0 : if (value == NULL) {
33810 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name");
33811 0 : return -1;
33812 : }
33813 0 : if (value == Py_None) {
33814 0 : object->in.system_name = NULL;
33815 : } else {
33816 0 : object->in.system_name = NULL;
33817 : {
33818 : const char *test_str;
33819 : const char *talloc_str;
33820 0 : PyObject *unicode = NULL;
33821 0 : if (PyUnicode_Check(value)) {
33822 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
33823 0 : if (unicode == NULL) {
33824 0 : PyErr_NoMemory();
33825 0 : return -1;
33826 : }
33827 0 : test_str = PyBytes_AS_STRING(unicode);
33828 0 : } else if (PyBytes_Check(value)) {
33829 0 : test_str = PyBytes_AS_STRING(value);
33830 : } else {
33831 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
33832 0 : return -1;
33833 : }
33834 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
33835 0 : if (unicode != NULL) {
33836 0 : Py_DECREF(unicode);
33837 : }
33838 0 : if (talloc_str == NULL) {
33839 0 : PyErr_NoMemory();
33840 0 : return -1;
33841 : }
33842 0 : object->in.system_name = talloc_str;
33843 : }
33844 : }
33845 0 : return 0;
33846 : }
33847 :
33848 0 : static PyObject *py_lsa_OpenPolicy2_in_get_attr(PyObject *obj, void *closure)
33849 : {
33850 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(obj);
33851 : PyObject *py_attr;
33852 0 : if (object->in.attr == NULL) {
33853 0 : Py_RETURN_NONE;
33854 : }
33855 0 : py_attr = pytalloc_reference_ex(&lsa_ObjectAttribute_Type, object->in.attr, object->in.attr);
33856 0 : return py_attr;
33857 : }
33858 :
33859 0 : static int py_lsa_OpenPolicy2_in_set_attr(PyObject *py_obj, PyObject *value, void *closure)
33860 : {
33861 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
33862 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.attr));
33863 0 : if (value == NULL) {
33864 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.attr");
33865 0 : return -1;
33866 : }
33867 0 : object->in.attr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.attr);
33868 0 : if (object->in.attr == NULL) {
33869 0 : PyErr_NoMemory();
33870 0 : return -1;
33871 : }
33872 0 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, value, return -1;);
33873 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33874 0 : PyErr_NoMemory();
33875 0 : return -1;
33876 : }
33877 0 : object->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(value);
33878 0 : return 0;
33879 : }
33880 :
33881 0 : static PyObject *py_lsa_OpenPolicy2_in_get_access_mask(PyObject *obj, void *closure)
33882 : {
33883 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(obj);
33884 : PyObject *py_access_mask;
33885 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
33886 0 : return py_access_mask;
33887 : }
33888 :
33889 0 : static int py_lsa_OpenPolicy2_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
33890 : {
33891 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
33892 0 : if (value == NULL) {
33893 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
33894 0 : return -1;
33895 : }
33896 : {
33897 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
33898 0 : if (PyLong_Check(value)) {
33899 : unsigned long long test_var;
33900 0 : test_var = PyLong_AsUnsignedLongLong(value);
33901 0 : if (PyErr_Occurred() != NULL) {
33902 0 : return -1;
33903 : }
33904 0 : if (test_var > uint_max) {
33905 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33906 : PyLong_Type.tp_name, uint_max, test_var);
33907 0 : return -1;
33908 : }
33909 0 : object->in.access_mask = test_var;
33910 : } else {
33911 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33912 : PyLong_Type.tp_name);
33913 0 : return -1;
33914 : }
33915 : }
33916 0 : return 0;
33917 : }
33918 :
33919 0 : static PyObject *py_lsa_OpenPolicy2_out_get_handle(PyObject *obj, void *closure)
33920 : {
33921 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(obj);
33922 : PyObject *py_handle;
33923 0 : if (object->out.handle == NULL) {
33924 0 : Py_RETURN_NONE;
33925 : }
33926 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
33927 0 : return py_handle;
33928 : }
33929 :
33930 0 : static int py_lsa_OpenPolicy2_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
33931 : {
33932 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
33933 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
33934 0 : if (value == NULL) {
33935 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
33936 0 : return -1;
33937 : }
33938 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
33939 0 : if (object->out.handle == NULL) {
33940 0 : PyErr_NoMemory();
33941 0 : return -1;
33942 : }
33943 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
33944 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33945 0 : PyErr_NoMemory();
33946 0 : return -1;
33947 : }
33948 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
33949 0 : return 0;
33950 : }
33951 :
33952 0 : static PyObject *py_lsa_OpenPolicy2_get_result(PyObject *obj, void *closure)
33953 : {
33954 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(obj);
33955 : PyObject *py_result;
33956 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
33957 0 : return py_result;
33958 : }
33959 :
33960 0 : static int py_lsa_OpenPolicy2_set_result(PyObject *py_obj, PyObject *value, void *closure)
33961 : {
33962 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
33963 0 : if (value == NULL) {
33964 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
33965 0 : return -1;
33966 : }
33967 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
33968 0 : return 0;
33969 : }
33970 :
33971 : static PyGetSetDef py_lsa_OpenPolicy2_getsetters[] = {
33972 : {
33973 : .name = discard_const_p(char, "in_system_name"),
33974 : .get = py_lsa_OpenPolicy2_in_get_system_name,
33975 : .set = py_lsa_OpenPolicy2_in_set_system_name,
33976 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
33977 : },
33978 : {
33979 : .name = discard_const_p(char, "in_attr"),
33980 : .get = py_lsa_OpenPolicy2_in_get_attr,
33981 : .set = py_lsa_OpenPolicy2_in_set_attr,
33982 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ObjectAttribute")
33983 : },
33984 : {
33985 : .name = discard_const_p(char, "in_access_mask"),
33986 : .get = py_lsa_OpenPolicy2_in_get_access_mask,
33987 : .set = py_lsa_OpenPolicy2_in_set_access_mask,
33988 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyAccessMask")
33989 : },
33990 : {
33991 : .name = discard_const_p(char, "out_handle"),
33992 : .get = py_lsa_OpenPolicy2_out_get_handle,
33993 : .set = py_lsa_OpenPolicy2_out_set_handle,
33994 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
33995 : },
33996 : {
33997 : .name = discard_const_p(char, "result"),
33998 : .get = py_lsa_OpenPolicy2_get_result,
33999 : .set = py_lsa_OpenPolicy2_set_result,
34000 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
34001 : },
34002 : { .name = NULL }
34003 : };
34004 :
34005 0 : static PyObject *py_lsa_OpenPolicy2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
34006 : {
34007 0 : PyObject *self = pytalloc_new(struct lsa_OpenPolicy2, type);
34008 0 : struct lsa_OpenPolicy2 *_self = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(self);
34009 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
34010 0 : _self->in.attr = talloc_zero(mem_ctx, struct lsa_ObjectAttribute);
34011 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
34012 0 : return self;
34013 : }
34014 :
34015 0 : static PyObject *py_lsa_OpenPolicy2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
34016 : {
34017 :
34018 :
34019 0 : return PyLong_FromLong(44);
34020 : }
34021 :
34022 0 : static PyObject *py_lsa_OpenPolicy2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
34023 : {
34024 0 : const struct ndr_interface_call *call = NULL;
34025 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
34026 0 : PyObject *ret = NULL;
34027 0 : struct ndr_push *push = NULL;
34028 : DATA_BLOB blob;
34029 : enum ndr_err_code err;
34030 :
34031 0 : if (ndr_table_lsarpc.num_calls < 45) {
34032 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy2_ndr_pack");
34033 0 : return NULL;
34034 : }
34035 0 : call = &ndr_table_lsarpc.calls[44];
34036 :
34037 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
34038 0 : if (push == NULL) {
34039 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34040 0 : return NULL;
34041 : }
34042 :
34043 0 : push->flags |= ndr_push_flags;
34044 :
34045 0 : err = call->ndr_push(push, ndr_inout_flags, object);
34046 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34047 0 : TALLOC_FREE(push);
34048 0 : PyErr_SetNdrError(err);
34049 0 : return NULL;
34050 : }
34051 0 : blob = ndr_push_blob(push);
34052 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
34053 0 : TALLOC_FREE(push);
34054 0 : return ret;
34055 : }
34056 :
34057 0 : static PyObject *py_lsa_OpenPolicy2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34058 : {
34059 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34060 0 : PyObject *bigendian_obj = NULL;
34061 0 : PyObject *ndr64_obj = NULL;
34062 0 : uint32_t ndr_push_flags = 0;
34063 :
34064 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
34065 : discard_const_p(char *, kwnames),
34066 : &bigendian_obj,
34067 : &ndr64_obj)) {
34068 0 : return NULL;
34069 : }
34070 :
34071 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34072 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34073 : }
34074 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34075 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34076 : }
34077 :
34078 0 : return py_lsa_OpenPolicy2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
34079 : }
34080 :
34081 0 : static PyObject *py_lsa_OpenPolicy2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34082 : {
34083 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34084 0 : PyObject *bigendian_obj = NULL;
34085 0 : PyObject *ndr64_obj = NULL;
34086 0 : uint32_t ndr_push_flags = 0;
34087 :
34088 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
34089 : discard_const_p(char *, kwnames),
34090 : &bigendian_obj,
34091 : &ndr64_obj)) {
34092 0 : return NULL;
34093 : }
34094 :
34095 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34096 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34097 : }
34098 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34099 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34100 : }
34101 :
34102 0 : return py_lsa_OpenPolicy2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
34103 : }
34104 :
34105 0 : static PyObject *py_lsa_OpenPolicy2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
34106 : {
34107 0 : const struct ndr_interface_call *call = NULL;
34108 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
34109 0 : struct ndr_pull *pull = NULL;
34110 : enum ndr_err_code err;
34111 :
34112 0 : if (ndr_table_lsarpc.num_calls < 45) {
34113 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy2_ndr_unpack");
34114 0 : return NULL;
34115 : }
34116 0 : call = &ndr_table_lsarpc.calls[44];
34117 :
34118 0 : pull = ndr_pull_init_blob(blob, object);
34119 0 : if (pull == NULL) {
34120 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34121 0 : return NULL;
34122 : }
34123 :
34124 0 : pull->flags |= ndr_pull_flags;
34125 :
34126 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
34127 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34128 0 : TALLOC_FREE(pull);
34129 0 : PyErr_SetNdrError(err);
34130 0 : return NULL;
34131 : }
34132 0 : if (!allow_remaining) {
34133 : uint32_t highest_ofs;
34134 :
34135 0 : if (pull->offset > pull->relative_highest_offset) {
34136 0 : highest_ofs = pull->offset;
34137 : } else {
34138 0 : highest_ofs = pull->relative_highest_offset;
34139 : }
34140 0 : if (highest_ofs < pull->data_size) {
34141 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
34142 : "not all bytes consumed ofs[%u] size[%u]",
34143 : highest_ofs, pull->data_size);
34144 0 : TALLOC_FREE(pull);
34145 0 : PyErr_SetNdrError(err);
34146 0 : return NULL;
34147 : }
34148 : }
34149 :
34150 0 : TALLOC_FREE(pull);
34151 0 : Py_RETURN_NONE;
34152 : }
34153 :
34154 0 : static PyObject *py_lsa_OpenPolicy2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34155 : {
34156 : DATA_BLOB blob;
34157 0 : Py_ssize_t blob_length = 0;
34158 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34159 0 : PyObject *bigendian_obj = NULL;
34160 0 : PyObject *ndr64_obj = NULL;
34161 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34162 0 : PyObject *allow_remaining_obj = NULL;
34163 0 : bool allow_remaining = false;
34164 :
34165 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
34166 : discard_const_p(char *, kwnames),
34167 : &blob.data, &blob_length,
34168 : &bigendian_obj,
34169 : &ndr64_obj,
34170 : &allow_remaining_obj)) {
34171 0 : return NULL;
34172 : }
34173 0 : blob.length = blob_length;
34174 :
34175 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34176 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34177 : }
34178 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34179 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34180 : }
34181 :
34182 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34183 0 : allow_remaining = true;
34184 : }
34185 :
34186 0 : return py_lsa_OpenPolicy2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
34187 : }
34188 :
34189 0 : static PyObject *py_lsa_OpenPolicy2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34190 : {
34191 : DATA_BLOB blob;
34192 0 : Py_ssize_t blob_length = 0;
34193 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34194 0 : PyObject *bigendian_obj = NULL;
34195 0 : PyObject *ndr64_obj = NULL;
34196 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34197 0 : PyObject *allow_remaining_obj = NULL;
34198 0 : bool allow_remaining = false;
34199 :
34200 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
34201 : discard_const_p(char *, kwnames),
34202 : &blob.data, &blob_length,
34203 : &bigendian_obj,
34204 : &ndr64_obj,
34205 : &allow_remaining_obj)) {
34206 0 : return NULL;
34207 : }
34208 0 : blob.length = blob_length;
34209 :
34210 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34211 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34212 : }
34213 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34214 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34215 : }
34216 :
34217 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34218 0 : allow_remaining = true;
34219 : }
34220 :
34221 0 : return py_lsa_OpenPolicy2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
34222 : }
34223 :
34224 0 : static PyObject *py_lsa_OpenPolicy2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
34225 : {
34226 0 : const struct ndr_interface_call *call = NULL;
34227 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
34228 : PyObject *ret;
34229 : char *retstr;
34230 :
34231 0 : if (ndr_table_lsarpc.num_calls < 45) {
34232 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy2_ndr_print");
34233 0 : return NULL;
34234 : }
34235 0 : call = &ndr_table_lsarpc.calls[44];
34236 :
34237 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
34238 0 : ret = PyUnicode_FromString(retstr);
34239 0 : TALLOC_FREE(retstr);
34240 :
34241 0 : return ret;
34242 : }
34243 :
34244 0 : static PyObject *py_lsa_OpenPolicy2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34245 : {
34246 0 : return py_lsa_OpenPolicy2_ndr_print(py_obj, "lsa_OpenPolicy2_in", NDR_IN);
34247 : }
34248 :
34249 0 : static PyObject *py_lsa_OpenPolicy2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34250 : {
34251 0 : return py_lsa_OpenPolicy2_ndr_print(py_obj, "lsa_OpenPolicy2_out", NDR_OUT);
34252 : }
34253 :
34254 : static PyMethodDef py_lsa_OpenPolicy2_methods[] = {
34255 : { "opnum", (PyCFunction)py_lsa_OpenPolicy2_ndr_opnum, METH_NOARGS|METH_CLASS,
34256 : "lsa.OpenPolicy2.opnum() -> 44 (0x2c) " },
34257 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
34258 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
34259 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
34260 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
34261 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
34262 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
34263 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
34264 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
34265 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenPolicy2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
34266 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenPolicy2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
34267 : { NULL, NULL, 0, NULL }
34268 : };
34269 :
34270 :
34271 : static PyTypeObject lsa_OpenPolicy2_Type = {
34272 : PyVarObject_HEAD_INIT(NULL, 0)
34273 : .tp_name = "lsa.OpenPolicy2",
34274 : .tp_getset = py_lsa_OpenPolicy2_getsetters,
34275 : .tp_methods = py_lsa_OpenPolicy2_methods,
34276 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
34277 : .tp_new = py_lsa_OpenPolicy2_new,
34278 : };
34279 :
34280 217 : static bool pack_py_lsa_OpenPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenPolicy2 *r)
34281 : {
34282 : PyObject *py_system_name;
34283 : PyObject *py_attr;
34284 : PyObject *py_access_mask;
34285 217 : const char *kwnames[] = {
34286 : "system_name", "attr", "access_mask", NULL
34287 : };
34288 :
34289 217 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenPolicy2", discard_const_p(char *, kwnames), &py_system_name, &py_attr, &py_access_mask)) {
34290 0 : return false;
34291 : }
34292 :
34293 217 : if (py_system_name == NULL) {
34294 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name");
34295 0 : return false;
34296 : }
34297 217 : if (py_system_name == Py_None) {
34298 0 : r->in.system_name = NULL;
34299 : } else {
34300 217 : r->in.system_name = NULL;
34301 : {
34302 : const char *test_str;
34303 : const char *talloc_str;
34304 217 : PyObject *unicode = NULL;
34305 217 : if (PyUnicode_Check(py_system_name)) {
34306 217 : unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore");
34307 217 : if (unicode == NULL) {
34308 0 : PyErr_NoMemory();
34309 0 : return false;
34310 : }
34311 217 : test_str = PyBytes_AS_STRING(unicode);
34312 0 : } else if (PyBytes_Check(py_system_name)) {
34313 0 : test_str = PyBytes_AS_STRING(py_system_name);
34314 : } else {
34315 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
34316 0 : return false;
34317 : }
34318 217 : talloc_str = talloc_strdup(r, test_str);
34319 217 : if (unicode != NULL) {
34320 217 : Py_DECREF(unicode);
34321 : }
34322 217 : if (talloc_str == NULL) {
34323 0 : PyErr_NoMemory();
34324 0 : return false;
34325 : }
34326 217 : r->in.system_name = talloc_str;
34327 : }
34328 : }
34329 217 : if (py_attr == NULL) {
34330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.attr");
34331 0 : return false;
34332 : }
34333 217 : r->in.attr = talloc_ptrtype(r, r->in.attr);
34334 217 : if (r->in.attr == NULL) {
34335 0 : PyErr_NoMemory();
34336 0 : return false;
34337 : }
34338 217 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, py_attr, return false;);
34339 217 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_attr)) == NULL) {
34340 0 : PyErr_NoMemory();
34341 0 : return false;
34342 : }
34343 217 : r->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_attr);
34344 217 : if (py_access_mask == NULL) {
34345 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
34346 0 : return false;
34347 : }
34348 : {
34349 217 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
34350 217 : if (PyLong_Check(py_access_mask)) {
34351 : unsigned long long test_var;
34352 217 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
34353 217 : if (PyErr_Occurred() != NULL) {
34354 0 : return false;
34355 : }
34356 217 : if (test_var > uint_max) {
34357 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34358 : PyLong_Type.tp_name, uint_max, test_var);
34359 0 : return false;
34360 : }
34361 217 : r->in.access_mask = test_var;
34362 : } else {
34363 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34364 : PyLong_Type.tp_name);
34365 0 : return false;
34366 : }
34367 : }
34368 217 : return true;
34369 : }
34370 :
34371 217 : static PyObject *unpack_py_lsa_OpenPolicy2_args_out(struct lsa_OpenPolicy2 *r)
34372 : {
34373 : PyObject *result;
34374 : PyObject *py_handle;
34375 217 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
34376 217 : result = py_handle;
34377 217 : if (NT_STATUS_IS_ERR(r->out.result)) {
34378 0 : PyErr_SetNTSTATUS(r->out.result);
34379 0 : return NULL;
34380 : }
34381 :
34382 217 : return result;
34383 : }
34384 :
34385 :
34386 0 : static PyObject *py_lsa_GetUserName_in_get_system_name(PyObject *obj, void *closure)
34387 : {
34388 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(obj);
34389 : PyObject *py_system_name;
34390 0 : if (object->in.system_name == NULL) {
34391 0 : Py_RETURN_NONE;
34392 : }
34393 0 : if (object->in.system_name == NULL) {
34394 0 : py_system_name = Py_None;
34395 0 : Py_INCREF(py_system_name);
34396 : } else {
34397 0 : if (object->in.system_name == NULL) {
34398 0 : py_system_name = Py_None;
34399 0 : Py_INCREF(py_system_name);
34400 : } else {
34401 0 : py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore");
34402 : }
34403 : }
34404 0 : return py_system_name;
34405 : }
34406 :
34407 30 : static int py_lsa_GetUserName_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
34408 : {
34409 30 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34410 30 : if (value == NULL) {
34411 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name");
34412 0 : return -1;
34413 : }
34414 30 : if (value == Py_None) {
34415 0 : object->in.system_name = NULL;
34416 : } else {
34417 30 : object->in.system_name = NULL;
34418 : {
34419 : const char *test_str;
34420 : const char *talloc_str;
34421 30 : PyObject *unicode = NULL;
34422 30 : if (PyUnicode_Check(value)) {
34423 30 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
34424 30 : if (unicode == NULL) {
34425 0 : PyErr_NoMemory();
34426 0 : return -1;
34427 : }
34428 30 : test_str = PyBytes_AS_STRING(unicode);
34429 0 : } else if (PyBytes_Check(value)) {
34430 0 : test_str = PyBytes_AS_STRING(value);
34431 : } else {
34432 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
34433 0 : return -1;
34434 : }
34435 30 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
34436 30 : if (unicode != NULL) {
34437 30 : Py_DECREF(unicode);
34438 : }
34439 30 : if (talloc_str == NULL) {
34440 0 : PyErr_NoMemory();
34441 0 : return -1;
34442 : }
34443 30 : object->in.system_name = talloc_str;
34444 : }
34445 : }
34446 30 : return 0;
34447 : }
34448 :
34449 0 : static PyObject *py_lsa_GetUserName_in_get_account_name(PyObject *obj, void *closure)
34450 : {
34451 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(obj);
34452 : PyObject *py_account_name;
34453 0 : if (object->in.account_name == NULL) {
34454 0 : Py_RETURN_NONE;
34455 : }
34456 0 : if (*object->in.account_name == NULL) {
34457 0 : py_account_name = Py_None;
34458 0 : Py_INCREF(py_account_name);
34459 : } else {
34460 0 : py_account_name = pytalloc_reference_ex(&lsa_String_Type, *object->in.account_name, *object->in.account_name);
34461 : }
34462 0 : return py_account_name;
34463 : }
34464 :
34465 30 : static int py_lsa_GetUserName_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
34466 : {
34467 30 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34468 30 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account_name));
34469 30 : if (value == NULL) {
34470 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
34471 0 : return -1;
34472 : }
34473 30 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
34474 30 : if (object->in.account_name == NULL) {
34475 0 : PyErr_NoMemory();
34476 0 : return -1;
34477 : }
34478 30 : if (value == Py_None) {
34479 30 : *object->in.account_name = NULL;
34480 : } else {
34481 0 : *object->in.account_name = NULL;
34482 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
34483 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34484 0 : PyErr_NoMemory();
34485 0 : return -1;
34486 : }
34487 0 : *object->in.account_name = (struct lsa_String *)pytalloc_get_ptr(value);
34488 : }
34489 30 : return 0;
34490 : }
34491 :
34492 294 : static PyObject *py_lsa_GetUserName_out_get_account_name(PyObject *obj, void *closure)
34493 : {
34494 294 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(obj);
34495 : PyObject *py_account_name;
34496 294 : if (object->out.account_name == NULL) {
34497 0 : Py_RETURN_NONE;
34498 : }
34499 294 : if (*object->out.account_name == NULL) {
34500 0 : py_account_name = Py_None;
34501 0 : Py_INCREF(py_account_name);
34502 : } else {
34503 294 : py_account_name = pytalloc_reference_ex(&lsa_String_Type, *object->out.account_name, *object->out.account_name);
34504 : }
34505 294 : return py_account_name;
34506 : }
34507 :
34508 0 : static int py_lsa_GetUserName_out_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
34509 : {
34510 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34511 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.account_name));
34512 0 : if (value == NULL) {
34513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.account_name");
34514 0 : return -1;
34515 : }
34516 0 : object->out.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.account_name);
34517 0 : if (object->out.account_name == NULL) {
34518 0 : PyErr_NoMemory();
34519 0 : return -1;
34520 : }
34521 0 : if (value == Py_None) {
34522 0 : *object->out.account_name = NULL;
34523 : } else {
34524 0 : *object->out.account_name = NULL;
34525 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
34526 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34527 0 : PyErr_NoMemory();
34528 0 : return -1;
34529 : }
34530 0 : *object->out.account_name = (struct lsa_String *)pytalloc_get_ptr(value);
34531 : }
34532 0 : return 0;
34533 : }
34534 :
34535 0 : static PyObject *py_lsa_GetUserName_in_get_authority_name(PyObject *obj, void *closure)
34536 : {
34537 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(obj);
34538 : PyObject *py_authority_name;
34539 0 : if (object->in.authority_name == NULL) {
34540 0 : Py_RETURN_NONE;
34541 : }
34542 0 : if (object->in.authority_name == NULL) {
34543 0 : py_authority_name = Py_None;
34544 0 : Py_INCREF(py_authority_name);
34545 : } else {
34546 0 : if (*object->in.authority_name == NULL) {
34547 0 : py_authority_name = Py_None;
34548 0 : Py_INCREF(py_authority_name);
34549 : } else {
34550 0 : py_authority_name = pytalloc_reference_ex(&lsa_String_Type, *object->in.authority_name, *object->in.authority_name);
34551 : }
34552 : }
34553 : {
34554 0 : PyObject *py_authority_name_level_0 = py_authority_name;
34555 0 : py_authority_name = py_dcerpc_ndr_pointer_wrap(ndr_pointer_Type, py_authority_name_level_0);
34556 0 : Py_XDECREF(py_authority_name_level_0);
34557 : }
34558 0 : return py_authority_name;
34559 : }
34560 :
34561 30 : static int py_lsa_GetUserName_in_set_authority_name(PyObject *py_obj, PyObject *value, void *closure)
34562 : {
34563 30 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34564 30 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.authority_name));
34565 30 : if (value == NULL) {
34566 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.authority_name");
34567 0 : return -1;
34568 : }
34569 30 : if (value == Py_None) {
34570 0 : object->in.authority_name = NULL;
34571 : } else {
34572 30 : object->in.authority_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.authority_name);
34573 30 : if (object->in.authority_name == NULL) {
34574 0 : PyErr_NoMemory();
34575 0 : return -1;
34576 : }
34577 30 : value = py_dcerpc_ndr_pointer_deref(ndr_pointer_Type, value);
34578 30 : if (value == NULL) {
34579 0 : return -1;
34580 : }
34581 30 : if (value == Py_None) {
34582 30 : *object->in.authority_name = NULL;
34583 : } else {
34584 0 : *object->in.authority_name = NULL;
34585 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
34586 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34587 0 : PyErr_NoMemory();
34588 0 : return -1;
34589 : }
34590 0 : *object->in.authority_name = (struct lsa_String *)pytalloc_get_ptr(value);
34591 : }
34592 : }
34593 30 : return 0;
34594 : }
34595 :
34596 294 : static PyObject *py_lsa_GetUserName_out_get_authority_name(PyObject *obj, void *closure)
34597 : {
34598 294 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(obj);
34599 : PyObject *py_authority_name;
34600 294 : if (object->out.authority_name == NULL) {
34601 0 : Py_RETURN_NONE;
34602 : }
34603 294 : if (object->out.authority_name == NULL) {
34604 0 : py_authority_name = Py_None;
34605 0 : Py_INCREF(py_authority_name);
34606 : } else {
34607 294 : if (*object->out.authority_name == NULL) {
34608 0 : py_authority_name = Py_None;
34609 0 : Py_INCREF(py_authority_name);
34610 : } else {
34611 294 : py_authority_name = pytalloc_reference_ex(&lsa_String_Type, *object->out.authority_name, *object->out.authority_name);
34612 : }
34613 : }
34614 : {
34615 294 : PyObject *py_authority_name_level_0 = py_authority_name;
34616 294 : py_authority_name = py_dcerpc_ndr_pointer_wrap(ndr_pointer_Type, py_authority_name_level_0);
34617 294 : Py_XDECREF(py_authority_name_level_0);
34618 : }
34619 294 : return py_authority_name;
34620 : }
34621 :
34622 0 : static int py_lsa_GetUserName_out_set_authority_name(PyObject *py_obj, PyObject *value, void *closure)
34623 : {
34624 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34625 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.authority_name));
34626 0 : if (value == NULL) {
34627 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.authority_name");
34628 0 : return -1;
34629 : }
34630 0 : if (value == Py_None) {
34631 0 : object->out.authority_name = NULL;
34632 : } else {
34633 0 : object->out.authority_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.authority_name);
34634 0 : if (object->out.authority_name == NULL) {
34635 0 : PyErr_NoMemory();
34636 0 : return -1;
34637 : }
34638 0 : value = py_dcerpc_ndr_pointer_deref(ndr_pointer_Type, value);
34639 0 : if (value == NULL) {
34640 0 : return -1;
34641 : }
34642 0 : if (value == Py_None) {
34643 0 : *object->out.authority_name = NULL;
34644 : } else {
34645 0 : *object->out.authority_name = NULL;
34646 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
34647 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34648 0 : PyErr_NoMemory();
34649 0 : return -1;
34650 : }
34651 0 : *object->out.authority_name = (struct lsa_String *)pytalloc_get_ptr(value);
34652 : }
34653 : }
34654 0 : return 0;
34655 : }
34656 :
34657 294 : static PyObject *py_lsa_GetUserName_get_result(PyObject *obj, void *closure)
34658 : {
34659 294 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(obj);
34660 : PyObject *py_result;
34661 294 : py_result = PyErr_FromNTSTATUS(object->out.result);
34662 294 : return py_result;
34663 : }
34664 :
34665 0 : static int py_lsa_GetUserName_set_result(PyObject *py_obj, PyObject *value, void *closure)
34666 : {
34667 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34668 0 : if (value == NULL) {
34669 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
34670 0 : return -1;
34671 : }
34672 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
34673 0 : return 0;
34674 : }
34675 :
34676 : static PyGetSetDef py_lsa_GetUserName_getsetters[] = {
34677 : {
34678 : .name = discard_const_p(char, "in_system_name"),
34679 : .get = py_lsa_GetUserName_in_get_system_name,
34680 : .set = py_lsa_GetUserName_in_set_system_name,
34681 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
34682 : },
34683 : {
34684 : .name = discard_const_p(char, "in_account_name"),
34685 : .get = py_lsa_GetUserName_in_get_account_name,
34686 : .set = py_lsa_GetUserName_in_set_account_name,
34687 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
34688 : },
34689 : {
34690 : .name = discard_const_p(char, "out_account_name"),
34691 : .get = py_lsa_GetUserName_out_get_account_name,
34692 : .set = py_lsa_GetUserName_out_set_account_name,
34693 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
34694 : },
34695 : {
34696 : .name = discard_const_p(char, "in_authority_name"),
34697 : .get = py_lsa_GetUserName_in_get_authority_name,
34698 : .set = py_lsa_GetUserName_in_set_authority_name,
34699 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
34700 : },
34701 : {
34702 : .name = discard_const_p(char, "out_authority_name"),
34703 : .get = py_lsa_GetUserName_out_get_authority_name,
34704 : .set = py_lsa_GetUserName_out_set_authority_name,
34705 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
34706 : },
34707 : {
34708 : .name = discard_const_p(char, "result"),
34709 : .get = py_lsa_GetUserName_get_result,
34710 : .set = py_lsa_GetUserName_set_result,
34711 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
34712 : },
34713 : { .name = NULL }
34714 : };
34715 :
34716 30 : static PyObject *py_lsa_GetUserName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
34717 : {
34718 30 : PyObject *self = pytalloc_new(struct lsa_GetUserName, type);
34719 30 : struct lsa_GetUserName *_self = (struct lsa_GetUserName *)pytalloc_get_ptr(self);
34720 30 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
34721 : /* a pointer to a NULL pointer */
34722 30 : _self->in.account_name = talloc_zero(mem_ctx, struct lsa_String *);
34723 30 : _self->out.account_name = talloc_zero(mem_ctx, struct lsa_String *);
34724 30 : return self;
34725 : }
34726 :
34727 294 : static PyObject *py_lsa_GetUserName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
34728 : {
34729 :
34730 :
34731 294 : return PyLong_FromLong(45);
34732 : }
34733 :
34734 294 : static PyObject *py_lsa_GetUserName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
34735 : {
34736 294 : const struct ndr_interface_call *call = NULL;
34737 294 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34738 294 : PyObject *ret = NULL;
34739 294 : struct ndr_push *push = NULL;
34740 : DATA_BLOB blob;
34741 : enum ndr_err_code err;
34742 :
34743 294 : if (ndr_table_lsarpc.num_calls < 46) {
34744 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetUserName_ndr_pack");
34745 0 : return NULL;
34746 : }
34747 294 : call = &ndr_table_lsarpc.calls[45];
34748 :
34749 294 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
34750 294 : if (push == NULL) {
34751 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34752 0 : return NULL;
34753 : }
34754 :
34755 294 : push->flags |= ndr_push_flags;
34756 :
34757 294 : err = call->ndr_push(push, ndr_inout_flags, object);
34758 294 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34759 0 : TALLOC_FREE(push);
34760 0 : PyErr_SetNdrError(err);
34761 0 : return NULL;
34762 : }
34763 294 : blob = ndr_push_blob(push);
34764 294 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
34765 294 : TALLOC_FREE(push);
34766 294 : return ret;
34767 : }
34768 :
34769 294 : static PyObject *py_lsa_GetUserName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34770 : {
34771 294 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34772 294 : PyObject *bigendian_obj = NULL;
34773 294 : PyObject *ndr64_obj = NULL;
34774 294 : uint32_t ndr_push_flags = 0;
34775 :
34776 294 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
34777 : discard_const_p(char *, kwnames),
34778 : &bigendian_obj,
34779 : &ndr64_obj)) {
34780 0 : return NULL;
34781 : }
34782 :
34783 294 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34784 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34785 : }
34786 294 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34787 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34788 : }
34789 :
34790 294 : return py_lsa_GetUserName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
34791 : }
34792 :
34793 0 : static PyObject *py_lsa_GetUserName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34794 : {
34795 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34796 0 : PyObject *bigendian_obj = NULL;
34797 0 : PyObject *ndr64_obj = NULL;
34798 0 : uint32_t ndr_push_flags = 0;
34799 :
34800 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
34801 : discard_const_p(char *, kwnames),
34802 : &bigendian_obj,
34803 : &ndr64_obj)) {
34804 0 : return NULL;
34805 : }
34806 :
34807 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34808 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34809 : }
34810 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34811 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34812 : }
34813 :
34814 0 : return py_lsa_GetUserName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
34815 : }
34816 :
34817 294 : static PyObject *py_lsa_GetUserName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
34818 : {
34819 294 : const struct ndr_interface_call *call = NULL;
34820 294 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34821 294 : struct ndr_pull *pull = NULL;
34822 : enum ndr_err_code err;
34823 :
34824 294 : if (ndr_table_lsarpc.num_calls < 46) {
34825 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetUserName_ndr_unpack");
34826 0 : return NULL;
34827 : }
34828 294 : call = &ndr_table_lsarpc.calls[45];
34829 :
34830 294 : pull = ndr_pull_init_blob(blob, object);
34831 294 : if (pull == NULL) {
34832 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34833 0 : return NULL;
34834 : }
34835 :
34836 294 : pull->flags |= ndr_pull_flags;
34837 :
34838 294 : err = call->ndr_pull(pull, ndr_inout_flags, object);
34839 294 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34840 0 : TALLOC_FREE(pull);
34841 0 : PyErr_SetNdrError(err);
34842 0 : return NULL;
34843 : }
34844 294 : if (!allow_remaining) {
34845 : uint32_t highest_ofs;
34846 :
34847 294 : if (pull->offset > pull->relative_highest_offset) {
34848 294 : highest_ofs = pull->offset;
34849 : } else {
34850 0 : highest_ofs = pull->relative_highest_offset;
34851 : }
34852 294 : if (highest_ofs < pull->data_size) {
34853 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
34854 : "not all bytes consumed ofs[%u] size[%u]",
34855 : highest_ofs, pull->data_size);
34856 0 : TALLOC_FREE(pull);
34857 0 : PyErr_SetNdrError(err);
34858 0 : return NULL;
34859 : }
34860 : }
34861 :
34862 294 : TALLOC_FREE(pull);
34863 294 : Py_RETURN_NONE;
34864 : }
34865 :
34866 0 : static PyObject *py_lsa_GetUserName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34867 : {
34868 : DATA_BLOB blob;
34869 0 : Py_ssize_t blob_length = 0;
34870 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34871 0 : PyObject *bigendian_obj = NULL;
34872 0 : PyObject *ndr64_obj = NULL;
34873 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34874 0 : PyObject *allow_remaining_obj = NULL;
34875 0 : bool allow_remaining = false;
34876 :
34877 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
34878 : discard_const_p(char *, kwnames),
34879 : &blob.data, &blob_length,
34880 : &bigendian_obj,
34881 : &ndr64_obj,
34882 : &allow_remaining_obj)) {
34883 0 : return NULL;
34884 : }
34885 0 : blob.length = blob_length;
34886 :
34887 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34888 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34889 : }
34890 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34891 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34892 : }
34893 :
34894 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34895 0 : allow_remaining = true;
34896 : }
34897 :
34898 0 : return py_lsa_GetUserName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
34899 : }
34900 :
34901 294 : static PyObject *py_lsa_GetUserName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34902 : {
34903 : DATA_BLOB blob;
34904 294 : Py_ssize_t blob_length = 0;
34905 294 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34906 294 : PyObject *bigendian_obj = NULL;
34907 294 : PyObject *ndr64_obj = NULL;
34908 294 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34909 294 : PyObject *allow_remaining_obj = NULL;
34910 294 : bool allow_remaining = false;
34911 :
34912 294 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
34913 : discard_const_p(char *, kwnames),
34914 : &blob.data, &blob_length,
34915 : &bigendian_obj,
34916 : &ndr64_obj,
34917 : &allow_remaining_obj)) {
34918 0 : return NULL;
34919 : }
34920 294 : blob.length = blob_length;
34921 :
34922 294 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34923 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34924 : }
34925 294 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34926 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34927 : }
34928 :
34929 294 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34930 0 : allow_remaining = true;
34931 : }
34932 :
34933 294 : return py_lsa_GetUserName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
34934 : }
34935 :
34936 0 : static PyObject *py_lsa_GetUserName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
34937 : {
34938 0 : const struct ndr_interface_call *call = NULL;
34939 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34940 : PyObject *ret;
34941 : char *retstr;
34942 :
34943 0 : if (ndr_table_lsarpc.num_calls < 46) {
34944 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetUserName_ndr_print");
34945 0 : return NULL;
34946 : }
34947 0 : call = &ndr_table_lsarpc.calls[45];
34948 :
34949 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
34950 0 : ret = PyUnicode_FromString(retstr);
34951 0 : TALLOC_FREE(retstr);
34952 :
34953 0 : return ret;
34954 : }
34955 :
34956 0 : static PyObject *py_lsa_GetUserName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34957 : {
34958 0 : return py_lsa_GetUserName_ndr_print(py_obj, "lsa_GetUserName_in", NDR_IN);
34959 : }
34960 :
34961 0 : static PyObject *py_lsa_GetUserName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34962 : {
34963 0 : return py_lsa_GetUserName_ndr_print(py_obj, "lsa_GetUserName_out", NDR_OUT);
34964 : }
34965 :
34966 : static PyMethodDef py_lsa_GetUserName_methods[] = {
34967 : { "opnum", (PyCFunction)py_lsa_GetUserName_ndr_opnum, METH_NOARGS|METH_CLASS,
34968 : "lsa.GetUserName.opnum() -> 45 (0x2d) " },
34969 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetUserName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
34970 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
34971 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetUserName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
34972 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
34973 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetUserName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
34974 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
34975 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetUserName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
34976 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
34977 : { "__ndr_print_in__", (PyCFunction)py_lsa_GetUserName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
34978 : { "__ndr_print_out__", (PyCFunction)py_lsa_GetUserName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
34979 : { NULL, NULL, 0, NULL }
34980 : };
34981 :
34982 :
34983 : static PyTypeObject lsa_GetUserName_Type = {
34984 : PyVarObject_HEAD_INIT(NULL, 0)
34985 : .tp_name = "lsa.GetUserName",
34986 : .tp_getset = py_lsa_GetUserName_getsetters,
34987 : .tp_methods = py_lsa_GetUserName_methods,
34988 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
34989 : .tp_new = py_lsa_GetUserName_new,
34990 : };
34991 :
34992 12 : static bool pack_py_lsa_GetUserName_args_in(PyObject *args, PyObject *kwargs, struct lsa_GetUserName *r)
34993 : {
34994 : PyObject *py_system_name;
34995 : PyObject *py_account_name;
34996 : PyObject *py_authority_name;
34997 12 : const char *kwnames[] = {
34998 : "system_name", "account_name", "authority_name", NULL
34999 : };
35000 :
35001 12 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_GetUserName", discard_const_p(char *, kwnames), &py_system_name, &py_account_name, &py_authority_name)) {
35002 0 : return false;
35003 : }
35004 :
35005 12 : if (py_system_name == NULL) {
35006 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name");
35007 0 : return false;
35008 : }
35009 12 : if (py_system_name == Py_None) {
35010 12 : r->in.system_name = NULL;
35011 : } else {
35012 0 : r->in.system_name = NULL;
35013 : {
35014 : const char *test_str;
35015 : const char *talloc_str;
35016 0 : PyObject *unicode = NULL;
35017 0 : if (PyUnicode_Check(py_system_name)) {
35018 0 : unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore");
35019 0 : if (unicode == NULL) {
35020 0 : PyErr_NoMemory();
35021 0 : return false;
35022 : }
35023 0 : test_str = PyBytes_AS_STRING(unicode);
35024 0 : } else if (PyBytes_Check(py_system_name)) {
35025 0 : test_str = PyBytes_AS_STRING(py_system_name);
35026 : } else {
35027 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
35028 0 : return false;
35029 : }
35030 0 : talloc_str = talloc_strdup(r, test_str);
35031 0 : if (unicode != NULL) {
35032 0 : Py_DECREF(unicode);
35033 : }
35034 0 : if (talloc_str == NULL) {
35035 0 : PyErr_NoMemory();
35036 0 : return false;
35037 : }
35038 0 : r->in.system_name = talloc_str;
35039 : }
35040 : }
35041 12 : if (py_account_name == NULL) {
35042 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
35043 0 : return false;
35044 : }
35045 12 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
35046 12 : if (r->in.account_name == NULL) {
35047 0 : PyErr_NoMemory();
35048 0 : return false;
35049 : }
35050 12 : if (py_account_name == Py_None) {
35051 12 : *r->in.account_name = NULL;
35052 : } else {
35053 0 : *r->in.account_name = NULL;
35054 0 : PY_CHECK_TYPE(&lsa_String_Type, py_account_name, return false;);
35055 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_account_name)) == NULL) {
35056 0 : PyErr_NoMemory();
35057 0 : return false;
35058 : }
35059 0 : *r->in.account_name = (struct lsa_String *)pytalloc_get_ptr(py_account_name);
35060 : }
35061 12 : if (py_authority_name == NULL) {
35062 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.authority_name");
35063 0 : return false;
35064 : }
35065 12 : if (py_authority_name == Py_None) {
35066 12 : r->in.authority_name = NULL;
35067 : } else {
35068 0 : r->in.authority_name = talloc_ptrtype(r, r->in.authority_name);
35069 0 : if (r->in.authority_name == NULL) {
35070 0 : PyErr_NoMemory();
35071 0 : return false;
35072 : }
35073 0 : py_authority_name = py_dcerpc_ndr_pointer_deref(ndr_pointer_Type, py_authority_name);
35074 0 : if (py_authority_name == NULL) {
35075 0 : return false;
35076 : }
35077 0 : if (py_authority_name == Py_None) {
35078 0 : *r->in.authority_name = NULL;
35079 : } else {
35080 0 : *r->in.authority_name = NULL;
35081 0 : PY_CHECK_TYPE(&lsa_String_Type, py_authority_name, return false;);
35082 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_authority_name)) == NULL) {
35083 0 : PyErr_NoMemory();
35084 0 : return false;
35085 : }
35086 0 : *r->in.authority_name = (struct lsa_String *)pytalloc_get_ptr(py_authority_name);
35087 : }
35088 : }
35089 12 : return true;
35090 : }
35091 :
35092 12 : static PyObject *unpack_py_lsa_GetUserName_args_out(struct lsa_GetUserName *r)
35093 : {
35094 : PyObject *result;
35095 : PyObject *py_account_name;
35096 : PyObject *py_authority_name;
35097 12 : result = PyTuple_New(2);
35098 12 : if (*r->out.account_name == NULL) {
35099 0 : py_account_name = Py_None;
35100 0 : Py_INCREF(py_account_name);
35101 : } else {
35102 12 : py_account_name = pytalloc_reference_ex(&lsa_String_Type, *r->out.account_name, *r->out.account_name);
35103 : }
35104 12 : PyTuple_SetItem(result, 0, py_account_name);
35105 12 : if (r->out.authority_name == NULL) {
35106 12 : py_authority_name = Py_None;
35107 12 : Py_INCREF(py_authority_name);
35108 : } else {
35109 0 : if (*r->out.authority_name == NULL) {
35110 0 : py_authority_name = Py_None;
35111 0 : Py_INCREF(py_authority_name);
35112 : } else {
35113 0 : py_authority_name = pytalloc_reference_ex(&lsa_String_Type, *r->out.authority_name, *r->out.authority_name);
35114 : }
35115 : }
35116 : {
35117 12 : PyObject *py_authority_name_level_0 = py_authority_name;
35118 12 : py_authority_name = py_dcerpc_ndr_pointer_wrap(ndr_pointer_Type, py_authority_name_level_0);
35119 12 : Py_XDECREF(py_authority_name_level_0);
35120 : }
35121 12 : PyTuple_SetItem(result, 1, py_authority_name);
35122 12 : if (NT_STATUS_IS_ERR(r->out.result)) {
35123 0 : PyErr_SetNTSTATUS(r->out.result);
35124 0 : return NULL;
35125 : }
35126 :
35127 12 : return result;
35128 : }
35129 :
35130 :
35131 0 : static PyObject *py_lsa_QueryInfoPolicy2_in_get_handle(PyObject *obj, void *closure)
35132 : {
35133 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(obj);
35134 : PyObject *py_handle;
35135 0 : if (object->in.handle == NULL) {
35136 0 : Py_RETURN_NONE;
35137 : }
35138 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
35139 0 : return py_handle;
35140 : }
35141 :
35142 0 : static int py_lsa_QueryInfoPolicy2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
35143 : {
35144 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35145 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
35146 0 : if (value == NULL) {
35147 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
35148 0 : return -1;
35149 : }
35150 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
35151 0 : if (object->in.handle == NULL) {
35152 0 : PyErr_NoMemory();
35153 0 : return -1;
35154 : }
35155 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
35156 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35157 0 : PyErr_NoMemory();
35158 0 : return -1;
35159 : }
35160 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
35161 0 : return 0;
35162 : }
35163 :
35164 0 : static PyObject *py_lsa_QueryInfoPolicy2_in_get_level(PyObject *obj, void *closure)
35165 : {
35166 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(obj);
35167 : PyObject *py_level;
35168 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
35169 0 : return py_level;
35170 : }
35171 :
35172 0 : static int py_lsa_QueryInfoPolicy2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
35173 : {
35174 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35175 0 : if (value == NULL) {
35176 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
35177 0 : return -1;
35178 : }
35179 : {
35180 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
35181 0 : if (PyLong_Check(value)) {
35182 : unsigned long long test_var;
35183 0 : test_var = PyLong_AsUnsignedLongLong(value);
35184 0 : if (PyErr_Occurred() != NULL) {
35185 0 : return -1;
35186 : }
35187 0 : if (test_var > uint_max) {
35188 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35189 : PyLong_Type.tp_name, uint_max, test_var);
35190 0 : return -1;
35191 : }
35192 0 : object->in.level = test_var;
35193 : } else {
35194 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35195 : PyLong_Type.tp_name);
35196 0 : return -1;
35197 : }
35198 : }
35199 0 : return 0;
35200 : }
35201 :
35202 0 : static PyObject *py_lsa_QueryInfoPolicy2_out_get_info(PyObject *obj, void *closure)
35203 : {
35204 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(obj);
35205 : PyObject *py_info;
35206 0 : if (object->out.info == NULL) {
35207 0 : Py_RETURN_NONE;
35208 : }
35209 0 : if (*object->out.info == NULL) {
35210 0 : py_info = Py_None;
35211 0 : Py_INCREF(py_info);
35212 : } else {
35213 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_PolicyInformation");
35214 0 : if (py_info == NULL) {
35215 0 : return NULL;
35216 : }
35217 : }
35218 0 : return py_info;
35219 : }
35220 :
35221 0 : static int py_lsa_QueryInfoPolicy2_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
35222 : {
35223 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35224 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
35225 0 : if (value == NULL) {
35226 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
35227 0 : return -1;
35228 : }
35229 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
35230 0 : if (object->out.info == NULL) {
35231 0 : PyErr_NoMemory();
35232 0 : return -1;
35233 : }
35234 0 : if (value == Py_None) {
35235 0 : *object->out.info = NULL;
35236 : } else {
35237 0 : *object->out.info = NULL;
35238 : {
35239 : union lsa_PolicyInformation *info_switch_2;
35240 0 : info_switch_2 = (union lsa_PolicyInformation *)pyrpc_export_union(&lsa_PolicyInformation_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union lsa_PolicyInformation");
35241 0 : if (info_switch_2 == NULL) {
35242 0 : return -1;
35243 : }
35244 0 : *object->out.info = info_switch_2;
35245 : }
35246 : }
35247 0 : return 0;
35248 : }
35249 :
35250 0 : static PyObject *py_lsa_QueryInfoPolicy2_get_result(PyObject *obj, void *closure)
35251 : {
35252 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(obj);
35253 : PyObject *py_result;
35254 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
35255 0 : return py_result;
35256 : }
35257 :
35258 0 : static int py_lsa_QueryInfoPolicy2_set_result(PyObject *py_obj, PyObject *value, void *closure)
35259 : {
35260 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35261 0 : if (value == NULL) {
35262 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
35263 0 : return -1;
35264 : }
35265 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
35266 0 : return 0;
35267 : }
35268 :
35269 : static PyGetSetDef py_lsa_QueryInfoPolicy2_getsetters[] = {
35270 : {
35271 : .name = discard_const_p(char, "in_handle"),
35272 : .get = py_lsa_QueryInfoPolicy2_in_get_handle,
35273 : .set = py_lsa_QueryInfoPolicy2_in_set_handle,
35274 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
35275 : },
35276 : {
35277 : .name = discard_const_p(char, "in_level"),
35278 : .get = py_lsa_QueryInfoPolicy2_in_get_level,
35279 : .set = py_lsa_QueryInfoPolicy2_in_set_level,
35280 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInfo")
35281 : },
35282 : {
35283 : .name = discard_const_p(char, "out_info"),
35284 : .get = py_lsa_QueryInfoPolicy2_out_get_info,
35285 : .set = py_lsa_QueryInfoPolicy2_out_set_info,
35286 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInformation")
35287 : },
35288 : {
35289 : .name = discard_const_p(char, "result"),
35290 : .get = py_lsa_QueryInfoPolicy2_get_result,
35291 : .set = py_lsa_QueryInfoPolicy2_set_result,
35292 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
35293 : },
35294 : { .name = NULL }
35295 : };
35296 :
35297 0 : static PyObject *py_lsa_QueryInfoPolicy2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
35298 : {
35299 0 : PyObject *self = pytalloc_new(struct lsa_QueryInfoPolicy2, type);
35300 0 : struct lsa_QueryInfoPolicy2 *_self = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(self);
35301 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
35302 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
35303 : /* a pointer to a NULL pointer */
35304 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_PolicyInformation *);
35305 0 : return self;
35306 : }
35307 :
35308 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
35309 : {
35310 :
35311 :
35312 0 : return PyLong_FromLong(46);
35313 : }
35314 :
35315 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
35316 : {
35317 0 : const struct ndr_interface_call *call = NULL;
35318 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35319 0 : PyObject *ret = NULL;
35320 0 : struct ndr_push *push = NULL;
35321 : DATA_BLOB blob;
35322 : enum ndr_err_code err;
35323 :
35324 0 : if (ndr_table_lsarpc.num_calls < 47) {
35325 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy2_ndr_pack");
35326 0 : return NULL;
35327 : }
35328 0 : call = &ndr_table_lsarpc.calls[46];
35329 :
35330 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
35331 0 : if (push == NULL) {
35332 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35333 0 : return NULL;
35334 : }
35335 :
35336 0 : push->flags |= ndr_push_flags;
35337 :
35338 0 : err = call->ndr_push(push, ndr_inout_flags, object);
35339 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35340 0 : TALLOC_FREE(push);
35341 0 : PyErr_SetNdrError(err);
35342 0 : return NULL;
35343 : }
35344 0 : blob = ndr_push_blob(push);
35345 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
35346 0 : TALLOC_FREE(push);
35347 0 : return ret;
35348 : }
35349 :
35350 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35351 : {
35352 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35353 0 : PyObject *bigendian_obj = NULL;
35354 0 : PyObject *ndr64_obj = NULL;
35355 0 : uint32_t ndr_push_flags = 0;
35356 :
35357 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
35358 : discard_const_p(char *, kwnames),
35359 : &bigendian_obj,
35360 : &ndr64_obj)) {
35361 0 : return NULL;
35362 : }
35363 :
35364 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35365 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35366 : }
35367 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35368 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35369 : }
35370 :
35371 0 : return py_lsa_QueryInfoPolicy2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
35372 : }
35373 :
35374 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35375 : {
35376 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35377 0 : PyObject *bigendian_obj = NULL;
35378 0 : PyObject *ndr64_obj = NULL;
35379 0 : uint32_t ndr_push_flags = 0;
35380 :
35381 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
35382 : discard_const_p(char *, kwnames),
35383 : &bigendian_obj,
35384 : &ndr64_obj)) {
35385 0 : return NULL;
35386 : }
35387 :
35388 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35389 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35390 : }
35391 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35392 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35393 : }
35394 :
35395 0 : return py_lsa_QueryInfoPolicy2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
35396 : }
35397 :
35398 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
35399 : {
35400 0 : const struct ndr_interface_call *call = NULL;
35401 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35402 0 : struct ndr_pull *pull = NULL;
35403 : enum ndr_err_code err;
35404 :
35405 0 : if (ndr_table_lsarpc.num_calls < 47) {
35406 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy2_ndr_unpack");
35407 0 : return NULL;
35408 : }
35409 0 : call = &ndr_table_lsarpc.calls[46];
35410 :
35411 0 : pull = ndr_pull_init_blob(blob, object);
35412 0 : if (pull == NULL) {
35413 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35414 0 : return NULL;
35415 : }
35416 :
35417 0 : pull->flags |= ndr_pull_flags;
35418 :
35419 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
35420 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35421 0 : TALLOC_FREE(pull);
35422 0 : PyErr_SetNdrError(err);
35423 0 : return NULL;
35424 : }
35425 0 : if (!allow_remaining) {
35426 : uint32_t highest_ofs;
35427 :
35428 0 : if (pull->offset > pull->relative_highest_offset) {
35429 0 : highest_ofs = pull->offset;
35430 : } else {
35431 0 : highest_ofs = pull->relative_highest_offset;
35432 : }
35433 0 : if (highest_ofs < pull->data_size) {
35434 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
35435 : "not all bytes consumed ofs[%u] size[%u]",
35436 : highest_ofs, pull->data_size);
35437 0 : TALLOC_FREE(pull);
35438 0 : PyErr_SetNdrError(err);
35439 0 : return NULL;
35440 : }
35441 : }
35442 :
35443 0 : TALLOC_FREE(pull);
35444 0 : Py_RETURN_NONE;
35445 : }
35446 :
35447 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35448 : {
35449 : DATA_BLOB blob;
35450 0 : Py_ssize_t blob_length = 0;
35451 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35452 0 : PyObject *bigendian_obj = NULL;
35453 0 : PyObject *ndr64_obj = NULL;
35454 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35455 0 : PyObject *allow_remaining_obj = NULL;
35456 0 : bool allow_remaining = false;
35457 :
35458 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
35459 : discard_const_p(char *, kwnames),
35460 : &blob.data, &blob_length,
35461 : &bigendian_obj,
35462 : &ndr64_obj,
35463 : &allow_remaining_obj)) {
35464 0 : return NULL;
35465 : }
35466 0 : blob.length = blob_length;
35467 :
35468 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35469 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
35470 : }
35471 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35472 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
35473 : }
35474 :
35475 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
35476 0 : allow_remaining = true;
35477 : }
35478 :
35479 0 : return py_lsa_QueryInfoPolicy2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
35480 : }
35481 :
35482 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35483 : {
35484 : DATA_BLOB blob;
35485 0 : Py_ssize_t blob_length = 0;
35486 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35487 0 : PyObject *bigendian_obj = NULL;
35488 0 : PyObject *ndr64_obj = NULL;
35489 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35490 0 : PyObject *allow_remaining_obj = NULL;
35491 0 : bool allow_remaining = false;
35492 :
35493 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
35494 : discard_const_p(char *, kwnames),
35495 : &blob.data, &blob_length,
35496 : &bigendian_obj,
35497 : &ndr64_obj,
35498 : &allow_remaining_obj)) {
35499 0 : return NULL;
35500 : }
35501 0 : blob.length = blob_length;
35502 :
35503 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35504 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
35505 : }
35506 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35507 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
35508 : }
35509 :
35510 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
35511 0 : allow_remaining = true;
35512 : }
35513 :
35514 0 : return py_lsa_QueryInfoPolicy2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
35515 : }
35516 :
35517 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
35518 : {
35519 0 : const struct ndr_interface_call *call = NULL;
35520 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35521 : PyObject *ret;
35522 : char *retstr;
35523 :
35524 0 : if (ndr_table_lsarpc.num_calls < 47) {
35525 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy2_ndr_print");
35526 0 : return NULL;
35527 : }
35528 0 : call = &ndr_table_lsarpc.calls[46];
35529 :
35530 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
35531 0 : ret = PyUnicode_FromString(retstr);
35532 0 : TALLOC_FREE(retstr);
35533 :
35534 0 : return ret;
35535 : }
35536 :
35537 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
35538 : {
35539 0 : return py_lsa_QueryInfoPolicy2_ndr_print(py_obj, "lsa_QueryInfoPolicy2_in", NDR_IN);
35540 : }
35541 :
35542 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
35543 : {
35544 0 : return py_lsa_QueryInfoPolicy2_ndr_print(py_obj, "lsa_QueryInfoPolicy2_out", NDR_OUT);
35545 : }
35546 :
35547 : static PyMethodDef py_lsa_QueryInfoPolicy2_methods[] = {
35548 : { "opnum", (PyCFunction)py_lsa_QueryInfoPolicy2_ndr_opnum, METH_NOARGS|METH_CLASS,
35549 : "lsa.QueryInfoPolicy2.opnum() -> 46 (0x2e) " },
35550 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
35551 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
35552 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
35553 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
35554 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
35555 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
35556 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
35557 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
35558 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryInfoPolicy2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
35559 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryInfoPolicy2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
35560 : { NULL, NULL, 0, NULL }
35561 : };
35562 :
35563 :
35564 : static PyTypeObject lsa_QueryInfoPolicy2_Type = {
35565 : PyVarObject_HEAD_INIT(NULL, 0)
35566 : .tp_name = "lsa.QueryInfoPolicy2",
35567 : .tp_getset = py_lsa_QueryInfoPolicy2_getsetters,
35568 : .tp_methods = py_lsa_QueryInfoPolicy2_methods,
35569 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
35570 : .tp_new = py_lsa_QueryInfoPolicy2_new,
35571 : };
35572 :
35573 213 : static bool pack_py_lsa_QueryInfoPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryInfoPolicy2 *r)
35574 : {
35575 : PyObject *py_handle;
35576 : PyObject *py_level;
35577 213 : const char *kwnames[] = {
35578 : "handle", "level", NULL
35579 : };
35580 :
35581 213 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryInfoPolicy2", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
35582 0 : return false;
35583 : }
35584 :
35585 213 : if (py_handle == NULL) {
35586 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
35587 0 : return false;
35588 : }
35589 213 : r->in.handle = talloc_ptrtype(r, r->in.handle);
35590 213 : if (r->in.handle == NULL) {
35591 0 : PyErr_NoMemory();
35592 0 : return false;
35593 : }
35594 213 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
35595 213 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
35596 0 : PyErr_NoMemory();
35597 0 : return false;
35598 : }
35599 213 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
35600 213 : if (py_level == NULL) {
35601 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
35602 0 : return false;
35603 : }
35604 : {
35605 213 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
35606 213 : if (PyLong_Check(py_level)) {
35607 : unsigned long long test_var;
35608 213 : test_var = PyLong_AsUnsignedLongLong(py_level);
35609 213 : if (PyErr_Occurred() != NULL) {
35610 0 : return false;
35611 : }
35612 213 : if (test_var > uint_max) {
35613 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35614 : PyLong_Type.tp_name, uint_max, test_var);
35615 0 : return false;
35616 : }
35617 213 : r->in.level = test_var;
35618 : } else {
35619 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35620 : PyLong_Type.tp_name);
35621 0 : return false;
35622 : }
35623 : }
35624 213 : return true;
35625 : }
35626 :
35627 213 : static PyObject *unpack_py_lsa_QueryInfoPolicy2_args_out(struct lsa_QueryInfoPolicy2 *r)
35628 : {
35629 : PyObject *result;
35630 : PyObject *py_info;
35631 213 : if (*r->out.info == NULL) {
35632 0 : py_info = Py_None;
35633 0 : Py_INCREF(py_info);
35634 : } else {
35635 213 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_PolicyInformation");
35636 213 : if (py_info == NULL) {
35637 0 : return NULL;
35638 : }
35639 : }
35640 213 : result = py_info;
35641 213 : if (NT_STATUS_IS_ERR(r->out.result)) {
35642 0 : PyErr_SetNTSTATUS(r->out.result);
35643 0 : return NULL;
35644 : }
35645 :
35646 213 : return result;
35647 : }
35648 :
35649 :
35650 0 : static PyObject *py_lsa_SetInfoPolicy2_in_get_handle(PyObject *obj, void *closure)
35651 : {
35652 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(obj);
35653 : PyObject *py_handle;
35654 0 : if (object->in.handle == NULL) {
35655 0 : Py_RETURN_NONE;
35656 : }
35657 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
35658 0 : return py_handle;
35659 : }
35660 :
35661 0 : static int py_lsa_SetInfoPolicy2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
35662 : {
35663 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35664 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
35665 0 : if (value == NULL) {
35666 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
35667 0 : return -1;
35668 : }
35669 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
35670 0 : if (object->in.handle == NULL) {
35671 0 : PyErr_NoMemory();
35672 0 : return -1;
35673 : }
35674 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
35675 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35676 0 : PyErr_NoMemory();
35677 0 : return -1;
35678 : }
35679 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
35680 0 : return 0;
35681 : }
35682 :
35683 0 : static PyObject *py_lsa_SetInfoPolicy2_in_get_level(PyObject *obj, void *closure)
35684 : {
35685 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(obj);
35686 : PyObject *py_level;
35687 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
35688 0 : return py_level;
35689 : }
35690 :
35691 0 : static int py_lsa_SetInfoPolicy2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
35692 : {
35693 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35694 0 : if (value == NULL) {
35695 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
35696 0 : return -1;
35697 : }
35698 : {
35699 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
35700 0 : if (PyLong_Check(value)) {
35701 : unsigned long long test_var;
35702 0 : test_var = PyLong_AsUnsignedLongLong(value);
35703 0 : if (PyErr_Occurred() != NULL) {
35704 0 : return -1;
35705 : }
35706 0 : if (test_var > uint_max) {
35707 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35708 : PyLong_Type.tp_name, uint_max, test_var);
35709 0 : return -1;
35710 : }
35711 0 : object->in.level = test_var;
35712 : } else {
35713 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35714 : PyLong_Type.tp_name);
35715 0 : return -1;
35716 : }
35717 : }
35718 0 : return 0;
35719 : }
35720 :
35721 0 : static PyObject *py_lsa_SetInfoPolicy2_in_get_info(PyObject *obj, void *closure)
35722 : {
35723 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(obj);
35724 : PyObject *py_info;
35725 0 : if (object->in.info == NULL) {
35726 0 : Py_RETURN_NONE;
35727 : }
35728 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, object->in.info, object->in.level, object->in.info, "union lsa_PolicyInformation");
35729 0 : if (py_info == NULL) {
35730 0 : return NULL;
35731 : }
35732 0 : return py_info;
35733 : }
35734 :
35735 0 : static int py_lsa_SetInfoPolicy2_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
35736 : {
35737 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35738 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
35739 0 : if (value == NULL) {
35740 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
35741 0 : return -1;
35742 : }
35743 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
35744 0 : if (object->in.info == NULL) {
35745 0 : PyErr_NoMemory();
35746 0 : return -1;
35747 : }
35748 : {
35749 : union lsa_PolicyInformation *info_switch_1;
35750 0 : info_switch_1 = (union lsa_PolicyInformation *)pyrpc_export_union(&lsa_PolicyInformation_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union lsa_PolicyInformation");
35751 0 : if (info_switch_1 == NULL) {
35752 0 : return -1;
35753 : }
35754 0 : object->in.info = info_switch_1;
35755 : }
35756 0 : return 0;
35757 : }
35758 :
35759 0 : static PyObject *py_lsa_SetInfoPolicy2_get_result(PyObject *obj, void *closure)
35760 : {
35761 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(obj);
35762 : PyObject *py_result;
35763 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
35764 0 : return py_result;
35765 : }
35766 :
35767 0 : static int py_lsa_SetInfoPolicy2_set_result(PyObject *py_obj, PyObject *value, void *closure)
35768 : {
35769 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35770 0 : if (value == NULL) {
35771 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
35772 0 : return -1;
35773 : }
35774 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
35775 0 : return 0;
35776 : }
35777 :
35778 : static PyGetSetDef py_lsa_SetInfoPolicy2_getsetters[] = {
35779 : {
35780 : .name = discard_const_p(char, "in_handle"),
35781 : .get = py_lsa_SetInfoPolicy2_in_get_handle,
35782 : .set = py_lsa_SetInfoPolicy2_in_set_handle,
35783 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
35784 : },
35785 : {
35786 : .name = discard_const_p(char, "in_level"),
35787 : .get = py_lsa_SetInfoPolicy2_in_get_level,
35788 : .set = py_lsa_SetInfoPolicy2_in_set_level,
35789 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInfo")
35790 : },
35791 : {
35792 : .name = discard_const_p(char, "in_info"),
35793 : .get = py_lsa_SetInfoPolicy2_in_get_info,
35794 : .set = py_lsa_SetInfoPolicy2_in_set_info,
35795 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInformation")
35796 : },
35797 : {
35798 : .name = discard_const_p(char, "result"),
35799 : .get = py_lsa_SetInfoPolicy2_get_result,
35800 : .set = py_lsa_SetInfoPolicy2_set_result,
35801 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
35802 : },
35803 : { .name = NULL }
35804 : };
35805 :
35806 0 : static PyObject *py_lsa_SetInfoPolicy2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
35807 : {
35808 0 : PyObject *self = pytalloc_new(struct lsa_SetInfoPolicy2, type);
35809 0 : struct lsa_SetInfoPolicy2 *_self = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(self);
35810 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
35811 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
35812 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_PolicyInformation);
35813 0 : return self;
35814 : }
35815 :
35816 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
35817 : {
35818 :
35819 :
35820 0 : return PyLong_FromLong(47);
35821 : }
35822 :
35823 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
35824 : {
35825 0 : const struct ndr_interface_call *call = NULL;
35826 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35827 0 : PyObject *ret = NULL;
35828 0 : struct ndr_push *push = NULL;
35829 : DATA_BLOB blob;
35830 : enum ndr_err_code err;
35831 :
35832 0 : if (ndr_table_lsarpc.num_calls < 48) {
35833 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy2_ndr_pack");
35834 0 : return NULL;
35835 : }
35836 0 : call = &ndr_table_lsarpc.calls[47];
35837 :
35838 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
35839 0 : if (push == NULL) {
35840 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35841 0 : return NULL;
35842 : }
35843 :
35844 0 : push->flags |= ndr_push_flags;
35845 :
35846 0 : err = call->ndr_push(push, ndr_inout_flags, object);
35847 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35848 0 : TALLOC_FREE(push);
35849 0 : PyErr_SetNdrError(err);
35850 0 : return NULL;
35851 : }
35852 0 : blob = ndr_push_blob(push);
35853 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
35854 0 : TALLOC_FREE(push);
35855 0 : return ret;
35856 : }
35857 :
35858 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35859 : {
35860 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35861 0 : PyObject *bigendian_obj = NULL;
35862 0 : PyObject *ndr64_obj = NULL;
35863 0 : uint32_t ndr_push_flags = 0;
35864 :
35865 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
35866 : discard_const_p(char *, kwnames),
35867 : &bigendian_obj,
35868 : &ndr64_obj)) {
35869 0 : return NULL;
35870 : }
35871 :
35872 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35873 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35874 : }
35875 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35876 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35877 : }
35878 :
35879 0 : return py_lsa_SetInfoPolicy2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
35880 : }
35881 :
35882 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35883 : {
35884 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35885 0 : PyObject *bigendian_obj = NULL;
35886 0 : PyObject *ndr64_obj = NULL;
35887 0 : uint32_t ndr_push_flags = 0;
35888 :
35889 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
35890 : discard_const_p(char *, kwnames),
35891 : &bigendian_obj,
35892 : &ndr64_obj)) {
35893 0 : return NULL;
35894 : }
35895 :
35896 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35897 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35898 : }
35899 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35900 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35901 : }
35902 :
35903 0 : return py_lsa_SetInfoPolicy2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
35904 : }
35905 :
35906 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
35907 : {
35908 0 : const struct ndr_interface_call *call = NULL;
35909 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35910 0 : struct ndr_pull *pull = NULL;
35911 : enum ndr_err_code err;
35912 :
35913 0 : if (ndr_table_lsarpc.num_calls < 48) {
35914 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy2_ndr_unpack");
35915 0 : return NULL;
35916 : }
35917 0 : call = &ndr_table_lsarpc.calls[47];
35918 :
35919 0 : pull = ndr_pull_init_blob(blob, object);
35920 0 : if (pull == NULL) {
35921 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35922 0 : return NULL;
35923 : }
35924 :
35925 0 : pull->flags |= ndr_pull_flags;
35926 :
35927 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
35928 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35929 0 : TALLOC_FREE(pull);
35930 0 : PyErr_SetNdrError(err);
35931 0 : return NULL;
35932 : }
35933 0 : if (!allow_remaining) {
35934 : uint32_t highest_ofs;
35935 :
35936 0 : if (pull->offset > pull->relative_highest_offset) {
35937 0 : highest_ofs = pull->offset;
35938 : } else {
35939 0 : highest_ofs = pull->relative_highest_offset;
35940 : }
35941 0 : if (highest_ofs < pull->data_size) {
35942 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
35943 : "not all bytes consumed ofs[%u] size[%u]",
35944 : highest_ofs, pull->data_size);
35945 0 : TALLOC_FREE(pull);
35946 0 : PyErr_SetNdrError(err);
35947 0 : return NULL;
35948 : }
35949 : }
35950 :
35951 0 : TALLOC_FREE(pull);
35952 0 : Py_RETURN_NONE;
35953 : }
35954 :
35955 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35956 : {
35957 : DATA_BLOB blob;
35958 0 : Py_ssize_t blob_length = 0;
35959 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35960 0 : PyObject *bigendian_obj = NULL;
35961 0 : PyObject *ndr64_obj = NULL;
35962 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35963 0 : PyObject *allow_remaining_obj = NULL;
35964 0 : bool allow_remaining = false;
35965 :
35966 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
35967 : discard_const_p(char *, kwnames),
35968 : &blob.data, &blob_length,
35969 : &bigendian_obj,
35970 : &ndr64_obj,
35971 : &allow_remaining_obj)) {
35972 0 : return NULL;
35973 : }
35974 0 : blob.length = blob_length;
35975 :
35976 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35977 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
35978 : }
35979 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35980 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
35981 : }
35982 :
35983 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
35984 0 : allow_remaining = true;
35985 : }
35986 :
35987 0 : return py_lsa_SetInfoPolicy2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
35988 : }
35989 :
35990 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35991 : {
35992 : DATA_BLOB blob;
35993 0 : Py_ssize_t blob_length = 0;
35994 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35995 0 : PyObject *bigendian_obj = NULL;
35996 0 : PyObject *ndr64_obj = NULL;
35997 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35998 0 : PyObject *allow_remaining_obj = NULL;
35999 0 : bool allow_remaining = false;
36000 :
36001 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
36002 : discard_const_p(char *, kwnames),
36003 : &blob.data, &blob_length,
36004 : &bigendian_obj,
36005 : &ndr64_obj,
36006 : &allow_remaining_obj)) {
36007 0 : return NULL;
36008 : }
36009 0 : blob.length = blob_length;
36010 :
36011 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36012 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36013 : }
36014 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36015 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36016 : }
36017 :
36018 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36019 0 : allow_remaining = true;
36020 : }
36021 :
36022 0 : return py_lsa_SetInfoPolicy2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
36023 : }
36024 :
36025 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
36026 : {
36027 0 : const struct ndr_interface_call *call = NULL;
36028 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
36029 : PyObject *ret;
36030 : char *retstr;
36031 :
36032 0 : if (ndr_table_lsarpc.num_calls < 48) {
36033 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy2_ndr_print");
36034 0 : return NULL;
36035 : }
36036 0 : call = &ndr_table_lsarpc.calls[47];
36037 :
36038 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
36039 0 : ret = PyUnicode_FromString(retstr);
36040 0 : TALLOC_FREE(retstr);
36041 :
36042 0 : return ret;
36043 : }
36044 :
36045 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36046 : {
36047 0 : return py_lsa_SetInfoPolicy2_ndr_print(py_obj, "lsa_SetInfoPolicy2_in", NDR_IN);
36048 : }
36049 :
36050 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36051 : {
36052 0 : return py_lsa_SetInfoPolicy2_ndr_print(py_obj, "lsa_SetInfoPolicy2_out", NDR_OUT);
36053 : }
36054 :
36055 : static PyMethodDef py_lsa_SetInfoPolicy2_methods[] = {
36056 : { "opnum", (PyCFunction)py_lsa_SetInfoPolicy2_ndr_opnum, METH_NOARGS|METH_CLASS,
36057 : "lsa.SetInfoPolicy2.opnum() -> 47 (0x2f) " },
36058 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
36059 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
36060 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
36061 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
36062 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
36063 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
36064 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
36065 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
36066 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetInfoPolicy2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
36067 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetInfoPolicy2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
36068 : { NULL, NULL, 0, NULL }
36069 : };
36070 :
36071 :
36072 : static PyTypeObject lsa_SetInfoPolicy2_Type = {
36073 : PyVarObject_HEAD_INIT(NULL, 0)
36074 : .tp_name = "lsa.SetInfoPolicy2",
36075 : .tp_getset = py_lsa_SetInfoPolicy2_getsetters,
36076 : .tp_methods = py_lsa_SetInfoPolicy2_methods,
36077 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
36078 : .tp_new = py_lsa_SetInfoPolicy2_new,
36079 : };
36080 :
36081 0 : static bool pack_py_lsa_SetInfoPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInfoPolicy2 *r)
36082 : {
36083 : PyObject *py_handle;
36084 : PyObject *py_level;
36085 : PyObject *py_info;
36086 0 : const char *kwnames[] = {
36087 : "handle", "level", "info", NULL
36088 : };
36089 :
36090 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInfoPolicy2", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
36091 0 : return false;
36092 : }
36093 :
36094 0 : if (py_handle == NULL) {
36095 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
36096 0 : return false;
36097 : }
36098 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
36099 0 : if (r->in.handle == NULL) {
36100 0 : PyErr_NoMemory();
36101 0 : return false;
36102 : }
36103 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
36104 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
36105 0 : PyErr_NoMemory();
36106 0 : return false;
36107 : }
36108 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
36109 0 : if (py_level == NULL) {
36110 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
36111 0 : return false;
36112 : }
36113 : {
36114 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
36115 0 : if (PyLong_Check(py_level)) {
36116 : unsigned long long test_var;
36117 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
36118 0 : if (PyErr_Occurred() != NULL) {
36119 0 : return false;
36120 : }
36121 0 : if (test_var > uint_max) {
36122 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36123 : PyLong_Type.tp_name, uint_max, test_var);
36124 0 : return false;
36125 : }
36126 0 : r->in.level = test_var;
36127 : } else {
36128 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36129 : PyLong_Type.tp_name);
36130 0 : return false;
36131 : }
36132 : }
36133 0 : if (py_info == NULL) {
36134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
36135 0 : return false;
36136 : }
36137 0 : r->in.info = talloc_ptrtype(r, r->in.info);
36138 0 : if (r->in.info == NULL) {
36139 0 : PyErr_NoMemory();
36140 0 : return false;
36141 : }
36142 : {
36143 : union lsa_PolicyInformation *info_switch_1;
36144 0 : info_switch_1 = (union lsa_PolicyInformation *)pyrpc_export_union(&lsa_PolicyInformation_Type, r, r->in.level, py_info, "union lsa_PolicyInformation");
36145 0 : if (info_switch_1 == NULL) {
36146 0 : return false;
36147 : }
36148 0 : r->in.info = info_switch_1;
36149 : }
36150 0 : return true;
36151 : }
36152 :
36153 0 : static PyObject *unpack_py_lsa_SetInfoPolicy2_args_out(struct lsa_SetInfoPolicy2 *r)
36154 : {
36155 : PyObject *result;
36156 0 : result = Py_None;
36157 0 : Py_INCREF(result);
36158 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
36159 0 : PyErr_SetNTSTATUS(r->out.result);
36160 0 : return NULL;
36161 : }
36162 :
36163 0 : return result;
36164 : }
36165 :
36166 :
36167 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_in_get_handle(PyObject *obj, void *closure)
36168 : {
36169 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36170 : PyObject *py_handle;
36171 0 : if (object->in.handle == NULL) {
36172 0 : Py_RETURN_NONE;
36173 : }
36174 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
36175 0 : return py_handle;
36176 : }
36177 :
36178 0 : static int py_lsa_QueryTrustedDomainInfoByName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
36179 : {
36180 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36181 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
36182 0 : if (value == NULL) {
36183 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
36184 0 : return -1;
36185 : }
36186 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
36187 0 : if (object->in.handle == NULL) {
36188 0 : PyErr_NoMemory();
36189 0 : return -1;
36190 : }
36191 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
36192 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36193 0 : PyErr_NoMemory();
36194 0 : return -1;
36195 : }
36196 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
36197 0 : return 0;
36198 : }
36199 :
36200 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_in_get_trusted_domain(PyObject *obj, void *closure)
36201 : {
36202 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36203 : PyObject *py_trusted_domain;
36204 0 : if (object->in.trusted_domain == NULL) {
36205 0 : Py_RETURN_NONE;
36206 : }
36207 0 : py_trusted_domain = pytalloc_reference_ex(&lsa_String_Type, object->in.trusted_domain, object->in.trusted_domain);
36208 0 : return py_trusted_domain;
36209 : }
36210 :
36211 0 : static int py_lsa_QueryTrustedDomainInfoByName_in_set_trusted_domain(PyObject *py_obj, PyObject *value, void *closure)
36212 : {
36213 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36214 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain));
36215 0 : if (value == NULL) {
36216 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trusted_domain");
36217 0 : return -1;
36218 : }
36219 0 : object->in.trusted_domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain);
36220 0 : if (object->in.trusted_domain == NULL) {
36221 0 : PyErr_NoMemory();
36222 0 : return -1;
36223 : }
36224 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
36225 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36226 0 : PyErr_NoMemory();
36227 0 : return -1;
36228 : }
36229 0 : object->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(value);
36230 0 : return 0;
36231 : }
36232 :
36233 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_in_get_level(PyObject *obj, void *closure)
36234 : {
36235 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36236 : PyObject *py_level;
36237 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
36238 0 : return py_level;
36239 : }
36240 :
36241 0 : static int py_lsa_QueryTrustedDomainInfoByName_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
36242 : {
36243 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36244 0 : if (value == NULL) {
36245 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
36246 0 : return -1;
36247 : }
36248 : {
36249 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
36250 0 : if (PyLong_Check(value)) {
36251 : unsigned long long test_var;
36252 0 : test_var = PyLong_AsUnsignedLongLong(value);
36253 0 : if (PyErr_Occurred() != NULL) {
36254 0 : return -1;
36255 : }
36256 0 : if (test_var > uint_max) {
36257 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36258 : PyLong_Type.tp_name, uint_max, test_var);
36259 0 : return -1;
36260 : }
36261 0 : object->in.level = test_var;
36262 : } else {
36263 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36264 : PyLong_Type.tp_name);
36265 0 : return -1;
36266 : }
36267 : }
36268 0 : return 0;
36269 : }
36270 :
36271 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_out_get_info(PyObject *obj, void *closure)
36272 : {
36273 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36274 : PyObject *py_info;
36275 0 : if (object->out.info == NULL) {
36276 0 : Py_RETURN_NONE;
36277 : }
36278 0 : if (*object->out.info == NULL) {
36279 0 : py_info = Py_None;
36280 0 : Py_INCREF(py_info);
36281 : } else {
36282 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_TrustedDomainInfo");
36283 0 : if (py_info == NULL) {
36284 0 : return NULL;
36285 : }
36286 : }
36287 0 : return py_info;
36288 : }
36289 :
36290 0 : static int py_lsa_QueryTrustedDomainInfoByName_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
36291 : {
36292 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36293 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
36294 0 : if (value == NULL) {
36295 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
36296 0 : return -1;
36297 : }
36298 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
36299 0 : if (object->out.info == NULL) {
36300 0 : PyErr_NoMemory();
36301 0 : return -1;
36302 : }
36303 0 : if (value == Py_None) {
36304 0 : *object->out.info = NULL;
36305 : } else {
36306 0 : *object->out.info = NULL;
36307 : {
36308 : union lsa_TrustedDomainInfo *info_switch_2;
36309 0 : info_switch_2 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union lsa_TrustedDomainInfo");
36310 0 : if (info_switch_2 == NULL) {
36311 0 : return -1;
36312 : }
36313 0 : *object->out.info = info_switch_2;
36314 : }
36315 : }
36316 0 : return 0;
36317 : }
36318 :
36319 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_get_result(PyObject *obj, void *closure)
36320 : {
36321 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36322 : PyObject *py_result;
36323 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
36324 0 : return py_result;
36325 : }
36326 :
36327 0 : static int py_lsa_QueryTrustedDomainInfoByName_set_result(PyObject *py_obj, PyObject *value, void *closure)
36328 : {
36329 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36330 0 : if (value == NULL) {
36331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
36332 0 : return -1;
36333 : }
36334 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
36335 0 : return 0;
36336 : }
36337 :
36338 : static PyGetSetDef py_lsa_QueryTrustedDomainInfoByName_getsetters[] = {
36339 : {
36340 : .name = discard_const_p(char, "in_handle"),
36341 : .get = py_lsa_QueryTrustedDomainInfoByName_in_get_handle,
36342 : .set = py_lsa_QueryTrustedDomainInfoByName_in_set_handle,
36343 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
36344 : },
36345 : {
36346 : .name = discard_const_p(char, "in_trusted_domain"),
36347 : .get = py_lsa_QueryTrustedDomainInfoByName_in_get_trusted_domain,
36348 : .set = py_lsa_QueryTrustedDomainInfoByName_in_set_trusted_domain,
36349 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
36350 : },
36351 : {
36352 : .name = discard_const_p(char, "in_level"),
36353 : .get = py_lsa_QueryTrustedDomainInfoByName_in_get_level,
36354 : .set = py_lsa_QueryTrustedDomainInfoByName_in_set_level,
36355 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
36356 : },
36357 : {
36358 : .name = discard_const_p(char, "out_info"),
36359 : .get = py_lsa_QueryTrustedDomainInfoByName_out_get_info,
36360 : .set = py_lsa_QueryTrustedDomainInfoByName_out_set_info,
36361 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
36362 : },
36363 : {
36364 : .name = discard_const_p(char, "result"),
36365 : .get = py_lsa_QueryTrustedDomainInfoByName_get_result,
36366 : .set = py_lsa_QueryTrustedDomainInfoByName_set_result,
36367 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
36368 : },
36369 : { .name = NULL }
36370 : };
36371 :
36372 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
36373 : {
36374 0 : PyObject *self = pytalloc_new(struct lsa_QueryTrustedDomainInfoByName, type);
36375 0 : struct lsa_QueryTrustedDomainInfoByName *_self = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(self);
36376 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
36377 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
36378 0 : _self->in.trusted_domain = talloc_zero(mem_ctx, struct lsa_String);
36379 : /* a pointer to a NULL pointer */
36380 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo *);
36381 0 : return self;
36382 : }
36383 :
36384 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
36385 : {
36386 :
36387 :
36388 0 : return PyLong_FromLong(48);
36389 : }
36390 :
36391 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
36392 : {
36393 0 : const struct ndr_interface_call *call = NULL;
36394 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36395 0 : PyObject *ret = NULL;
36396 0 : struct ndr_push *push = NULL;
36397 : DATA_BLOB blob;
36398 : enum ndr_err_code err;
36399 :
36400 0 : if (ndr_table_lsarpc.num_calls < 49) {
36401 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoByName_ndr_pack");
36402 0 : return NULL;
36403 : }
36404 0 : call = &ndr_table_lsarpc.calls[48];
36405 :
36406 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
36407 0 : if (push == NULL) {
36408 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36409 0 : return NULL;
36410 : }
36411 :
36412 0 : push->flags |= ndr_push_flags;
36413 :
36414 0 : err = call->ndr_push(push, ndr_inout_flags, object);
36415 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36416 0 : TALLOC_FREE(push);
36417 0 : PyErr_SetNdrError(err);
36418 0 : return NULL;
36419 : }
36420 0 : blob = ndr_push_blob(push);
36421 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
36422 0 : TALLOC_FREE(push);
36423 0 : return ret;
36424 : }
36425 :
36426 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36427 : {
36428 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36429 0 : PyObject *bigendian_obj = NULL;
36430 0 : PyObject *ndr64_obj = NULL;
36431 0 : uint32_t ndr_push_flags = 0;
36432 :
36433 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
36434 : discard_const_p(char *, kwnames),
36435 : &bigendian_obj,
36436 : &ndr64_obj)) {
36437 0 : return NULL;
36438 : }
36439 :
36440 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36441 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36442 : }
36443 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36444 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36445 : }
36446 :
36447 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
36448 : }
36449 :
36450 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36451 : {
36452 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36453 0 : PyObject *bigendian_obj = NULL;
36454 0 : PyObject *ndr64_obj = NULL;
36455 0 : uint32_t ndr_push_flags = 0;
36456 :
36457 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
36458 : discard_const_p(char *, kwnames),
36459 : &bigendian_obj,
36460 : &ndr64_obj)) {
36461 0 : return NULL;
36462 : }
36463 :
36464 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36465 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36466 : }
36467 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36468 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36469 : }
36470 :
36471 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
36472 : }
36473 :
36474 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
36475 : {
36476 0 : const struct ndr_interface_call *call = NULL;
36477 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36478 0 : struct ndr_pull *pull = NULL;
36479 : enum ndr_err_code err;
36480 :
36481 0 : if (ndr_table_lsarpc.num_calls < 49) {
36482 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoByName_ndr_unpack");
36483 0 : return NULL;
36484 : }
36485 0 : call = &ndr_table_lsarpc.calls[48];
36486 :
36487 0 : pull = ndr_pull_init_blob(blob, object);
36488 0 : if (pull == NULL) {
36489 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36490 0 : return NULL;
36491 : }
36492 :
36493 0 : pull->flags |= ndr_pull_flags;
36494 :
36495 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
36496 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36497 0 : TALLOC_FREE(pull);
36498 0 : PyErr_SetNdrError(err);
36499 0 : return NULL;
36500 : }
36501 0 : if (!allow_remaining) {
36502 : uint32_t highest_ofs;
36503 :
36504 0 : if (pull->offset > pull->relative_highest_offset) {
36505 0 : highest_ofs = pull->offset;
36506 : } else {
36507 0 : highest_ofs = pull->relative_highest_offset;
36508 : }
36509 0 : if (highest_ofs < pull->data_size) {
36510 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
36511 : "not all bytes consumed ofs[%u] size[%u]",
36512 : highest_ofs, pull->data_size);
36513 0 : TALLOC_FREE(pull);
36514 0 : PyErr_SetNdrError(err);
36515 0 : return NULL;
36516 : }
36517 : }
36518 :
36519 0 : TALLOC_FREE(pull);
36520 0 : Py_RETURN_NONE;
36521 : }
36522 :
36523 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36524 : {
36525 : DATA_BLOB blob;
36526 0 : Py_ssize_t blob_length = 0;
36527 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36528 0 : PyObject *bigendian_obj = NULL;
36529 0 : PyObject *ndr64_obj = NULL;
36530 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36531 0 : PyObject *allow_remaining_obj = NULL;
36532 0 : bool allow_remaining = false;
36533 :
36534 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
36535 : discard_const_p(char *, kwnames),
36536 : &blob.data, &blob_length,
36537 : &bigendian_obj,
36538 : &ndr64_obj,
36539 : &allow_remaining_obj)) {
36540 0 : return NULL;
36541 : }
36542 0 : blob.length = blob_length;
36543 :
36544 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36545 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36546 : }
36547 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36548 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36549 : }
36550 :
36551 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36552 0 : allow_remaining = true;
36553 : }
36554 :
36555 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
36556 : }
36557 :
36558 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36559 : {
36560 : DATA_BLOB blob;
36561 0 : Py_ssize_t blob_length = 0;
36562 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36563 0 : PyObject *bigendian_obj = NULL;
36564 0 : PyObject *ndr64_obj = NULL;
36565 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36566 0 : PyObject *allow_remaining_obj = NULL;
36567 0 : bool allow_remaining = false;
36568 :
36569 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
36570 : discard_const_p(char *, kwnames),
36571 : &blob.data, &blob_length,
36572 : &bigendian_obj,
36573 : &ndr64_obj,
36574 : &allow_remaining_obj)) {
36575 0 : return NULL;
36576 : }
36577 0 : blob.length = blob_length;
36578 :
36579 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36580 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36581 : }
36582 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36583 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36584 : }
36585 :
36586 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36587 0 : allow_remaining = true;
36588 : }
36589 :
36590 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
36591 : }
36592 :
36593 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
36594 : {
36595 0 : const struct ndr_interface_call *call = NULL;
36596 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36597 : PyObject *ret;
36598 : char *retstr;
36599 :
36600 0 : if (ndr_table_lsarpc.num_calls < 49) {
36601 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoByName_ndr_print");
36602 0 : return NULL;
36603 : }
36604 0 : call = &ndr_table_lsarpc.calls[48];
36605 :
36606 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
36607 0 : ret = PyUnicode_FromString(retstr);
36608 0 : TALLOC_FREE(retstr);
36609 :
36610 0 : return ret;
36611 : }
36612 :
36613 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36614 : {
36615 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_print(py_obj, "lsa_QueryTrustedDomainInfoByName_in", NDR_IN);
36616 : }
36617 :
36618 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36619 : {
36620 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_print(py_obj, "lsa_QueryTrustedDomainInfoByName_out", NDR_OUT);
36621 : }
36622 :
36623 : static PyMethodDef py_lsa_QueryTrustedDomainInfoByName_methods[] = {
36624 : { "opnum", (PyCFunction)py_lsa_QueryTrustedDomainInfoByName_ndr_opnum, METH_NOARGS|METH_CLASS,
36625 : "lsa.QueryTrustedDomainInfoByName.opnum() -> 48 (0x30) " },
36626 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoByName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
36627 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
36628 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoByName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
36629 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
36630 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoByName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
36631 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
36632 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoByName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
36633 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
36634 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryTrustedDomainInfoByName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
36635 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryTrustedDomainInfoByName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
36636 : { NULL, NULL, 0, NULL }
36637 : };
36638 :
36639 :
36640 : static PyTypeObject lsa_QueryTrustedDomainInfoByName_Type = {
36641 : PyVarObject_HEAD_INIT(NULL, 0)
36642 : .tp_name = "lsa.QueryTrustedDomainInfoByName",
36643 : .tp_getset = py_lsa_QueryTrustedDomainInfoByName_getsetters,
36644 : .tp_methods = py_lsa_QueryTrustedDomainInfoByName_methods,
36645 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
36646 : .tp_new = py_lsa_QueryTrustedDomainInfoByName_new,
36647 : };
36648 :
36649 188 : static bool pack_py_lsa_QueryTrustedDomainInfoByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfoByName *r)
36650 : {
36651 : PyObject *py_handle;
36652 : PyObject *py_trusted_domain;
36653 : PyObject *py_level;
36654 188 : const char *kwnames[] = {
36655 : "handle", "trusted_domain", "level", NULL
36656 : };
36657 :
36658 188 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_QueryTrustedDomainInfoByName", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain, &py_level)) {
36659 0 : return false;
36660 : }
36661 :
36662 188 : if (py_handle == NULL) {
36663 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
36664 0 : return false;
36665 : }
36666 188 : r->in.handle = talloc_ptrtype(r, r->in.handle);
36667 188 : if (r->in.handle == NULL) {
36668 0 : PyErr_NoMemory();
36669 0 : return false;
36670 : }
36671 188 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
36672 188 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
36673 0 : PyErr_NoMemory();
36674 0 : return false;
36675 : }
36676 188 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
36677 188 : if (py_trusted_domain == NULL) {
36678 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trusted_domain");
36679 0 : return false;
36680 : }
36681 188 : r->in.trusted_domain = talloc_ptrtype(r, r->in.trusted_domain);
36682 188 : if (r->in.trusted_domain == NULL) {
36683 0 : PyErr_NoMemory();
36684 0 : return false;
36685 : }
36686 188 : PY_CHECK_TYPE(&lsa_String_Type, py_trusted_domain, return false;);
36687 188 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain)) == NULL) {
36688 0 : PyErr_NoMemory();
36689 0 : return false;
36690 : }
36691 188 : r->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain);
36692 188 : if (py_level == NULL) {
36693 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
36694 0 : return false;
36695 : }
36696 : {
36697 188 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
36698 188 : if (PyLong_Check(py_level)) {
36699 : unsigned long long test_var;
36700 188 : test_var = PyLong_AsUnsignedLongLong(py_level);
36701 188 : if (PyErr_Occurred() != NULL) {
36702 0 : return false;
36703 : }
36704 188 : if (test_var > uint_max) {
36705 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36706 : PyLong_Type.tp_name, uint_max, test_var);
36707 0 : return false;
36708 : }
36709 188 : r->in.level = test_var;
36710 : } else {
36711 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36712 : PyLong_Type.tp_name);
36713 0 : return false;
36714 : }
36715 : }
36716 188 : return true;
36717 : }
36718 :
36719 188 : static PyObject *unpack_py_lsa_QueryTrustedDomainInfoByName_args_out(struct lsa_QueryTrustedDomainInfoByName *r)
36720 : {
36721 : PyObject *result;
36722 : PyObject *py_info;
36723 188 : if (*r->out.info == NULL) {
36724 44 : py_info = Py_None;
36725 44 : Py_INCREF(py_info);
36726 : } else {
36727 144 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_TrustedDomainInfo");
36728 144 : if (py_info == NULL) {
36729 0 : return NULL;
36730 : }
36731 : }
36732 188 : result = py_info;
36733 188 : if (NT_STATUS_IS_ERR(r->out.result)) {
36734 44 : PyErr_SetNTSTATUS(r->out.result);
36735 44 : return NULL;
36736 : }
36737 :
36738 144 : return result;
36739 : }
36740 :
36741 :
36742 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_in_get_handle(PyObject *obj, void *closure)
36743 : {
36744 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36745 : PyObject *py_handle;
36746 0 : if (object->in.handle == NULL) {
36747 0 : Py_RETURN_NONE;
36748 : }
36749 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
36750 0 : return py_handle;
36751 : }
36752 :
36753 0 : static int py_lsa_SetTrustedDomainInfoByName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
36754 : {
36755 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36756 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
36757 0 : if (value == NULL) {
36758 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
36759 0 : return -1;
36760 : }
36761 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
36762 0 : if (object->in.handle == NULL) {
36763 0 : PyErr_NoMemory();
36764 0 : return -1;
36765 : }
36766 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
36767 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36768 0 : PyErr_NoMemory();
36769 0 : return -1;
36770 : }
36771 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
36772 0 : return 0;
36773 : }
36774 :
36775 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_in_get_trusted_domain(PyObject *obj, void *closure)
36776 : {
36777 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36778 : PyObject *py_trusted_domain;
36779 0 : if (object->in.trusted_domain == NULL) {
36780 0 : Py_RETURN_NONE;
36781 : }
36782 0 : py_trusted_domain = pytalloc_reference_ex(&lsa_String_Type, object->in.trusted_domain, object->in.trusted_domain);
36783 0 : return py_trusted_domain;
36784 : }
36785 :
36786 0 : static int py_lsa_SetTrustedDomainInfoByName_in_set_trusted_domain(PyObject *py_obj, PyObject *value, void *closure)
36787 : {
36788 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36789 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain));
36790 0 : if (value == NULL) {
36791 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trusted_domain");
36792 0 : return -1;
36793 : }
36794 0 : object->in.trusted_domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain);
36795 0 : if (object->in.trusted_domain == NULL) {
36796 0 : PyErr_NoMemory();
36797 0 : return -1;
36798 : }
36799 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
36800 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36801 0 : PyErr_NoMemory();
36802 0 : return -1;
36803 : }
36804 0 : object->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(value);
36805 0 : return 0;
36806 : }
36807 :
36808 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_in_get_level(PyObject *obj, void *closure)
36809 : {
36810 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36811 : PyObject *py_level;
36812 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
36813 0 : return py_level;
36814 : }
36815 :
36816 0 : static int py_lsa_SetTrustedDomainInfoByName_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
36817 : {
36818 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36819 0 : if (value == NULL) {
36820 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
36821 0 : return -1;
36822 : }
36823 : {
36824 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
36825 0 : if (PyLong_Check(value)) {
36826 : unsigned long long test_var;
36827 0 : test_var = PyLong_AsUnsignedLongLong(value);
36828 0 : if (PyErr_Occurred() != NULL) {
36829 0 : return -1;
36830 : }
36831 0 : if (test_var > uint_max) {
36832 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36833 : PyLong_Type.tp_name, uint_max, test_var);
36834 0 : return -1;
36835 : }
36836 0 : object->in.level = test_var;
36837 : } else {
36838 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36839 : PyLong_Type.tp_name);
36840 0 : return -1;
36841 : }
36842 : }
36843 0 : return 0;
36844 : }
36845 :
36846 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_in_get_info(PyObject *obj, void *closure)
36847 : {
36848 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36849 : PyObject *py_info;
36850 0 : if (object->in.info == NULL) {
36851 0 : Py_RETURN_NONE;
36852 : }
36853 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, object->in.info, object->in.level, object->in.info, "union lsa_TrustedDomainInfo");
36854 0 : if (py_info == NULL) {
36855 0 : return NULL;
36856 : }
36857 0 : return py_info;
36858 : }
36859 :
36860 0 : static int py_lsa_SetTrustedDomainInfoByName_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
36861 : {
36862 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36863 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
36864 0 : if (value == NULL) {
36865 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
36866 0 : return -1;
36867 : }
36868 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
36869 0 : if (object->in.info == NULL) {
36870 0 : PyErr_NoMemory();
36871 0 : return -1;
36872 : }
36873 : {
36874 : union lsa_TrustedDomainInfo *info_switch_1;
36875 0 : info_switch_1 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union lsa_TrustedDomainInfo");
36876 0 : if (info_switch_1 == NULL) {
36877 0 : return -1;
36878 : }
36879 0 : object->in.info = info_switch_1;
36880 : }
36881 0 : return 0;
36882 : }
36883 :
36884 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_get_result(PyObject *obj, void *closure)
36885 : {
36886 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36887 : PyObject *py_result;
36888 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
36889 0 : return py_result;
36890 : }
36891 :
36892 0 : static int py_lsa_SetTrustedDomainInfoByName_set_result(PyObject *py_obj, PyObject *value, void *closure)
36893 : {
36894 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36895 0 : if (value == NULL) {
36896 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
36897 0 : return -1;
36898 : }
36899 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
36900 0 : return 0;
36901 : }
36902 :
36903 : static PyGetSetDef py_lsa_SetTrustedDomainInfoByName_getsetters[] = {
36904 : {
36905 : .name = discard_const_p(char, "in_handle"),
36906 : .get = py_lsa_SetTrustedDomainInfoByName_in_get_handle,
36907 : .set = py_lsa_SetTrustedDomainInfoByName_in_set_handle,
36908 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
36909 : },
36910 : {
36911 : .name = discard_const_p(char, "in_trusted_domain"),
36912 : .get = py_lsa_SetTrustedDomainInfoByName_in_get_trusted_domain,
36913 : .set = py_lsa_SetTrustedDomainInfoByName_in_set_trusted_domain,
36914 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
36915 : },
36916 : {
36917 : .name = discard_const_p(char, "in_level"),
36918 : .get = py_lsa_SetTrustedDomainInfoByName_in_get_level,
36919 : .set = py_lsa_SetTrustedDomainInfoByName_in_set_level,
36920 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
36921 : },
36922 : {
36923 : .name = discard_const_p(char, "in_info"),
36924 : .get = py_lsa_SetTrustedDomainInfoByName_in_get_info,
36925 : .set = py_lsa_SetTrustedDomainInfoByName_in_set_info,
36926 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
36927 : },
36928 : {
36929 : .name = discard_const_p(char, "result"),
36930 : .get = py_lsa_SetTrustedDomainInfoByName_get_result,
36931 : .set = py_lsa_SetTrustedDomainInfoByName_set_result,
36932 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
36933 : },
36934 : { .name = NULL }
36935 : };
36936 :
36937 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
36938 : {
36939 0 : PyObject *self = pytalloc_new(struct lsa_SetTrustedDomainInfoByName, type);
36940 0 : struct lsa_SetTrustedDomainInfoByName *_self = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(self);
36941 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
36942 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
36943 0 : _self->in.trusted_domain = talloc_zero(mem_ctx, struct lsa_String);
36944 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
36945 0 : return self;
36946 : }
36947 :
36948 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
36949 : {
36950 :
36951 :
36952 0 : return PyLong_FromLong(49);
36953 : }
36954 :
36955 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
36956 : {
36957 0 : const struct ndr_interface_call *call = NULL;
36958 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36959 0 : PyObject *ret = NULL;
36960 0 : struct ndr_push *push = NULL;
36961 : DATA_BLOB blob;
36962 : enum ndr_err_code err;
36963 :
36964 0 : if (ndr_table_lsarpc.num_calls < 50) {
36965 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfoByName_ndr_pack");
36966 0 : return NULL;
36967 : }
36968 0 : call = &ndr_table_lsarpc.calls[49];
36969 :
36970 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
36971 0 : if (push == NULL) {
36972 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36973 0 : return NULL;
36974 : }
36975 :
36976 0 : push->flags |= ndr_push_flags;
36977 :
36978 0 : err = call->ndr_push(push, ndr_inout_flags, object);
36979 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36980 0 : TALLOC_FREE(push);
36981 0 : PyErr_SetNdrError(err);
36982 0 : return NULL;
36983 : }
36984 0 : blob = ndr_push_blob(push);
36985 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
36986 0 : TALLOC_FREE(push);
36987 0 : return ret;
36988 : }
36989 :
36990 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36991 : {
36992 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36993 0 : PyObject *bigendian_obj = NULL;
36994 0 : PyObject *ndr64_obj = NULL;
36995 0 : uint32_t ndr_push_flags = 0;
36996 :
36997 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
36998 : discard_const_p(char *, kwnames),
36999 : &bigendian_obj,
37000 : &ndr64_obj)) {
37001 0 : return NULL;
37002 : }
37003 :
37004 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37005 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37006 : }
37007 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37008 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37009 : }
37010 :
37011 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
37012 : }
37013 :
37014 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37015 : {
37016 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37017 0 : PyObject *bigendian_obj = NULL;
37018 0 : PyObject *ndr64_obj = NULL;
37019 0 : uint32_t ndr_push_flags = 0;
37020 :
37021 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
37022 : discard_const_p(char *, kwnames),
37023 : &bigendian_obj,
37024 : &ndr64_obj)) {
37025 0 : return NULL;
37026 : }
37027 :
37028 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37029 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37030 : }
37031 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37032 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37033 : }
37034 :
37035 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
37036 : }
37037 :
37038 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
37039 : {
37040 0 : const struct ndr_interface_call *call = NULL;
37041 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
37042 0 : struct ndr_pull *pull = NULL;
37043 : enum ndr_err_code err;
37044 :
37045 0 : if (ndr_table_lsarpc.num_calls < 50) {
37046 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfoByName_ndr_unpack");
37047 0 : return NULL;
37048 : }
37049 0 : call = &ndr_table_lsarpc.calls[49];
37050 :
37051 0 : pull = ndr_pull_init_blob(blob, object);
37052 0 : if (pull == NULL) {
37053 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37054 0 : return NULL;
37055 : }
37056 :
37057 0 : pull->flags |= ndr_pull_flags;
37058 :
37059 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
37060 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37061 0 : TALLOC_FREE(pull);
37062 0 : PyErr_SetNdrError(err);
37063 0 : return NULL;
37064 : }
37065 0 : if (!allow_remaining) {
37066 : uint32_t highest_ofs;
37067 :
37068 0 : if (pull->offset > pull->relative_highest_offset) {
37069 0 : highest_ofs = pull->offset;
37070 : } else {
37071 0 : highest_ofs = pull->relative_highest_offset;
37072 : }
37073 0 : if (highest_ofs < pull->data_size) {
37074 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
37075 : "not all bytes consumed ofs[%u] size[%u]",
37076 : highest_ofs, pull->data_size);
37077 0 : TALLOC_FREE(pull);
37078 0 : PyErr_SetNdrError(err);
37079 0 : return NULL;
37080 : }
37081 : }
37082 :
37083 0 : TALLOC_FREE(pull);
37084 0 : Py_RETURN_NONE;
37085 : }
37086 :
37087 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37088 : {
37089 : DATA_BLOB blob;
37090 0 : Py_ssize_t blob_length = 0;
37091 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37092 0 : PyObject *bigendian_obj = NULL;
37093 0 : PyObject *ndr64_obj = NULL;
37094 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37095 0 : PyObject *allow_remaining_obj = NULL;
37096 0 : bool allow_remaining = false;
37097 :
37098 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
37099 : discard_const_p(char *, kwnames),
37100 : &blob.data, &blob_length,
37101 : &bigendian_obj,
37102 : &ndr64_obj,
37103 : &allow_remaining_obj)) {
37104 0 : return NULL;
37105 : }
37106 0 : blob.length = blob_length;
37107 :
37108 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37109 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37110 : }
37111 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37112 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37113 : }
37114 :
37115 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37116 0 : allow_remaining = true;
37117 : }
37118 :
37119 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
37120 : }
37121 :
37122 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37123 : {
37124 : DATA_BLOB blob;
37125 0 : Py_ssize_t blob_length = 0;
37126 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37127 0 : PyObject *bigendian_obj = NULL;
37128 0 : PyObject *ndr64_obj = NULL;
37129 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37130 0 : PyObject *allow_remaining_obj = NULL;
37131 0 : bool allow_remaining = false;
37132 :
37133 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
37134 : discard_const_p(char *, kwnames),
37135 : &blob.data, &blob_length,
37136 : &bigendian_obj,
37137 : &ndr64_obj,
37138 : &allow_remaining_obj)) {
37139 0 : return NULL;
37140 : }
37141 0 : blob.length = blob_length;
37142 :
37143 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37144 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37145 : }
37146 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37147 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37148 : }
37149 :
37150 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37151 0 : allow_remaining = true;
37152 : }
37153 :
37154 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
37155 : }
37156 :
37157 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
37158 : {
37159 0 : const struct ndr_interface_call *call = NULL;
37160 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
37161 : PyObject *ret;
37162 : char *retstr;
37163 :
37164 0 : if (ndr_table_lsarpc.num_calls < 50) {
37165 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfoByName_ndr_print");
37166 0 : return NULL;
37167 : }
37168 0 : call = &ndr_table_lsarpc.calls[49];
37169 :
37170 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
37171 0 : ret = PyUnicode_FromString(retstr);
37172 0 : TALLOC_FREE(retstr);
37173 :
37174 0 : return ret;
37175 : }
37176 :
37177 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37178 : {
37179 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_print(py_obj, "lsa_SetTrustedDomainInfoByName_in", NDR_IN);
37180 : }
37181 :
37182 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37183 : {
37184 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_print(py_obj, "lsa_SetTrustedDomainInfoByName_out", NDR_OUT);
37185 : }
37186 :
37187 : static PyMethodDef py_lsa_SetTrustedDomainInfoByName_methods[] = {
37188 : { "opnum", (PyCFunction)py_lsa_SetTrustedDomainInfoByName_ndr_opnum, METH_NOARGS|METH_CLASS,
37189 : "lsa.SetTrustedDomainInfoByName.opnum() -> 49 (0x31) " },
37190 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfoByName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
37191 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
37192 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfoByName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
37193 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
37194 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfoByName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
37195 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
37196 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfoByName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
37197 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
37198 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetTrustedDomainInfoByName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
37199 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetTrustedDomainInfoByName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
37200 : { NULL, NULL, 0, NULL }
37201 : };
37202 :
37203 :
37204 : static PyTypeObject lsa_SetTrustedDomainInfoByName_Type = {
37205 : PyVarObject_HEAD_INIT(NULL, 0)
37206 : .tp_name = "lsa.SetTrustedDomainInfoByName",
37207 : .tp_getset = py_lsa_SetTrustedDomainInfoByName_getsetters,
37208 : .tp_methods = py_lsa_SetTrustedDomainInfoByName_methods,
37209 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
37210 : .tp_new = py_lsa_SetTrustedDomainInfoByName_new,
37211 : };
37212 :
37213 0 : static bool pack_py_lsa_SetTrustedDomainInfoByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetTrustedDomainInfoByName *r)
37214 : {
37215 : PyObject *py_handle;
37216 : PyObject *py_trusted_domain;
37217 : PyObject *py_level;
37218 : PyObject *py_info;
37219 0 : const char *kwnames[] = {
37220 : "handle", "trusted_domain", "level", "info", NULL
37221 : };
37222 :
37223 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_SetTrustedDomainInfoByName", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain, &py_level, &py_info)) {
37224 0 : return false;
37225 : }
37226 :
37227 0 : if (py_handle == NULL) {
37228 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
37229 0 : return false;
37230 : }
37231 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
37232 0 : if (r->in.handle == NULL) {
37233 0 : PyErr_NoMemory();
37234 0 : return false;
37235 : }
37236 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
37237 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
37238 0 : PyErr_NoMemory();
37239 0 : return false;
37240 : }
37241 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
37242 0 : if (py_trusted_domain == NULL) {
37243 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trusted_domain");
37244 0 : return false;
37245 : }
37246 0 : r->in.trusted_domain = talloc_ptrtype(r, r->in.trusted_domain);
37247 0 : if (r->in.trusted_domain == NULL) {
37248 0 : PyErr_NoMemory();
37249 0 : return false;
37250 : }
37251 0 : PY_CHECK_TYPE(&lsa_String_Type, py_trusted_domain, return false;);
37252 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain)) == NULL) {
37253 0 : PyErr_NoMemory();
37254 0 : return false;
37255 : }
37256 0 : r->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain);
37257 0 : if (py_level == NULL) {
37258 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
37259 0 : return false;
37260 : }
37261 : {
37262 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
37263 0 : if (PyLong_Check(py_level)) {
37264 : unsigned long long test_var;
37265 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
37266 0 : if (PyErr_Occurred() != NULL) {
37267 0 : return false;
37268 : }
37269 0 : if (test_var > uint_max) {
37270 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37271 : PyLong_Type.tp_name, uint_max, test_var);
37272 0 : return false;
37273 : }
37274 0 : r->in.level = test_var;
37275 : } else {
37276 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37277 : PyLong_Type.tp_name);
37278 0 : return false;
37279 : }
37280 : }
37281 0 : if (py_info == NULL) {
37282 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
37283 0 : return false;
37284 : }
37285 0 : r->in.info = talloc_ptrtype(r, r->in.info);
37286 0 : if (r->in.info == NULL) {
37287 0 : PyErr_NoMemory();
37288 0 : return false;
37289 : }
37290 : {
37291 : union lsa_TrustedDomainInfo *info_switch_1;
37292 0 : info_switch_1 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, r, r->in.level, py_info, "union lsa_TrustedDomainInfo");
37293 0 : if (info_switch_1 == NULL) {
37294 0 : return false;
37295 : }
37296 0 : r->in.info = info_switch_1;
37297 : }
37298 0 : return true;
37299 : }
37300 :
37301 0 : static PyObject *unpack_py_lsa_SetTrustedDomainInfoByName_args_out(struct lsa_SetTrustedDomainInfoByName *r)
37302 : {
37303 : PyObject *result;
37304 0 : result = Py_None;
37305 0 : Py_INCREF(result);
37306 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
37307 0 : PyErr_SetNTSTATUS(r->out.result);
37308 0 : return NULL;
37309 : }
37310 :
37311 0 : return result;
37312 : }
37313 :
37314 :
37315 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_in_get_handle(PyObject *obj, void *closure)
37316 : {
37317 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(obj);
37318 : PyObject *py_handle;
37319 0 : if (object->in.handle == NULL) {
37320 0 : Py_RETURN_NONE;
37321 : }
37322 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
37323 0 : return py_handle;
37324 : }
37325 :
37326 0 : static int py_lsa_EnumTrustedDomainsEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
37327 : {
37328 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37329 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
37330 0 : if (value == NULL) {
37331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
37332 0 : return -1;
37333 : }
37334 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
37335 0 : if (object->in.handle == NULL) {
37336 0 : PyErr_NoMemory();
37337 0 : return -1;
37338 : }
37339 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
37340 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
37341 0 : PyErr_NoMemory();
37342 0 : return -1;
37343 : }
37344 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
37345 0 : return 0;
37346 : }
37347 :
37348 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_in_get_resume_handle(PyObject *obj, void *closure)
37349 : {
37350 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(obj);
37351 : PyObject *py_resume_handle;
37352 0 : if (object->in.resume_handle == NULL) {
37353 0 : Py_RETURN_NONE;
37354 : }
37355 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
37356 0 : return py_resume_handle;
37357 : }
37358 :
37359 0 : static int py_lsa_EnumTrustedDomainsEx_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
37360 : {
37361 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37362 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
37363 0 : if (value == NULL) {
37364 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
37365 0 : return -1;
37366 : }
37367 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
37368 0 : if (object->in.resume_handle == NULL) {
37369 0 : PyErr_NoMemory();
37370 0 : return -1;
37371 : }
37372 : {
37373 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
37374 0 : if (PyLong_Check(value)) {
37375 : unsigned long long test_var;
37376 0 : test_var = PyLong_AsUnsignedLongLong(value);
37377 0 : if (PyErr_Occurred() != NULL) {
37378 0 : return -1;
37379 : }
37380 0 : if (test_var > uint_max) {
37381 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37382 : PyLong_Type.tp_name, uint_max, test_var);
37383 0 : return -1;
37384 : }
37385 0 : *object->in.resume_handle = test_var;
37386 : } else {
37387 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37388 : PyLong_Type.tp_name);
37389 0 : return -1;
37390 : }
37391 : }
37392 0 : return 0;
37393 : }
37394 :
37395 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_out_get_resume_handle(PyObject *obj, void *closure)
37396 : {
37397 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(obj);
37398 : PyObject *py_resume_handle;
37399 0 : if (object->out.resume_handle == NULL) {
37400 0 : Py_RETURN_NONE;
37401 : }
37402 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
37403 0 : return py_resume_handle;
37404 : }
37405 :
37406 0 : static int py_lsa_EnumTrustedDomainsEx_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
37407 : {
37408 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37409 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
37410 0 : if (value == NULL) {
37411 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
37412 0 : return -1;
37413 : }
37414 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
37415 0 : if (object->out.resume_handle == NULL) {
37416 0 : PyErr_NoMemory();
37417 0 : return -1;
37418 : }
37419 : {
37420 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
37421 0 : if (PyLong_Check(value)) {
37422 : unsigned long long test_var;
37423 0 : test_var = PyLong_AsUnsignedLongLong(value);
37424 0 : if (PyErr_Occurred() != NULL) {
37425 0 : return -1;
37426 : }
37427 0 : if (test_var > uint_max) {
37428 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37429 : PyLong_Type.tp_name, uint_max, test_var);
37430 0 : return -1;
37431 : }
37432 0 : *object->out.resume_handle = test_var;
37433 : } else {
37434 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37435 : PyLong_Type.tp_name);
37436 0 : return -1;
37437 : }
37438 : }
37439 0 : return 0;
37440 : }
37441 :
37442 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_out_get_domains(PyObject *obj, void *closure)
37443 : {
37444 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(obj);
37445 : PyObject *py_domains;
37446 0 : if (object->out.domains == NULL) {
37447 0 : Py_RETURN_NONE;
37448 : }
37449 0 : py_domains = pytalloc_reference_ex(&lsa_DomainListEx_Type, object->out.domains, object->out.domains);
37450 0 : return py_domains;
37451 : }
37452 :
37453 0 : static int py_lsa_EnumTrustedDomainsEx_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
37454 : {
37455 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37456 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
37457 0 : if (value == NULL) {
37458 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
37459 0 : return -1;
37460 : }
37461 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
37462 0 : if (object->out.domains == NULL) {
37463 0 : PyErr_NoMemory();
37464 0 : return -1;
37465 : }
37466 0 : PY_CHECK_TYPE(&lsa_DomainListEx_Type, value, return -1;);
37467 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
37468 0 : PyErr_NoMemory();
37469 0 : return -1;
37470 : }
37471 0 : object->out.domains = (struct lsa_DomainListEx *)pytalloc_get_ptr(value);
37472 0 : return 0;
37473 : }
37474 :
37475 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_in_get_max_size(PyObject *obj, void *closure)
37476 : {
37477 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(obj);
37478 : PyObject *py_max_size;
37479 0 : py_max_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_size);
37480 0 : return py_max_size;
37481 : }
37482 :
37483 0 : static int py_lsa_EnumTrustedDomainsEx_in_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
37484 : {
37485 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37486 0 : if (value == NULL) {
37487 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_size");
37488 0 : return -1;
37489 : }
37490 : {
37491 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_size));
37492 0 : if (PyLong_Check(value)) {
37493 : unsigned long long test_var;
37494 0 : test_var = PyLong_AsUnsignedLongLong(value);
37495 0 : if (PyErr_Occurred() != NULL) {
37496 0 : return -1;
37497 : }
37498 0 : if (test_var > uint_max) {
37499 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37500 : PyLong_Type.tp_name, uint_max, test_var);
37501 0 : return -1;
37502 : }
37503 0 : object->in.max_size = test_var;
37504 : } else {
37505 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37506 : PyLong_Type.tp_name);
37507 0 : return -1;
37508 : }
37509 : }
37510 0 : return 0;
37511 : }
37512 :
37513 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_get_result(PyObject *obj, void *closure)
37514 : {
37515 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(obj);
37516 : PyObject *py_result;
37517 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
37518 0 : return py_result;
37519 : }
37520 :
37521 0 : static int py_lsa_EnumTrustedDomainsEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
37522 : {
37523 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37524 0 : if (value == NULL) {
37525 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
37526 0 : return -1;
37527 : }
37528 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
37529 0 : return 0;
37530 : }
37531 :
37532 : static PyGetSetDef py_lsa_EnumTrustedDomainsEx_getsetters[] = {
37533 : {
37534 : .name = discard_const_p(char, "in_handle"),
37535 : .get = py_lsa_EnumTrustedDomainsEx_in_get_handle,
37536 : .set = py_lsa_EnumTrustedDomainsEx_in_set_handle,
37537 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
37538 : },
37539 : {
37540 : .name = discard_const_p(char, "in_resume_handle"),
37541 : .get = py_lsa_EnumTrustedDomainsEx_in_get_resume_handle,
37542 : .set = py_lsa_EnumTrustedDomainsEx_in_set_resume_handle,
37543 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37544 : },
37545 : {
37546 : .name = discard_const_p(char, "out_resume_handle"),
37547 : .get = py_lsa_EnumTrustedDomainsEx_out_get_resume_handle,
37548 : .set = py_lsa_EnumTrustedDomainsEx_out_set_resume_handle,
37549 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37550 : },
37551 : {
37552 : .name = discard_const_p(char, "out_domains"),
37553 : .get = py_lsa_EnumTrustedDomainsEx_out_get_domains,
37554 : .set = py_lsa_EnumTrustedDomainsEx_out_set_domains,
37555 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainListEx")
37556 : },
37557 : {
37558 : .name = discard_const_p(char, "in_max_size"),
37559 : .get = py_lsa_EnumTrustedDomainsEx_in_get_max_size,
37560 : .set = py_lsa_EnumTrustedDomainsEx_in_set_max_size,
37561 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37562 : },
37563 : {
37564 : .name = discard_const_p(char, "result"),
37565 : .get = py_lsa_EnumTrustedDomainsEx_get_result,
37566 : .set = py_lsa_EnumTrustedDomainsEx_set_result,
37567 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
37568 : },
37569 : { .name = NULL }
37570 : };
37571 :
37572 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
37573 : {
37574 0 : PyObject *self = pytalloc_new(struct lsa_EnumTrustedDomainsEx, type);
37575 0 : struct lsa_EnumTrustedDomainsEx *_self = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(self);
37576 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
37577 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
37578 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
37579 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
37580 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_DomainListEx);
37581 0 : return self;
37582 : }
37583 :
37584 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
37585 : {
37586 :
37587 :
37588 0 : return PyLong_FromLong(50);
37589 : }
37590 :
37591 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
37592 : {
37593 0 : const struct ndr_interface_call *call = NULL;
37594 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37595 0 : PyObject *ret = NULL;
37596 0 : struct ndr_push *push = NULL;
37597 : DATA_BLOB blob;
37598 : enum ndr_err_code err;
37599 :
37600 0 : if (ndr_table_lsarpc.num_calls < 51) {
37601 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustedDomainsEx_ndr_pack");
37602 0 : return NULL;
37603 : }
37604 0 : call = &ndr_table_lsarpc.calls[50];
37605 :
37606 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
37607 0 : if (push == NULL) {
37608 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37609 0 : return NULL;
37610 : }
37611 :
37612 0 : push->flags |= ndr_push_flags;
37613 :
37614 0 : err = call->ndr_push(push, ndr_inout_flags, object);
37615 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37616 0 : TALLOC_FREE(push);
37617 0 : PyErr_SetNdrError(err);
37618 0 : return NULL;
37619 : }
37620 0 : blob = ndr_push_blob(push);
37621 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
37622 0 : TALLOC_FREE(push);
37623 0 : return ret;
37624 : }
37625 :
37626 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37627 : {
37628 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37629 0 : PyObject *bigendian_obj = NULL;
37630 0 : PyObject *ndr64_obj = NULL;
37631 0 : uint32_t ndr_push_flags = 0;
37632 :
37633 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
37634 : discard_const_p(char *, kwnames),
37635 : &bigendian_obj,
37636 : &ndr64_obj)) {
37637 0 : return NULL;
37638 : }
37639 :
37640 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37641 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37642 : }
37643 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37644 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37645 : }
37646 :
37647 0 : return py_lsa_EnumTrustedDomainsEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
37648 : }
37649 :
37650 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37651 : {
37652 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37653 0 : PyObject *bigendian_obj = NULL;
37654 0 : PyObject *ndr64_obj = NULL;
37655 0 : uint32_t ndr_push_flags = 0;
37656 :
37657 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
37658 : discard_const_p(char *, kwnames),
37659 : &bigendian_obj,
37660 : &ndr64_obj)) {
37661 0 : return NULL;
37662 : }
37663 :
37664 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37665 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37666 : }
37667 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37668 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37669 : }
37670 :
37671 0 : return py_lsa_EnumTrustedDomainsEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
37672 : }
37673 :
37674 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
37675 : {
37676 0 : const struct ndr_interface_call *call = NULL;
37677 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37678 0 : struct ndr_pull *pull = NULL;
37679 : enum ndr_err_code err;
37680 :
37681 0 : if (ndr_table_lsarpc.num_calls < 51) {
37682 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustedDomainsEx_ndr_unpack");
37683 0 : return NULL;
37684 : }
37685 0 : call = &ndr_table_lsarpc.calls[50];
37686 :
37687 0 : pull = ndr_pull_init_blob(blob, object);
37688 0 : if (pull == NULL) {
37689 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37690 0 : return NULL;
37691 : }
37692 :
37693 0 : pull->flags |= ndr_pull_flags;
37694 :
37695 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
37696 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37697 0 : TALLOC_FREE(pull);
37698 0 : PyErr_SetNdrError(err);
37699 0 : return NULL;
37700 : }
37701 0 : if (!allow_remaining) {
37702 : uint32_t highest_ofs;
37703 :
37704 0 : if (pull->offset > pull->relative_highest_offset) {
37705 0 : highest_ofs = pull->offset;
37706 : } else {
37707 0 : highest_ofs = pull->relative_highest_offset;
37708 : }
37709 0 : if (highest_ofs < pull->data_size) {
37710 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
37711 : "not all bytes consumed ofs[%u] size[%u]",
37712 : highest_ofs, pull->data_size);
37713 0 : TALLOC_FREE(pull);
37714 0 : PyErr_SetNdrError(err);
37715 0 : return NULL;
37716 : }
37717 : }
37718 :
37719 0 : TALLOC_FREE(pull);
37720 0 : Py_RETURN_NONE;
37721 : }
37722 :
37723 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37724 : {
37725 : DATA_BLOB blob;
37726 0 : Py_ssize_t blob_length = 0;
37727 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37728 0 : PyObject *bigendian_obj = NULL;
37729 0 : PyObject *ndr64_obj = NULL;
37730 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37731 0 : PyObject *allow_remaining_obj = NULL;
37732 0 : bool allow_remaining = false;
37733 :
37734 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
37735 : discard_const_p(char *, kwnames),
37736 : &blob.data, &blob_length,
37737 : &bigendian_obj,
37738 : &ndr64_obj,
37739 : &allow_remaining_obj)) {
37740 0 : return NULL;
37741 : }
37742 0 : blob.length = blob_length;
37743 :
37744 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37745 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37746 : }
37747 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37748 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37749 : }
37750 :
37751 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37752 0 : allow_remaining = true;
37753 : }
37754 :
37755 0 : return py_lsa_EnumTrustedDomainsEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
37756 : }
37757 :
37758 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37759 : {
37760 : DATA_BLOB blob;
37761 0 : Py_ssize_t blob_length = 0;
37762 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37763 0 : PyObject *bigendian_obj = NULL;
37764 0 : PyObject *ndr64_obj = NULL;
37765 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37766 0 : PyObject *allow_remaining_obj = NULL;
37767 0 : bool allow_remaining = false;
37768 :
37769 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
37770 : discard_const_p(char *, kwnames),
37771 : &blob.data, &blob_length,
37772 : &bigendian_obj,
37773 : &ndr64_obj,
37774 : &allow_remaining_obj)) {
37775 0 : return NULL;
37776 : }
37777 0 : blob.length = blob_length;
37778 :
37779 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37780 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37781 : }
37782 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37783 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37784 : }
37785 :
37786 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37787 0 : allow_remaining = true;
37788 : }
37789 :
37790 0 : return py_lsa_EnumTrustedDomainsEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
37791 : }
37792 :
37793 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
37794 : {
37795 0 : const struct ndr_interface_call *call = NULL;
37796 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37797 : PyObject *ret;
37798 : char *retstr;
37799 :
37800 0 : if (ndr_table_lsarpc.num_calls < 51) {
37801 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustedDomainsEx_ndr_print");
37802 0 : return NULL;
37803 : }
37804 0 : call = &ndr_table_lsarpc.calls[50];
37805 :
37806 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
37807 0 : ret = PyUnicode_FromString(retstr);
37808 0 : TALLOC_FREE(retstr);
37809 :
37810 0 : return ret;
37811 : }
37812 :
37813 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37814 : {
37815 0 : return py_lsa_EnumTrustedDomainsEx_ndr_print(py_obj, "lsa_EnumTrustedDomainsEx_in", NDR_IN);
37816 : }
37817 :
37818 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37819 : {
37820 0 : return py_lsa_EnumTrustedDomainsEx_ndr_print(py_obj, "lsa_EnumTrustedDomainsEx_out", NDR_OUT);
37821 : }
37822 :
37823 : static PyMethodDef py_lsa_EnumTrustedDomainsEx_methods[] = {
37824 : { "opnum", (PyCFunction)py_lsa_EnumTrustedDomainsEx_ndr_opnum, METH_NOARGS|METH_CLASS,
37825 : "lsa.EnumTrustedDomainsEx.opnum() -> 50 (0x32) " },
37826 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustedDomainsEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
37827 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
37828 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustedDomainsEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
37829 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
37830 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustedDomainsEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
37831 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
37832 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustedDomainsEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
37833 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
37834 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumTrustedDomainsEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
37835 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumTrustedDomainsEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
37836 : { NULL, NULL, 0, NULL }
37837 : };
37838 :
37839 :
37840 : static PyTypeObject lsa_EnumTrustedDomainsEx_Type = {
37841 : PyVarObject_HEAD_INIT(NULL, 0)
37842 : .tp_name = "lsa.EnumTrustedDomainsEx",
37843 : .tp_getset = py_lsa_EnumTrustedDomainsEx_getsetters,
37844 : .tp_methods = py_lsa_EnumTrustedDomainsEx_methods,
37845 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
37846 : .tp_new = py_lsa_EnumTrustedDomainsEx_new,
37847 : };
37848 :
37849 0 : static bool pack_py_lsa_EnumTrustedDomainsEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumTrustedDomainsEx *r)
37850 : {
37851 : PyObject *py_handle;
37852 : PyObject *py_resume_handle;
37853 : PyObject *py_max_size;
37854 0 : const char *kwnames[] = {
37855 : "handle", "resume_handle", "max_size", NULL
37856 : };
37857 :
37858 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumTrustedDomainsEx", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_size)) {
37859 0 : return false;
37860 : }
37861 :
37862 0 : if (py_handle == NULL) {
37863 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
37864 0 : return false;
37865 : }
37866 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
37867 0 : if (r->in.handle == NULL) {
37868 0 : PyErr_NoMemory();
37869 0 : return false;
37870 : }
37871 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
37872 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
37873 0 : PyErr_NoMemory();
37874 0 : return false;
37875 : }
37876 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
37877 0 : if (py_resume_handle == NULL) {
37878 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
37879 0 : return false;
37880 : }
37881 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
37882 0 : if (r->in.resume_handle == NULL) {
37883 0 : PyErr_NoMemory();
37884 0 : return false;
37885 : }
37886 : {
37887 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
37888 0 : if (PyLong_Check(py_resume_handle)) {
37889 : unsigned long long test_var;
37890 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
37891 0 : if (PyErr_Occurred() != NULL) {
37892 0 : return false;
37893 : }
37894 0 : if (test_var > uint_max) {
37895 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37896 : PyLong_Type.tp_name, uint_max, test_var);
37897 0 : return false;
37898 : }
37899 0 : *r->in.resume_handle = test_var;
37900 : } else {
37901 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37902 : PyLong_Type.tp_name);
37903 0 : return false;
37904 : }
37905 : }
37906 0 : if (py_max_size == NULL) {
37907 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_size");
37908 0 : return false;
37909 : }
37910 : {
37911 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size));
37912 0 : if (PyLong_Check(py_max_size)) {
37913 : unsigned long long test_var;
37914 0 : test_var = PyLong_AsUnsignedLongLong(py_max_size);
37915 0 : if (PyErr_Occurred() != NULL) {
37916 0 : return false;
37917 : }
37918 0 : if (test_var > uint_max) {
37919 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37920 : PyLong_Type.tp_name, uint_max, test_var);
37921 0 : return false;
37922 : }
37923 0 : r->in.max_size = test_var;
37924 : } else {
37925 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37926 : PyLong_Type.tp_name);
37927 0 : return false;
37928 : }
37929 : }
37930 0 : return true;
37931 : }
37932 :
37933 0 : static PyObject *unpack_py_lsa_EnumTrustedDomainsEx_args_out(struct lsa_EnumTrustedDomainsEx *r)
37934 : {
37935 : PyObject *result;
37936 : PyObject *py_resume_handle;
37937 : PyObject *py_domains;
37938 0 : result = PyTuple_New(2);
37939 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
37940 0 : PyTuple_SetItem(result, 0, py_resume_handle);
37941 0 : py_domains = pytalloc_reference_ex(&lsa_DomainListEx_Type, r->out.domains, r->out.domains);
37942 0 : PyTuple_SetItem(result, 1, py_domains);
37943 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
37944 0 : PyErr_SetNTSTATUS(r->out.result);
37945 0 : return NULL;
37946 : }
37947 :
37948 0 : return result;
37949 : }
37950 :
37951 :
37952 0 : static PyObject *py_lsa_CreateTrustedDomainEx_in_get_policy_handle(PyObject *obj, void *closure)
37953 : {
37954 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(obj);
37955 : PyObject *py_policy_handle;
37956 0 : if (object->in.policy_handle == NULL) {
37957 0 : Py_RETURN_NONE;
37958 : }
37959 0 : py_policy_handle = pytalloc_reference_ex(policy_handle_Type, object->in.policy_handle, object->in.policy_handle);
37960 0 : return py_policy_handle;
37961 : }
37962 :
37963 0 : static int py_lsa_CreateTrustedDomainEx_in_set_policy_handle(PyObject *py_obj, PyObject *value, void *closure)
37964 : {
37965 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
37966 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.policy_handle));
37967 0 : if (value == NULL) {
37968 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.policy_handle");
37969 0 : return -1;
37970 : }
37971 0 : object->in.policy_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.policy_handle);
37972 0 : if (object->in.policy_handle == NULL) {
37973 0 : PyErr_NoMemory();
37974 0 : return -1;
37975 : }
37976 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
37977 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
37978 0 : PyErr_NoMemory();
37979 0 : return -1;
37980 : }
37981 0 : object->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(value);
37982 0 : return 0;
37983 : }
37984 :
37985 0 : static PyObject *py_lsa_CreateTrustedDomainEx_in_get_info(PyObject *obj, void *closure)
37986 : {
37987 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(obj);
37988 : PyObject *py_info;
37989 0 : if (object->in.info == NULL) {
37990 0 : Py_RETURN_NONE;
37991 : }
37992 0 : py_info = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, object->in.info, object->in.info);
37993 0 : return py_info;
37994 : }
37995 :
37996 0 : static int py_lsa_CreateTrustedDomainEx_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
37997 : {
37998 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
37999 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
38000 0 : if (value == NULL) {
38001 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
38002 0 : return -1;
38003 : }
38004 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
38005 0 : if (object->in.info == NULL) {
38006 0 : PyErr_NoMemory();
38007 0 : return -1;
38008 : }
38009 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
38010 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38011 0 : PyErr_NoMemory();
38012 0 : return -1;
38013 : }
38014 0 : object->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
38015 0 : return 0;
38016 : }
38017 :
38018 0 : static PyObject *py_lsa_CreateTrustedDomainEx_in_get_auth_info(PyObject *obj, void *closure)
38019 : {
38020 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(obj);
38021 : PyObject *py_auth_info;
38022 0 : if (object->in.auth_info == NULL) {
38023 0 : Py_RETURN_NONE;
38024 : }
38025 0 : py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, object->in.auth_info, object->in.auth_info);
38026 0 : return py_auth_info;
38027 : }
38028 :
38029 0 : static int py_lsa_CreateTrustedDomainEx_in_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
38030 : {
38031 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38032 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.auth_info));
38033 0 : if (value == NULL) {
38034 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.auth_info");
38035 0 : return -1;
38036 : }
38037 0 : object->in.auth_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.auth_info);
38038 0 : if (object->in.auth_info == NULL) {
38039 0 : PyErr_NoMemory();
38040 0 : return -1;
38041 : }
38042 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, value, return -1;);
38043 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38044 0 : PyErr_NoMemory();
38045 0 : return -1;
38046 : }
38047 0 : object->in.auth_info = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(value);
38048 0 : return 0;
38049 : }
38050 :
38051 0 : static PyObject *py_lsa_CreateTrustedDomainEx_in_get_access_mask(PyObject *obj, void *closure)
38052 : {
38053 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(obj);
38054 : PyObject *py_access_mask;
38055 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
38056 0 : return py_access_mask;
38057 : }
38058 :
38059 0 : static int py_lsa_CreateTrustedDomainEx_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
38060 : {
38061 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38062 0 : if (value == NULL) {
38063 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
38064 0 : return -1;
38065 : }
38066 : {
38067 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
38068 0 : if (PyLong_Check(value)) {
38069 : unsigned long long test_var;
38070 0 : test_var = PyLong_AsUnsignedLongLong(value);
38071 0 : if (PyErr_Occurred() != NULL) {
38072 0 : return -1;
38073 : }
38074 0 : if (test_var > uint_max) {
38075 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38076 : PyLong_Type.tp_name, uint_max, test_var);
38077 0 : return -1;
38078 : }
38079 0 : object->in.access_mask = test_var;
38080 : } else {
38081 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38082 : PyLong_Type.tp_name);
38083 0 : return -1;
38084 : }
38085 : }
38086 0 : return 0;
38087 : }
38088 :
38089 0 : static PyObject *py_lsa_CreateTrustedDomainEx_out_get_trustdom_handle(PyObject *obj, void *closure)
38090 : {
38091 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(obj);
38092 : PyObject *py_trustdom_handle;
38093 0 : if (object->out.trustdom_handle == NULL) {
38094 0 : Py_RETURN_NONE;
38095 : }
38096 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
38097 0 : return py_trustdom_handle;
38098 : }
38099 :
38100 0 : static int py_lsa_CreateTrustedDomainEx_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
38101 : {
38102 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38103 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
38104 0 : if (value == NULL) {
38105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trustdom_handle");
38106 0 : return -1;
38107 : }
38108 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
38109 0 : if (object->out.trustdom_handle == NULL) {
38110 0 : PyErr_NoMemory();
38111 0 : return -1;
38112 : }
38113 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
38114 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38115 0 : PyErr_NoMemory();
38116 0 : return -1;
38117 : }
38118 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
38119 0 : return 0;
38120 : }
38121 :
38122 0 : static PyObject *py_lsa_CreateTrustedDomainEx_get_result(PyObject *obj, void *closure)
38123 : {
38124 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(obj);
38125 : PyObject *py_result;
38126 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
38127 0 : return py_result;
38128 : }
38129 :
38130 0 : static int py_lsa_CreateTrustedDomainEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
38131 : {
38132 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38133 0 : if (value == NULL) {
38134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
38135 0 : return -1;
38136 : }
38137 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
38138 0 : return 0;
38139 : }
38140 :
38141 : static PyGetSetDef py_lsa_CreateTrustedDomainEx_getsetters[] = {
38142 : {
38143 : .name = discard_const_p(char, "in_policy_handle"),
38144 : .get = py_lsa_CreateTrustedDomainEx_in_get_policy_handle,
38145 : .set = py_lsa_CreateTrustedDomainEx_in_set_policy_handle,
38146 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38147 : },
38148 : {
38149 : .name = discard_const_p(char, "in_info"),
38150 : .get = py_lsa_CreateTrustedDomainEx_in_get_info,
38151 : .set = py_lsa_CreateTrustedDomainEx_in_set_info,
38152 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
38153 : },
38154 : {
38155 : .name = discard_const_p(char, "in_auth_info"),
38156 : .get = py_lsa_CreateTrustedDomainEx_in_get_auth_info,
38157 : .set = py_lsa_CreateTrustedDomainEx_in_set_auth_info,
38158 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfo")
38159 : },
38160 : {
38161 : .name = discard_const_p(char, "in_access_mask"),
38162 : .get = py_lsa_CreateTrustedDomainEx_in_get_access_mask,
38163 : .set = py_lsa_CreateTrustedDomainEx_in_set_access_mask,
38164 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
38165 : },
38166 : {
38167 : .name = discard_const_p(char, "out_trustdom_handle"),
38168 : .get = py_lsa_CreateTrustedDomainEx_out_get_trustdom_handle,
38169 : .set = py_lsa_CreateTrustedDomainEx_out_set_trustdom_handle,
38170 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38171 : },
38172 : {
38173 : .name = discard_const_p(char, "result"),
38174 : .get = py_lsa_CreateTrustedDomainEx_get_result,
38175 : .set = py_lsa_CreateTrustedDomainEx_set_result,
38176 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
38177 : },
38178 : { .name = NULL }
38179 : };
38180 :
38181 0 : static PyObject *py_lsa_CreateTrustedDomainEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
38182 : {
38183 0 : PyObject *self = pytalloc_new(struct lsa_CreateTrustedDomainEx, type);
38184 0 : struct lsa_CreateTrustedDomainEx *_self = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(self);
38185 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
38186 0 : _self->in.policy_handle = talloc_zero(mem_ctx, struct policy_handle);
38187 0 : _self->in.info = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoInfoEx);
38188 0 : _self->in.auth_info = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoAuthInfo);
38189 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
38190 0 : return self;
38191 : }
38192 :
38193 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
38194 : {
38195 :
38196 :
38197 0 : return PyLong_FromLong(51);
38198 : }
38199 :
38200 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
38201 : {
38202 0 : const struct ndr_interface_call *call = NULL;
38203 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38204 0 : PyObject *ret = NULL;
38205 0 : struct ndr_push *push = NULL;
38206 : DATA_BLOB blob;
38207 : enum ndr_err_code err;
38208 :
38209 0 : if (ndr_table_lsarpc.num_calls < 52) {
38210 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx_ndr_pack");
38211 0 : return NULL;
38212 : }
38213 0 : call = &ndr_table_lsarpc.calls[51];
38214 :
38215 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
38216 0 : if (push == NULL) {
38217 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38218 0 : return NULL;
38219 : }
38220 :
38221 0 : push->flags |= ndr_push_flags;
38222 :
38223 0 : err = call->ndr_push(push, ndr_inout_flags, object);
38224 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38225 0 : TALLOC_FREE(push);
38226 0 : PyErr_SetNdrError(err);
38227 0 : return NULL;
38228 : }
38229 0 : blob = ndr_push_blob(push);
38230 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
38231 0 : TALLOC_FREE(push);
38232 0 : return ret;
38233 : }
38234 :
38235 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38236 : {
38237 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38238 0 : PyObject *bigendian_obj = NULL;
38239 0 : PyObject *ndr64_obj = NULL;
38240 0 : uint32_t ndr_push_flags = 0;
38241 :
38242 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
38243 : discard_const_p(char *, kwnames),
38244 : &bigendian_obj,
38245 : &ndr64_obj)) {
38246 0 : return NULL;
38247 : }
38248 :
38249 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38250 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38251 : }
38252 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38253 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38254 : }
38255 :
38256 0 : return py_lsa_CreateTrustedDomainEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
38257 : }
38258 :
38259 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38260 : {
38261 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38262 0 : PyObject *bigendian_obj = NULL;
38263 0 : PyObject *ndr64_obj = NULL;
38264 0 : uint32_t ndr_push_flags = 0;
38265 :
38266 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
38267 : discard_const_p(char *, kwnames),
38268 : &bigendian_obj,
38269 : &ndr64_obj)) {
38270 0 : return NULL;
38271 : }
38272 :
38273 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38274 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38275 : }
38276 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38277 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38278 : }
38279 :
38280 0 : return py_lsa_CreateTrustedDomainEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
38281 : }
38282 :
38283 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
38284 : {
38285 0 : const struct ndr_interface_call *call = NULL;
38286 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38287 0 : struct ndr_pull *pull = NULL;
38288 : enum ndr_err_code err;
38289 :
38290 0 : if (ndr_table_lsarpc.num_calls < 52) {
38291 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx_ndr_unpack");
38292 0 : return NULL;
38293 : }
38294 0 : call = &ndr_table_lsarpc.calls[51];
38295 :
38296 0 : pull = ndr_pull_init_blob(blob, object);
38297 0 : if (pull == NULL) {
38298 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38299 0 : return NULL;
38300 : }
38301 :
38302 0 : pull->flags |= ndr_pull_flags;
38303 :
38304 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
38305 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38306 0 : TALLOC_FREE(pull);
38307 0 : PyErr_SetNdrError(err);
38308 0 : return NULL;
38309 : }
38310 0 : if (!allow_remaining) {
38311 : uint32_t highest_ofs;
38312 :
38313 0 : if (pull->offset > pull->relative_highest_offset) {
38314 0 : highest_ofs = pull->offset;
38315 : } else {
38316 0 : highest_ofs = pull->relative_highest_offset;
38317 : }
38318 0 : if (highest_ofs < pull->data_size) {
38319 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
38320 : "not all bytes consumed ofs[%u] size[%u]",
38321 : highest_ofs, pull->data_size);
38322 0 : TALLOC_FREE(pull);
38323 0 : PyErr_SetNdrError(err);
38324 0 : return NULL;
38325 : }
38326 : }
38327 :
38328 0 : TALLOC_FREE(pull);
38329 0 : Py_RETURN_NONE;
38330 : }
38331 :
38332 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38333 : {
38334 : DATA_BLOB blob;
38335 0 : Py_ssize_t blob_length = 0;
38336 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38337 0 : PyObject *bigendian_obj = NULL;
38338 0 : PyObject *ndr64_obj = NULL;
38339 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38340 0 : PyObject *allow_remaining_obj = NULL;
38341 0 : bool allow_remaining = false;
38342 :
38343 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
38344 : discard_const_p(char *, kwnames),
38345 : &blob.data, &blob_length,
38346 : &bigendian_obj,
38347 : &ndr64_obj,
38348 : &allow_remaining_obj)) {
38349 0 : return NULL;
38350 : }
38351 0 : blob.length = blob_length;
38352 :
38353 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38354 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38355 : }
38356 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38357 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38358 : }
38359 :
38360 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38361 0 : allow_remaining = true;
38362 : }
38363 :
38364 0 : return py_lsa_CreateTrustedDomainEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
38365 : }
38366 :
38367 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38368 : {
38369 : DATA_BLOB blob;
38370 0 : Py_ssize_t blob_length = 0;
38371 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38372 0 : PyObject *bigendian_obj = NULL;
38373 0 : PyObject *ndr64_obj = NULL;
38374 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38375 0 : PyObject *allow_remaining_obj = NULL;
38376 0 : bool allow_remaining = false;
38377 :
38378 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
38379 : discard_const_p(char *, kwnames),
38380 : &blob.data, &blob_length,
38381 : &bigendian_obj,
38382 : &ndr64_obj,
38383 : &allow_remaining_obj)) {
38384 0 : return NULL;
38385 : }
38386 0 : blob.length = blob_length;
38387 :
38388 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38389 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38390 : }
38391 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38392 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38393 : }
38394 :
38395 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38396 0 : allow_remaining = true;
38397 : }
38398 :
38399 0 : return py_lsa_CreateTrustedDomainEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
38400 : }
38401 :
38402 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
38403 : {
38404 0 : const struct ndr_interface_call *call = NULL;
38405 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38406 : PyObject *ret;
38407 : char *retstr;
38408 :
38409 0 : if (ndr_table_lsarpc.num_calls < 52) {
38410 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx_ndr_print");
38411 0 : return NULL;
38412 : }
38413 0 : call = &ndr_table_lsarpc.calls[51];
38414 :
38415 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
38416 0 : ret = PyUnicode_FromString(retstr);
38417 0 : TALLOC_FREE(retstr);
38418 :
38419 0 : return ret;
38420 : }
38421 :
38422 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38423 : {
38424 0 : return py_lsa_CreateTrustedDomainEx_ndr_print(py_obj, "lsa_CreateTrustedDomainEx_in", NDR_IN);
38425 : }
38426 :
38427 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38428 : {
38429 0 : return py_lsa_CreateTrustedDomainEx_ndr_print(py_obj, "lsa_CreateTrustedDomainEx_out", NDR_OUT);
38430 : }
38431 :
38432 : static PyMethodDef py_lsa_CreateTrustedDomainEx_methods[] = {
38433 : { "opnum", (PyCFunction)py_lsa_CreateTrustedDomainEx_ndr_opnum, METH_NOARGS|METH_CLASS,
38434 : "lsa.CreateTrustedDomainEx.opnum() -> 51 (0x33) " },
38435 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
38436 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
38437 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
38438 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
38439 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
38440 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
38441 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
38442 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
38443 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateTrustedDomainEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
38444 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateTrustedDomainEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
38445 : { NULL, NULL, 0, NULL }
38446 : };
38447 :
38448 :
38449 : static PyTypeObject lsa_CreateTrustedDomainEx_Type = {
38450 : PyVarObject_HEAD_INIT(NULL, 0)
38451 : .tp_name = "lsa.CreateTrustedDomainEx",
38452 : .tp_getset = py_lsa_CreateTrustedDomainEx_getsetters,
38453 : .tp_methods = py_lsa_CreateTrustedDomainEx_methods,
38454 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
38455 : .tp_new = py_lsa_CreateTrustedDomainEx_new,
38456 : };
38457 :
38458 0 : static bool pack_py_lsa_CreateTrustedDomainEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomainEx *r)
38459 : {
38460 : PyObject *py_policy_handle;
38461 : PyObject *py_info;
38462 : PyObject *py_auth_info;
38463 : PyObject *py_access_mask;
38464 0 : const char *kwnames[] = {
38465 : "policy_handle", "info", "auth_info", "access_mask", NULL
38466 : };
38467 :
38468 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_CreateTrustedDomainEx", discard_const_p(char *, kwnames), &py_policy_handle, &py_info, &py_auth_info, &py_access_mask)) {
38469 0 : return false;
38470 : }
38471 :
38472 0 : if (py_policy_handle == NULL) {
38473 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.policy_handle");
38474 0 : return false;
38475 : }
38476 0 : r->in.policy_handle = talloc_ptrtype(r, r->in.policy_handle);
38477 0 : if (r->in.policy_handle == NULL) {
38478 0 : PyErr_NoMemory();
38479 0 : return false;
38480 : }
38481 0 : PY_CHECK_TYPE(policy_handle_Type, py_policy_handle, return false;);
38482 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_policy_handle)) == NULL) {
38483 0 : PyErr_NoMemory();
38484 0 : return false;
38485 : }
38486 0 : r->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(py_policy_handle);
38487 0 : if (py_info == NULL) {
38488 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
38489 0 : return false;
38490 : }
38491 0 : r->in.info = talloc_ptrtype(r, r->in.info);
38492 0 : if (r->in.info == NULL) {
38493 0 : PyErr_NoMemory();
38494 0 : return false;
38495 : }
38496 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, py_info, return false;);
38497 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
38498 0 : PyErr_NoMemory();
38499 0 : return false;
38500 : }
38501 0 : r->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_info);
38502 0 : if (py_auth_info == NULL) {
38503 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.auth_info");
38504 0 : return false;
38505 : }
38506 0 : r->in.auth_info = talloc_ptrtype(r, r->in.auth_info);
38507 0 : if (r->in.auth_info == NULL) {
38508 0 : PyErr_NoMemory();
38509 0 : return false;
38510 : }
38511 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, py_auth_info, return false;);
38512 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_auth_info)) == NULL) {
38513 0 : PyErr_NoMemory();
38514 0 : return false;
38515 : }
38516 0 : r->in.auth_info = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_auth_info);
38517 0 : if (py_access_mask == NULL) {
38518 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
38519 0 : return false;
38520 : }
38521 : {
38522 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
38523 0 : if (PyLong_Check(py_access_mask)) {
38524 : unsigned long long test_var;
38525 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
38526 0 : if (PyErr_Occurred() != NULL) {
38527 0 : return false;
38528 : }
38529 0 : if (test_var > uint_max) {
38530 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38531 : PyLong_Type.tp_name, uint_max, test_var);
38532 0 : return false;
38533 : }
38534 0 : r->in.access_mask = test_var;
38535 : } else {
38536 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38537 : PyLong_Type.tp_name);
38538 0 : return false;
38539 : }
38540 : }
38541 0 : return true;
38542 : }
38543 :
38544 0 : static PyObject *unpack_py_lsa_CreateTrustedDomainEx_args_out(struct lsa_CreateTrustedDomainEx *r)
38545 : {
38546 : PyObject *result;
38547 : PyObject *py_trustdom_handle;
38548 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
38549 0 : result = py_trustdom_handle;
38550 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
38551 0 : PyErr_SetNTSTATUS(r->out.result);
38552 0 : return NULL;
38553 : }
38554 :
38555 0 : return result;
38556 : }
38557 :
38558 :
38559 0 : static PyObject *py_lsa_CloseTrustedDomainEx_in_get_handle(PyObject *obj, void *closure)
38560 : {
38561 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(obj);
38562 : PyObject *py_handle;
38563 0 : if (object->in.handle == NULL) {
38564 0 : Py_RETURN_NONE;
38565 : }
38566 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
38567 0 : return py_handle;
38568 : }
38569 :
38570 0 : static int py_lsa_CloseTrustedDomainEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
38571 : {
38572 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38573 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
38574 0 : if (value == NULL) {
38575 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
38576 0 : return -1;
38577 : }
38578 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
38579 0 : if (object->in.handle == NULL) {
38580 0 : PyErr_NoMemory();
38581 0 : return -1;
38582 : }
38583 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
38584 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38585 0 : PyErr_NoMemory();
38586 0 : return -1;
38587 : }
38588 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
38589 0 : return 0;
38590 : }
38591 :
38592 0 : static PyObject *py_lsa_CloseTrustedDomainEx_out_get_handle(PyObject *obj, void *closure)
38593 : {
38594 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(obj);
38595 : PyObject *py_handle;
38596 0 : if (object->out.handle == NULL) {
38597 0 : Py_RETURN_NONE;
38598 : }
38599 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
38600 0 : return py_handle;
38601 : }
38602 :
38603 0 : static int py_lsa_CloseTrustedDomainEx_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
38604 : {
38605 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38606 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
38607 0 : if (value == NULL) {
38608 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
38609 0 : return -1;
38610 : }
38611 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
38612 0 : if (object->out.handle == NULL) {
38613 0 : PyErr_NoMemory();
38614 0 : return -1;
38615 : }
38616 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
38617 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38618 0 : PyErr_NoMemory();
38619 0 : return -1;
38620 : }
38621 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
38622 0 : return 0;
38623 : }
38624 :
38625 0 : static PyObject *py_lsa_CloseTrustedDomainEx_get_result(PyObject *obj, void *closure)
38626 : {
38627 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(obj);
38628 : PyObject *py_result;
38629 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
38630 0 : return py_result;
38631 : }
38632 :
38633 0 : static int py_lsa_CloseTrustedDomainEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
38634 : {
38635 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38636 0 : if (value == NULL) {
38637 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
38638 0 : return -1;
38639 : }
38640 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
38641 0 : return 0;
38642 : }
38643 :
38644 : static PyGetSetDef py_lsa_CloseTrustedDomainEx_getsetters[] = {
38645 : {
38646 : .name = discard_const_p(char, "in_handle"),
38647 : .get = py_lsa_CloseTrustedDomainEx_in_get_handle,
38648 : .set = py_lsa_CloseTrustedDomainEx_in_set_handle,
38649 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38650 : },
38651 : {
38652 : .name = discard_const_p(char, "out_handle"),
38653 : .get = py_lsa_CloseTrustedDomainEx_out_get_handle,
38654 : .set = py_lsa_CloseTrustedDomainEx_out_set_handle,
38655 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38656 : },
38657 : {
38658 : .name = discard_const_p(char, "result"),
38659 : .get = py_lsa_CloseTrustedDomainEx_get_result,
38660 : .set = py_lsa_CloseTrustedDomainEx_set_result,
38661 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
38662 : },
38663 : { .name = NULL }
38664 : };
38665 :
38666 0 : static PyObject *py_lsa_CloseTrustedDomainEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
38667 : {
38668 0 : PyObject *self = pytalloc_new(struct lsa_CloseTrustedDomainEx, type);
38669 0 : struct lsa_CloseTrustedDomainEx *_self = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(self);
38670 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
38671 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
38672 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
38673 0 : return self;
38674 : }
38675 :
38676 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
38677 : {
38678 :
38679 :
38680 0 : return PyLong_FromLong(52);
38681 : }
38682 :
38683 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
38684 : {
38685 0 : const struct ndr_interface_call *call = NULL;
38686 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38687 0 : PyObject *ret = NULL;
38688 0 : struct ndr_push *push = NULL;
38689 : DATA_BLOB blob;
38690 : enum ndr_err_code err;
38691 :
38692 0 : if (ndr_table_lsarpc.num_calls < 53) {
38693 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CloseTrustedDomainEx_ndr_pack");
38694 0 : return NULL;
38695 : }
38696 0 : call = &ndr_table_lsarpc.calls[52];
38697 :
38698 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
38699 0 : if (push == NULL) {
38700 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38701 0 : return NULL;
38702 : }
38703 :
38704 0 : push->flags |= ndr_push_flags;
38705 :
38706 0 : err = call->ndr_push(push, ndr_inout_flags, object);
38707 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38708 0 : TALLOC_FREE(push);
38709 0 : PyErr_SetNdrError(err);
38710 0 : return NULL;
38711 : }
38712 0 : blob = ndr_push_blob(push);
38713 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
38714 0 : TALLOC_FREE(push);
38715 0 : return ret;
38716 : }
38717 :
38718 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38719 : {
38720 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38721 0 : PyObject *bigendian_obj = NULL;
38722 0 : PyObject *ndr64_obj = NULL;
38723 0 : uint32_t ndr_push_flags = 0;
38724 :
38725 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
38726 : discard_const_p(char *, kwnames),
38727 : &bigendian_obj,
38728 : &ndr64_obj)) {
38729 0 : return NULL;
38730 : }
38731 :
38732 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38733 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38734 : }
38735 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38736 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38737 : }
38738 :
38739 0 : return py_lsa_CloseTrustedDomainEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
38740 : }
38741 :
38742 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38743 : {
38744 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38745 0 : PyObject *bigendian_obj = NULL;
38746 0 : PyObject *ndr64_obj = NULL;
38747 0 : uint32_t ndr_push_flags = 0;
38748 :
38749 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
38750 : discard_const_p(char *, kwnames),
38751 : &bigendian_obj,
38752 : &ndr64_obj)) {
38753 0 : return NULL;
38754 : }
38755 :
38756 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38757 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38758 : }
38759 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38760 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38761 : }
38762 :
38763 0 : return py_lsa_CloseTrustedDomainEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
38764 : }
38765 :
38766 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
38767 : {
38768 0 : const struct ndr_interface_call *call = NULL;
38769 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38770 0 : struct ndr_pull *pull = NULL;
38771 : enum ndr_err_code err;
38772 :
38773 0 : if (ndr_table_lsarpc.num_calls < 53) {
38774 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CloseTrustedDomainEx_ndr_unpack");
38775 0 : return NULL;
38776 : }
38777 0 : call = &ndr_table_lsarpc.calls[52];
38778 :
38779 0 : pull = ndr_pull_init_blob(blob, object);
38780 0 : if (pull == NULL) {
38781 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38782 0 : return NULL;
38783 : }
38784 :
38785 0 : pull->flags |= ndr_pull_flags;
38786 :
38787 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
38788 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38789 0 : TALLOC_FREE(pull);
38790 0 : PyErr_SetNdrError(err);
38791 0 : return NULL;
38792 : }
38793 0 : if (!allow_remaining) {
38794 : uint32_t highest_ofs;
38795 :
38796 0 : if (pull->offset > pull->relative_highest_offset) {
38797 0 : highest_ofs = pull->offset;
38798 : } else {
38799 0 : highest_ofs = pull->relative_highest_offset;
38800 : }
38801 0 : if (highest_ofs < pull->data_size) {
38802 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
38803 : "not all bytes consumed ofs[%u] size[%u]",
38804 : highest_ofs, pull->data_size);
38805 0 : TALLOC_FREE(pull);
38806 0 : PyErr_SetNdrError(err);
38807 0 : return NULL;
38808 : }
38809 : }
38810 :
38811 0 : TALLOC_FREE(pull);
38812 0 : Py_RETURN_NONE;
38813 : }
38814 :
38815 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38816 : {
38817 : DATA_BLOB blob;
38818 0 : Py_ssize_t blob_length = 0;
38819 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38820 0 : PyObject *bigendian_obj = NULL;
38821 0 : PyObject *ndr64_obj = NULL;
38822 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38823 0 : PyObject *allow_remaining_obj = NULL;
38824 0 : bool allow_remaining = false;
38825 :
38826 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
38827 : discard_const_p(char *, kwnames),
38828 : &blob.data, &blob_length,
38829 : &bigendian_obj,
38830 : &ndr64_obj,
38831 : &allow_remaining_obj)) {
38832 0 : return NULL;
38833 : }
38834 0 : blob.length = blob_length;
38835 :
38836 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38837 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38838 : }
38839 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38840 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38841 : }
38842 :
38843 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38844 0 : allow_remaining = true;
38845 : }
38846 :
38847 0 : return py_lsa_CloseTrustedDomainEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
38848 : }
38849 :
38850 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38851 : {
38852 : DATA_BLOB blob;
38853 0 : Py_ssize_t blob_length = 0;
38854 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38855 0 : PyObject *bigendian_obj = NULL;
38856 0 : PyObject *ndr64_obj = NULL;
38857 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38858 0 : PyObject *allow_remaining_obj = NULL;
38859 0 : bool allow_remaining = false;
38860 :
38861 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
38862 : discard_const_p(char *, kwnames),
38863 : &blob.data, &blob_length,
38864 : &bigendian_obj,
38865 : &ndr64_obj,
38866 : &allow_remaining_obj)) {
38867 0 : return NULL;
38868 : }
38869 0 : blob.length = blob_length;
38870 :
38871 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38872 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38873 : }
38874 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38875 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38876 : }
38877 :
38878 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38879 0 : allow_remaining = true;
38880 : }
38881 :
38882 0 : return py_lsa_CloseTrustedDomainEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
38883 : }
38884 :
38885 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
38886 : {
38887 0 : const struct ndr_interface_call *call = NULL;
38888 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38889 : PyObject *ret;
38890 : char *retstr;
38891 :
38892 0 : if (ndr_table_lsarpc.num_calls < 53) {
38893 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CloseTrustedDomainEx_ndr_print");
38894 0 : return NULL;
38895 : }
38896 0 : call = &ndr_table_lsarpc.calls[52];
38897 :
38898 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
38899 0 : ret = PyUnicode_FromString(retstr);
38900 0 : TALLOC_FREE(retstr);
38901 :
38902 0 : return ret;
38903 : }
38904 :
38905 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38906 : {
38907 0 : return py_lsa_CloseTrustedDomainEx_ndr_print(py_obj, "lsa_CloseTrustedDomainEx_in", NDR_IN);
38908 : }
38909 :
38910 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38911 : {
38912 0 : return py_lsa_CloseTrustedDomainEx_ndr_print(py_obj, "lsa_CloseTrustedDomainEx_out", NDR_OUT);
38913 : }
38914 :
38915 : static PyMethodDef py_lsa_CloseTrustedDomainEx_methods[] = {
38916 : { "opnum", (PyCFunction)py_lsa_CloseTrustedDomainEx_ndr_opnum, METH_NOARGS|METH_CLASS,
38917 : "lsa.CloseTrustedDomainEx.opnum() -> 52 (0x34) " },
38918 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CloseTrustedDomainEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
38919 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
38920 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CloseTrustedDomainEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
38921 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
38922 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CloseTrustedDomainEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
38923 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
38924 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CloseTrustedDomainEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
38925 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
38926 : { "__ndr_print_in__", (PyCFunction)py_lsa_CloseTrustedDomainEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
38927 : { "__ndr_print_out__", (PyCFunction)py_lsa_CloseTrustedDomainEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
38928 : { NULL, NULL, 0, NULL }
38929 : };
38930 :
38931 :
38932 : static PyTypeObject lsa_CloseTrustedDomainEx_Type = {
38933 : PyVarObject_HEAD_INIT(NULL, 0)
38934 : .tp_name = "lsa.CloseTrustedDomainEx",
38935 : .tp_getset = py_lsa_CloseTrustedDomainEx_getsetters,
38936 : .tp_methods = py_lsa_CloseTrustedDomainEx_methods,
38937 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
38938 : .tp_new = py_lsa_CloseTrustedDomainEx_new,
38939 : };
38940 :
38941 0 : static bool pack_py_lsa_CloseTrustedDomainEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_CloseTrustedDomainEx *r)
38942 : {
38943 : PyObject *py_handle;
38944 0 : const char *kwnames[] = {
38945 : "handle", NULL
38946 : };
38947 :
38948 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_CloseTrustedDomainEx", discard_const_p(char *, kwnames), &py_handle)) {
38949 0 : return false;
38950 : }
38951 :
38952 0 : if (py_handle == NULL) {
38953 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
38954 0 : return false;
38955 : }
38956 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
38957 0 : if (r->in.handle == NULL) {
38958 0 : PyErr_NoMemory();
38959 0 : return false;
38960 : }
38961 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
38962 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
38963 0 : PyErr_NoMemory();
38964 0 : return false;
38965 : }
38966 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
38967 0 : return true;
38968 : }
38969 :
38970 0 : static PyObject *unpack_py_lsa_CloseTrustedDomainEx_args_out(struct lsa_CloseTrustedDomainEx *r)
38971 : {
38972 : PyObject *result;
38973 : PyObject *py_handle;
38974 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
38975 0 : result = py_handle;
38976 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
38977 0 : PyErr_SetNTSTATUS(r->out.result);
38978 0 : return NULL;
38979 : }
38980 :
38981 0 : return result;
38982 : }
38983 :
38984 :
38985 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_in_get_handle(PyObject *obj, void *closure)
38986 : {
38987 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(obj);
38988 : PyObject *py_handle;
38989 0 : if (object->in.handle == NULL) {
38990 0 : Py_RETURN_NONE;
38991 : }
38992 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
38993 0 : return py_handle;
38994 : }
38995 :
38996 0 : static int py_lsa_QueryDomainInformationPolicy_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
38997 : {
38998 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
38999 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
39000 0 : if (value == NULL) {
39001 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
39002 0 : return -1;
39003 : }
39004 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
39005 0 : if (object->in.handle == NULL) {
39006 0 : PyErr_NoMemory();
39007 0 : return -1;
39008 : }
39009 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
39010 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39011 0 : PyErr_NoMemory();
39012 0 : return -1;
39013 : }
39014 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
39015 0 : return 0;
39016 : }
39017 :
39018 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_in_get_level(PyObject *obj, void *closure)
39019 : {
39020 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(obj);
39021 : PyObject *py_level;
39022 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
39023 0 : return py_level;
39024 : }
39025 :
39026 0 : static int py_lsa_QueryDomainInformationPolicy_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
39027 : {
39028 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39029 0 : if (value == NULL) {
39030 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
39031 0 : return -1;
39032 : }
39033 : {
39034 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
39035 0 : if (PyLong_Check(value)) {
39036 : unsigned long long test_var;
39037 0 : test_var = PyLong_AsUnsignedLongLong(value);
39038 0 : if (PyErr_Occurred() != NULL) {
39039 0 : return -1;
39040 : }
39041 0 : if (test_var > uint_max) {
39042 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39043 : PyLong_Type.tp_name, uint_max, test_var);
39044 0 : return -1;
39045 : }
39046 0 : object->in.level = test_var;
39047 : } else {
39048 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39049 : PyLong_Type.tp_name);
39050 0 : return -1;
39051 : }
39052 : }
39053 0 : return 0;
39054 : }
39055 :
39056 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_out_get_info(PyObject *obj, void *closure)
39057 : {
39058 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(obj);
39059 : PyObject *py_info;
39060 0 : if (object->out.info == NULL) {
39061 0 : Py_RETURN_NONE;
39062 : }
39063 0 : if (*object->out.info == NULL) {
39064 0 : py_info = Py_None;
39065 0 : Py_INCREF(py_info);
39066 : } else {
39067 0 : py_info = pyrpc_import_union(&lsa_DomainInformationPolicy_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_DomainInformationPolicy");
39068 0 : if (py_info == NULL) {
39069 0 : return NULL;
39070 : }
39071 : }
39072 0 : return py_info;
39073 : }
39074 :
39075 0 : static int py_lsa_QueryDomainInformationPolicy_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
39076 : {
39077 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39078 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
39079 0 : if (value == NULL) {
39080 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
39081 0 : return -1;
39082 : }
39083 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
39084 0 : if (object->out.info == NULL) {
39085 0 : PyErr_NoMemory();
39086 0 : return -1;
39087 : }
39088 0 : if (value == Py_None) {
39089 0 : *object->out.info = NULL;
39090 : } else {
39091 0 : *object->out.info = NULL;
39092 : {
39093 : union lsa_DomainInformationPolicy *info_switch_2;
39094 0 : info_switch_2 = (union lsa_DomainInformationPolicy *)pyrpc_export_union(&lsa_DomainInformationPolicy_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union lsa_DomainInformationPolicy");
39095 0 : if (info_switch_2 == NULL) {
39096 0 : return -1;
39097 : }
39098 0 : *object->out.info = info_switch_2;
39099 : }
39100 : }
39101 0 : return 0;
39102 : }
39103 :
39104 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_get_result(PyObject *obj, void *closure)
39105 : {
39106 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(obj);
39107 : PyObject *py_result;
39108 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
39109 0 : return py_result;
39110 : }
39111 :
39112 0 : static int py_lsa_QueryDomainInformationPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
39113 : {
39114 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39115 0 : if (value == NULL) {
39116 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
39117 0 : return -1;
39118 : }
39119 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
39120 0 : return 0;
39121 : }
39122 :
39123 : static PyGetSetDef py_lsa_QueryDomainInformationPolicy_getsetters[] = {
39124 : {
39125 : .name = discard_const_p(char, "in_handle"),
39126 : .get = py_lsa_QueryDomainInformationPolicy_in_get_handle,
39127 : .set = py_lsa_QueryDomainInformationPolicy_in_set_handle,
39128 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
39129 : },
39130 : {
39131 : .name = discard_const_p(char, "in_level"),
39132 : .get = py_lsa_QueryDomainInformationPolicy_in_get_level,
39133 : .set = py_lsa_QueryDomainInformationPolicy_in_set_level,
39134 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
39135 : },
39136 : {
39137 : .name = discard_const_p(char, "out_info"),
39138 : .get = py_lsa_QueryDomainInformationPolicy_out_get_info,
39139 : .set = py_lsa_QueryDomainInformationPolicy_out_set_info,
39140 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInformationPolicy")
39141 : },
39142 : {
39143 : .name = discard_const_p(char, "result"),
39144 : .get = py_lsa_QueryDomainInformationPolicy_get_result,
39145 : .set = py_lsa_QueryDomainInformationPolicy_set_result,
39146 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
39147 : },
39148 : { .name = NULL }
39149 : };
39150 :
39151 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
39152 : {
39153 0 : PyObject *self = pytalloc_new(struct lsa_QueryDomainInformationPolicy, type);
39154 0 : struct lsa_QueryDomainInformationPolicy *_self = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(self);
39155 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
39156 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
39157 : /* a pointer to a NULL pointer */
39158 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_DomainInformationPolicy *);
39159 0 : return self;
39160 : }
39161 :
39162 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
39163 : {
39164 :
39165 :
39166 0 : return PyLong_FromLong(53);
39167 : }
39168 :
39169 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
39170 : {
39171 0 : const struct ndr_interface_call *call = NULL;
39172 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39173 0 : PyObject *ret = NULL;
39174 0 : struct ndr_push *push = NULL;
39175 : DATA_BLOB blob;
39176 : enum ndr_err_code err;
39177 :
39178 0 : if (ndr_table_lsarpc.num_calls < 54) {
39179 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryDomainInformationPolicy_ndr_pack");
39180 0 : return NULL;
39181 : }
39182 0 : call = &ndr_table_lsarpc.calls[53];
39183 :
39184 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
39185 0 : if (push == NULL) {
39186 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39187 0 : return NULL;
39188 : }
39189 :
39190 0 : push->flags |= ndr_push_flags;
39191 :
39192 0 : err = call->ndr_push(push, ndr_inout_flags, object);
39193 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39194 0 : TALLOC_FREE(push);
39195 0 : PyErr_SetNdrError(err);
39196 0 : return NULL;
39197 : }
39198 0 : blob = ndr_push_blob(push);
39199 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
39200 0 : TALLOC_FREE(push);
39201 0 : return ret;
39202 : }
39203 :
39204 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39205 : {
39206 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39207 0 : PyObject *bigendian_obj = NULL;
39208 0 : PyObject *ndr64_obj = NULL;
39209 0 : uint32_t ndr_push_flags = 0;
39210 :
39211 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
39212 : discard_const_p(char *, kwnames),
39213 : &bigendian_obj,
39214 : &ndr64_obj)) {
39215 0 : return NULL;
39216 : }
39217 :
39218 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39219 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39220 : }
39221 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39222 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39223 : }
39224 :
39225 0 : return py_lsa_QueryDomainInformationPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
39226 : }
39227 :
39228 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39229 : {
39230 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39231 0 : PyObject *bigendian_obj = NULL;
39232 0 : PyObject *ndr64_obj = NULL;
39233 0 : uint32_t ndr_push_flags = 0;
39234 :
39235 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
39236 : discard_const_p(char *, kwnames),
39237 : &bigendian_obj,
39238 : &ndr64_obj)) {
39239 0 : return NULL;
39240 : }
39241 :
39242 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39243 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39244 : }
39245 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39246 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39247 : }
39248 :
39249 0 : return py_lsa_QueryDomainInformationPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
39250 : }
39251 :
39252 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
39253 : {
39254 0 : const struct ndr_interface_call *call = NULL;
39255 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39256 0 : struct ndr_pull *pull = NULL;
39257 : enum ndr_err_code err;
39258 :
39259 0 : if (ndr_table_lsarpc.num_calls < 54) {
39260 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryDomainInformationPolicy_ndr_unpack");
39261 0 : return NULL;
39262 : }
39263 0 : call = &ndr_table_lsarpc.calls[53];
39264 :
39265 0 : pull = ndr_pull_init_blob(blob, object);
39266 0 : if (pull == NULL) {
39267 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39268 0 : return NULL;
39269 : }
39270 :
39271 0 : pull->flags |= ndr_pull_flags;
39272 :
39273 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
39274 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39275 0 : TALLOC_FREE(pull);
39276 0 : PyErr_SetNdrError(err);
39277 0 : return NULL;
39278 : }
39279 0 : if (!allow_remaining) {
39280 : uint32_t highest_ofs;
39281 :
39282 0 : if (pull->offset > pull->relative_highest_offset) {
39283 0 : highest_ofs = pull->offset;
39284 : } else {
39285 0 : highest_ofs = pull->relative_highest_offset;
39286 : }
39287 0 : if (highest_ofs < pull->data_size) {
39288 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
39289 : "not all bytes consumed ofs[%u] size[%u]",
39290 : highest_ofs, pull->data_size);
39291 0 : TALLOC_FREE(pull);
39292 0 : PyErr_SetNdrError(err);
39293 0 : return NULL;
39294 : }
39295 : }
39296 :
39297 0 : TALLOC_FREE(pull);
39298 0 : Py_RETURN_NONE;
39299 : }
39300 :
39301 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39302 : {
39303 : DATA_BLOB blob;
39304 0 : Py_ssize_t blob_length = 0;
39305 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39306 0 : PyObject *bigendian_obj = NULL;
39307 0 : PyObject *ndr64_obj = NULL;
39308 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39309 0 : PyObject *allow_remaining_obj = NULL;
39310 0 : bool allow_remaining = false;
39311 :
39312 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
39313 : discard_const_p(char *, kwnames),
39314 : &blob.data, &blob_length,
39315 : &bigendian_obj,
39316 : &ndr64_obj,
39317 : &allow_remaining_obj)) {
39318 0 : return NULL;
39319 : }
39320 0 : blob.length = blob_length;
39321 :
39322 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39323 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39324 : }
39325 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39326 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39327 : }
39328 :
39329 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39330 0 : allow_remaining = true;
39331 : }
39332 :
39333 0 : return py_lsa_QueryDomainInformationPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
39334 : }
39335 :
39336 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39337 : {
39338 : DATA_BLOB blob;
39339 0 : Py_ssize_t blob_length = 0;
39340 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39341 0 : PyObject *bigendian_obj = NULL;
39342 0 : PyObject *ndr64_obj = NULL;
39343 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39344 0 : PyObject *allow_remaining_obj = NULL;
39345 0 : bool allow_remaining = false;
39346 :
39347 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
39348 : discard_const_p(char *, kwnames),
39349 : &blob.data, &blob_length,
39350 : &bigendian_obj,
39351 : &ndr64_obj,
39352 : &allow_remaining_obj)) {
39353 0 : return NULL;
39354 : }
39355 0 : blob.length = blob_length;
39356 :
39357 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39358 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39359 : }
39360 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39361 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39362 : }
39363 :
39364 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39365 0 : allow_remaining = true;
39366 : }
39367 :
39368 0 : return py_lsa_QueryDomainInformationPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
39369 : }
39370 :
39371 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
39372 : {
39373 0 : const struct ndr_interface_call *call = NULL;
39374 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39375 : PyObject *ret;
39376 : char *retstr;
39377 :
39378 0 : if (ndr_table_lsarpc.num_calls < 54) {
39379 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryDomainInformationPolicy_ndr_print");
39380 0 : return NULL;
39381 : }
39382 0 : call = &ndr_table_lsarpc.calls[53];
39383 :
39384 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
39385 0 : ret = PyUnicode_FromString(retstr);
39386 0 : TALLOC_FREE(retstr);
39387 :
39388 0 : return ret;
39389 : }
39390 :
39391 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39392 : {
39393 0 : return py_lsa_QueryDomainInformationPolicy_ndr_print(py_obj, "lsa_QueryDomainInformationPolicy_in", NDR_IN);
39394 : }
39395 :
39396 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39397 : {
39398 0 : return py_lsa_QueryDomainInformationPolicy_ndr_print(py_obj, "lsa_QueryDomainInformationPolicy_out", NDR_OUT);
39399 : }
39400 :
39401 : static PyMethodDef py_lsa_QueryDomainInformationPolicy_methods[] = {
39402 : { "opnum", (PyCFunction)py_lsa_QueryDomainInformationPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
39403 : "lsa.QueryDomainInformationPolicy.opnum() -> 53 (0x35) " },
39404 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryDomainInformationPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
39405 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
39406 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryDomainInformationPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
39407 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
39408 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryDomainInformationPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
39409 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
39410 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryDomainInformationPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
39411 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
39412 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryDomainInformationPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
39413 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryDomainInformationPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
39414 : { NULL, NULL, 0, NULL }
39415 : };
39416 :
39417 :
39418 : static PyTypeObject lsa_QueryDomainInformationPolicy_Type = {
39419 : PyVarObject_HEAD_INIT(NULL, 0)
39420 : .tp_name = "lsa.QueryDomainInformationPolicy",
39421 : .tp_getset = py_lsa_QueryDomainInformationPolicy_getsetters,
39422 : .tp_methods = py_lsa_QueryDomainInformationPolicy_methods,
39423 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
39424 : .tp_new = py_lsa_QueryDomainInformationPolicy_new,
39425 : };
39426 :
39427 0 : static bool pack_py_lsa_QueryDomainInformationPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryDomainInformationPolicy *r)
39428 : {
39429 : PyObject *py_handle;
39430 : PyObject *py_level;
39431 0 : const char *kwnames[] = {
39432 : "handle", "level", NULL
39433 : };
39434 :
39435 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryDomainInformationPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
39436 0 : return false;
39437 : }
39438 :
39439 0 : if (py_handle == NULL) {
39440 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
39441 0 : return false;
39442 : }
39443 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
39444 0 : if (r->in.handle == NULL) {
39445 0 : PyErr_NoMemory();
39446 0 : return false;
39447 : }
39448 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
39449 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
39450 0 : PyErr_NoMemory();
39451 0 : return false;
39452 : }
39453 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
39454 0 : if (py_level == NULL) {
39455 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
39456 0 : return false;
39457 : }
39458 : {
39459 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
39460 0 : if (PyLong_Check(py_level)) {
39461 : unsigned long long test_var;
39462 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
39463 0 : if (PyErr_Occurred() != NULL) {
39464 0 : return false;
39465 : }
39466 0 : if (test_var > uint_max) {
39467 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39468 : PyLong_Type.tp_name, uint_max, test_var);
39469 0 : return false;
39470 : }
39471 0 : r->in.level = test_var;
39472 : } else {
39473 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39474 : PyLong_Type.tp_name);
39475 0 : return false;
39476 : }
39477 : }
39478 0 : return true;
39479 : }
39480 :
39481 0 : static PyObject *unpack_py_lsa_QueryDomainInformationPolicy_args_out(struct lsa_QueryDomainInformationPolicy *r)
39482 : {
39483 : PyObject *result;
39484 : PyObject *py_info;
39485 0 : if (*r->out.info == NULL) {
39486 0 : py_info = Py_None;
39487 0 : Py_INCREF(py_info);
39488 : } else {
39489 0 : py_info = pyrpc_import_union(&lsa_DomainInformationPolicy_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_DomainInformationPolicy");
39490 0 : if (py_info == NULL) {
39491 0 : return NULL;
39492 : }
39493 : }
39494 0 : result = py_info;
39495 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
39496 0 : PyErr_SetNTSTATUS(r->out.result);
39497 0 : return NULL;
39498 : }
39499 :
39500 0 : return result;
39501 : }
39502 :
39503 :
39504 0 : static PyObject *py_lsa_SetDomainInformationPolicy_in_get_handle(PyObject *obj, void *closure)
39505 : {
39506 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(obj);
39507 : PyObject *py_handle;
39508 0 : if (object->in.handle == NULL) {
39509 0 : Py_RETURN_NONE;
39510 : }
39511 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
39512 0 : return py_handle;
39513 : }
39514 :
39515 0 : static int py_lsa_SetDomainInformationPolicy_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
39516 : {
39517 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39518 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
39519 0 : if (value == NULL) {
39520 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
39521 0 : return -1;
39522 : }
39523 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
39524 0 : if (object->in.handle == NULL) {
39525 0 : PyErr_NoMemory();
39526 0 : return -1;
39527 : }
39528 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
39529 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39530 0 : PyErr_NoMemory();
39531 0 : return -1;
39532 : }
39533 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
39534 0 : return 0;
39535 : }
39536 :
39537 0 : static PyObject *py_lsa_SetDomainInformationPolicy_in_get_level(PyObject *obj, void *closure)
39538 : {
39539 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(obj);
39540 : PyObject *py_level;
39541 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
39542 0 : return py_level;
39543 : }
39544 :
39545 0 : static int py_lsa_SetDomainInformationPolicy_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
39546 : {
39547 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39548 0 : if (value == NULL) {
39549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
39550 0 : return -1;
39551 : }
39552 : {
39553 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
39554 0 : if (PyLong_Check(value)) {
39555 : unsigned long long test_var;
39556 0 : test_var = PyLong_AsUnsignedLongLong(value);
39557 0 : if (PyErr_Occurred() != NULL) {
39558 0 : return -1;
39559 : }
39560 0 : if (test_var > uint_max) {
39561 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39562 : PyLong_Type.tp_name, uint_max, test_var);
39563 0 : return -1;
39564 : }
39565 0 : object->in.level = test_var;
39566 : } else {
39567 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39568 : PyLong_Type.tp_name);
39569 0 : return -1;
39570 : }
39571 : }
39572 0 : return 0;
39573 : }
39574 :
39575 0 : static PyObject *py_lsa_SetDomainInformationPolicy_in_get_info(PyObject *obj, void *closure)
39576 : {
39577 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(obj);
39578 : PyObject *py_info;
39579 0 : if (object->in.info == NULL) {
39580 0 : Py_RETURN_NONE;
39581 : }
39582 0 : if (object->in.info == NULL) {
39583 0 : py_info = Py_None;
39584 0 : Py_INCREF(py_info);
39585 : } else {
39586 0 : py_info = pyrpc_import_union(&lsa_DomainInformationPolicy_Type, object->in.info, object->in.level, object->in.info, "union lsa_DomainInformationPolicy");
39587 0 : if (py_info == NULL) {
39588 0 : return NULL;
39589 : }
39590 : }
39591 0 : return py_info;
39592 : }
39593 :
39594 0 : static int py_lsa_SetDomainInformationPolicy_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
39595 : {
39596 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39597 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
39598 0 : if (value == NULL) {
39599 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
39600 0 : return -1;
39601 : }
39602 0 : if (value == Py_None) {
39603 0 : object->in.info = NULL;
39604 : } else {
39605 0 : object->in.info = NULL;
39606 : {
39607 : union lsa_DomainInformationPolicy *info_switch_1;
39608 0 : info_switch_1 = (union lsa_DomainInformationPolicy *)pyrpc_export_union(&lsa_DomainInformationPolicy_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union lsa_DomainInformationPolicy");
39609 0 : if (info_switch_1 == NULL) {
39610 0 : return -1;
39611 : }
39612 0 : object->in.info = info_switch_1;
39613 : }
39614 : }
39615 0 : return 0;
39616 : }
39617 :
39618 0 : static PyObject *py_lsa_SetDomainInformationPolicy_get_result(PyObject *obj, void *closure)
39619 : {
39620 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(obj);
39621 : PyObject *py_result;
39622 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
39623 0 : return py_result;
39624 : }
39625 :
39626 0 : static int py_lsa_SetDomainInformationPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
39627 : {
39628 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39629 0 : if (value == NULL) {
39630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
39631 0 : return -1;
39632 : }
39633 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
39634 0 : return 0;
39635 : }
39636 :
39637 : static PyGetSetDef py_lsa_SetDomainInformationPolicy_getsetters[] = {
39638 : {
39639 : .name = discard_const_p(char, "in_handle"),
39640 : .get = py_lsa_SetDomainInformationPolicy_in_get_handle,
39641 : .set = py_lsa_SetDomainInformationPolicy_in_set_handle,
39642 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
39643 : },
39644 : {
39645 : .name = discard_const_p(char, "in_level"),
39646 : .get = py_lsa_SetDomainInformationPolicy_in_get_level,
39647 : .set = py_lsa_SetDomainInformationPolicy_in_set_level,
39648 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
39649 : },
39650 : {
39651 : .name = discard_const_p(char, "in_info"),
39652 : .get = py_lsa_SetDomainInformationPolicy_in_get_info,
39653 : .set = py_lsa_SetDomainInformationPolicy_in_set_info,
39654 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInformationPolicy")
39655 : },
39656 : {
39657 : .name = discard_const_p(char, "result"),
39658 : .get = py_lsa_SetDomainInformationPolicy_get_result,
39659 : .set = py_lsa_SetDomainInformationPolicy_set_result,
39660 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
39661 : },
39662 : { .name = NULL }
39663 : };
39664 :
39665 0 : static PyObject *py_lsa_SetDomainInformationPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
39666 : {
39667 0 : PyObject *self = pytalloc_new(struct lsa_SetDomainInformationPolicy, type);
39668 0 : struct lsa_SetDomainInformationPolicy *_self = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(self);
39669 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
39670 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
39671 0 : return self;
39672 : }
39673 :
39674 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
39675 : {
39676 :
39677 :
39678 0 : return PyLong_FromLong(54);
39679 : }
39680 :
39681 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
39682 : {
39683 0 : const struct ndr_interface_call *call = NULL;
39684 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39685 0 : PyObject *ret = NULL;
39686 0 : struct ndr_push *push = NULL;
39687 : DATA_BLOB blob;
39688 : enum ndr_err_code err;
39689 :
39690 0 : if (ndr_table_lsarpc.num_calls < 55) {
39691 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetDomainInformationPolicy_ndr_pack");
39692 0 : return NULL;
39693 : }
39694 0 : call = &ndr_table_lsarpc.calls[54];
39695 :
39696 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
39697 0 : if (push == NULL) {
39698 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39699 0 : return NULL;
39700 : }
39701 :
39702 0 : push->flags |= ndr_push_flags;
39703 :
39704 0 : err = call->ndr_push(push, ndr_inout_flags, object);
39705 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39706 0 : TALLOC_FREE(push);
39707 0 : PyErr_SetNdrError(err);
39708 0 : return NULL;
39709 : }
39710 0 : blob = ndr_push_blob(push);
39711 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
39712 0 : TALLOC_FREE(push);
39713 0 : return ret;
39714 : }
39715 :
39716 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39717 : {
39718 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39719 0 : PyObject *bigendian_obj = NULL;
39720 0 : PyObject *ndr64_obj = NULL;
39721 0 : uint32_t ndr_push_flags = 0;
39722 :
39723 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
39724 : discard_const_p(char *, kwnames),
39725 : &bigendian_obj,
39726 : &ndr64_obj)) {
39727 0 : return NULL;
39728 : }
39729 :
39730 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39731 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39732 : }
39733 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39734 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39735 : }
39736 :
39737 0 : return py_lsa_SetDomainInformationPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
39738 : }
39739 :
39740 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39741 : {
39742 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39743 0 : PyObject *bigendian_obj = NULL;
39744 0 : PyObject *ndr64_obj = NULL;
39745 0 : uint32_t ndr_push_flags = 0;
39746 :
39747 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
39748 : discard_const_p(char *, kwnames),
39749 : &bigendian_obj,
39750 : &ndr64_obj)) {
39751 0 : return NULL;
39752 : }
39753 :
39754 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39755 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39756 : }
39757 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39758 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39759 : }
39760 :
39761 0 : return py_lsa_SetDomainInformationPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
39762 : }
39763 :
39764 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
39765 : {
39766 0 : const struct ndr_interface_call *call = NULL;
39767 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39768 0 : struct ndr_pull *pull = NULL;
39769 : enum ndr_err_code err;
39770 :
39771 0 : if (ndr_table_lsarpc.num_calls < 55) {
39772 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetDomainInformationPolicy_ndr_unpack");
39773 0 : return NULL;
39774 : }
39775 0 : call = &ndr_table_lsarpc.calls[54];
39776 :
39777 0 : pull = ndr_pull_init_blob(blob, object);
39778 0 : if (pull == NULL) {
39779 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39780 0 : return NULL;
39781 : }
39782 :
39783 0 : pull->flags |= ndr_pull_flags;
39784 :
39785 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
39786 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39787 0 : TALLOC_FREE(pull);
39788 0 : PyErr_SetNdrError(err);
39789 0 : return NULL;
39790 : }
39791 0 : if (!allow_remaining) {
39792 : uint32_t highest_ofs;
39793 :
39794 0 : if (pull->offset > pull->relative_highest_offset) {
39795 0 : highest_ofs = pull->offset;
39796 : } else {
39797 0 : highest_ofs = pull->relative_highest_offset;
39798 : }
39799 0 : if (highest_ofs < pull->data_size) {
39800 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
39801 : "not all bytes consumed ofs[%u] size[%u]",
39802 : highest_ofs, pull->data_size);
39803 0 : TALLOC_FREE(pull);
39804 0 : PyErr_SetNdrError(err);
39805 0 : return NULL;
39806 : }
39807 : }
39808 :
39809 0 : TALLOC_FREE(pull);
39810 0 : Py_RETURN_NONE;
39811 : }
39812 :
39813 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39814 : {
39815 : DATA_BLOB blob;
39816 0 : Py_ssize_t blob_length = 0;
39817 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39818 0 : PyObject *bigendian_obj = NULL;
39819 0 : PyObject *ndr64_obj = NULL;
39820 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39821 0 : PyObject *allow_remaining_obj = NULL;
39822 0 : bool allow_remaining = false;
39823 :
39824 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
39825 : discard_const_p(char *, kwnames),
39826 : &blob.data, &blob_length,
39827 : &bigendian_obj,
39828 : &ndr64_obj,
39829 : &allow_remaining_obj)) {
39830 0 : return NULL;
39831 : }
39832 0 : blob.length = blob_length;
39833 :
39834 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39835 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39836 : }
39837 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39838 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39839 : }
39840 :
39841 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39842 0 : allow_remaining = true;
39843 : }
39844 :
39845 0 : return py_lsa_SetDomainInformationPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
39846 : }
39847 :
39848 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39849 : {
39850 : DATA_BLOB blob;
39851 0 : Py_ssize_t blob_length = 0;
39852 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39853 0 : PyObject *bigendian_obj = NULL;
39854 0 : PyObject *ndr64_obj = NULL;
39855 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39856 0 : PyObject *allow_remaining_obj = NULL;
39857 0 : bool allow_remaining = false;
39858 :
39859 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
39860 : discard_const_p(char *, kwnames),
39861 : &blob.data, &blob_length,
39862 : &bigendian_obj,
39863 : &ndr64_obj,
39864 : &allow_remaining_obj)) {
39865 0 : return NULL;
39866 : }
39867 0 : blob.length = blob_length;
39868 :
39869 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39870 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39871 : }
39872 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39873 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39874 : }
39875 :
39876 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39877 0 : allow_remaining = true;
39878 : }
39879 :
39880 0 : return py_lsa_SetDomainInformationPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
39881 : }
39882 :
39883 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
39884 : {
39885 0 : const struct ndr_interface_call *call = NULL;
39886 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39887 : PyObject *ret;
39888 : char *retstr;
39889 :
39890 0 : if (ndr_table_lsarpc.num_calls < 55) {
39891 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetDomainInformationPolicy_ndr_print");
39892 0 : return NULL;
39893 : }
39894 0 : call = &ndr_table_lsarpc.calls[54];
39895 :
39896 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
39897 0 : ret = PyUnicode_FromString(retstr);
39898 0 : TALLOC_FREE(retstr);
39899 :
39900 0 : return ret;
39901 : }
39902 :
39903 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39904 : {
39905 0 : return py_lsa_SetDomainInformationPolicy_ndr_print(py_obj, "lsa_SetDomainInformationPolicy_in", NDR_IN);
39906 : }
39907 :
39908 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39909 : {
39910 0 : return py_lsa_SetDomainInformationPolicy_ndr_print(py_obj, "lsa_SetDomainInformationPolicy_out", NDR_OUT);
39911 : }
39912 :
39913 : static PyMethodDef py_lsa_SetDomainInformationPolicy_methods[] = {
39914 : { "opnum", (PyCFunction)py_lsa_SetDomainInformationPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
39915 : "lsa.SetDomainInformationPolicy.opnum() -> 54 (0x36) " },
39916 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetDomainInformationPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
39917 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
39918 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetDomainInformationPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
39919 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
39920 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetDomainInformationPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
39921 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
39922 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetDomainInformationPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
39923 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
39924 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetDomainInformationPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
39925 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetDomainInformationPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
39926 : { NULL, NULL, 0, NULL }
39927 : };
39928 :
39929 :
39930 : static PyTypeObject lsa_SetDomainInformationPolicy_Type = {
39931 : PyVarObject_HEAD_INIT(NULL, 0)
39932 : .tp_name = "lsa.SetDomainInformationPolicy",
39933 : .tp_getset = py_lsa_SetDomainInformationPolicy_getsetters,
39934 : .tp_methods = py_lsa_SetDomainInformationPolicy_methods,
39935 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
39936 : .tp_new = py_lsa_SetDomainInformationPolicy_new,
39937 : };
39938 :
39939 0 : static bool pack_py_lsa_SetDomainInformationPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetDomainInformationPolicy *r)
39940 : {
39941 : PyObject *py_handle;
39942 : PyObject *py_level;
39943 : PyObject *py_info;
39944 0 : const char *kwnames[] = {
39945 : "handle", "level", "info", NULL
39946 : };
39947 :
39948 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetDomainInformationPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
39949 0 : return false;
39950 : }
39951 :
39952 0 : if (py_handle == NULL) {
39953 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
39954 0 : return false;
39955 : }
39956 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
39957 0 : if (r->in.handle == NULL) {
39958 0 : PyErr_NoMemory();
39959 0 : return false;
39960 : }
39961 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
39962 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
39963 0 : PyErr_NoMemory();
39964 0 : return false;
39965 : }
39966 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
39967 0 : if (py_level == NULL) {
39968 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
39969 0 : return false;
39970 : }
39971 : {
39972 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
39973 0 : if (PyLong_Check(py_level)) {
39974 : unsigned long long test_var;
39975 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
39976 0 : if (PyErr_Occurred() != NULL) {
39977 0 : return false;
39978 : }
39979 0 : if (test_var > uint_max) {
39980 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39981 : PyLong_Type.tp_name, uint_max, test_var);
39982 0 : return false;
39983 : }
39984 0 : r->in.level = test_var;
39985 : } else {
39986 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39987 : PyLong_Type.tp_name);
39988 0 : return false;
39989 : }
39990 : }
39991 0 : if (py_info == NULL) {
39992 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
39993 0 : return false;
39994 : }
39995 0 : if (py_info == Py_None) {
39996 0 : r->in.info = NULL;
39997 : } else {
39998 0 : r->in.info = NULL;
39999 : {
40000 : union lsa_DomainInformationPolicy *info_switch_1;
40001 0 : info_switch_1 = (union lsa_DomainInformationPolicy *)pyrpc_export_union(&lsa_DomainInformationPolicy_Type, r, r->in.level, py_info, "union lsa_DomainInformationPolicy");
40002 0 : if (info_switch_1 == NULL) {
40003 0 : return false;
40004 : }
40005 0 : r->in.info = info_switch_1;
40006 : }
40007 : }
40008 0 : return true;
40009 : }
40010 :
40011 0 : static PyObject *unpack_py_lsa_SetDomainInformationPolicy_args_out(struct lsa_SetDomainInformationPolicy *r)
40012 : {
40013 : PyObject *result;
40014 0 : result = Py_None;
40015 0 : Py_INCREF(result);
40016 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
40017 0 : PyErr_SetNTSTATUS(r->out.result);
40018 0 : return NULL;
40019 : }
40020 :
40021 0 : return result;
40022 : }
40023 :
40024 :
40025 0 : static PyObject *py_lsa_OpenTrustedDomainByName_in_get_handle(PyObject *obj, void *closure)
40026 : {
40027 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(obj);
40028 : PyObject *py_handle;
40029 0 : if (object->in.handle == NULL) {
40030 0 : Py_RETURN_NONE;
40031 : }
40032 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
40033 0 : return py_handle;
40034 : }
40035 :
40036 0 : static int py_lsa_OpenTrustedDomainByName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
40037 : {
40038 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40039 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
40040 0 : if (value == NULL) {
40041 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
40042 0 : return -1;
40043 : }
40044 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
40045 0 : if (object->in.handle == NULL) {
40046 0 : PyErr_NoMemory();
40047 0 : return -1;
40048 : }
40049 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
40050 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40051 0 : PyErr_NoMemory();
40052 0 : return -1;
40053 : }
40054 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
40055 0 : return 0;
40056 : }
40057 :
40058 0 : static PyObject *py_lsa_OpenTrustedDomainByName_in_get_name(PyObject *obj, void *closure)
40059 : {
40060 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(obj);
40061 : PyObject *py_name;
40062 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->in.name);
40063 0 : return py_name;
40064 : }
40065 :
40066 0 : static int py_lsa_OpenTrustedDomainByName_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
40067 : {
40068 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40069 0 : if (value == NULL) {
40070 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
40071 0 : return -1;
40072 : }
40073 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
40074 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40075 0 : PyErr_NoMemory();
40076 0 : return -1;
40077 : }
40078 0 : object->in.name = *(struct lsa_String *)pytalloc_get_ptr(value);
40079 0 : return 0;
40080 : }
40081 :
40082 0 : static PyObject *py_lsa_OpenTrustedDomainByName_in_get_access_mask(PyObject *obj, void *closure)
40083 : {
40084 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(obj);
40085 : PyObject *py_access_mask;
40086 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
40087 0 : return py_access_mask;
40088 : }
40089 :
40090 0 : static int py_lsa_OpenTrustedDomainByName_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
40091 : {
40092 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40093 0 : if (value == NULL) {
40094 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
40095 0 : return -1;
40096 : }
40097 : {
40098 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
40099 0 : if (PyLong_Check(value)) {
40100 : unsigned long long test_var;
40101 0 : test_var = PyLong_AsUnsignedLongLong(value);
40102 0 : if (PyErr_Occurred() != NULL) {
40103 0 : return -1;
40104 : }
40105 0 : if (test_var > uint_max) {
40106 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40107 : PyLong_Type.tp_name, uint_max, test_var);
40108 0 : return -1;
40109 : }
40110 0 : object->in.access_mask = test_var;
40111 : } else {
40112 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40113 : PyLong_Type.tp_name);
40114 0 : return -1;
40115 : }
40116 : }
40117 0 : return 0;
40118 : }
40119 :
40120 0 : static PyObject *py_lsa_OpenTrustedDomainByName_out_get_trustdom_handle(PyObject *obj, void *closure)
40121 : {
40122 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(obj);
40123 : PyObject *py_trustdom_handle;
40124 0 : if (object->out.trustdom_handle == NULL) {
40125 0 : Py_RETURN_NONE;
40126 : }
40127 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
40128 0 : return py_trustdom_handle;
40129 : }
40130 :
40131 0 : static int py_lsa_OpenTrustedDomainByName_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
40132 : {
40133 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40134 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
40135 0 : if (value == NULL) {
40136 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trustdom_handle");
40137 0 : return -1;
40138 : }
40139 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
40140 0 : if (object->out.trustdom_handle == NULL) {
40141 0 : PyErr_NoMemory();
40142 0 : return -1;
40143 : }
40144 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
40145 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40146 0 : PyErr_NoMemory();
40147 0 : return -1;
40148 : }
40149 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
40150 0 : return 0;
40151 : }
40152 :
40153 0 : static PyObject *py_lsa_OpenTrustedDomainByName_get_result(PyObject *obj, void *closure)
40154 : {
40155 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(obj);
40156 : PyObject *py_result;
40157 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
40158 0 : return py_result;
40159 : }
40160 :
40161 0 : static int py_lsa_OpenTrustedDomainByName_set_result(PyObject *py_obj, PyObject *value, void *closure)
40162 : {
40163 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40164 0 : if (value == NULL) {
40165 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
40166 0 : return -1;
40167 : }
40168 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
40169 0 : return 0;
40170 : }
40171 :
40172 : static PyGetSetDef py_lsa_OpenTrustedDomainByName_getsetters[] = {
40173 : {
40174 : .name = discard_const_p(char, "in_handle"),
40175 : .get = py_lsa_OpenTrustedDomainByName_in_get_handle,
40176 : .set = py_lsa_OpenTrustedDomainByName_in_set_handle,
40177 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
40178 : },
40179 : {
40180 : .name = discard_const_p(char, "in_name"),
40181 : .get = py_lsa_OpenTrustedDomainByName_in_get_name,
40182 : .set = py_lsa_OpenTrustedDomainByName_in_set_name,
40183 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
40184 : },
40185 : {
40186 : .name = discard_const_p(char, "in_access_mask"),
40187 : .get = py_lsa_OpenTrustedDomainByName_in_get_access_mask,
40188 : .set = py_lsa_OpenTrustedDomainByName_in_set_access_mask,
40189 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
40190 : },
40191 : {
40192 : .name = discard_const_p(char, "out_trustdom_handle"),
40193 : .get = py_lsa_OpenTrustedDomainByName_out_get_trustdom_handle,
40194 : .set = py_lsa_OpenTrustedDomainByName_out_set_trustdom_handle,
40195 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
40196 : },
40197 : {
40198 : .name = discard_const_p(char, "result"),
40199 : .get = py_lsa_OpenTrustedDomainByName_get_result,
40200 : .set = py_lsa_OpenTrustedDomainByName_set_result,
40201 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
40202 : },
40203 : { .name = NULL }
40204 : };
40205 :
40206 0 : static PyObject *py_lsa_OpenTrustedDomainByName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
40207 : {
40208 0 : PyObject *self = pytalloc_new(struct lsa_OpenTrustedDomainByName, type);
40209 0 : struct lsa_OpenTrustedDomainByName *_self = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(self);
40210 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
40211 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
40212 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
40213 0 : return self;
40214 : }
40215 :
40216 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
40217 : {
40218 :
40219 :
40220 0 : return PyLong_FromLong(55);
40221 : }
40222 :
40223 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
40224 : {
40225 0 : const struct ndr_interface_call *call = NULL;
40226 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40227 0 : PyObject *ret = NULL;
40228 0 : struct ndr_push *push = NULL;
40229 : DATA_BLOB blob;
40230 : enum ndr_err_code err;
40231 :
40232 0 : if (ndr_table_lsarpc.num_calls < 56) {
40233 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomainByName_ndr_pack");
40234 0 : return NULL;
40235 : }
40236 0 : call = &ndr_table_lsarpc.calls[55];
40237 :
40238 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
40239 0 : if (push == NULL) {
40240 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40241 0 : return NULL;
40242 : }
40243 :
40244 0 : push->flags |= ndr_push_flags;
40245 :
40246 0 : err = call->ndr_push(push, ndr_inout_flags, object);
40247 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40248 0 : TALLOC_FREE(push);
40249 0 : PyErr_SetNdrError(err);
40250 0 : return NULL;
40251 : }
40252 0 : blob = ndr_push_blob(push);
40253 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
40254 0 : TALLOC_FREE(push);
40255 0 : return ret;
40256 : }
40257 :
40258 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40259 : {
40260 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40261 0 : PyObject *bigendian_obj = NULL;
40262 0 : PyObject *ndr64_obj = NULL;
40263 0 : uint32_t ndr_push_flags = 0;
40264 :
40265 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
40266 : discard_const_p(char *, kwnames),
40267 : &bigendian_obj,
40268 : &ndr64_obj)) {
40269 0 : return NULL;
40270 : }
40271 :
40272 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40273 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40274 : }
40275 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40276 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40277 : }
40278 :
40279 0 : return py_lsa_OpenTrustedDomainByName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
40280 : }
40281 :
40282 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40283 : {
40284 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40285 0 : PyObject *bigendian_obj = NULL;
40286 0 : PyObject *ndr64_obj = NULL;
40287 0 : uint32_t ndr_push_flags = 0;
40288 :
40289 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
40290 : discard_const_p(char *, kwnames),
40291 : &bigendian_obj,
40292 : &ndr64_obj)) {
40293 0 : return NULL;
40294 : }
40295 :
40296 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40297 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40298 : }
40299 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40300 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40301 : }
40302 :
40303 0 : return py_lsa_OpenTrustedDomainByName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
40304 : }
40305 :
40306 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
40307 : {
40308 0 : const struct ndr_interface_call *call = NULL;
40309 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40310 0 : struct ndr_pull *pull = NULL;
40311 : enum ndr_err_code err;
40312 :
40313 0 : if (ndr_table_lsarpc.num_calls < 56) {
40314 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomainByName_ndr_unpack");
40315 0 : return NULL;
40316 : }
40317 0 : call = &ndr_table_lsarpc.calls[55];
40318 :
40319 0 : pull = ndr_pull_init_blob(blob, object);
40320 0 : if (pull == NULL) {
40321 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40322 0 : return NULL;
40323 : }
40324 :
40325 0 : pull->flags |= ndr_pull_flags;
40326 :
40327 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
40328 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40329 0 : TALLOC_FREE(pull);
40330 0 : PyErr_SetNdrError(err);
40331 0 : return NULL;
40332 : }
40333 0 : if (!allow_remaining) {
40334 : uint32_t highest_ofs;
40335 :
40336 0 : if (pull->offset > pull->relative_highest_offset) {
40337 0 : highest_ofs = pull->offset;
40338 : } else {
40339 0 : highest_ofs = pull->relative_highest_offset;
40340 : }
40341 0 : if (highest_ofs < pull->data_size) {
40342 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
40343 : "not all bytes consumed ofs[%u] size[%u]",
40344 : highest_ofs, pull->data_size);
40345 0 : TALLOC_FREE(pull);
40346 0 : PyErr_SetNdrError(err);
40347 0 : return NULL;
40348 : }
40349 : }
40350 :
40351 0 : TALLOC_FREE(pull);
40352 0 : Py_RETURN_NONE;
40353 : }
40354 :
40355 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40356 : {
40357 : DATA_BLOB blob;
40358 0 : Py_ssize_t blob_length = 0;
40359 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40360 0 : PyObject *bigendian_obj = NULL;
40361 0 : PyObject *ndr64_obj = NULL;
40362 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40363 0 : PyObject *allow_remaining_obj = NULL;
40364 0 : bool allow_remaining = false;
40365 :
40366 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
40367 : discard_const_p(char *, kwnames),
40368 : &blob.data, &blob_length,
40369 : &bigendian_obj,
40370 : &ndr64_obj,
40371 : &allow_remaining_obj)) {
40372 0 : return NULL;
40373 : }
40374 0 : blob.length = blob_length;
40375 :
40376 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40377 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40378 : }
40379 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40380 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40381 : }
40382 :
40383 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40384 0 : allow_remaining = true;
40385 : }
40386 :
40387 0 : return py_lsa_OpenTrustedDomainByName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
40388 : }
40389 :
40390 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40391 : {
40392 : DATA_BLOB blob;
40393 0 : Py_ssize_t blob_length = 0;
40394 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40395 0 : PyObject *bigendian_obj = NULL;
40396 0 : PyObject *ndr64_obj = NULL;
40397 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40398 0 : PyObject *allow_remaining_obj = NULL;
40399 0 : bool allow_remaining = false;
40400 :
40401 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
40402 : discard_const_p(char *, kwnames),
40403 : &blob.data, &blob_length,
40404 : &bigendian_obj,
40405 : &ndr64_obj,
40406 : &allow_remaining_obj)) {
40407 0 : return NULL;
40408 : }
40409 0 : blob.length = blob_length;
40410 :
40411 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40412 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40413 : }
40414 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40415 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40416 : }
40417 :
40418 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40419 0 : allow_remaining = true;
40420 : }
40421 :
40422 0 : return py_lsa_OpenTrustedDomainByName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
40423 : }
40424 :
40425 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
40426 : {
40427 0 : const struct ndr_interface_call *call = NULL;
40428 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40429 : PyObject *ret;
40430 : char *retstr;
40431 :
40432 0 : if (ndr_table_lsarpc.num_calls < 56) {
40433 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomainByName_ndr_print");
40434 0 : return NULL;
40435 : }
40436 0 : call = &ndr_table_lsarpc.calls[55];
40437 :
40438 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
40439 0 : ret = PyUnicode_FromString(retstr);
40440 0 : TALLOC_FREE(retstr);
40441 :
40442 0 : return ret;
40443 : }
40444 :
40445 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40446 : {
40447 0 : return py_lsa_OpenTrustedDomainByName_ndr_print(py_obj, "lsa_OpenTrustedDomainByName_in", NDR_IN);
40448 : }
40449 :
40450 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40451 : {
40452 0 : return py_lsa_OpenTrustedDomainByName_ndr_print(py_obj, "lsa_OpenTrustedDomainByName_out", NDR_OUT);
40453 : }
40454 :
40455 : static PyMethodDef py_lsa_OpenTrustedDomainByName_methods[] = {
40456 : { "opnum", (PyCFunction)py_lsa_OpenTrustedDomainByName_ndr_opnum, METH_NOARGS|METH_CLASS,
40457 : "lsa.OpenTrustedDomainByName.opnum() -> 55 (0x37) " },
40458 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomainByName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
40459 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
40460 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomainByName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
40461 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
40462 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomainByName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
40463 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
40464 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomainByName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
40465 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
40466 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenTrustedDomainByName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
40467 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenTrustedDomainByName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
40468 : { NULL, NULL, 0, NULL }
40469 : };
40470 :
40471 :
40472 : static PyTypeObject lsa_OpenTrustedDomainByName_Type = {
40473 : PyVarObject_HEAD_INIT(NULL, 0)
40474 : .tp_name = "lsa.OpenTrustedDomainByName",
40475 : .tp_getset = py_lsa_OpenTrustedDomainByName_getsetters,
40476 : .tp_methods = py_lsa_OpenTrustedDomainByName_methods,
40477 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
40478 : .tp_new = py_lsa_OpenTrustedDomainByName_new,
40479 : };
40480 :
40481 0 : static bool pack_py_lsa_OpenTrustedDomainByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenTrustedDomainByName *r)
40482 : {
40483 : PyObject *py_handle;
40484 : PyObject *py_name;
40485 : PyObject *py_access_mask;
40486 0 : const char *kwnames[] = {
40487 : "handle", "name", "access_mask", NULL
40488 : };
40489 :
40490 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenTrustedDomainByName", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
40491 0 : return false;
40492 : }
40493 :
40494 0 : if (py_handle == NULL) {
40495 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
40496 0 : return false;
40497 : }
40498 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
40499 0 : if (r->in.handle == NULL) {
40500 0 : PyErr_NoMemory();
40501 0 : return false;
40502 : }
40503 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
40504 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
40505 0 : PyErr_NoMemory();
40506 0 : return false;
40507 : }
40508 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
40509 0 : if (py_name == NULL) {
40510 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
40511 0 : return false;
40512 : }
40513 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
40514 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
40515 0 : PyErr_NoMemory();
40516 0 : return false;
40517 : }
40518 0 : r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
40519 0 : if (py_access_mask == NULL) {
40520 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
40521 0 : return false;
40522 : }
40523 : {
40524 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
40525 0 : if (PyLong_Check(py_access_mask)) {
40526 : unsigned long long test_var;
40527 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
40528 0 : if (PyErr_Occurred() != NULL) {
40529 0 : return false;
40530 : }
40531 0 : if (test_var > uint_max) {
40532 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40533 : PyLong_Type.tp_name, uint_max, test_var);
40534 0 : return false;
40535 : }
40536 0 : r->in.access_mask = test_var;
40537 : } else {
40538 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40539 : PyLong_Type.tp_name);
40540 0 : return false;
40541 : }
40542 : }
40543 0 : return true;
40544 : }
40545 :
40546 0 : static PyObject *unpack_py_lsa_OpenTrustedDomainByName_args_out(struct lsa_OpenTrustedDomainByName *r)
40547 : {
40548 : PyObject *result;
40549 : PyObject *py_trustdom_handle;
40550 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
40551 0 : result = py_trustdom_handle;
40552 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
40553 0 : PyErr_SetNTSTATUS(r->out.result);
40554 0 : return NULL;
40555 : }
40556 :
40557 0 : return result;
40558 : }
40559 :
40560 :
40561 0 : static PyObject *py_lsa_LookupSids2_in_get_handle(PyObject *obj, void *closure)
40562 : {
40563 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40564 : PyObject *py_handle;
40565 0 : if (object->in.handle == NULL) {
40566 0 : Py_RETURN_NONE;
40567 : }
40568 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
40569 0 : return py_handle;
40570 : }
40571 :
40572 0 : static int py_lsa_LookupSids2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
40573 : {
40574 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40575 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
40576 0 : if (value == NULL) {
40577 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
40578 0 : return -1;
40579 : }
40580 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
40581 0 : if (object->in.handle == NULL) {
40582 0 : PyErr_NoMemory();
40583 0 : return -1;
40584 : }
40585 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
40586 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40587 0 : PyErr_NoMemory();
40588 0 : return -1;
40589 : }
40590 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
40591 0 : return 0;
40592 : }
40593 :
40594 0 : static PyObject *py_lsa_LookupSids2_in_get_sids(PyObject *obj, void *closure)
40595 : {
40596 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40597 : PyObject *py_sids;
40598 0 : if (object->in.sids == NULL) {
40599 0 : Py_RETURN_NONE;
40600 : }
40601 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->in.sids, object->in.sids);
40602 0 : return py_sids;
40603 : }
40604 :
40605 0 : static int py_lsa_LookupSids2_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
40606 : {
40607 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40608 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
40609 0 : if (value == NULL) {
40610 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
40611 0 : return -1;
40612 : }
40613 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
40614 0 : if (object->in.sids == NULL) {
40615 0 : PyErr_NoMemory();
40616 0 : return -1;
40617 : }
40618 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
40619 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40620 0 : PyErr_NoMemory();
40621 0 : return -1;
40622 : }
40623 0 : object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
40624 0 : return 0;
40625 : }
40626 :
40627 0 : static PyObject *py_lsa_LookupSids2_out_get_domains(PyObject *obj, void *closure)
40628 : {
40629 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40630 : PyObject *py_domains;
40631 0 : if (object->out.domains == NULL) {
40632 0 : Py_RETURN_NONE;
40633 : }
40634 0 : if (*object->out.domains == NULL) {
40635 0 : py_domains = Py_None;
40636 0 : Py_INCREF(py_domains);
40637 : } else {
40638 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
40639 : }
40640 0 : return py_domains;
40641 : }
40642 :
40643 0 : static int py_lsa_LookupSids2_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
40644 : {
40645 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40646 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
40647 0 : if (value == NULL) {
40648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
40649 0 : return -1;
40650 : }
40651 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
40652 0 : if (object->out.domains == NULL) {
40653 0 : PyErr_NoMemory();
40654 0 : return -1;
40655 : }
40656 0 : if (value == Py_None) {
40657 0 : *object->out.domains = NULL;
40658 : } else {
40659 0 : *object->out.domains = NULL;
40660 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
40661 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40662 0 : PyErr_NoMemory();
40663 0 : return -1;
40664 : }
40665 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
40666 : }
40667 0 : return 0;
40668 : }
40669 :
40670 0 : static PyObject *py_lsa_LookupSids2_in_get_names(PyObject *obj, void *closure)
40671 : {
40672 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40673 : PyObject *py_names;
40674 0 : if (object->in.names == NULL) {
40675 0 : Py_RETURN_NONE;
40676 : }
40677 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, object->in.names, object->in.names);
40678 0 : return py_names;
40679 : }
40680 :
40681 0 : static int py_lsa_LookupSids2_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
40682 : {
40683 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40684 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.names));
40685 0 : if (value == NULL) {
40686 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
40687 0 : return -1;
40688 : }
40689 0 : object->in.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names);
40690 0 : if (object->in.names == NULL) {
40691 0 : PyErr_NoMemory();
40692 0 : return -1;
40693 : }
40694 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, value, return -1;);
40695 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40696 0 : PyErr_NoMemory();
40697 0 : return -1;
40698 : }
40699 0 : object->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(value);
40700 0 : return 0;
40701 : }
40702 :
40703 0 : static PyObject *py_lsa_LookupSids2_out_get_names(PyObject *obj, void *closure)
40704 : {
40705 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40706 : PyObject *py_names;
40707 0 : if (object->out.names == NULL) {
40708 0 : Py_RETURN_NONE;
40709 : }
40710 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, object->out.names, object->out.names);
40711 0 : return py_names;
40712 : }
40713 :
40714 0 : static int py_lsa_LookupSids2_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
40715 : {
40716 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40717 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
40718 0 : if (value == NULL) {
40719 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.names");
40720 0 : return -1;
40721 : }
40722 0 : object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
40723 0 : if (object->out.names == NULL) {
40724 0 : PyErr_NoMemory();
40725 0 : return -1;
40726 : }
40727 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, value, return -1;);
40728 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40729 0 : PyErr_NoMemory();
40730 0 : return -1;
40731 : }
40732 0 : object->out.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(value);
40733 0 : return 0;
40734 : }
40735 :
40736 0 : static PyObject *py_lsa_LookupSids2_in_get_level(PyObject *obj, void *closure)
40737 : {
40738 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40739 : PyObject *py_level;
40740 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
40741 0 : return py_level;
40742 : }
40743 :
40744 0 : static int py_lsa_LookupSids2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
40745 : {
40746 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40747 0 : if (value == NULL) {
40748 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
40749 0 : return -1;
40750 : }
40751 : {
40752 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
40753 0 : if (PyLong_Check(value)) {
40754 : unsigned long long test_var;
40755 0 : test_var = PyLong_AsUnsignedLongLong(value);
40756 0 : if (PyErr_Occurred() != NULL) {
40757 0 : return -1;
40758 : }
40759 0 : if (test_var > uint_max) {
40760 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40761 : PyLong_Type.tp_name, uint_max, test_var);
40762 0 : return -1;
40763 : }
40764 0 : object->in.level = test_var;
40765 : } else {
40766 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40767 : PyLong_Type.tp_name);
40768 0 : return -1;
40769 : }
40770 : }
40771 0 : return 0;
40772 : }
40773 :
40774 0 : static PyObject *py_lsa_LookupSids2_in_get_count(PyObject *obj, void *closure)
40775 : {
40776 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40777 : PyObject *py_count;
40778 0 : if (object->in.count == NULL) {
40779 0 : Py_RETURN_NONE;
40780 : }
40781 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
40782 0 : return py_count;
40783 : }
40784 :
40785 0 : static int py_lsa_LookupSids2_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
40786 : {
40787 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40788 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
40789 0 : if (value == NULL) {
40790 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
40791 0 : return -1;
40792 : }
40793 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
40794 0 : if (object->in.count == NULL) {
40795 0 : PyErr_NoMemory();
40796 0 : return -1;
40797 : }
40798 : {
40799 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
40800 0 : if (PyLong_Check(value)) {
40801 : unsigned long long test_var;
40802 0 : test_var = PyLong_AsUnsignedLongLong(value);
40803 0 : if (PyErr_Occurred() != NULL) {
40804 0 : return -1;
40805 : }
40806 0 : if (test_var > uint_max) {
40807 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40808 : PyLong_Type.tp_name, uint_max, test_var);
40809 0 : return -1;
40810 : }
40811 0 : *object->in.count = test_var;
40812 : } else {
40813 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40814 : PyLong_Type.tp_name);
40815 0 : return -1;
40816 : }
40817 : }
40818 0 : return 0;
40819 : }
40820 :
40821 0 : static PyObject *py_lsa_LookupSids2_out_get_count(PyObject *obj, void *closure)
40822 : {
40823 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40824 : PyObject *py_count;
40825 0 : if (object->out.count == NULL) {
40826 0 : Py_RETURN_NONE;
40827 : }
40828 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
40829 0 : return py_count;
40830 : }
40831 :
40832 0 : static int py_lsa_LookupSids2_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
40833 : {
40834 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40835 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
40836 0 : if (value == NULL) {
40837 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
40838 0 : return -1;
40839 : }
40840 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
40841 0 : if (object->out.count == NULL) {
40842 0 : PyErr_NoMemory();
40843 0 : return -1;
40844 : }
40845 : {
40846 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
40847 0 : if (PyLong_Check(value)) {
40848 : unsigned long long test_var;
40849 0 : test_var = PyLong_AsUnsignedLongLong(value);
40850 0 : if (PyErr_Occurred() != NULL) {
40851 0 : return -1;
40852 : }
40853 0 : if (test_var > uint_max) {
40854 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40855 : PyLong_Type.tp_name, uint_max, test_var);
40856 0 : return -1;
40857 : }
40858 0 : *object->out.count = test_var;
40859 : } else {
40860 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40861 : PyLong_Type.tp_name);
40862 0 : return -1;
40863 : }
40864 : }
40865 0 : return 0;
40866 : }
40867 :
40868 0 : static PyObject *py_lsa_LookupSids2_in_get_lookup_options(PyObject *obj, void *closure)
40869 : {
40870 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40871 : PyObject *py_lookup_options;
40872 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)object->in.lookup_options);
40873 0 : return py_lookup_options;
40874 : }
40875 :
40876 0 : static int py_lsa_LookupSids2_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
40877 : {
40878 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40879 0 : if (value == NULL) {
40880 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lookup_options");
40881 0 : return -1;
40882 : }
40883 : {
40884 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
40885 0 : if (PyLong_Check(value)) {
40886 : unsigned long long test_var;
40887 0 : test_var = PyLong_AsUnsignedLongLong(value);
40888 0 : if (PyErr_Occurred() != NULL) {
40889 0 : return -1;
40890 : }
40891 0 : if (test_var > uint_max) {
40892 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40893 : PyLong_Type.tp_name, uint_max, test_var);
40894 0 : return -1;
40895 : }
40896 0 : object->in.lookup_options = test_var;
40897 : } else {
40898 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40899 : PyLong_Type.tp_name);
40900 0 : return -1;
40901 : }
40902 : }
40903 0 : return 0;
40904 : }
40905 :
40906 0 : static PyObject *py_lsa_LookupSids2_in_get_client_revision(PyObject *obj, void *closure)
40907 : {
40908 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40909 : PyObject *py_client_revision;
40910 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)object->in.client_revision);
40911 0 : return py_client_revision;
40912 : }
40913 :
40914 0 : static int py_lsa_LookupSids2_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
40915 : {
40916 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40917 0 : if (value == NULL) {
40918 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_revision");
40919 0 : return -1;
40920 : }
40921 : {
40922 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
40923 0 : if (PyLong_Check(value)) {
40924 : unsigned long long test_var;
40925 0 : test_var = PyLong_AsUnsignedLongLong(value);
40926 0 : if (PyErr_Occurred() != NULL) {
40927 0 : return -1;
40928 : }
40929 0 : if (test_var > uint_max) {
40930 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40931 : PyLong_Type.tp_name, uint_max, test_var);
40932 0 : return -1;
40933 : }
40934 0 : object->in.client_revision = test_var;
40935 : } else {
40936 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40937 : PyLong_Type.tp_name);
40938 0 : return -1;
40939 : }
40940 : }
40941 0 : return 0;
40942 : }
40943 :
40944 0 : static PyObject *py_lsa_LookupSids2_get_result(PyObject *obj, void *closure)
40945 : {
40946 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40947 : PyObject *py_result;
40948 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
40949 0 : return py_result;
40950 : }
40951 :
40952 0 : static int py_lsa_LookupSids2_set_result(PyObject *py_obj, PyObject *value, void *closure)
40953 : {
40954 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40955 0 : if (value == NULL) {
40956 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
40957 0 : return -1;
40958 : }
40959 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
40960 0 : return 0;
40961 : }
40962 :
40963 : static PyGetSetDef py_lsa_LookupSids2_getsetters[] = {
40964 : {
40965 : .name = discard_const_p(char, "in_handle"),
40966 : .get = py_lsa_LookupSids2_in_get_handle,
40967 : .set = py_lsa_LookupSids2_in_set_handle,
40968 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
40969 : },
40970 : {
40971 : .name = discard_const_p(char, "in_sids"),
40972 : .get = py_lsa_LookupSids2_in_get_sids,
40973 : .set = py_lsa_LookupSids2_in_set_sids,
40974 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
40975 : },
40976 : {
40977 : .name = discard_const_p(char, "out_domains"),
40978 : .get = py_lsa_LookupSids2_out_get_domains,
40979 : .set = py_lsa_LookupSids2_out_set_domains,
40980 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
40981 : },
40982 : {
40983 : .name = discard_const_p(char, "in_names"),
40984 : .get = py_lsa_LookupSids2_in_get_names,
40985 : .set = py_lsa_LookupSids2_in_set_names,
40986 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray2")
40987 : },
40988 : {
40989 : .name = discard_const_p(char, "out_names"),
40990 : .get = py_lsa_LookupSids2_out_get_names,
40991 : .set = py_lsa_LookupSids2_out_set_names,
40992 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray2")
40993 : },
40994 : {
40995 : .name = discard_const_p(char, "in_level"),
40996 : .get = py_lsa_LookupSids2_in_get_level,
40997 : .set = py_lsa_LookupSids2_in_set_level,
40998 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
40999 : },
41000 : {
41001 : .name = discard_const_p(char, "in_count"),
41002 : .get = py_lsa_LookupSids2_in_get_count,
41003 : .set = py_lsa_LookupSids2_in_set_count,
41004 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
41005 : },
41006 : {
41007 : .name = discard_const_p(char, "out_count"),
41008 : .get = py_lsa_LookupSids2_out_get_count,
41009 : .set = py_lsa_LookupSids2_out_set_count,
41010 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
41011 : },
41012 : {
41013 : .name = discard_const_p(char, "in_lookup_options"),
41014 : .get = py_lsa_LookupSids2_in_get_lookup_options,
41015 : .set = py_lsa_LookupSids2_in_set_lookup_options,
41016 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
41017 : },
41018 : {
41019 : .name = discard_const_p(char, "in_client_revision"),
41020 : .get = py_lsa_LookupSids2_in_get_client_revision,
41021 : .set = py_lsa_LookupSids2_in_set_client_revision,
41022 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
41023 : },
41024 : {
41025 : .name = discard_const_p(char, "result"),
41026 : .get = py_lsa_LookupSids2_get_result,
41027 : .set = py_lsa_LookupSids2_set_result,
41028 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
41029 : },
41030 : { .name = NULL }
41031 : };
41032 :
41033 0 : static PyObject *py_lsa_LookupSids2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
41034 : {
41035 0 : PyObject *self = pytalloc_new(struct lsa_LookupSids2, type);
41036 0 : struct lsa_LookupSids2 *_self = (struct lsa_LookupSids2 *)pytalloc_get_ptr(self);
41037 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
41038 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
41039 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
41040 : /* a pointer to a NULL pointer */
41041 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
41042 0 : _self->in.names = talloc_zero(mem_ctx, struct lsa_TransNameArray2);
41043 0 : _self->out.names = talloc_zero(mem_ctx, struct lsa_TransNameArray2);
41044 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
41045 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
41046 0 : return self;
41047 : }
41048 :
41049 0 : static PyObject *py_lsa_LookupSids2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
41050 : {
41051 :
41052 :
41053 0 : return PyLong_FromLong(57);
41054 : }
41055 :
41056 0 : static PyObject *py_lsa_LookupSids2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
41057 : {
41058 0 : const struct ndr_interface_call *call = NULL;
41059 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
41060 0 : PyObject *ret = NULL;
41061 0 : struct ndr_push *push = NULL;
41062 : DATA_BLOB blob;
41063 : enum ndr_err_code err;
41064 :
41065 0 : if (ndr_table_lsarpc.num_calls < 58) {
41066 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids2_ndr_pack");
41067 0 : return NULL;
41068 : }
41069 0 : call = &ndr_table_lsarpc.calls[57];
41070 :
41071 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
41072 0 : if (push == NULL) {
41073 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41074 0 : return NULL;
41075 : }
41076 :
41077 0 : push->flags |= ndr_push_flags;
41078 :
41079 0 : err = call->ndr_push(push, ndr_inout_flags, object);
41080 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41081 0 : TALLOC_FREE(push);
41082 0 : PyErr_SetNdrError(err);
41083 0 : return NULL;
41084 : }
41085 0 : blob = ndr_push_blob(push);
41086 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
41087 0 : TALLOC_FREE(push);
41088 0 : return ret;
41089 : }
41090 :
41091 0 : static PyObject *py_lsa_LookupSids2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41092 : {
41093 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41094 0 : PyObject *bigendian_obj = NULL;
41095 0 : PyObject *ndr64_obj = NULL;
41096 0 : uint32_t ndr_push_flags = 0;
41097 :
41098 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
41099 : discard_const_p(char *, kwnames),
41100 : &bigendian_obj,
41101 : &ndr64_obj)) {
41102 0 : return NULL;
41103 : }
41104 :
41105 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41106 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41107 : }
41108 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41109 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41110 : }
41111 :
41112 0 : return py_lsa_LookupSids2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
41113 : }
41114 :
41115 0 : static PyObject *py_lsa_LookupSids2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41116 : {
41117 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41118 0 : PyObject *bigendian_obj = NULL;
41119 0 : PyObject *ndr64_obj = NULL;
41120 0 : uint32_t ndr_push_flags = 0;
41121 :
41122 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
41123 : discard_const_p(char *, kwnames),
41124 : &bigendian_obj,
41125 : &ndr64_obj)) {
41126 0 : return NULL;
41127 : }
41128 :
41129 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41130 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41131 : }
41132 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41133 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41134 : }
41135 :
41136 0 : return py_lsa_LookupSids2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
41137 : }
41138 :
41139 0 : static PyObject *py_lsa_LookupSids2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
41140 : {
41141 0 : const struct ndr_interface_call *call = NULL;
41142 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
41143 0 : struct ndr_pull *pull = NULL;
41144 : enum ndr_err_code err;
41145 :
41146 0 : if (ndr_table_lsarpc.num_calls < 58) {
41147 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids2_ndr_unpack");
41148 0 : return NULL;
41149 : }
41150 0 : call = &ndr_table_lsarpc.calls[57];
41151 :
41152 0 : pull = ndr_pull_init_blob(blob, object);
41153 0 : if (pull == NULL) {
41154 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41155 0 : return NULL;
41156 : }
41157 :
41158 0 : pull->flags |= ndr_pull_flags;
41159 :
41160 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
41161 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41162 0 : TALLOC_FREE(pull);
41163 0 : PyErr_SetNdrError(err);
41164 0 : return NULL;
41165 : }
41166 0 : if (!allow_remaining) {
41167 : uint32_t highest_ofs;
41168 :
41169 0 : if (pull->offset > pull->relative_highest_offset) {
41170 0 : highest_ofs = pull->offset;
41171 : } else {
41172 0 : highest_ofs = pull->relative_highest_offset;
41173 : }
41174 0 : if (highest_ofs < pull->data_size) {
41175 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
41176 : "not all bytes consumed ofs[%u] size[%u]",
41177 : highest_ofs, pull->data_size);
41178 0 : TALLOC_FREE(pull);
41179 0 : PyErr_SetNdrError(err);
41180 0 : return NULL;
41181 : }
41182 : }
41183 :
41184 0 : TALLOC_FREE(pull);
41185 0 : Py_RETURN_NONE;
41186 : }
41187 :
41188 0 : static PyObject *py_lsa_LookupSids2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41189 : {
41190 : DATA_BLOB blob;
41191 0 : Py_ssize_t blob_length = 0;
41192 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41193 0 : PyObject *bigendian_obj = NULL;
41194 0 : PyObject *ndr64_obj = NULL;
41195 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41196 0 : PyObject *allow_remaining_obj = NULL;
41197 0 : bool allow_remaining = false;
41198 :
41199 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
41200 : discard_const_p(char *, kwnames),
41201 : &blob.data, &blob_length,
41202 : &bigendian_obj,
41203 : &ndr64_obj,
41204 : &allow_remaining_obj)) {
41205 0 : return NULL;
41206 : }
41207 0 : blob.length = blob_length;
41208 :
41209 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41210 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41211 : }
41212 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41213 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41214 : }
41215 :
41216 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41217 0 : allow_remaining = true;
41218 : }
41219 :
41220 0 : return py_lsa_LookupSids2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
41221 : }
41222 :
41223 0 : static PyObject *py_lsa_LookupSids2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41224 : {
41225 : DATA_BLOB blob;
41226 0 : Py_ssize_t blob_length = 0;
41227 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41228 0 : PyObject *bigendian_obj = NULL;
41229 0 : PyObject *ndr64_obj = NULL;
41230 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41231 0 : PyObject *allow_remaining_obj = NULL;
41232 0 : bool allow_remaining = false;
41233 :
41234 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
41235 : discard_const_p(char *, kwnames),
41236 : &blob.data, &blob_length,
41237 : &bigendian_obj,
41238 : &ndr64_obj,
41239 : &allow_remaining_obj)) {
41240 0 : return NULL;
41241 : }
41242 0 : blob.length = blob_length;
41243 :
41244 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41245 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41246 : }
41247 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41248 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41249 : }
41250 :
41251 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41252 0 : allow_remaining = true;
41253 : }
41254 :
41255 0 : return py_lsa_LookupSids2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
41256 : }
41257 :
41258 0 : static PyObject *py_lsa_LookupSids2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
41259 : {
41260 0 : const struct ndr_interface_call *call = NULL;
41261 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
41262 : PyObject *ret;
41263 : char *retstr;
41264 :
41265 0 : if (ndr_table_lsarpc.num_calls < 58) {
41266 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids2_ndr_print");
41267 0 : return NULL;
41268 : }
41269 0 : call = &ndr_table_lsarpc.calls[57];
41270 :
41271 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
41272 0 : ret = PyUnicode_FromString(retstr);
41273 0 : TALLOC_FREE(retstr);
41274 :
41275 0 : return ret;
41276 : }
41277 :
41278 0 : static PyObject *py_lsa_LookupSids2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41279 : {
41280 0 : return py_lsa_LookupSids2_ndr_print(py_obj, "lsa_LookupSids2_in", NDR_IN);
41281 : }
41282 :
41283 0 : static PyObject *py_lsa_LookupSids2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41284 : {
41285 0 : return py_lsa_LookupSids2_ndr_print(py_obj, "lsa_LookupSids2_out", NDR_OUT);
41286 : }
41287 :
41288 : static PyMethodDef py_lsa_LookupSids2_methods[] = {
41289 : { "opnum", (PyCFunction)py_lsa_LookupSids2_ndr_opnum, METH_NOARGS|METH_CLASS,
41290 : "lsa.LookupSids2.opnum() -> 57 (0x39) " },
41291 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
41292 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
41293 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
41294 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
41295 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
41296 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
41297 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
41298 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
41299 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupSids2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
41300 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupSids2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
41301 : { NULL, NULL, 0, NULL }
41302 : };
41303 :
41304 :
41305 : static PyTypeObject lsa_LookupSids2_Type = {
41306 : PyVarObject_HEAD_INIT(NULL, 0)
41307 : .tp_name = "lsa.LookupSids2",
41308 : .tp_getset = py_lsa_LookupSids2_getsetters,
41309 : .tp_methods = py_lsa_LookupSids2_methods,
41310 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
41311 : .tp_new = py_lsa_LookupSids2_new,
41312 : };
41313 :
41314 0 : static bool pack_py_lsa_LookupSids2_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids2 *r)
41315 : {
41316 : PyObject *py_handle;
41317 : PyObject *py_sids;
41318 : PyObject *py_names;
41319 : PyObject *py_level;
41320 : PyObject *py_count;
41321 : PyObject *py_lookup_options;
41322 : PyObject *py_client_revision;
41323 0 : const char *kwnames[] = {
41324 : "handle", "sids", "names", "level", "count", "lookup_options", "client_revision", NULL
41325 : };
41326 :
41327 0 : 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)) {
41328 0 : return false;
41329 : }
41330 :
41331 0 : if (py_handle == NULL) {
41332 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
41333 0 : return false;
41334 : }
41335 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
41336 0 : if (r->in.handle == NULL) {
41337 0 : PyErr_NoMemory();
41338 0 : return false;
41339 : }
41340 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
41341 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
41342 0 : PyErr_NoMemory();
41343 0 : return false;
41344 : }
41345 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
41346 0 : if (py_sids == NULL) {
41347 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
41348 0 : return false;
41349 : }
41350 0 : r->in.sids = talloc_ptrtype(r, r->in.sids);
41351 0 : if (r->in.sids == NULL) {
41352 0 : PyErr_NoMemory();
41353 0 : return false;
41354 : }
41355 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, py_sids, return false;);
41356 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
41357 0 : PyErr_NoMemory();
41358 0 : return false;
41359 : }
41360 0 : r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
41361 0 : if (py_names == NULL) {
41362 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
41363 0 : return false;
41364 : }
41365 0 : r->in.names = talloc_ptrtype(r, r->in.names);
41366 0 : if (r->in.names == NULL) {
41367 0 : PyErr_NoMemory();
41368 0 : return false;
41369 : }
41370 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, py_names, return false;);
41371 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_names)) == NULL) {
41372 0 : PyErr_NoMemory();
41373 0 : return false;
41374 : }
41375 0 : r->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_names);
41376 0 : if (py_level == NULL) {
41377 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
41378 0 : return false;
41379 : }
41380 : {
41381 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
41382 0 : if (PyLong_Check(py_level)) {
41383 : unsigned long long test_var;
41384 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
41385 0 : if (PyErr_Occurred() != NULL) {
41386 0 : return false;
41387 : }
41388 0 : if (test_var > uint_max) {
41389 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41390 : PyLong_Type.tp_name, uint_max, test_var);
41391 0 : return false;
41392 : }
41393 0 : r->in.level = test_var;
41394 : } else {
41395 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41396 : PyLong_Type.tp_name);
41397 0 : return false;
41398 : }
41399 : }
41400 0 : if (py_count == NULL) {
41401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
41402 0 : return false;
41403 : }
41404 0 : r->in.count = talloc_ptrtype(r, r->in.count);
41405 0 : if (r->in.count == NULL) {
41406 0 : PyErr_NoMemory();
41407 0 : return false;
41408 : }
41409 : {
41410 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
41411 0 : if (PyLong_Check(py_count)) {
41412 : unsigned long long test_var;
41413 0 : test_var = PyLong_AsUnsignedLongLong(py_count);
41414 0 : if (PyErr_Occurred() != NULL) {
41415 0 : return false;
41416 : }
41417 0 : if (test_var > uint_max) {
41418 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41419 : PyLong_Type.tp_name, uint_max, test_var);
41420 0 : return false;
41421 : }
41422 0 : *r->in.count = test_var;
41423 : } else {
41424 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41425 : PyLong_Type.tp_name);
41426 0 : return false;
41427 : }
41428 : }
41429 0 : if (py_lookup_options == NULL) {
41430 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lookup_options");
41431 0 : return false;
41432 : }
41433 : {
41434 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
41435 0 : if (PyLong_Check(py_lookup_options)) {
41436 : unsigned long long test_var;
41437 0 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
41438 0 : if (PyErr_Occurred() != NULL) {
41439 0 : return false;
41440 : }
41441 0 : if (test_var > uint_max) {
41442 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41443 : PyLong_Type.tp_name, uint_max, test_var);
41444 0 : return false;
41445 : }
41446 0 : r->in.lookup_options = test_var;
41447 : } else {
41448 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41449 : PyLong_Type.tp_name);
41450 0 : return false;
41451 : }
41452 : }
41453 0 : if (py_client_revision == NULL) {
41454 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_revision");
41455 0 : return false;
41456 : }
41457 : {
41458 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
41459 0 : if (PyLong_Check(py_client_revision)) {
41460 : unsigned long long test_var;
41461 0 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
41462 0 : if (PyErr_Occurred() != NULL) {
41463 0 : return false;
41464 : }
41465 0 : if (test_var > uint_max) {
41466 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41467 : PyLong_Type.tp_name, uint_max, test_var);
41468 0 : return false;
41469 : }
41470 0 : r->in.client_revision = test_var;
41471 : } else {
41472 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41473 : PyLong_Type.tp_name);
41474 0 : return false;
41475 : }
41476 : }
41477 0 : return true;
41478 : }
41479 :
41480 0 : static PyObject *unpack_py_lsa_LookupSids2_args_out(struct lsa_LookupSids2 *r)
41481 : {
41482 : PyObject *result;
41483 : PyObject *py_domains;
41484 : PyObject *py_names;
41485 : PyObject *py_count;
41486 0 : result = PyTuple_New(3);
41487 0 : if (*r->out.domains == NULL) {
41488 0 : py_domains = Py_None;
41489 0 : Py_INCREF(py_domains);
41490 : } else {
41491 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
41492 : }
41493 0 : PyTuple_SetItem(result, 0, py_domains);
41494 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, r->out.names, r->out.names);
41495 0 : PyTuple_SetItem(result, 1, py_names);
41496 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
41497 0 : PyTuple_SetItem(result, 2, py_count);
41498 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
41499 0 : PyErr_SetNTSTATUS(r->out.result);
41500 0 : return NULL;
41501 : }
41502 :
41503 0 : return result;
41504 : }
41505 :
41506 :
41507 0 : static PyObject *py_lsa_LookupNames2_in_get_handle(PyObject *obj, void *closure)
41508 : {
41509 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41510 : PyObject *py_handle;
41511 0 : if (object->in.handle == NULL) {
41512 0 : Py_RETURN_NONE;
41513 : }
41514 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
41515 0 : return py_handle;
41516 : }
41517 :
41518 0 : static int py_lsa_LookupNames2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
41519 : {
41520 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41521 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
41522 0 : if (value == NULL) {
41523 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
41524 0 : return -1;
41525 : }
41526 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
41527 0 : if (object->in.handle == NULL) {
41528 0 : PyErr_NoMemory();
41529 0 : return -1;
41530 : }
41531 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
41532 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41533 0 : PyErr_NoMemory();
41534 0 : return -1;
41535 : }
41536 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
41537 0 : return 0;
41538 : }
41539 :
41540 0 : static PyObject *py_lsa_LookupNames2_in_get_num_names(PyObject *obj, void *closure)
41541 : {
41542 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41543 : PyObject *py_num_names;
41544 0 : py_num_names = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_names);
41545 0 : return py_num_names;
41546 : }
41547 :
41548 0 : static int py_lsa_LookupNames2_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
41549 : {
41550 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41551 0 : if (value == NULL) {
41552 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_names");
41553 0 : return -1;
41554 : }
41555 : {
41556 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names));
41557 0 : if (PyLong_Check(value)) {
41558 : unsigned long long test_var;
41559 0 : test_var = PyLong_AsUnsignedLongLong(value);
41560 0 : if (PyErr_Occurred() != NULL) {
41561 0 : return -1;
41562 : }
41563 0 : if (test_var > uint_max) {
41564 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41565 : PyLong_Type.tp_name, uint_max, test_var);
41566 0 : return -1;
41567 : }
41568 0 : object->in.num_names = test_var;
41569 : } else {
41570 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41571 : PyLong_Type.tp_name);
41572 0 : return -1;
41573 : }
41574 : }
41575 0 : return 0;
41576 : }
41577 :
41578 0 : static PyObject *py_lsa_LookupNames2_in_get_names(PyObject *obj, void *closure)
41579 : {
41580 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41581 : PyObject *py_names;
41582 0 : py_names = PyList_New(object->in.num_names);
41583 0 : if (py_names == NULL) {
41584 0 : return NULL;
41585 : }
41586 : {
41587 : int names_cntr_0;
41588 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) {
41589 : PyObject *py_names_0;
41590 0 : py_names_0 = pytalloc_reference_ex(&lsa_String_Type, object->in.names, &object->in.names[names_cntr_0]);
41591 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
41592 : }
41593 : }
41594 0 : return py_names;
41595 : }
41596 :
41597 0 : static int py_lsa_LookupNames2_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
41598 : {
41599 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41600 0 : if (value == NULL) {
41601 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
41602 0 : return -1;
41603 : }
41604 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
41605 : {
41606 : int names_cntr_0;
41607 0 : object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value));
41608 0 : if (!object->in.names) { return -1;; }
41609 0 : talloc_set_name_const(object->in.names, "ARRAY: object->in.names");
41610 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
41611 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
41612 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names[names_cntr_0]");
41613 0 : return -1;
41614 : }
41615 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
41616 0 : if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
41617 0 : PyErr_NoMemory();
41618 0 : return -1;
41619 : }
41620 0 : object->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
41621 : }
41622 : }
41623 0 : return 0;
41624 : }
41625 :
41626 0 : static PyObject *py_lsa_LookupNames2_out_get_domains(PyObject *obj, void *closure)
41627 : {
41628 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41629 : PyObject *py_domains;
41630 0 : if (object->out.domains == NULL) {
41631 0 : Py_RETURN_NONE;
41632 : }
41633 0 : if (*object->out.domains == NULL) {
41634 0 : py_domains = Py_None;
41635 0 : Py_INCREF(py_domains);
41636 : } else {
41637 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
41638 : }
41639 0 : return py_domains;
41640 : }
41641 :
41642 0 : static int py_lsa_LookupNames2_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
41643 : {
41644 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41645 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
41646 0 : if (value == NULL) {
41647 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
41648 0 : return -1;
41649 : }
41650 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
41651 0 : if (object->out.domains == NULL) {
41652 0 : PyErr_NoMemory();
41653 0 : return -1;
41654 : }
41655 0 : if (value == Py_None) {
41656 0 : *object->out.domains = NULL;
41657 : } else {
41658 0 : *object->out.domains = NULL;
41659 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
41660 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41661 0 : PyErr_NoMemory();
41662 0 : return -1;
41663 : }
41664 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
41665 : }
41666 0 : return 0;
41667 : }
41668 :
41669 0 : static PyObject *py_lsa_LookupNames2_in_get_sids(PyObject *obj, void *closure)
41670 : {
41671 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41672 : PyObject *py_sids;
41673 0 : if (object->in.sids == NULL) {
41674 0 : Py_RETURN_NONE;
41675 : }
41676 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray2_Type, object->in.sids, object->in.sids);
41677 0 : return py_sids;
41678 : }
41679 :
41680 0 : static int py_lsa_LookupNames2_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
41681 : {
41682 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41683 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
41684 0 : if (value == NULL) {
41685 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
41686 0 : return -1;
41687 : }
41688 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
41689 0 : if (object->in.sids == NULL) {
41690 0 : PyErr_NoMemory();
41691 0 : return -1;
41692 : }
41693 0 : PY_CHECK_TYPE(&lsa_TransSidArray2_Type, value, return -1;);
41694 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41695 0 : PyErr_NoMemory();
41696 0 : return -1;
41697 : }
41698 0 : object->in.sids = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(value);
41699 0 : return 0;
41700 : }
41701 :
41702 0 : static PyObject *py_lsa_LookupNames2_out_get_sids(PyObject *obj, void *closure)
41703 : {
41704 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41705 : PyObject *py_sids;
41706 0 : if (object->out.sids == NULL) {
41707 0 : Py_RETURN_NONE;
41708 : }
41709 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray2_Type, object->out.sids, object->out.sids);
41710 0 : return py_sids;
41711 : }
41712 :
41713 0 : static int py_lsa_LookupNames2_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
41714 : {
41715 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41716 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
41717 0 : if (value == NULL) {
41718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
41719 0 : return -1;
41720 : }
41721 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
41722 0 : if (object->out.sids == NULL) {
41723 0 : PyErr_NoMemory();
41724 0 : return -1;
41725 : }
41726 0 : PY_CHECK_TYPE(&lsa_TransSidArray2_Type, value, return -1;);
41727 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41728 0 : PyErr_NoMemory();
41729 0 : return -1;
41730 : }
41731 0 : object->out.sids = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(value);
41732 0 : return 0;
41733 : }
41734 :
41735 0 : static PyObject *py_lsa_LookupNames2_in_get_level(PyObject *obj, void *closure)
41736 : {
41737 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41738 : PyObject *py_level;
41739 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
41740 0 : return py_level;
41741 : }
41742 :
41743 0 : static int py_lsa_LookupNames2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
41744 : {
41745 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41746 0 : if (value == NULL) {
41747 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
41748 0 : return -1;
41749 : }
41750 : {
41751 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
41752 0 : if (PyLong_Check(value)) {
41753 : unsigned long long test_var;
41754 0 : test_var = PyLong_AsUnsignedLongLong(value);
41755 0 : if (PyErr_Occurred() != NULL) {
41756 0 : return -1;
41757 : }
41758 0 : if (test_var > uint_max) {
41759 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41760 : PyLong_Type.tp_name, uint_max, test_var);
41761 0 : return -1;
41762 : }
41763 0 : object->in.level = test_var;
41764 : } else {
41765 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41766 : PyLong_Type.tp_name);
41767 0 : return -1;
41768 : }
41769 : }
41770 0 : return 0;
41771 : }
41772 :
41773 0 : static PyObject *py_lsa_LookupNames2_in_get_count(PyObject *obj, void *closure)
41774 : {
41775 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41776 : PyObject *py_count;
41777 0 : if (object->in.count == NULL) {
41778 0 : Py_RETURN_NONE;
41779 : }
41780 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
41781 0 : return py_count;
41782 : }
41783 :
41784 0 : static int py_lsa_LookupNames2_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
41785 : {
41786 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41787 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
41788 0 : if (value == NULL) {
41789 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
41790 0 : return -1;
41791 : }
41792 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
41793 0 : if (object->in.count == NULL) {
41794 0 : PyErr_NoMemory();
41795 0 : return -1;
41796 : }
41797 : {
41798 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
41799 0 : if (PyLong_Check(value)) {
41800 : unsigned long long test_var;
41801 0 : test_var = PyLong_AsUnsignedLongLong(value);
41802 0 : if (PyErr_Occurred() != NULL) {
41803 0 : return -1;
41804 : }
41805 0 : if (test_var > uint_max) {
41806 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41807 : PyLong_Type.tp_name, uint_max, test_var);
41808 0 : return -1;
41809 : }
41810 0 : *object->in.count = test_var;
41811 : } else {
41812 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41813 : PyLong_Type.tp_name);
41814 0 : return -1;
41815 : }
41816 : }
41817 0 : return 0;
41818 : }
41819 :
41820 0 : static PyObject *py_lsa_LookupNames2_out_get_count(PyObject *obj, void *closure)
41821 : {
41822 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41823 : PyObject *py_count;
41824 0 : if (object->out.count == NULL) {
41825 0 : Py_RETURN_NONE;
41826 : }
41827 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
41828 0 : return py_count;
41829 : }
41830 :
41831 0 : static int py_lsa_LookupNames2_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
41832 : {
41833 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41834 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
41835 0 : if (value == NULL) {
41836 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
41837 0 : return -1;
41838 : }
41839 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
41840 0 : if (object->out.count == NULL) {
41841 0 : PyErr_NoMemory();
41842 0 : return -1;
41843 : }
41844 : {
41845 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
41846 0 : if (PyLong_Check(value)) {
41847 : unsigned long long test_var;
41848 0 : test_var = PyLong_AsUnsignedLongLong(value);
41849 0 : if (PyErr_Occurred() != NULL) {
41850 0 : return -1;
41851 : }
41852 0 : if (test_var > uint_max) {
41853 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41854 : PyLong_Type.tp_name, uint_max, test_var);
41855 0 : return -1;
41856 : }
41857 0 : *object->out.count = test_var;
41858 : } else {
41859 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41860 : PyLong_Type.tp_name);
41861 0 : return -1;
41862 : }
41863 : }
41864 0 : return 0;
41865 : }
41866 :
41867 0 : static PyObject *py_lsa_LookupNames2_in_get_lookup_options(PyObject *obj, void *closure)
41868 : {
41869 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41870 : PyObject *py_lookup_options;
41871 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)object->in.lookup_options);
41872 0 : return py_lookup_options;
41873 : }
41874 :
41875 0 : static int py_lsa_LookupNames2_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
41876 : {
41877 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41878 0 : if (value == NULL) {
41879 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lookup_options");
41880 0 : return -1;
41881 : }
41882 : {
41883 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
41884 0 : if (PyLong_Check(value)) {
41885 : unsigned long long test_var;
41886 0 : test_var = PyLong_AsUnsignedLongLong(value);
41887 0 : if (PyErr_Occurred() != NULL) {
41888 0 : return -1;
41889 : }
41890 0 : if (test_var > uint_max) {
41891 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41892 : PyLong_Type.tp_name, uint_max, test_var);
41893 0 : return -1;
41894 : }
41895 0 : object->in.lookup_options = test_var;
41896 : } else {
41897 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41898 : PyLong_Type.tp_name);
41899 0 : return -1;
41900 : }
41901 : }
41902 0 : return 0;
41903 : }
41904 :
41905 0 : static PyObject *py_lsa_LookupNames2_in_get_client_revision(PyObject *obj, void *closure)
41906 : {
41907 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41908 : PyObject *py_client_revision;
41909 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)object->in.client_revision);
41910 0 : return py_client_revision;
41911 : }
41912 :
41913 0 : static int py_lsa_LookupNames2_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
41914 : {
41915 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41916 0 : if (value == NULL) {
41917 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_revision");
41918 0 : return -1;
41919 : }
41920 : {
41921 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
41922 0 : if (PyLong_Check(value)) {
41923 : unsigned long long test_var;
41924 0 : test_var = PyLong_AsUnsignedLongLong(value);
41925 0 : if (PyErr_Occurred() != NULL) {
41926 0 : return -1;
41927 : }
41928 0 : if (test_var > uint_max) {
41929 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41930 : PyLong_Type.tp_name, uint_max, test_var);
41931 0 : return -1;
41932 : }
41933 0 : object->in.client_revision = test_var;
41934 : } else {
41935 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41936 : PyLong_Type.tp_name);
41937 0 : return -1;
41938 : }
41939 : }
41940 0 : return 0;
41941 : }
41942 :
41943 0 : static PyObject *py_lsa_LookupNames2_get_result(PyObject *obj, void *closure)
41944 : {
41945 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41946 : PyObject *py_result;
41947 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
41948 0 : return py_result;
41949 : }
41950 :
41951 0 : static int py_lsa_LookupNames2_set_result(PyObject *py_obj, PyObject *value, void *closure)
41952 : {
41953 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41954 0 : if (value == NULL) {
41955 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
41956 0 : return -1;
41957 : }
41958 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
41959 0 : return 0;
41960 : }
41961 :
41962 : static PyGetSetDef py_lsa_LookupNames2_getsetters[] = {
41963 : {
41964 : .name = discard_const_p(char, "in_handle"),
41965 : .get = py_lsa_LookupNames2_in_get_handle,
41966 : .set = py_lsa_LookupNames2_in_set_handle,
41967 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
41968 : },
41969 : {
41970 : .name = discard_const_p(char, "in_num_names"),
41971 : .get = py_lsa_LookupNames2_in_get_num_names,
41972 : .set = py_lsa_LookupNames2_in_set_num_names,
41973 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
41974 : },
41975 : {
41976 : .name = discard_const_p(char, "in_names"),
41977 : .get = py_lsa_LookupNames2_in_get_names,
41978 : .set = py_lsa_LookupNames2_in_set_names,
41979 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
41980 : },
41981 : {
41982 : .name = discard_const_p(char, "out_domains"),
41983 : .get = py_lsa_LookupNames2_out_get_domains,
41984 : .set = py_lsa_LookupNames2_out_set_domains,
41985 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
41986 : },
41987 : {
41988 : .name = discard_const_p(char, "in_sids"),
41989 : .get = py_lsa_LookupNames2_in_get_sids,
41990 : .set = py_lsa_LookupNames2_in_set_sids,
41991 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray2")
41992 : },
41993 : {
41994 : .name = discard_const_p(char, "out_sids"),
41995 : .get = py_lsa_LookupNames2_out_get_sids,
41996 : .set = py_lsa_LookupNames2_out_set_sids,
41997 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray2")
41998 : },
41999 : {
42000 : .name = discard_const_p(char, "in_level"),
42001 : .get = py_lsa_LookupNames2_in_get_level,
42002 : .set = py_lsa_LookupNames2_in_set_level,
42003 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
42004 : },
42005 : {
42006 : .name = discard_const_p(char, "in_count"),
42007 : .get = py_lsa_LookupNames2_in_get_count,
42008 : .set = py_lsa_LookupNames2_in_set_count,
42009 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
42010 : },
42011 : {
42012 : .name = discard_const_p(char, "out_count"),
42013 : .get = py_lsa_LookupNames2_out_get_count,
42014 : .set = py_lsa_LookupNames2_out_set_count,
42015 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
42016 : },
42017 : {
42018 : .name = discard_const_p(char, "in_lookup_options"),
42019 : .get = py_lsa_LookupNames2_in_get_lookup_options,
42020 : .set = py_lsa_LookupNames2_in_set_lookup_options,
42021 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
42022 : },
42023 : {
42024 : .name = discard_const_p(char, "in_client_revision"),
42025 : .get = py_lsa_LookupNames2_in_get_client_revision,
42026 : .set = py_lsa_LookupNames2_in_set_client_revision,
42027 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
42028 : },
42029 : {
42030 : .name = discard_const_p(char, "result"),
42031 : .get = py_lsa_LookupNames2_get_result,
42032 : .set = py_lsa_LookupNames2_set_result,
42033 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
42034 : },
42035 : { .name = NULL }
42036 : };
42037 :
42038 0 : static PyObject *py_lsa_LookupNames2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
42039 : {
42040 0 : PyObject *self = pytalloc_new(struct lsa_LookupNames2, type);
42041 0 : struct lsa_LookupNames2 *_self = (struct lsa_LookupNames2 *)pytalloc_get_ptr(self);
42042 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
42043 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
42044 : /* a pointer to a NULL pointer */
42045 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
42046 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray2);
42047 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray2);
42048 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
42049 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
42050 0 : return self;
42051 : }
42052 :
42053 0 : static PyObject *py_lsa_LookupNames2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
42054 : {
42055 :
42056 :
42057 0 : return PyLong_FromLong(58);
42058 : }
42059 :
42060 0 : static PyObject *py_lsa_LookupNames2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
42061 : {
42062 0 : const struct ndr_interface_call *call = NULL;
42063 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
42064 0 : PyObject *ret = NULL;
42065 0 : struct ndr_push *push = NULL;
42066 : DATA_BLOB blob;
42067 : enum ndr_err_code err;
42068 :
42069 0 : if (ndr_table_lsarpc.num_calls < 59) {
42070 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames2_ndr_pack");
42071 0 : return NULL;
42072 : }
42073 0 : call = &ndr_table_lsarpc.calls[58];
42074 :
42075 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
42076 0 : if (push == NULL) {
42077 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42078 0 : return NULL;
42079 : }
42080 :
42081 0 : push->flags |= ndr_push_flags;
42082 :
42083 0 : err = call->ndr_push(push, ndr_inout_flags, object);
42084 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42085 0 : TALLOC_FREE(push);
42086 0 : PyErr_SetNdrError(err);
42087 0 : return NULL;
42088 : }
42089 0 : blob = ndr_push_blob(push);
42090 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
42091 0 : TALLOC_FREE(push);
42092 0 : return ret;
42093 : }
42094 :
42095 0 : static PyObject *py_lsa_LookupNames2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42096 : {
42097 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42098 0 : PyObject *bigendian_obj = NULL;
42099 0 : PyObject *ndr64_obj = NULL;
42100 0 : uint32_t ndr_push_flags = 0;
42101 :
42102 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
42103 : discard_const_p(char *, kwnames),
42104 : &bigendian_obj,
42105 : &ndr64_obj)) {
42106 0 : return NULL;
42107 : }
42108 :
42109 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42110 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42111 : }
42112 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42113 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42114 : }
42115 :
42116 0 : return py_lsa_LookupNames2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
42117 : }
42118 :
42119 0 : static PyObject *py_lsa_LookupNames2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42120 : {
42121 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42122 0 : PyObject *bigendian_obj = NULL;
42123 0 : PyObject *ndr64_obj = NULL;
42124 0 : uint32_t ndr_push_flags = 0;
42125 :
42126 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
42127 : discard_const_p(char *, kwnames),
42128 : &bigendian_obj,
42129 : &ndr64_obj)) {
42130 0 : return NULL;
42131 : }
42132 :
42133 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42134 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42135 : }
42136 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42137 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42138 : }
42139 :
42140 0 : return py_lsa_LookupNames2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
42141 : }
42142 :
42143 0 : static PyObject *py_lsa_LookupNames2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
42144 : {
42145 0 : const struct ndr_interface_call *call = NULL;
42146 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
42147 0 : struct ndr_pull *pull = NULL;
42148 : enum ndr_err_code err;
42149 :
42150 0 : if (ndr_table_lsarpc.num_calls < 59) {
42151 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames2_ndr_unpack");
42152 0 : return NULL;
42153 : }
42154 0 : call = &ndr_table_lsarpc.calls[58];
42155 :
42156 0 : pull = ndr_pull_init_blob(blob, object);
42157 0 : if (pull == NULL) {
42158 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42159 0 : return NULL;
42160 : }
42161 :
42162 0 : pull->flags |= ndr_pull_flags;
42163 :
42164 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
42165 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42166 0 : TALLOC_FREE(pull);
42167 0 : PyErr_SetNdrError(err);
42168 0 : return NULL;
42169 : }
42170 0 : if (!allow_remaining) {
42171 : uint32_t highest_ofs;
42172 :
42173 0 : if (pull->offset > pull->relative_highest_offset) {
42174 0 : highest_ofs = pull->offset;
42175 : } else {
42176 0 : highest_ofs = pull->relative_highest_offset;
42177 : }
42178 0 : if (highest_ofs < pull->data_size) {
42179 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
42180 : "not all bytes consumed ofs[%u] size[%u]",
42181 : highest_ofs, pull->data_size);
42182 0 : TALLOC_FREE(pull);
42183 0 : PyErr_SetNdrError(err);
42184 0 : return NULL;
42185 : }
42186 : }
42187 :
42188 0 : TALLOC_FREE(pull);
42189 0 : Py_RETURN_NONE;
42190 : }
42191 :
42192 0 : static PyObject *py_lsa_LookupNames2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42193 : {
42194 : DATA_BLOB blob;
42195 0 : Py_ssize_t blob_length = 0;
42196 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42197 0 : PyObject *bigendian_obj = NULL;
42198 0 : PyObject *ndr64_obj = NULL;
42199 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42200 0 : PyObject *allow_remaining_obj = NULL;
42201 0 : bool allow_remaining = false;
42202 :
42203 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
42204 : discard_const_p(char *, kwnames),
42205 : &blob.data, &blob_length,
42206 : &bigendian_obj,
42207 : &ndr64_obj,
42208 : &allow_remaining_obj)) {
42209 0 : return NULL;
42210 : }
42211 0 : blob.length = blob_length;
42212 :
42213 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42214 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42215 : }
42216 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42217 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42218 : }
42219 :
42220 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42221 0 : allow_remaining = true;
42222 : }
42223 :
42224 0 : return py_lsa_LookupNames2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
42225 : }
42226 :
42227 0 : static PyObject *py_lsa_LookupNames2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42228 : {
42229 : DATA_BLOB blob;
42230 0 : Py_ssize_t blob_length = 0;
42231 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42232 0 : PyObject *bigendian_obj = NULL;
42233 0 : PyObject *ndr64_obj = NULL;
42234 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42235 0 : PyObject *allow_remaining_obj = NULL;
42236 0 : bool allow_remaining = false;
42237 :
42238 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
42239 : discard_const_p(char *, kwnames),
42240 : &blob.data, &blob_length,
42241 : &bigendian_obj,
42242 : &ndr64_obj,
42243 : &allow_remaining_obj)) {
42244 0 : return NULL;
42245 : }
42246 0 : blob.length = blob_length;
42247 :
42248 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42249 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42250 : }
42251 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42252 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42253 : }
42254 :
42255 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42256 0 : allow_remaining = true;
42257 : }
42258 :
42259 0 : return py_lsa_LookupNames2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
42260 : }
42261 :
42262 0 : static PyObject *py_lsa_LookupNames2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
42263 : {
42264 0 : const struct ndr_interface_call *call = NULL;
42265 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
42266 : PyObject *ret;
42267 : char *retstr;
42268 :
42269 0 : if (ndr_table_lsarpc.num_calls < 59) {
42270 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames2_ndr_print");
42271 0 : return NULL;
42272 : }
42273 0 : call = &ndr_table_lsarpc.calls[58];
42274 :
42275 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
42276 0 : ret = PyUnicode_FromString(retstr);
42277 0 : TALLOC_FREE(retstr);
42278 :
42279 0 : return ret;
42280 : }
42281 :
42282 0 : static PyObject *py_lsa_LookupNames2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42283 : {
42284 0 : return py_lsa_LookupNames2_ndr_print(py_obj, "lsa_LookupNames2_in", NDR_IN);
42285 : }
42286 :
42287 0 : static PyObject *py_lsa_LookupNames2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42288 : {
42289 0 : return py_lsa_LookupNames2_ndr_print(py_obj, "lsa_LookupNames2_out", NDR_OUT);
42290 : }
42291 :
42292 : static PyMethodDef py_lsa_LookupNames2_methods[] = {
42293 : { "opnum", (PyCFunction)py_lsa_LookupNames2_ndr_opnum, METH_NOARGS|METH_CLASS,
42294 : "lsa.LookupNames2.opnum() -> 58 (0x3a) " },
42295 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
42296 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
42297 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
42298 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
42299 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
42300 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
42301 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
42302 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
42303 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupNames2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
42304 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupNames2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
42305 : { NULL, NULL, 0, NULL }
42306 : };
42307 :
42308 :
42309 : static PyTypeObject lsa_LookupNames2_Type = {
42310 : PyVarObject_HEAD_INIT(NULL, 0)
42311 : .tp_name = "lsa.LookupNames2",
42312 : .tp_getset = py_lsa_LookupNames2_getsetters,
42313 : .tp_methods = py_lsa_LookupNames2_methods,
42314 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
42315 : .tp_new = py_lsa_LookupNames2_new,
42316 : };
42317 :
42318 0 : static bool pack_py_lsa_LookupNames2_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames2 *r)
42319 : {
42320 : PyObject *py_handle;
42321 : PyObject *py_names;
42322 : PyObject *py_sids;
42323 : PyObject *py_level;
42324 : PyObject *py_count;
42325 : PyObject *py_lookup_options;
42326 : PyObject *py_client_revision;
42327 0 : const char *kwnames[] = {
42328 : "handle", "names", "sids", "level", "count", "lookup_options", "client_revision", NULL
42329 : };
42330 :
42331 0 : 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)) {
42332 0 : return false;
42333 : }
42334 :
42335 0 : if (py_handle == NULL) {
42336 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
42337 0 : return false;
42338 : }
42339 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
42340 0 : if (r->in.handle == NULL) {
42341 0 : PyErr_NoMemory();
42342 0 : return false;
42343 : }
42344 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
42345 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
42346 0 : PyErr_NoMemory();
42347 0 : return false;
42348 : }
42349 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
42350 0 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
42351 0 : r->in.num_names = PyList_GET_SIZE(py_names);
42352 0 : if (py_names == NULL) {
42353 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
42354 0 : return false;
42355 : }
42356 0 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
42357 : {
42358 : int names_cntr_0;
42359 0 : r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
42360 0 : if (!r->in.names) { return false;; }
42361 0 : talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
42362 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
42363 0 : if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) {
42364 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names[names_cntr_0]");
42365 0 : return false;
42366 : }
42367 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
42368 0 : if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
42369 0 : PyErr_NoMemory();
42370 0 : return false;
42371 : }
42372 0 : r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
42373 : }
42374 : }
42375 0 : if (py_sids == NULL) {
42376 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
42377 0 : return false;
42378 : }
42379 0 : r->in.sids = talloc_ptrtype(r, r->in.sids);
42380 0 : if (r->in.sids == NULL) {
42381 0 : PyErr_NoMemory();
42382 0 : return false;
42383 : }
42384 0 : PY_CHECK_TYPE(&lsa_TransSidArray2_Type, py_sids, return false;);
42385 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
42386 0 : PyErr_NoMemory();
42387 0 : return false;
42388 : }
42389 0 : r->in.sids = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(py_sids);
42390 0 : if (py_level == NULL) {
42391 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
42392 0 : return false;
42393 : }
42394 : {
42395 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
42396 0 : if (PyLong_Check(py_level)) {
42397 : unsigned long long test_var;
42398 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
42399 0 : if (PyErr_Occurred() != NULL) {
42400 0 : return false;
42401 : }
42402 0 : if (test_var > uint_max) {
42403 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42404 : PyLong_Type.tp_name, uint_max, test_var);
42405 0 : return false;
42406 : }
42407 0 : r->in.level = test_var;
42408 : } else {
42409 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42410 : PyLong_Type.tp_name);
42411 0 : return false;
42412 : }
42413 : }
42414 0 : if (py_count == NULL) {
42415 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
42416 0 : return false;
42417 : }
42418 0 : r->in.count = talloc_ptrtype(r, r->in.count);
42419 0 : if (r->in.count == NULL) {
42420 0 : PyErr_NoMemory();
42421 0 : return false;
42422 : }
42423 : {
42424 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
42425 0 : if (PyLong_Check(py_count)) {
42426 : unsigned long long test_var;
42427 0 : test_var = PyLong_AsUnsignedLongLong(py_count);
42428 0 : if (PyErr_Occurred() != NULL) {
42429 0 : return false;
42430 : }
42431 0 : if (test_var > uint_max) {
42432 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42433 : PyLong_Type.tp_name, uint_max, test_var);
42434 0 : return false;
42435 : }
42436 0 : *r->in.count = test_var;
42437 : } else {
42438 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42439 : PyLong_Type.tp_name);
42440 0 : return false;
42441 : }
42442 : }
42443 0 : if (py_lookup_options == NULL) {
42444 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lookup_options");
42445 0 : return false;
42446 : }
42447 : {
42448 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
42449 0 : if (PyLong_Check(py_lookup_options)) {
42450 : unsigned long long test_var;
42451 0 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
42452 0 : if (PyErr_Occurred() != NULL) {
42453 0 : return false;
42454 : }
42455 0 : if (test_var > uint_max) {
42456 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42457 : PyLong_Type.tp_name, uint_max, test_var);
42458 0 : return false;
42459 : }
42460 0 : r->in.lookup_options = test_var;
42461 : } else {
42462 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42463 : PyLong_Type.tp_name);
42464 0 : return false;
42465 : }
42466 : }
42467 0 : if (py_client_revision == NULL) {
42468 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_revision");
42469 0 : return false;
42470 : }
42471 : {
42472 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
42473 0 : if (PyLong_Check(py_client_revision)) {
42474 : unsigned long long test_var;
42475 0 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
42476 0 : if (PyErr_Occurred() != NULL) {
42477 0 : return false;
42478 : }
42479 0 : if (test_var > uint_max) {
42480 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42481 : PyLong_Type.tp_name, uint_max, test_var);
42482 0 : return false;
42483 : }
42484 0 : r->in.client_revision = test_var;
42485 : } else {
42486 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42487 : PyLong_Type.tp_name);
42488 0 : return false;
42489 : }
42490 : }
42491 0 : return true;
42492 : }
42493 :
42494 0 : static PyObject *unpack_py_lsa_LookupNames2_args_out(struct lsa_LookupNames2 *r)
42495 : {
42496 : PyObject *result;
42497 : PyObject *py_domains;
42498 : PyObject *py_sids;
42499 : PyObject *py_count;
42500 0 : result = PyTuple_New(3);
42501 0 : if (*r->out.domains == NULL) {
42502 0 : py_domains = Py_None;
42503 0 : Py_INCREF(py_domains);
42504 : } else {
42505 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
42506 : }
42507 0 : PyTuple_SetItem(result, 0, py_domains);
42508 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray2_Type, r->out.sids, r->out.sids);
42509 0 : PyTuple_SetItem(result, 1, py_sids);
42510 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
42511 0 : PyTuple_SetItem(result, 2, py_count);
42512 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
42513 0 : PyErr_SetNTSTATUS(r->out.result);
42514 0 : return NULL;
42515 : }
42516 :
42517 0 : return result;
42518 : }
42519 :
42520 :
42521 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_in_get_policy_handle(PyObject *obj, void *closure)
42522 : {
42523 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(obj);
42524 : PyObject *py_policy_handle;
42525 0 : if (object->in.policy_handle == NULL) {
42526 0 : Py_RETURN_NONE;
42527 : }
42528 0 : py_policy_handle = pytalloc_reference_ex(policy_handle_Type, object->in.policy_handle, object->in.policy_handle);
42529 0 : return py_policy_handle;
42530 : }
42531 :
42532 0 : static int py_lsa_CreateTrustedDomainEx2_in_set_policy_handle(PyObject *py_obj, PyObject *value, void *closure)
42533 : {
42534 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42535 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.policy_handle));
42536 0 : if (value == NULL) {
42537 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.policy_handle");
42538 0 : return -1;
42539 : }
42540 0 : object->in.policy_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.policy_handle);
42541 0 : if (object->in.policy_handle == NULL) {
42542 0 : PyErr_NoMemory();
42543 0 : return -1;
42544 : }
42545 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
42546 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42547 0 : PyErr_NoMemory();
42548 0 : return -1;
42549 : }
42550 0 : object->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(value);
42551 0 : return 0;
42552 : }
42553 :
42554 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_in_get_info(PyObject *obj, void *closure)
42555 : {
42556 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(obj);
42557 : PyObject *py_info;
42558 0 : if (object->in.info == NULL) {
42559 0 : Py_RETURN_NONE;
42560 : }
42561 0 : py_info = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, object->in.info, object->in.info);
42562 0 : return py_info;
42563 : }
42564 :
42565 0 : static int py_lsa_CreateTrustedDomainEx2_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
42566 : {
42567 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42568 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
42569 0 : if (value == NULL) {
42570 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
42571 0 : return -1;
42572 : }
42573 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
42574 0 : if (object->in.info == NULL) {
42575 0 : PyErr_NoMemory();
42576 0 : return -1;
42577 : }
42578 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
42579 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42580 0 : PyErr_NoMemory();
42581 0 : return -1;
42582 : }
42583 0 : object->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
42584 0 : return 0;
42585 : }
42586 :
42587 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_in_get_auth_info_internal(PyObject *obj, void *closure)
42588 : {
42589 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(obj);
42590 : PyObject *py_auth_info_internal;
42591 0 : if (object->in.auth_info_internal == NULL) {
42592 0 : Py_RETURN_NONE;
42593 : }
42594 0 : py_auth_info_internal = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternal_Type, object->in.auth_info_internal, object->in.auth_info_internal);
42595 0 : return py_auth_info_internal;
42596 : }
42597 :
42598 0 : static int py_lsa_CreateTrustedDomainEx2_in_set_auth_info_internal(PyObject *py_obj, PyObject *value, void *closure)
42599 : {
42600 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42601 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.auth_info_internal));
42602 0 : if (value == NULL) {
42603 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.auth_info_internal");
42604 0 : return -1;
42605 : }
42606 0 : object->in.auth_info_internal = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.auth_info_internal);
42607 0 : if (object->in.auth_info_internal == NULL) {
42608 0 : PyErr_NoMemory();
42609 0 : return -1;
42610 : }
42611 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, value, return -1;);
42612 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42613 0 : PyErr_NoMemory();
42614 0 : return -1;
42615 : }
42616 0 : object->in.auth_info_internal = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(value);
42617 0 : return 0;
42618 : }
42619 :
42620 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_in_get_access_mask(PyObject *obj, void *closure)
42621 : {
42622 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(obj);
42623 : PyObject *py_access_mask;
42624 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
42625 0 : return py_access_mask;
42626 : }
42627 :
42628 0 : static int py_lsa_CreateTrustedDomainEx2_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
42629 : {
42630 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42631 0 : if (value == NULL) {
42632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
42633 0 : return -1;
42634 : }
42635 : {
42636 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
42637 0 : if (PyLong_Check(value)) {
42638 : unsigned long long test_var;
42639 0 : test_var = PyLong_AsUnsignedLongLong(value);
42640 0 : if (PyErr_Occurred() != NULL) {
42641 0 : return -1;
42642 : }
42643 0 : if (test_var > uint_max) {
42644 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42645 : PyLong_Type.tp_name, uint_max, test_var);
42646 0 : return -1;
42647 : }
42648 0 : object->in.access_mask = test_var;
42649 : } else {
42650 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42651 : PyLong_Type.tp_name);
42652 0 : return -1;
42653 : }
42654 : }
42655 0 : return 0;
42656 : }
42657 :
42658 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_out_get_trustdom_handle(PyObject *obj, void *closure)
42659 : {
42660 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(obj);
42661 : PyObject *py_trustdom_handle;
42662 0 : if (object->out.trustdom_handle == NULL) {
42663 0 : Py_RETURN_NONE;
42664 : }
42665 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
42666 0 : return py_trustdom_handle;
42667 : }
42668 :
42669 0 : static int py_lsa_CreateTrustedDomainEx2_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
42670 : {
42671 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42672 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
42673 0 : if (value == NULL) {
42674 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trustdom_handle");
42675 0 : return -1;
42676 : }
42677 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
42678 0 : if (object->out.trustdom_handle == NULL) {
42679 0 : PyErr_NoMemory();
42680 0 : return -1;
42681 : }
42682 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
42683 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42684 0 : PyErr_NoMemory();
42685 0 : return -1;
42686 : }
42687 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
42688 0 : return 0;
42689 : }
42690 :
42691 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_get_result(PyObject *obj, void *closure)
42692 : {
42693 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(obj);
42694 : PyObject *py_result;
42695 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
42696 0 : return py_result;
42697 : }
42698 :
42699 0 : static int py_lsa_CreateTrustedDomainEx2_set_result(PyObject *py_obj, PyObject *value, void *closure)
42700 : {
42701 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42702 0 : if (value == NULL) {
42703 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
42704 0 : return -1;
42705 : }
42706 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
42707 0 : return 0;
42708 : }
42709 :
42710 : static PyGetSetDef py_lsa_CreateTrustedDomainEx2_getsetters[] = {
42711 : {
42712 : .name = discard_const_p(char, "in_policy_handle"),
42713 : .get = py_lsa_CreateTrustedDomainEx2_in_get_policy_handle,
42714 : .set = py_lsa_CreateTrustedDomainEx2_in_set_policy_handle,
42715 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
42716 : },
42717 : {
42718 : .name = discard_const_p(char, "in_info"),
42719 : .get = py_lsa_CreateTrustedDomainEx2_in_get_info,
42720 : .set = py_lsa_CreateTrustedDomainEx2_in_set_info,
42721 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
42722 : },
42723 : {
42724 : .name = discard_const_p(char, "in_auth_info_internal"),
42725 : .get = py_lsa_CreateTrustedDomainEx2_in_get_auth_info_internal,
42726 : .set = py_lsa_CreateTrustedDomainEx2_in_set_auth_info_internal,
42727 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfoInternal")
42728 : },
42729 : {
42730 : .name = discard_const_p(char, "in_access_mask"),
42731 : .get = py_lsa_CreateTrustedDomainEx2_in_get_access_mask,
42732 : .set = py_lsa_CreateTrustedDomainEx2_in_set_access_mask,
42733 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
42734 : },
42735 : {
42736 : .name = discard_const_p(char, "out_trustdom_handle"),
42737 : .get = py_lsa_CreateTrustedDomainEx2_out_get_trustdom_handle,
42738 : .set = py_lsa_CreateTrustedDomainEx2_out_set_trustdom_handle,
42739 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
42740 : },
42741 : {
42742 : .name = discard_const_p(char, "result"),
42743 : .get = py_lsa_CreateTrustedDomainEx2_get_result,
42744 : .set = py_lsa_CreateTrustedDomainEx2_set_result,
42745 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
42746 : },
42747 : { .name = NULL }
42748 : };
42749 :
42750 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
42751 : {
42752 0 : PyObject *self = pytalloc_new(struct lsa_CreateTrustedDomainEx2, type);
42753 0 : struct lsa_CreateTrustedDomainEx2 *_self = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(self);
42754 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
42755 0 : _self->in.policy_handle = talloc_zero(mem_ctx, struct policy_handle);
42756 0 : _self->in.info = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoInfoEx);
42757 0 : _self->in.auth_info_internal = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoAuthInfoInternal);
42758 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
42759 0 : return self;
42760 : }
42761 :
42762 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
42763 : {
42764 :
42765 :
42766 0 : return PyLong_FromLong(59);
42767 : }
42768 :
42769 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
42770 : {
42771 0 : const struct ndr_interface_call *call = NULL;
42772 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42773 0 : PyObject *ret = NULL;
42774 0 : struct ndr_push *push = NULL;
42775 : DATA_BLOB blob;
42776 : enum ndr_err_code err;
42777 :
42778 0 : if (ndr_table_lsarpc.num_calls < 60) {
42779 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx2_ndr_pack");
42780 0 : return NULL;
42781 : }
42782 0 : call = &ndr_table_lsarpc.calls[59];
42783 :
42784 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
42785 0 : if (push == NULL) {
42786 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42787 0 : return NULL;
42788 : }
42789 :
42790 0 : push->flags |= ndr_push_flags;
42791 :
42792 0 : err = call->ndr_push(push, ndr_inout_flags, object);
42793 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42794 0 : TALLOC_FREE(push);
42795 0 : PyErr_SetNdrError(err);
42796 0 : return NULL;
42797 : }
42798 0 : blob = ndr_push_blob(push);
42799 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
42800 0 : TALLOC_FREE(push);
42801 0 : return ret;
42802 : }
42803 :
42804 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42805 : {
42806 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42807 0 : PyObject *bigendian_obj = NULL;
42808 0 : PyObject *ndr64_obj = NULL;
42809 0 : uint32_t ndr_push_flags = 0;
42810 :
42811 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
42812 : discard_const_p(char *, kwnames),
42813 : &bigendian_obj,
42814 : &ndr64_obj)) {
42815 0 : return NULL;
42816 : }
42817 :
42818 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42819 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42820 : }
42821 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42822 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42823 : }
42824 :
42825 0 : return py_lsa_CreateTrustedDomainEx2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
42826 : }
42827 :
42828 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42829 : {
42830 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42831 0 : PyObject *bigendian_obj = NULL;
42832 0 : PyObject *ndr64_obj = NULL;
42833 0 : uint32_t ndr_push_flags = 0;
42834 :
42835 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
42836 : discard_const_p(char *, kwnames),
42837 : &bigendian_obj,
42838 : &ndr64_obj)) {
42839 0 : return NULL;
42840 : }
42841 :
42842 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42843 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42844 : }
42845 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42846 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42847 : }
42848 :
42849 0 : return py_lsa_CreateTrustedDomainEx2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
42850 : }
42851 :
42852 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
42853 : {
42854 0 : const struct ndr_interface_call *call = NULL;
42855 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42856 0 : struct ndr_pull *pull = NULL;
42857 : enum ndr_err_code err;
42858 :
42859 0 : if (ndr_table_lsarpc.num_calls < 60) {
42860 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx2_ndr_unpack");
42861 0 : return NULL;
42862 : }
42863 0 : call = &ndr_table_lsarpc.calls[59];
42864 :
42865 0 : pull = ndr_pull_init_blob(blob, object);
42866 0 : if (pull == NULL) {
42867 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42868 0 : return NULL;
42869 : }
42870 :
42871 0 : pull->flags |= ndr_pull_flags;
42872 :
42873 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
42874 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42875 0 : TALLOC_FREE(pull);
42876 0 : PyErr_SetNdrError(err);
42877 0 : return NULL;
42878 : }
42879 0 : if (!allow_remaining) {
42880 : uint32_t highest_ofs;
42881 :
42882 0 : if (pull->offset > pull->relative_highest_offset) {
42883 0 : highest_ofs = pull->offset;
42884 : } else {
42885 0 : highest_ofs = pull->relative_highest_offset;
42886 : }
42887 0 : if (highest_ofs < pull->data_size) {
42888 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
42889 : "not all bytes consumed ofs[%u] size[%u]",
42890 : highest_ofs, pull->data_size);
42891 0 : TALLOC_FREE(pull);
42892 0 : PyErr_SetNdrError(err);
42893 0 : return NULL;
42894 : }
42895 : }
42896 :
42897 0 : TALLOC_FREE(pull);
42898 0 : Py_RETURN_NONE;
42899 : }
42900 :
42901 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42902 : {
42903 : DATA_BLOB blob;
42904 0 : Py_ssize_t blob_length = 0;
42905 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42906 0 : PyObject *bigendian_obj = NULL;
42907 0 : PyObject *ndr64_obj = NULL;
42908 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42909 0 : PyObject *allow_remaining_obj = NULL;
42910 0 : bool allow_remaining = false;
42911 :
42912 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
42913 : discard_const_p(char *, kwnames),
42914 : &blob.data, &blob_length,
42915 : &bigendian_obj,
42916 : &ndr64_obj,
42917 : &allow_remaining_obj)) {
42918 0 : return NULL;
42919 : }
42920 0 : blob.length = blob_length;
42921 :
42922 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42923 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42924 : }
42925 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42926 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42927 : }
42928 :
42929 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42930 0 : allow_remaining = true;
42931 : }
42932 :
42933 0 : return py_lsa_CreateTrustedDomainEx2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
42934 : }
42935 :
42936 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42937 : {
42938 : DATA_BLOB blob;
42939 0 : Py_ssize_t blob_length = 0;
42940 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42941 0 : PyObject *bigendian_obj = NULL;
42942 0 : PyObject *ndr64_obj = NULL;
42943 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42944 0 : PyObject *allow_remaining_obj = NULL;
42945 0 : bool allow_remaining = false;
42946 :
42947 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
42948 : discard_const_p(char *, kwnames),
42949 : &blob.data, &blob_length,
42950 : &bigendian_obj,
42951 : &ndr64_obj,
42952 : &allow_remaining_obj)) {
42953 0 : return NULL;
42954 : }
42955 0 : blob.length = blob_length;
42956 :
42957 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42958 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42959 : }
42960 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42961 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42962 : }
42963 :
42964 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42965 0 : allow_remaining = true;
42966 : }
42967 :
42968 0 : return py_lsa_CreateTrustedDomainEx2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
42969 : }
42970 :
42971 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
42972 : {
42973 0 : const struct ndr_interface_call *call = NULL;
42974 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42975 : PyObject *ret;
42976 : char *retstr;
42977 :
42978 0 : if (ndr_table_lsarpc.num_calls < 60) {
42979 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx2_ndr_print");
42980 0 : return NULL;
42981 : }
42982 0 : call = &ndr_table_lsarpc.calls[59];
42983 :
42984 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
42985 0 : ret = PyUnicode_FromString(retstr);
42986 0 : TALLOC_FREE(retstr);
42987 :
42988 0 : return ret;
42989 : }
42990 :
42991 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42992 : {
42993 0 : return py_lsa_CreateTrustedDomainEx2_ndr_print(py_obj, "lsa_CreateTrustedDomainEx2_in", NDR_IN);
42994 : }
42995 :
42996 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42997 : {
42998 0 : return py_lsa_CreateTrustedDomainEx2_ndr_print(py_obj, "lsa_CreateTrustedDomainEx2_out", NDR_OUT);
42999 : }
43000 :
43001 : static PyMethodDef py_lsa_CreateTrustedDomainEx2_methods[] = {
43002 : { "opnum", (PyCFunction)py_lsa_CreateTrustedDomainEx2_ndr_opnum, METH_NOARGS|METH_CLASS,
43003 : "lsa.CreateTrustedDomainEx2.opnum() -> 59 (0x3b) " },
43004 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
43005 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
43006 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
43007 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
43008 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
43009 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
43010 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
43011 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
43012 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateTrustedDomainEx2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
43013 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateTrustedDomainEx2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
43014 : { NULL, NULL, 0, NULL }
43015 : };
43016 :
43017 :
43018 : static PyTypeObject lsa_CreateTrustedDomainEx2_Type = {
43019 : PyVarObject_HEAD_INIT(NULL, 0)
43020 : .tp_name = "lsa.CreateTrustedDomainEx2",
43021 : .tp_getset = py_lsa_CreateTrustedDomainEx2_getsetters,
43022 : .tp_methods = py_lsa_CreateTrustedDomainEx2_methods,
43023 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
43024 : .tp_new = py_lsa_CreateTrustedDomainEx2_new,
43025 : };
43026 :
43027 22 : static bool pack_py_lsa_CreateTrustedDomainEx2_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomainEx2 *r)
43028 : {
43029 : PyObject *py_policy_handle;
43030 : PyObject *py_info;
43031 : PyObject *py_auth_info_internal;
43032 : PyObject *py_access_mask;
43033 22 : const char *kwnames[] = {
43034 : "policy_handle", "info", "auth_info_internal", "access_mask", NULL
43035 : };
43036 :
43037 22 : 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)) {
43038 0 : return false;
43039 : }
43040 :
43041 22 : if (py_policy_handle == NULL) {
43042 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.policy_handle");
43043 0 : return false;
43044 : }
43045 22 : r->in.policy_handle = talloc_ptrtype(r, r->in.policy_handle);
43046 22 : if (r->in.policy_handle == NULL) {
43047 0 : PyErr_NoMemory();
43048 0 : return false;
43049 : }
43050 22 : PY_CHECK_TYPE(policy_handle_Type, py_policy_handle, return false;);
43051 22 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_policy_handle)) == NULL) {
43052 0 : PyErr_NoMemory();
43053 0 : return false;
43054 : }
43055 22 : r->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(py_policy_handle);
43056 22 : if (py_info == NULL) {
43057 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
43058 0 : return false;
43059 : }
43060 22 : r->in.info = talloc_ptrtype(r, r->in.info);
43061 22 : if (r->in.info == NULL) {
43062 0 : PyErr_NoMemory();
43063 0 : return false;
43064 : }
43065 22 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, py_info, return false;);
43066 22 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
43067 0 : PyErr_NoMemory();
43068 0 : return false;
43069 : }
43070 22 : r->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_info);
43071 22 : if (py_auth_info_internal == NULL) {
43072 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.auth_info_internal");
43073 0 : return false;
43074 : }
43075 22 : r->in.auth_info_internal = talloc_ptrtype(r, r->in.auth_info_internal);
43076 22 : if (r->in.auth_info_internal == NULL) {
43077 0 : PyErr_NoMemory();
43078 0 : return false;
43079 : }
43080 22 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, py_auth_info_internal, return false;);
43081 22 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_auth_info_internal)) == NULL) {
43082 0 : PyErr_NoMemory();
43083 0 : return false;
43084 : }
43085 22 : r->in.auth_info_internal = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(py_auth_info_internal);
43086 22 : if (py_access_mask == NULL) {
43087 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
43088 0 : return false;
43089 : }
43090 : {
43091 22 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
43092 22 : if (PyLong_Check(py_access_mask)) {
43093 : unsigned long long test_var;
43094 22 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
43095 22 : if (PyErr_Occurred() != NULL) {
43096 0 : return false;
43097 : }
43098 22 : if (test_var > uint_max) {
43099 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43100 : PyLong_Type.tp_name, uint_max, test_var);
43101 0 : return false;
43102 : }
43103 22 : r->in.access_mask = test_var;
43104 : } else {
43105 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43106 : PyLong_Type.tp_name);
43107 0 : return false;
43108 : }
43109 : }
43110 22 : return true;
43111 : }
43112 :
43113 22 : static PyObject *unpack_py_lsa_CreateTrustedDomainEx2_args_out(struct lsa_CreateTrustedDomainEx2 *r)
43114 : {
43115 : PyObject *result;
43116 : PyObject *py_trustdom_handle;
43117 22 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
43118 22 : result = py_trustdom_handle;
43119 22 : if (NT_STATUS_IS_ERR(r->out.result)) {
43120 0 : PyErr_SetNTSTATUS(r->out.result);
43121 0 : return NULL;
43122 : }
43123 :
43124 22 : return result;
43125 : }
43126 :
43127 :
43128 0 : static PyObject *py_lsa_LookupNames3_in_get_handle(PyObject *obj, void *closure)
43129 : {
43130 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43131 : PyObject *py_handle;
43132 0 : if (object->in.handle == NULL) {
43133 0 : Py_RETURN_NONE;
43134 : }
43135 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
43136 0 : return py_handle;
43137 : }
43138 :
43139 0 : static int py_lsa_LookupNames3_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
43140 : {
43141 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43142 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
43143 0 : if (value == NULL) {
43144 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
43145 0 : return -1;
43146 : }
43147 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
43148 0 : if (object->in.handle == NULL) {
43149 0 : PyErr_NoMemory();
43150 0 : return -1;
43151 : }
43152 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
43153 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43154 0 : PyErr_NoMemory();
43155 0 : return -1;
43156 : }
43157 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
43158 0 : return 0;
43159 : }
43160 :
43161 0 : static PyObject *py_lsa_LookupNames3_in_get_num_names(PyObject *obj, void *closure)
43162 : {
43163 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43164 : PyObject *py_num_names;
43165 0 : py_num_names = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_names);
43166 0 : return py_num_names;
43167 : }
43168 :
43169 0 : static int py_lsa_LookupNames3_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
43170 : {
43171 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43172 0 : if (value == NULL) {
43173 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_names");
43174 0 : return -1;
43175 : }
43176 : {
43177 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names));
43178 0 : if (PyLong_Check(value)) {
43179 : unsigned long long test_var;
43180 0 : test_var = PyLong_AsUnsignedLongLong(value);
43181 0 : if (PyErr_Occurred() != NULL) {
43182 0 : return -1;
43183 : }
43184 0 : if (test_var > uint_max) {
43185 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43186 : PyLong_Type.tp_name, uint_max, test_var);
43187 0 : return -1;
43188 : }
43189 0 : object->in.num_names = test_var;
43190 : } else {
43191 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43192 : PyLong_Type.tp_name);
43193 0 : return -1;
43194 : }
43195 : }
43196 0 : return 0;
43197 : }
43198 :
43199 0 : static PyObject *py_lsa_LookupNames3_in_get_names(PyObject *obj, void *closure)
43200 : {
43201 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43202 : PyObject *py_names;
43203 0 : py_names = PyList_New(object->in.num_names);
43204 0 : if (py_names == NULL) {
43205 0 : return NULL;
43206 : }
43207 : {
43208 : int names_cntr_0;
43209 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) {
43210 : PyObject *py_names_0;
43211 0 : py_names_0 = pytalloc_reference_ex(&lsa_String_Type, object->in.names, &object->in.names[names_cntr_0]);
43212 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
43213 : }
43214 : }
43215 0 : return py_names;
43216 : }
43217 :
43218 0 : static int py_lsa_LookupNames3_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
43219 : {
43220 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43221 0 : if (value == NULL) {
43222 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
43223 0 : return -1;
43224 : }
43225 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
43226 : {
43227 : int names_cntr_0;
43228 0 : object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value));
43229 0 : if (!object->in.names) { return -1;; }
43230 0 : talloc_set_name_const(object->in.names, "ARRAY: object->in.names");
43231 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
43232 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
43233 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names[names_cntr_0]");
43234 0 : return -1;
43235 : }
43236 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
43237 0 : if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
43238 0 : PyErr_NoMemory();
43239 0 : return -1;
43240 : }
43241 0 : object->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
43242 : }
43243 : }
43244 0 : return 0;
43245 : }
43246 :
43247 0 : static PyObject *py_lsa_LookupNames3_out_get_domains(PyObject *obj, void *closure)
43248 : {
43249 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43250 : PyObject *py_domains;
43251 0 : if (object->out.domains == NULL) {
43252 0 : Py_RETURN_NONE;
43253 : }
43254 0 : if (*object->out.domains == NULL) {
43255 0 : py_domains = Py_None;
43256 0 : Py_INCREF(py_domains);
43257 : } else {
43258 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
43259 : }
43260 0 : return py_domains;
43261 : }
43262 :
43263 0 : static int py_lsa_LookupNames3_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
43264 : {
43265 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43266 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
43267 0 : if (value == NULL) {
43268 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
43269 0 : return -1;
43270 : }
43271 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
43272 0 : if (object->out.domains == NULL) {
43273 0 : PyErr_NoMemory();
43274 0 : return -1;
43275 : }
43276 0 : if (value == Py_None) {
43277 0 : *object->out.domains = NULL;
43278 : } else {
43279 0 : *object->out.domains = NULL;
43280 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
43281 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43282 0 : PyErr_NoMemory();
43283 0 : return -1;
43284 : }
43285 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
43286 : }
43287 0 : return 0;
43288 : }
43289 :
43290 0 : static PyObject *py_lsa_LookupNames3_in_get_sids(PyObject *obj, void *closure)
43291 : {
43292 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43293 : PyObject *py_sids;
43294 0 : if (object->in.sids == NULL) {
43295 0 : Py_RETURN_NONE;
43296 : }
43297 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, object->in.sids, object->in.sids);
43298 0 : return py_sids;
43299 : }
43300 :
43301 0 : static int py_lsa_LookupNames3_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
43302 : {
43303 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43304 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
43305 0 : if (value == NULL) {
43306 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
43307 0 : return -1;
43308 : }
43309 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
43310 0 : if (object->in.sids == NULL) {
43311 0 : PyErr_NoMemory();
43312 0 : return -1;
43313 : }
43314 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, value, return -1;);
43315 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43316 0 : PyErr_NoMemory();
43317 0 : return -1;
43318 : }
43319 0 : object->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(value);
43320 0 : return 0;
43321 : }
43322 :
43323 0 : static PyObject *py_lsa_LookupNames3_out_get_sids(PyObject *obj, void *closure)
43324 : {
43325 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43326 : PyObject *py_sids;
43327 0 : if (object->out.sids == NULL) {
43328 0 : Py_RETURN_NONE;
43329 : }
43330 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, object->out.sids, object->out.sids);
43331 0 : return py_sids;
43332 : }
43333 :
43334 0 : static int py_lsa_LookupNames3_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
43335 : {
43336 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43337 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
43338 0 : if (value == NULL) {
43339 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
43340 0 : return -1;
43341 : }
43342 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
43343 0 : if (object->out.sids == NULL) {
43344 0 : PyErr_NoMemory();
43345 0 : return -1;
43346 : }
43347 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, value, return -1;);
43348 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43349 0 : PyErr_NoMemory();
43350 0 : return -1;
43351 : }
43352 0 : object->out.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(value);
43353 0 : return 0;
43354 : }
43355 :
43356 0 : static PyObject *py_lsa_LookupNames3_in_get_level(PyObject *obj, void *closure)
43357 : {
43358 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43359 : PyObject *py_level;
43360 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
43361 0 : return py_level;
43362 : }
43363 :
43364 0 : static int py_lsa_LookupNames3_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
43365 : {
43366 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43367 0 : if (value == NULL) {
43368 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
43369 0 : return -1;
43370 : }
43371 : {
43372 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
43373 0 : if (PyLong_Check(value)) {
43374 : unsigned long long test_var;
43375 0 : test_var = PyLong_AsUnsignedLongLong(value);
43376 0 : if (PyErr_Occurred() != NULL) {
43377 0 : return -1;
43378 : }
43379 0 : if (test_var > uint_max) {
43380 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43381 : PyLong_Type.tp_name, uint_max, test_var);
43382 0 : return -1;
43383 : }
43384 0 : object->in.level = test_var;
43385 : } else {
43386 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43387 : PyLong_Type.tp_name);
43388 0 : return -1;
43389 : }
43390 : }
43391 0 : return 0;
43392 : }
43393 :
43394 0 : static PyObject *py_lsa_LookupNames3_in_get_count(PyObject *obj, void *closure)
43395 : {
43396 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43397 : PyObject *py_count;
43398 0 : if (object->in.count == NULL) {
43399 0 : Py_RETURN_NONE;
43400 : }
43401 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
43402 0 : return py_count;
43403 : }
43404 :
43405 0 : static int py_lsa_LookupNames3_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
43406 : {
43407 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43408 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
43409 0 : if (value == NULL) {
43410 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
43411 0 : return -1;
43412 : }
43413 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
43414 0 : if (object->in.count == NULL) {
43415 0 : PyErr_NoMemory();
43416 0 : return -1;
43417 : }
43418 : {
43419 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
43420 0 : if (PyLong_Check(value)) {
43421 : unsigned long long test_var;
43422 0 : test_var = PyLong_AsUnsignedLongLong(value);
43423 0 : if (PyErr_Occurred() != NULL) {
43424 0 : return -1;
43425 : }
43426 0 : if (test_var > uint_max) {
43427 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43428 : PyLong_Type.tp_name, uint_max, test_var);
43429 0 : return -1;
43430 : }
43431 0 : *object->in.count = test_var;
43432 : } else {
43433 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43434 : PyLong_Type.tp_name);
43435 0 : return -1;
43436 : }
43437 : }
43438 0 : return 0;
43439 : }
43440 :
43441 0 : static PyObject *py_lsa_LookupNames3_out_get_count(PyObject *obj, void *closure)
43442 : {
43443 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43444 : PyObject *py_count;
43445 0 : if (object->out.count == NULL) {
43446 0 : Py_RETURN_NONE;
43447 : }
43448 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
43449 0 : return py_count;
43450 : }
43451 :
43452 0 : static int py_lsa_LookupNames3_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
43453 : {
43454 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43455 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
43456 0 : if (value == NULL) {
43457 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
43458 0 : return -1;
43459 : }
43460 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
43461 0 : if (object->out.count == NULL) {
43462 0 : PyErr_NoMemory();
43463 0 : return -1;
43464 : }
43465 : {
43466 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
43467 0 : if (PyLong_Check(value)) {
43468 : unsigned long long test_var;
43469 0 : test_var = PyLong_AsUnsignedLongLong(value);
43470 0 : if (PyErr_Occurred() != NULL) {
43471 0 : return -1;
43472 : }
43473 0 : if (test_var > uint_max) {
43474 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43475 : PyLong_Type.tp_name, uint_max, test_var);
43476 0 : return -1;
43477 : }
43478 0 : *object->out.count = test_var;
43479 : } else {
43480 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43481 : PyLong_Type.tp_name);
43482 0 : return -1;
43483 : }
43484 : }
43485 0 : return 0;
43486 : }
43487 :
43488 0 : static PyObject *py_lsa_LookupNames3_in_get_lookup_options(PyObject *obj, void *closure)
43489 : {
43490 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43491 : PyObject *py_lookup_options;
43492 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)object->in.lookup_options);
43493 0 : return py_lookup_options;
43494 : }
43495 :
43496 0 : static int py_lsa_LookupNames3_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
43497 : {
43498 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43499 0 : if (value == NULL) {
43500 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lookup_options");
43501 0 : return -1;
43502 : }
43503 : {
43504 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
43505 0 : if (PyLong_Check(value)) {
43506 : unsigned long long test_var;
43507 0 : test_var = PyLong_AsUnsignedLongLong(value);
43508 0 : if (PyErr_Occurred() != NULL) {
43509 0 : return -1;
43510 : }
43511 0 : if (test_var > uint_max) {
43512 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43513 : PyLong_Type.tp_name, uint_max, test_var);
43514 0 : return -1;
43515 : }
43516 0 : object->in.lookup_options = test_var;
43517 : } else {
43518 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43519 : PyLong_Type.tp_name);
43520 0 : return -1;
43521 : }
43522 : }
43523 0 : return 0;
43524 : }
43525 :
43526 0 : static PyObject *py_lsa_LookupNames3_in_get_client_revision(PyObject *obj, void *closure)
43527 : {
43528 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43529 : PyObject *py_client_revision;
43530 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)object->in.client_revision);
43531 0 : return py_client_revision;
43532 : }
43533 :
43534 0 : static int py_lsa_LookupNames3_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
43535 : {
43536 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43537 0 : if (value == NULL) {
43538 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_revision");
43539 0 : return -1;
43540 : }
43541 : {
43542 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
43543 0 : if (PyLong_Check(value)) {
43544 : unsigned long long test_var;
43545 0 : test_var = PyLong_AsUnsignedLongLong(value);
43546 0 : if (PyErr_Occurred() != NULL) {
43547 0 : return -1;
43548 : }
43549 0 : if (test_var > uint_max) {
43550 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43551 : PyLong_Type.tp_name, uint_max, test_var);
43552 0 : return -1;
43553 : }
43554 0 : object->in.client_revision = test_var;
43555 : } else {
43556 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43557 : PyLong_Type.tp_name);
43558 0 : return -1;
43559 : }
43560 : }
43561 0 : return 0;
43562 : }
43563 :
43564 0 : static PyObject *py_lsa_LookupNames3_get_result(PyObject *obj, void *closure)
43565 : {
43566 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43567 : PyObject *py_result;
43568 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
43569 0 : return py_result;
43570 : }
43571 :
43572 0 : static int py_lsa_LookupNames3_set_result(PyObject *py_obj, PyObject *value, void *closure)
43573 : {
43574 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43575 0 : if (value == NULL) {
43576 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
43577 0 : return -1;
43578 : }
43579 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
43580 0 : return 0;
43581 : }
43582 :
43583 : static PyGetSetDef py_lsa_LookupNames3_getsetters[] = {
43584 : {
43585 : .name = discard_const_p(char, "in_handle"),
43586 : .get = py_lsa_LookupNames3_in_get_handle,
43587 : .set = py_lsa_LookupNames3_in_set_handle,
43588 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
43589 : },
43590 : {
43591 : .name = discard_const_p(char, "in_num_names"),
43592 : .get = py_lsa_LookupNames3_in_get_num_names,
43593 : .set = py_lsa_LookupNames3_in_set_num_names,
43594 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
43595 : },
43596 : {
43597 : .name = discard_const_p(char, "in_names"),
43598 : .get = py_lsa_LookupNames3_in_get_names,
43599 : .set = py_lsa_LookupNames3_in_set_names,
43600 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
43601 : },
43602 : {
43603 : .name = discard_const_p(char, "out_domains"),
43604 : .get = py_lsa_LookupNames3_out_get_domains,
43605 : .set = py_lsa_LookupNames3_out_set_domains,
43606 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
43607 : },
43608 : {
43609 : .name = discard_const_p(char, "in_sids"),
43610 : .get = py_lsa_LookupNames3_in_get_sids,
43611 : .set = py_lsa_LookupNames3_in_set_sids,
43612 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray3")
43613 : },
43614 : {
43615 : .name = discard_const_p(char, "out_sids"),
43616 : .get = py_lsa_LookupNames3_out_get_sids,
43617 : .set = py_lsa_LookupNames3_out_set_sids,
43618 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray3")
43619 : },
43620 : {
43621 : .name = discard_const_p(char, "in_level"),
43622 : .get = py_lsa_LookupNames3_in_get_level,
43623 : .set = py_lsa_LookupNames3_in_set_level,
43624 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
43625 : },
43626 : {
43627 : .name = discard_const_p(char, "in_count"),
43628 : .get = py_lsa_LookupNames3_in_get_count,
43629 : .set = py_lsa_LookupNames3_in_set_count,
43630 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
43631 : },
43632 : {
43633 : .name = discard_const_p(char, "out_count"),
43634 : .get = py_lsa_LookupNames3_out_get_count,
43635 : .set = py_lsa_LookupNames3_out_set_count,
43636 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
43637 : },
43638 : {
43639 : .name = discard_const_p(char, "in_lookup_options"),
43640 : .get = py_lsa_LookupNames3_in_get_lookup_options,
43641 : .set = py_lsa_LookupNames3_in_set_lookup_options,
43642 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
43643 : },
43644 : {
43645 : .name = discard_const_p(char, "in_client_revision"),
43646 : .get = py_lsa_LookupNames3_in_get_client_revision,
43647 : .set = py_lsa_LookupNames3_in_set_client_revision,
43648 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
43649 : },
43650 : {
43651 : .name = discard_const_p(char, "result"),
43652 : .get = py_lsa_LookupNames3_get_result,
43653 : .set = py_lsa_LookupNames3_set_result,
43654 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
43655 : },
43656 : { .name = NULL }
43657 : };
43658 :
43659 0 : static PyObject *py_lsa_LookupNames3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
43660 : {
43661 0 : PyObject *self = pytalloc_new(struct lsa_LookupNames3, type);
43662 0 : struct lsa_LookupNames3 *_self = (struct lsa_LookupNames3 *)pytalloc_get_ptr(self);
43663 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
43664 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
43665 : /* a pointer to a NULL pointer */
43666 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
43667 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray3);
43668 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray3);
43669 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
43670 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
43671 0 : return self;
43672 : }
43673 :
43674 0 : static PyObject *py_lsa_LookupNames3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
43675 : {
43676 :
43677 :
43678 0 : return PyLong_FromLong(68);
43679 : }
43680 :
43681 0 : static PyObject *py_lsa_LookupNames3_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
43682 : {
43683 0 : const struct ndr_interface_call *call = NULL;
43684 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43685 0 : PyObject *ret = NULL;
43686 0 : struct ndr_push *push = NULL;
43687 : DATA_BLOB blob;
43688 : enum ndr_err_code err;
43689 :
43690 0 : if (ndr_table_lsarpc.num_calls < 69) {
43691 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames3_ndr_pack");
43692 0 : return NULL;
43693 : }
43694 0 : call = &ndr_table_lsarpc.calls[68];
43695 :
43696 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
43697 0 : if (push == NULL) {
43698 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43699 0 : return NULL;
43700 : }
43701 :
43702 0 : push->flags |= ndr_push_flags;
43703 :
43704 0 : err = call->ndr_push(push, ndr_inout_flags, object);
43705 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43706 0 : TALLOC_FREE(push);
43707 0 : PyErr_SetNdrError(err);
43708 0 : return NULL;
43709 : }
43710 0 : blob = ndr_push_blob(push);
43711 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
43712 0 : TALLOC_FREE(push);
43713 0 : return ret;
43714 : }
43715 :
43716 0 : static PyObject *py_lsa_LookupNames3_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43717 : {
43718 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43719 0 : PyObject *bigendian_obj = NULL;
43720 0 : PyObject *ndr64_obj = NULL;
43721 0 : uint32_t ndr_push_flags = 0;
43722 :
43723 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
43724 : discard_const_p(char *, kwnames),
43725 : &bigendian_obj,
43726 : &ndr64_obj)) {
43727 0 : return NULL;
43728 : }
43729 :
43730 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43731 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43732 : }
43733 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43734 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43735 : }
43736 :
43737 0 : return py_lsa_LookupNames3_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
43738 : }
43739 :
43740 0 : static PyObject *py_lsa_LookupNames3_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43741 : {
43742 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43743 0 : PyObject *bigendian_obj = NULL;
43744 0 : PyObject *ndr64_obj = NULL;
43745 0 : uint32_t ndr_push_flags = 0;
43746 :
43747 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
43748 : discard_const_p(char *, kwnames),
43749 : &bigendian_obj,
43750 : &ndr64_obj)) {
43751 0 : return NULL;
43752 : }
43753 :
43754 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43755 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43756 : }
43757 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43758 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43759 : }
43760 :
43761 0 : return py_lsa_LookupNames3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
43762 : }
43763 :
43764 0 : static PyObject *py_lsa_LookupNames3_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
43765 : {
43766 0 : const struct ndr_interface_call *call = NULL;
43767 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43768 0 : struct ndr_pull *pull = NULL;
43769 : enum ndr_err_code err;
43770 :
43771 0 : if (ndr_table_lsarpc.num_calls < 69) {
43772 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames3_ndr_unpack");
43773 0 : return NULL;
43774 : }
43775 0 : call = &ndr_table_lsarpc.calls[68];
43776 :
43777 0 : pull = ndr_pull_init_blob(blob, object);
43778 0 : if (pull == NULL) {
43779 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43780 0 : return NULL;
43781 : }
43782 :
43783 0 : pull->flags |= ndr_pull_flags;
43784 :
43785 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
43786 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43787 0 : TALLOC_FREE(pull);
43788 0 : PyErr_SetNdrError(err);
43789 0 : return NULL;
43790 : }
43791 0 : if (!allow_remaining) {
43792 : uint32_t highest_ofs;
43793 :
43794 0 : if (pull->offset > pull->relative_highest_offset) {
43795 0 : highest_ofs = pull->offset;
43796 : } else {
43797 0 : highest_ofs = pull->relative_highest_offset;
43798 : }
43799 0 : if (highest_ofs < pull->data_size) {
43800 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
43801 : "not all bytes consumed ofs[%u] size[%u]",
43802 : highest_ofs, pull->data_size);
43803 0 : TALLOC_FREE(pull);
43804 0 : PyErr_SetNdrError(err);
43805 0 : return NULL;
43806 : }
43807 : }
43808 :
43809 0 : TALLOC_FREE(pull);
43810 0 : Py_RETURN_NONE;
43811 : }
43812 :
43813 0 : static PyObject *py_lsa_LookupNames3_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43814 : {
43815 : DATA_BLOB blob;
43816 0 : Py_ssize_t blob_length = 0;
43817 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43818 0 : PyObject *bigendian_obj = NULL;
43819 0 : PyObject *ndr64_obj = NULL;
43820 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43821 0 : PyObject *allow_remaining_obj = NULL;
43822 0 : bool allow_remaining = false;
43823 :
43824 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
43825 : discard_const_p(char *, kwnames),
43826 : &blob.data, &blob_length,
43827 : &bigendian_obj,
43828 : &ndr64_obj,
43829 : &allow_remaining_obj)) {
43830 0 : return NULL;
43831 : }
43832 0 : blob.length = blob_length;
43833 :
43834 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43835 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43836 : }
43837 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43838 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43839 : }
43840 :
43841 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43842 0 : allow_remaining = true;
43843 : }
43844 :
43845 0 : return py_lsa_LookupNames3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
43846 : }
43847 :
43848 0 : static PyObject *py_lsa_LookupNames3_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43849 : {
43850 : DATA_BLOB blob;
43851 0 : Py_ssize_t blob_length = 0;
43852 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43853 0 : PyObject *bigendian_obj = NULL;
43854 0 : PyObject *ndr64_obj = NULL;
43855 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43856 0 : PyObject *allow_remaining_obj = NULL;
43857 0 : bool allow_remaining = false;
43858 :
43859 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
43860 : discard_const_p(char *, kwnames),
43861 : &blob.data, &blob_length,
43862 : &bigendian_obj,
43863 : &ndr64_obj,
43864 : &allow_remaining_obj)) {
43865 0 : return NULL;
43866 : }
43867 0 : blob.length = blob_length;
43868 :
43869 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43870 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43871 : }
43872 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43873 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43874 : }
43875 :
43876 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43877 0 : allow_remaining = true;
43878 : }
43879 :
43880 0 : return py_lsa_LookupNames3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
43881 : }
43882 :
43883 0 : static PyObject *py_lsa_LookupNames3_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
43884 : {
43885 0 : const struct ndr_interface_call *call = NULL;
43886 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43887 : PyObject *ret;
43888 : char *retstr;
43889 :
43890 0 : if (ndr_table_lsarpc.num_calls < 69) {
43891 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames3_ndr_print");
43892 0 : return NULL;
43893 : }
43894 0 : call = &ndr_table_lsarpc.calls[68];
43895 :
43896 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
43897 0 : ret = PyUnicode_FromString(retstr);
43898 0 : TALLOC_FREE(retstr);
43899 :
43900 0 : return ret;
43901 : }
43902 :
43903 0 : static PyObject *py_lsa_LookupNames3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43904 : {
43905 0 : return py_lsa_LookupNames3_ndr_print(py_obj, "lsa_LookupNames3_in", NDR_IN);
43906 : }
43907 :
43908 0 : static PyObject *py_lsa_LookupNames3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43909 : {
43910 0 : return py_lsa_LookupNames3_ndr_print(py_obj, "lsa_LookupNames3_out", NDR_OUT);
43911 : }
43912 :
43913 : static PyMethodDef py_lsa_LookupNames3_methods[] = {
43914 : { "opnum", (PyCFunction)py_lsa_LookupNames3_ndr_opnum, METH_NOARGS|METH_CLASS,
43915 : "lsa.LookupNames3.opnum() -> 68 (0x44) " },
43916 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames3_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
43917 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
43918 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames3_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
43919 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
43920 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames3_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
43921 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
43922 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames3_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
43923 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
43924 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupNames3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
43925 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupNames3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
43926 : { NULL, NULL, 0, NULL }
43927 : };
43928 :
43929 :
43930 : static PyTypeObject lsa_LookupNames3_Type = {
43931 : PyVarObject_HEAD_INIT(NULL, 0)
43932 : .tp_name = "lsa.LookupNames3",
43933 : .tp_getset = py_lsa_LookupNames3_getsetters,
43934 : .tp_methods = py_lsa_LookupNames3_methods,
43935 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
43936 : .tp_new = py_lsa_LookupNames3_new,
43937 : };
43938 :
43939 0 : static bool pack_py_lsa_LookupNames3_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames3 *r)
43940 : {
43941 : PyObject *py_handle;
43942 : PyObject *py_names;
43943 : PyObject *py_sids;
43944 : PyObject *py_level;
43945 : PyObject *py_count;
43946 : PyObject *py_lookup_options;
43947 : PyObject *py_client_revision;
43948 0 : const char *kwnames[] = {
43949 : "handle", "names", "sids", "level", "count", "lookup_options", "client_revision", NULL
43950 : };
43951 :
43952 0 : 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)) {
43953 0 : return false;
43954 : }
43955 :
43956 0 : if (py_handle == NULL) {
43957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
43958 0 : return false;
43959 : }
43960 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
43961 0 : if (r->in.handle == NULL) {
43962 0 : PyErr_NoMemory();
43963 0 : return false;
43964 : }
43965 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
43966 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
43967 0 : PyErr_NoMemory();
43968 0 : return false;
43969 : }
43970 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
43971 0 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
43972 0 : r->in.num_names = PyList_GET_SIZE(py_names);
43973 0 : if (py_names == NULL) {
43974 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
43975 0 : return false;
43976 : }
43977 0 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
43978 : {
43979 : int names_cntr_0;
43980 0 : r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
43981 0 : if (!r->in.names) { return false;; }
43982 0 : talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
43983 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
43984 0 : if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) {
43985 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names[names_cntr_0]");
43986 0 : return false;
43987 : }
43988 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
43989 0 : if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
43990 0 : PyErr_NoMemory();
43991 0 : return false;
43992 : }
43993 0 : r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
43994 : }
43995 : }
43996 0 : if (py_sids == NULL) {
43997 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
43998 0 : return false;
43999 : }
44000 0 : r->in.sids = talloc_ptrtype(r, r->in.sids);
44001 0 : if (r->in.sids == NULL) {
44002 0 : PyErr_NoMemory();
44003 0 : return false;
44004 : }
44005 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, py_sids, return false;);
44006 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
44007 0 : PyErr_NoMemory();
44008 0 : return false;
44009 : }
44010 0 : r->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_sids);
44011 0 : if (py_level == NULL) {
44012 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
44013 0 : return false;
44014 : }
44015 : {
44016 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
44017 0 : if (PyLong_Check(py_level)) {
44018 : unsigned long long test_var;
44019 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
44020 0 : if (PyErr_Occurred() != NULL) {
44021 0 : return false;
44022 : }
44023 0 : if (test_var > uint_max) {
44024 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44025 : PyLong_Type.tp_name, uint_max, test_var);
44026 0 : return false;
44027 : }
44028 0 : r->in.level = test_var;
44029 : } else {
44030 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44031 : PyLong_Type.tp_name);
44032 0 : return false;
44033 : }
44034 : }
44035 0 : if (py_count == NULL) {
44036 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
44037 0 : return false;
44038 : }
44039 0 : r->in.count = talloc_ptrtype(r, r->in.count);
44040 0 : if (r->in.count == NULL) {
44041 0 : PyErr_NoMemory();
44042 0 : return false;
44043 : }
44044 : {
44045 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
44046 0 : if (PyLong_Check(py_count)) {
44047 : unsigned long long test_var;
44048 0 : test_var = PyLong_AsUnsignedLongLong(py_count);
44049 0 : if (PyErr_Occurred() != NULL) {
44050 0 : return false;
44051 : }
44052 0 : if (test_var > uint_max) {
44053 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44054 : PyLong_Type.tp_name, uint_max, test_var);
44055 0 : return false;
44056 : }
44057 0 : *r->in.count = test_var;
44058 : } else {
44059 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44060 : PyLong_Type.tp_name);
44061 0 : return false;
44062 : }
44063 : }
44064 0 : if (py_lookup_options == NULL) {
44065 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lookup_options");
44066 0 : return false;
44067 : }
44068 : {
44069 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
44070 0 : if (PyLong_Check(py_lookup_options)) {
44071 : unsigned long long test_var;
44072 0 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
44073 0 : if (PyErr_Occurred() != NULL) {
44074 0 : return false;
44075 : }
44076 0 : if (test_var > uint_max) {
44077 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44078 : PyLong_Type.tp_name, uint_max, test_var);
44079 0 : return false;
44080 : }
44081 0 : r->in.lookup_options = test_var;
44082 : } else {
44083 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44084 : PyLong_Type.tp_name);
44085 0 : return false;
44086 : }
44087 : }
44088 0 : if (py_client_revision == NULL) {
44089 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_revision");
44090 0 : return false;
44091 : }
44092 : {
44093 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
44094 0 : if (PyLong_Check(py_client_revision)) {
44095 : unsigned long long test_var;
44096 0 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
44097 0 : if (PyErr_Occurred() != NULL) {
44098 0 : return false;
44099 : }
44100 0 : if (test_var > uint_max) {
44101 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44102 : PyLong_Type.tp_name, uint_max, test_var);
44103 0 : return false;
44104 : }
44105 0 : r->in.client_revision = test_var;
44106 : } else {
44107 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44108 : PyLong_Type.tp_name);
44109 0 : return false;
44110 : }
44111 : }
44112 0 : return true;
44113 : }
44114 :
44115 0 : static PyObject *unpack_py_lsa_LookupNames3_args_out(struct lsa_LookupNames3 *r)
44116 : {
44117 : PyObject *result;
44118 : PyObject *py_domains;
44119 : PyObject *py_sids;
44120 : PyObject *py_count;
44121 0 : result = PyTuple_New(3);
44122 0 : if (*r->out.domains == NULL) {
44123 0 : py_domains = Py_None;
44124 0 : Py_INCREF(py_domains);
44125 : } else {
44126 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
44127 : }
44128 0 : PyTuple_SetItem(result, 0, py_domains);
44129 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, r->out.sids, r->out.sids);
44130 0 : PyTuple_SetItem(result, 1, py_sids);
44131 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
44132 0 : PyTuple_SetItem(result, 2, py_count);
44133 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
44134 0 : PyErr_SetNTSTATUS(r->out.result);
44135 0 : return NULL;
44136 : }
44137 :
44138 0 : return result;
44139 : }
44140 :
44141 :
44142 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_in_get_handle(PyObject *obj, void *closure)
44143 : {
44144 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(obj);
44145 : PyObject *py_handle;
44146 0 : if (object->in.handle == NULL) {
44147 0 : Py_RETURN_NONE;
44148 : }
44149 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
44150 0 : return py_handle;
44151 : }
44152 :
44153 0 : static int py_lsa_lsaRQueryForestTrustInformation_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
44154 : {
44155 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44156 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
44157 0 : if (value == NULL) {
44158 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
44159 0 : return -1;
44160 : }
44161 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
44162 0 : if (object->in.handle == NULL) {
44163 0 : PyErr_NoMemory();
44164 0 : return -1;
44165 : }
44166 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
44167 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44168 0 : PyErr_NoMemory();
44169 0 : return -1;
44170 : }
44171 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
44172 0 : return 0;
44173 : }
44174 :
44175 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_in_get_trusted_domain_name(PyObject *obj, void *closure)
44176 : {
44177 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(obj);
44178 : PyObject *py_trusted_domain_name;
44179 0 : if (object->in.trusted_domain_name == NULL) {
44180 0 : Py_RETURN_NONE;
44181 : }
44182 0 : py_trusted_domain_name = pytalloc_reference_ex(&lsa_String_Type, object->in.trusted_domain_name, object->in.trusted_domain_name);
44183 0 : return py_trusted_domain_name;
44184 : }
44185 :
44186 0 : static int py_lsa_lsaRQueryForestTrustInformation_in_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure)
44187 : {
44188 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44189 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain_name));
44190 0 : if (value == NULL) {
44191 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trusted_domain_name");
44192 0 : return -1;
44193 : }
44194 0 : object->in.trusted_domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain_name);
44195 0 : if (object->in.trusted_domain_name == NULL) {
44196 0 : PyErr_NoMemory();
44197 0 : return -1;
44198 : }
44199 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
44200 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44201 0 : PyErr_NoMemory();
44202 0 : return -1;
44203 : }
44204 0 : object->in.trusted_domain_name = (struct lsa_String *)pytalloc_get_ptr(value);
44205 0 : return 0;
44206 : }
44207 :
44208 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_in_get_highest_record_type(PyObject *obj, void *closure)
44209 : {
44210 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(obj);
44211 : PyObject *py_highest_record_type;
44212 0 : py_highest_record_type = PyLong_FromLong((uint16_t)object->in.highest_record_type);
44213 0 : return py_highest_record_type;
44214 : }
44215 :
44216 0 : static int py_lsa_lsaRQueryForestTrustInformation_in_set_highest_record_type(PyObject *py_obj, PyObject *value, void *closure)
44217 : {
44218 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44219 0 : if (value == NULL) {
44220 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.highest_record_type");
44221 0 : return -1;
44222 : }
44223 : {
44224 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.highest_record_type));
44225 0 : if (PyLong_Check(value)) {
44226 : unsigned long long test_var;
44227 0 : test_var = PyLong_AsUnsignedLongLong(value);
44228 0 : if (PyErr_Occurred() != NULL) {
44229 0 : return -1;
44230 : }
44231 0 : if (test_var > uint_max) {
44232 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44233 : PyLong_Type.tp_name, uint_max, test_var);
44234 0 : return -1;
44235 : }
44236 0 : object->in.highest_record_type = test_var;
44237 : } else {
44238 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44239 : PyLong_Type.tp_name);
44240 0 : return -1;
44241 : }
44242 : }
44243 0 : return 0;
44244 : }
44245 :
44246 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_out_get_forest_trust_info(PyObject *obj, void *closure)
44247 : {
44248 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(obj);
44249 : PyObject *py_forest_trust_info;
44250 0 : if (object->out.forest_trust_info == NULL) {
44251 0 : Py_RETURN_NONE;
44252 : }
44253 0 : if (*object->out.forest_trust_info == NULL) {
44254 0 : py_forest_trust_info = Py_None;
44255 0 : Py_INCREF(py_forest_trust_info);
44256 : } else {
44257 0 : py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation_Type, *object->out.forest_trust_info, *object->out.forest_trust_info);
44258 : }
44259 0 : return py_forest_trust_info;
44260 : }
44261 :
44262 0 : static int py_lsa_lsaRQueryForestTrustInformation_out_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure)
44263 : {
44264 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44265 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.forest_trust_info));
44266 0 : if (value == NULL) {
44267 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.forest_trust_info");
44268 0 : return -1;
44269 : }
44270 0 : object->out.forest_trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.forest_trust_info);
44271 0 : if (object->out.forest_trust_info == NULL) {
44272 0 : PyErr_NoMemory();
44273 0 : return -1;
44274 : }
44275 0 : if (value == Py_None) {
44276 0 : *object->out.forest_trust_info = NULL;
44277 : } else {
44278 0 : *object->out.forest_trust_info = NULL;
44279 0 : PY_CHECK_TYPE(&lsa_ForestTrustInformation_Type, value, return -1;);
44280 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44281 0 : PyErr_NoMemory();
44282 0 : return -1;
44283 : }
44284 0 : *object->out.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(value);
44285 : }
44286 0 : return 0;
44287 : }
44288 :
44289 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_get_result(PyObject *obj, void *closure)
44290 : {
44291 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(obj);
44292 : PyObject *py_result;
44293 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
44294 0 : return py_result;
44295 : }
44296 :
44297 0 : static int py_lsa_lsaRQueryForestTrustInformation_set_result(PyObject *py_obj, PyObject *value, void *closure)
44298 : {
44299 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44300 0 : if (value == NULL) {
44301 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
44302 0 : return -1;
44303 : }
44304 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
44305 0 : return 0;
44306 : }
44307 :
44308 : static PyGetSetDef py_lsa_lsaRQueryForestTrustInformation_getsetters[] = {
44309 : {
44310 : .name = discard_const_p(char, "in_handle"),
44311 : .get = py_lsa_lsaRQueryForestTrustInformation_in_get_handle,
44312 : .set = py_lsa_lsaRQueryForestTrustInformation_in_set_handle,
44313 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
44314 : },
44315 : {
44316 : .name = discard_const_p(char, "in_trusted_domain_name"),
44317 : .get = py_lsa_lsaRQueryForestTrustInformation_in_get_trusted_domain_name,
44318 : .set = py_lsa_lsaRQueryForestTrustInformation_in_set_trusted_domain_name,
44319 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
44320 : },
44321 : {
44322 : .name = discard_const_p(char, "in_highest_record_type"),
44323 : .get = py_lsa_lsaRQueryForestTrustInformation_in_get_highest_record_type,
44324 : .set = py_lsa_lsaRQueryForestTrustInformation_in_set_highest_record_type,
44325 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordType")
44326 : },
44327 : {
44328 : .name = discard_const_p(char, "out_forest_trust_info"),
44329 : .get = py_lsa_lsaRQueryForestTrustInformation_out_get_forest_trust_info,
44330 : .set = py_lsa_lsaRQueryForestTrustInformation_out_set_forest_trust_info,
44331 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustInformation")
44332 : },
44333 : {
44334 : .name = discard_const_p(char, "result"),
44335 : .get = py_lsa_lsaRQueryForestTrustInformation_get_result,
44336 : .set = py_lsa_lsaRQueryForestTrustInformation_set_result,
44337 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
44338 : },
44339 : { .name = NULL }
44340 : };
44341 :
44342 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
44343 : {
44344 0 : PyObject *self = pytalloc_new(struct lsa_lsaRQueryForestTrustInformation, type);
44345 0 : struct lsa_lsaRQueryForestTrustInformation *_self = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(self);
44346 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
44347 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
44348 0 : _self->in.trusted_domain_name = talloc_zero(mem_ctx, struct lsa_String);
44349 : /* a pointer to a NULL pointer */
44350 0 : _self->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *);
44351 0 : return self;
44352 : }
44353 :
44354 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
44355 : {
44356 :
44357 :
44358 0 : return PyLong_FromLong(73);
44359 : }
44360 :
44361 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
44362 : {
44363 0 : const struct ndr_interface_call *call = NULL;
44364 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44365 0 : PyObject *ret = NULL;
44366 0 : struct ndr_push *push = NULL;
44367 : DATA_BLOB blob;
44368 : enum ndr_err_code err;
44369 :
44370 0 : if (ndr_table_lsarpc.num_calls < 74) {
44371 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRQueryForestTrustInformation_ndr_pack");
44372 0 : return NULL;
44373 : }
44374 0 : call = &ndr_table_lsarpc.calls[73];
44375 :
44376 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
44377 0 : if (push == NULL) {
44378 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44379 0 : return NULL;
44380 : }
44381 :
44382 0 : push->flags |= ndr_push_flags;
44383 :
44384 0 : err = call->ndr_push(push, ndr_inout_flags, object);
44385 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44386 0 : TALLOC_FREE(push);
44387 0 : PyErr_SetNdrError(err);
44388 0 : return NULL;
44389 : }
44390 0 : blob = ndr_push_blob(push);
44391 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
44392 0 : TALLOC_FREE(push);
44393 0 : return ret;
44394 : }
44395 :
44396 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44397 : {
44398 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44399 0 : PyObject *bigendian_obj = NULL;
44400 0 : PyObject *ndr64_obj = NULL;
44401 0 : uint32_t ndr_push_flags = 0;
44402 :
44403 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
44404 : discard_const_p(char *, kwnames),
44405 : &bigendian_obj,
44406 : &ndr64_obj)) {
44407 0 : return NULL;
44408 : }
44409 :
44410 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44411 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44412 : }
44413 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44414 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44415 : }
44416 :
44417 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
44418 : }
44419 :
44420 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44421 : {
44422 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44423 0 : PyObject *bigendian_obj = NULL;
44424 0 : PyObject *ndr64_obj = NULL;
44425 0 : uint32_t ndr_push_flags = 0;
44426 :
44427 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
44428 : discard_const_p(char *, kwnames),
44429 : &bigendian_obj,
44430 : &ndr64_obj)) {
44431 0 : return NULL;
44432 : }
44433 :
44434 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44435 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44436 : }
44437 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44438 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44439 : }
44440 :
44441 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
44442 : }
44443 :
44444 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
44445 : {
44446 0 : const struct ndr_interface_call *call = NULL;
44447 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44448 0 : struct ndr_pull *pull = NULL;
44449 : enum ndr_err_code err;
44450 :
44451 0 : if (ndr_table_lsarpc.num_calls < 74) {
44452 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRQueryForestTrustInformation_ndr_unpack");
44453 0 : return NULL;
44454 : }
44455 0 : call = &ndr_table_lsarpc.calls[73];
44456 :
44457 0 : pull = ndr_pull_init_blob(blob, object);
44458 0 : if (pull == NULL) {
44459 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44460 0 : return NULL;
44461 : }
44462 :
44463 0 : pull->flags |= ndr_pull_flags;
44464 :
44465 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
44466 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44467 0 : TALLOC_FREE(pull);
44468 0 : PyErr_SetNdrError(err);
44469 0 : return NULL;
44470 : }
44471 0 : if (!allow_remaining) {
44472 : uint32_t highest_ofs;
44473 :
44474 0 : if (pull->offset > pull->relative_highest_offset) {
44475 0 : highest_ofs = pull->offset;
44476 : } else {
44477 0 : highest_ofs = pull->relative_highest_offset;
44478 : }
44479 0 : if (highest_ofs < pull->data_size) {
44480 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
44481 : "not all bytes consumed ofs[%u] size[%u]",
44482 : highest_ofs, pull->data_size);
44483 0 : TALLOC_FREE(pull);
44484 0 : PyErr_SetNdrError(err);
44485 0 : return NULL;
44486 : }
44487 : }
44488 :
44489 0 : TALLOC_FREE(pull);
44490 0 : Py_RETURN_NONE;
44491 : }
44492 :
44493 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44494 : {
44495 : DATA_BLOB blob;
44496 0 : Py_ssize_t blob_length = 0;
44497 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44498 0 : PyObject *bigendian_obj = NULL;
44499 0 : PyObject *ndr64_obj = NULL;
44500 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44501 0 : PyObject *allow_remaining_obj = NULL;
44502 0 : bool allow_remaining = false;
44503 :
44504 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
44505 : discard_const_p(char *, kwnames),
44506 : &blob.data, &blob_length,
44507 : &bigendian_obj,
44508 : &ndr64_obj,
44509 : &allow_remaining_obj)) {
44510 0 : return NULL;
44511 : }
44512 0 : blob.length = blob_length;
44513 :
44514 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44515 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44516 : }
44517 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44518 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44519 : }
44520 :
44521 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44522 0 : allow_remaining = true;
44523 : }
44524 :
44525 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
44526 : }
44527 :
44528 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44529 : {
44530 : DATA_BLOB blob;
44531 0 : Py_ssize_t blob_length = 0;
44532 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44533 0 : PyObject *bigendian_obj = NULL;
44534 0 : PyObject *ndr64_obj = NULL;
44535 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44536 0 : PyObject *allow_remaining_obj = NULL;
44537 0 : bool allow_remaining = false;
44538 :
44539 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
44540 : discard_const_p(char *, kwnames),
44541 : &blob.data, &blob_length,
44542 : &bigendian_obj,
44543 : &ndr64_obj,
44544 : &allow_remaining_obj)) {
44545 0 : return NULL;
44546 : }
44547 0 : blob.length = blob_length;
44548 :
44549 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44550 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44551 : }
44552 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44553 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44554 : }
44555 :
44556 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44557 0 : allow_remaining = true;
44558 : }
44559 :
44560 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
44561 : }
44562 :
44563 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
44564 : {
44565 0 : const struct ndr_interface_call *call = NULL;
44566 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44567 : PyObject *ret;
44568 : char *retstr;
44569 :
44570 0 : if (ndr_table_lsarpc.num_calls < 74) {
44571 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRQueryForestTrustInformation_ndr_print");
44572 0 : return NULL;
44573 : }
44574 0 : call = &ndr_table_lsarpc.calls[73];
44575 :
44576 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
44577 0 : ret = PyUnicode_FromString(retstr);
44578 0 : TALLOC_FREE(retstr);
44579 :
44580 0 : return ret;
44581 : }
44582 :
44583 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44584 : {
44585 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_print(py_obj, "lsa_lsaRQueryForestTrustInformation_in", NDR_IN);
44586 : }
44587 :
44588 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44589 : {
44590 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_print(py_obj, "lsa_lsaRQueryForestTrustInformation_out", NDR_OUT);
44591 : }
44592 :
44593 : static PyMethodDef py_lsa_lsaRQueryForestTrustInformation_methods[] = {
44594 : { "opnum", (PyCFunction)py_lsa_lsaRQueryForestTrustInformation_ndr_opnum, METH_NOARGS|METH_CLASS,
44595 : "lsa.lsaRQueryForestTrustInformation.opnum() -> 73 (0x49) " },
44596 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
44597 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
44598 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
44599 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
44600 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
44601 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
44602 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
44603 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
44604 : { "__ndr_print_in__", (PyCFunction)py_lsa_lsaRQueryForestTrustInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
44605 : { "__ndr_print_out__", (PyCFunction)py_lsa_lsaRQueryForestTrustInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
44606 : { NULL, NULL, 0, NULL }
44607 : };
44608 :
44609 :
44610 : static PyTypeObject lsa_lsaRQueryForestTrustInformation_Type = {
44611 : PyVarObject_HEAD_INIT(NULL, 0)
44612 : .tp_name = "lsa.lsaRQueryForestTrustInformation",
44613 : .tp_getset = py_lsa_lsaRQueryForestTrustInformation_getsetters,
44614 : .tp_methods = py_lsa_lsaRQueryForestTrustInformation_methods,
44615 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
44616 : .tp_new = py_lsa_lsaRQueryForestTrustInformation_new,
44617 : };
44618 :
44619 124 : static bool pack_py_lsa_lsaRQueryForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct lsa_lsaRQueryForestTrustInformation *r)
44620 : {
44621 : PyObject *py_handle;
44622 : PyObject *py_trusted_domain_name;
44623 : PyObject *py_highest_record_type;
44624 124 : const char *kwnames[] = {
44625 : "handle", "trusted_domain_name", "highest_record_type", NULL
44626 : };
44627 :
44628 124 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_lsaRQueryForestTrustInformation", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain_name, &py_highest_record_type)) {
44629 0 : return false;
44630 : }
44631 :
44632 124 : if (py_handle == NULL) {
44633 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
44634 0 : return false;
44635 : }
44636 124 : r->in.handle = talloc_ptrtype(r, r->in.handle);
44637 124 : if (r->in.handle == NULL) {
44638 0 : PyErr_NoMemory();
44639 0 : return false;
44640 : }
44641 124 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
44642 124 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
44643 0 : PyErr_NoMemory();
44644 0 : return false;
44645 : }
44646 124 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
44647 124 : if (py_trusted_domain_name == NULL) {
44648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trusted_domain_name");
44649 0 : return false;
44650 : }
44651 124 : r->in.trusted_domain_name = talloc_ptrtype(r, r->in.trusted_domain_name);
44652 124 : if (r->in.trusted_domain_name == NULL) {
44653 0 : PyErr_NoMemory();
44654 0 : return false;
44655 : }
44656 124 : PY_CHECK_TYPE(&lsa_String_Type, py_trusted_domain_name, return false;);
44657 124 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain_name)) == NULL) {
44658 0 : PyErr_NoMemory();
44659 0 : return false;
44660 : }
44661 124 : r->in.trusted_domain_name = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain_name);
44662 124 : if (py_highest_record_type == NULL) {
44663 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.highest_record_type");
44664 0 : return false;
44665 : }
44666 : {
44667 124 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.highest_record_type));
44668 124 : if (PyLong_Check(py_highest_record_type)) {
44669 : unsigned long long test_var;
44670 124 : test_var = PyLong_AsUnsignedLongLong(py_highest_record_type);
44671 124 : if (PyErr_Occurred() != NULL) {
44672 0 : return false;
44673 : }
44674 124 : if (test_var > uint_max) {
44675 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44676 : PyLong_Type.tp_name, uint_max, test_var);
44677 0 : return false;
44678 : }
44679 124 : r->in.highest_record_type = test_var;
44680 : } else {
44681 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44682 : PyLong_Type.tp_name);
44683 0 : return false;
44684 : }
44685 : }
44686 124 : return true;
44687 : }
44688 :
44689 124 : static PyObject *unpack_py_lsa_lsaRQueryForestTrustInformation_args_out(struct lsa_lsaRQueryForestTrustInformation *r)
44690 : {
44691 : PyObject *result;
44692 : PyObject *py_forest_trust_info;
44693 124 : if (*r->out.forest_trust_info == NULL) {
44694 0 : py_forest_trust_info = Py_None;
44695 0 : Py_INCREF(py_forest_trust_info);
44696 : } else {
44697 124 : py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation_Type, *r->out.forest_trust_info, *r->out.forest_trust_info);
44698 : }
44699 124 : result = py_forest_trust_info;
44700 124 : if (NT_STATUS_IS_ERR(r->out.result)) {
44701 0 : PyErr_SetNTSTATUS(r->out.result);
44702 0 : return NULL;
44703 : }
44704 :
44705 124 : return result;
44706 : }
44707 :
44708 :
44709 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_handle(PyObject *obj, void *closure)
44710 : {
44711 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44712 : PyObject *py_handle;
44713 0 : if (object->in.handle == NULL) {
44714 0 : Py_RETURN_NONE;
44715 : }
44716 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
44717 0 : return py_handle;
44718 : }
44719 :
44720 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
44721 : {
44722 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44723 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
44724 0 : if (value == NULL) {
44725 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
44726 0 : return -1;
44727 : }
44728 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
44729 0 : if (object->in.handle == NULL) {
44730 0 : PyErr_NoMemory();
44731 0 : return -1;
44732 : }
44733 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
44734 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44735 0 : PyErr_NoMemory();
44736 0 : return -1;
44737 : }
44738 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
44739 0 : return 0;
44740 : }
44741 :
44742 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_trusted_domain_name(PyObject *obj, void *closure)
44743 : {
44744 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44745 : PyObject *py_trusted_domain_name;
44746 0 : if (object->in.trusted_domain_name == NULL) {
44747 0 : Py_RETURN_NONE;
44748 : }
44749 0 : py_trusted_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, object->in.trusted_domain_name, object->in.trusted_domain_name);
44750 0 : return py_trusted_domain_name;
44751 : }
44752 :
44753 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure)
44754 : {
44755 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44756 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain_name));
44757 0 : if (value == NULL) {
44758 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trusted_domain_name");
44759 0 : return -1;
44760 : }
44761 0 : object->in.trusted_domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain_name);
44762 0 : if (object->in.trusted_domain_name == NULL) {
44763 0 : PyErr_NoMemory();
44764 0 : return -1;
44765 : }
44766 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
44767 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44768 0 : PyErr_NoMemory();
44769 0 : return -1;
44770 : }
44771 0 : object->in.trusted_domain_name = (struct lsa_StringLarge *)pytalloc_get_ptr(value);
44772 0 : return 0;
44773 : }
44774 :
44775 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_highest_record_type(PyObject *obj, void *closure)
44776 : {
44777 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44778 : PyObject *py_highest_record_type;
44779 0 : py_highest_record_type = PyLong_FromLong((uint16_t)object->in.highest_record_type);
44780 0 : return py_highest_record_type;
44781 : }
44782 :
44783 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_highest_record_type(PyObject *py_obj, PyObject *value, void *closure)
44784 : {
44785 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44786 0 : if (value == NULL) {
44787 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.highest_record_type");
44788 0 : return -1;
44789 : }
44790 : {
44791 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.highest_record_type));
44792 0 : if (PyLong_Check(value)) {
44793 : unsigned long long test_var;
44794 0 : test_var = PyLong_AsUnsignedLongLong(value);
44795 0 : if (PyErr_Occurred() != NULL) {
44796 0 : return -1;
44797 : }
44798 0 : if (test_var > uint_max) {
44799 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44800 : PyLong_Type.tp_name, uint_max, test_var);
44801 0 : return -1;
44802 : }
44803 0 : object->in.highest_record_type = test_var;
44804 : } else {
44805 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44806 : PyLong_Type.tp_name);
44807 0 : return -1;
44808 : }
44809 : }
44810 0 : return 0;
44811 : }
44812 :
44813 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_forest_trust_info(PyObject *obj, void *closure)
44814 : {
44815 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44816 : PyObject *py_forest_trust_info;
44817 0 : if (object->in.forest_trust_info == NULL) {
44818 0 : Py_RETURN_NONE;
44819 : }
44820 0 : py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation_Type, object->in.forest_trust_info, object->in.forest_trust_info);
44821 0 : return py_forest_trust_info;
44822 : }
44823 :
44824 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure)
44825 : {
44826 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44827 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.forest_trust_info));
44828 0 : if (value == NULL) {
44829 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.forest_trust_info");
44830 0 : return -1;
44831 : }
44832 0 : object->in.forest_trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.forest_trust_info);
44833 0 : if (object->in.forest_trust_info == NULL) {
44834 0 : PyErr_NoMemory();
44835 0 : return -1;
44836 : }
44837 0 : PY_CHECK_TYPE(&lsa_ForestTrustInformation_Type, value, return -1;);
44838 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44839 0 : PyErr_NoMemory();
44840 0 : return -1;
44841 : }
44842 0 : object->in.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(value);
44843 0 : return 0;
44844 : }
44845 :
44846 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_check_only(PyObject *obj, void *closure)
44847 : {
44848 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44849 : PyObject *py_check_only;
44850 0 : py_check_only = PyLong_FromLong((uint16_t)object->in.check_only);
44851 0 : return py_check_only;
44852 : }
44853 :
44854 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_check_only(PyObject *py_obj, PyObject *value, void *closure)
44855 : {
44856 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44857 0 : if (value == NULL) {
44858 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.check_only");
44859 0 : return -1;
44860 : }
44861 : {
44862 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.check_only));
44863 0 : if (PyLong_Check(value)) {
44864 : unsigned long long test_var;
44865 0 : test_var = PyLong_AsUnsignedLongLong(value);
44866 0 : if (PyErr_Occurred() != NULL) {
44867 0 : return -1;
44868 : }
44869 0 : if (test_var > uint_max) {
44870 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44871 : PyLong_Type.tp_name, uint_max, test_var);
44872 0 : return -1;
44873 : }
44874 0 : object->in.check_only = test_var;
44875 : } else {
44876 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44877 : PyLong_Type.tp_name);
44878 0 : return -1;
44879 : }
44880 : }
44881 0 : return 0;
44882 : }
44883 :
44884 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_out_get_collision_info(PyObject *obj, void *closure)
44885 : {
44886 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44887 : PyObject *py_collision_info;
44888 0 : if (object->out.collision_info == NULL) {
44889 0 : Py_RETURN_NONE;
44890 : }
44891 0 : if (*object->out.collision_info == NULL) {
44892 0 : py_collision_info = Py_None;
44893 0 : Py_INCREF(py_collision_info);
44894 : } else {
44895 0 : py_collision_info = pytalloc_reference_ex(&lsa_ForestTrustCollisionInfo_Type, *object->out.collision_info, *object->out.collision_info);
44896 : }
44897 0 : return py_collision_info;
44898 : }
44899 :
44900 0 : static int py_lsa_lsaRSetForestTrustInformation_out_set_collision_info(PyObject *py_obj, PyObject *value, void *closure)
44901 : {
44902 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44903 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.collision_info));
44904 0 : if (value == NULL) {
44905 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.collision_info");
44906 0 : return -1;
44907 : }
44908 0 : object->out.collision_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.collision_info);
44909 0 : if (object->out.collision_info == NULL) {
44910 0 : PyErr_NoMemory();
44911 0 : return -1;
44912 : }
44913 0 : if (value == Py_None) {
44914 0 : *object->out.collision_info = NULL;
44915 : } else {
44916 0 : *object->out.collision_info = NULL;
44917 0 : PY_CHECK_TYPE(&lsa_ForestTrustCollisionInfo_Type, value, return -1;);
44918 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44919 0 : PyErr_NoMemory();
44920 0 : return -1;
44921 : }
44922 0 : *object->out.collision_info = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(value);
44923 : }
44924 0 : return 0;
44925 : }
44926 :
44927 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_get_result(PyObject *obj, void *closure)
44928 : {
44929 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44930 : PyObject *py_result;
44931 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
44932 0 : return py_result;
44933 : }
44934 :
44935 0 : static int py_lsa_lsaRSetForestTrustInformation_set_result(PyObject *py_obj, PyObject *value, void *closure)
44936 : {
44937 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44938 0 : if (value == NULL) {
44939 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
44940 0 : return -1;
44941 : }
44942 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
44943 0 : return 0;
44944 : }
44945 :
44946 : static PyGetSetDef py_lsa_lsaRSetForestTrustInformation_getsetters[] = {
44947 : {
44948 : .name = discard_const_p(char, "in_handle"),
44949 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_handle,
44950 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_handle,
44951 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
44952 : },
44953 : {
44954 : .name = discard_const_p(char, "in_trusted_domain_name"),
44955 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_trusted_domain_name,
44956 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_trusted_domain_name,
44957 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
44958 : },
44959 : {
44960 : .name = discard_const_p(char, "in_highest_record_type"),
44961 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_highest_record_type,
44962 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_highest_record_type,
44963 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordType")
44964 : },
44965 : {
44966 : .name = discard_const_p(char, "in_forest_trust_info"),
44967 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_forest_trust_info,
44968 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_forest_trust_info,
44969 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustInformation")
44970 : },
44971 : {
44972 : .name = discard_const_p(char, "in_check_only"),
44973 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_check_only,
44974 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_check_only,
44975 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
44976 : },
44977 : {
44978 : .name = discard_const_p(char, "out_collision_info"),
44979 : .get = py_lsa_lsaRSetForestTrustInformation_out_get_collision_info,
44980 : .set = py_lsa_lsaRSetForestTrustInformation_out_set_collision_info,
44981 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustCollisionInfo")
44982 : },
44983 : {
44984 : .name = discard_const_p(char, "result"),
44985 : .get = py_lsa_lsaRSetForestTrustInformation_get_result,
44986 : .set = py_lsa_lsaRSetForestTrustInformation_set_result,
44987 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
44988 : },
44989 : { .name = NULL }
44990 : };
44991 :
44992 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
44993 : {
44994 0 : PyObject *self = pytalloc_new(struct lsa_lsaRSetForestTrustInformation, type);
44995 0 : struct lsa_lsaRSetForestTrustInformation *_self = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(self);
44996 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
44997 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
44998 0 : _self->in.trusted_domain_name = talloc_zero(mem_ctx, struct lsa_StringLarge);
44999 0 : _self->in.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation);
45000 : /* a pointer to a NULL pointer */
45001 0 : _self->out.collision_info = talloc_zero(mem_ctx, struct lsa_ForestTrustCollisionInfo *);
45002 0 : return self;
45003 : }
45004 :
45005 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
45006 : {
45007 :
45008 :
45009 0 : return PyLong_FromLong(74);
45010 : }
45011 :
45012 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
45013 : {
45014 0 : const struct ndr_interface_call *call = NULL;
45015 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
45016 0 : PyObject *ret = NULL;
45017 0 : struct ndr_push *push = NULL;
45018 : DATA_BLOB blob;
45019 : enum ndr_err_code err;
45020 :
45021 0 : if (ndr_table_lsarpc.num_calls < 75) {
45022 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRSetForestTrustInformation_ndr_pack");
45023 0 : return NULL;
45024 : }
45025 0 : call = &ndr_table_lsarpc.calls[74];
45026 :
45027 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
45028 0 : if (push == NULL) {
45029 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45030 0 : return NULL;
45031 : }
45032 :
45033 0 : push->flags |= ndr_push_flags;
45034 :
45035 0 : err = call->ndr_push(push, ndr_inout_flags, object);
45036 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45037 0 : TALLOC_FREE(push);
45038 0 : PyErr_SetNdrError(err);
45039 0 : return NULL;
45040 : }
45041 0 : blob = ndr_push_blob(push);
45042 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
45043 0 : TALLOC_FREE(push);
45044 0 : return ret;
45045 : }
45046 :
45047 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45048 : {
45049 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45050 0 : PyObject *bigendian_obj = NULL;
45051 0 : PyObject *ndr64_obj = NULL;
45052 0 : uint32_t ndr_push_flags = 0;
45053 :
45054 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
45055 : discard_const_p(char *, kwnames),
45056 : &bigendian_obj,
45057 : &ndr64_obj)) {
45058 0 : return NULL;
45059 : }
45060 :
45061 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45062 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45063 : }
45064 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45065 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45066 : }
45067 :
45068 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
45069 : }
45070 :
45071 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45072 : {
45073 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45074 0 : PyObject *bigendian_obj = NULL;
45075 0 : PyObject *ndr64_obj = NULL;
45076 0 : uint32_t ndr_push_flags = 0;
45077 :
45078 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
45079 : discard_const_p(char *, kwnames),
45080 : &bigendian_obj,
45081 : &ndr64_obj)) {
45082 0 : return NULL;
45083 : }
45084 :
45085 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45086 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45087 : }
45088 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45089 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45090 : }
45091 :
45092 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
45093 : }
45094 :
45095 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
45096 : {
45097 0 : const struct ndr_interface_call *call = NULL;
45098 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
45099 0 : struct ndr_pull *pull = NULL;
45100 : enum ndr_err_code err;
45101 :
45102 0 : if (ndr_table_lsarpc.num_calls < 75) {
45103 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRSetForestTrustInformation_ndr_unpack");
45104 0 : return NULL;
45105 : }
45106 0 : call = &ndr_table_lsarpc.calls[74];
45107 :
45108 0 : pull = ndr_pull_init_blob(blob, object);
45109 0 : if (pull == NULL) {
45110 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45111 0 : return NULL;
45112 : }
45113 :
45114 0 : pull->flags |= ndr_pull_flags;
45115 :
45116 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
45117 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45118 0 : TALLOC_FREE(pull);
45119 0 : PyErr_SetNdrError(err);
45120 0 : return NULL;
45121 : }
45122 0 : if (!allow_remaining) {
45123 : uint32_t highest_ofs;
45124 :
45125 0 : if (pull->offset > pull->relative_highest_offset) {
45126 0 : highest_ofs = pull->offset;
45127 : } else {
45128 0 : highest_ofs = pull->relative_highest_offset;
45129 : }
45130 0 : if (highest_ofs < pull->data_size) {
45131 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
45132 : "not all bytes consumed ofs[%u] size[%u]",
45133 : highest_ofs, pull->data_size);
45134 0 : TALLOC_FREE(pull);
45135 0 : PyErr_SetNdrError(err);
45136 0 : return NULL;
45137 : }
45138 : }
45139 :
45140 0 : TALLOC_FREE(pull);
45141 0 : Py_RETURN_NONE;
45142 : }
45143 :
45144 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45145 : {
45146 : DATA_BLOB blob;
45147 0 : Py_ssize_t blob_length = 0;
45148 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45149 0 : PyObject *bigendian_obj = NULL;
45150 0 : PyObject *ndr64_obj = NULL;
45151 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45152 0 : PyObject *allow_remaining_obj = NULL;
45153 0 : bool allow_remaining = false;
45154 :
45155 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
45156 : discard_const_p(char *, kwnames),
45157 : &blob.data, &blob_length,
45158 : &bigendian_obj,
45159 : &ndr64_obj,
45160 : &allow_remaining_obj)) {
45161 0 : return NULL;
45162 : }
45163 0 : blob.length = blob_length;
45164 :
45165 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45166 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45167 : }
45168 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45169 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45170 : }
45171 :
45172 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45173 0 : allow_remaining = true;
45174 : }
45175 :
45176 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
45177 : }
45178 :
45179 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45180 : {
45181 : DATA_BLOB blob;
45182 0 : Py_ssize_t blob_length = 0;
45183 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45184 0 : PyObject *bigendian_obj = NULL;
45185 0 : PyObject *ndr64_obj = NULL;
45186 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45187 0 : PyObject *allow_remaining_obj = NULL;
45188 0 : bool allow_remaining = false;
45189 :
45190 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
45191 : discard_const_p(char *, kwnames),
45192 : &blob.data, &blob_length,
45193 : &bigendian_obj,
45194 : &ndr64_obj,
45195 : &allow_remaining_obj)) {
45196 0 : return NULL;
45197 : }
45198 0 : blob.length = blob_length;
45199 :
45200 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45201 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45202 : }
45203 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45204 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45205 : }
45206 :
45207 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45208 0 : allow_remaining = true;
45209 : }
45210 :
45211 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
45212 : }
45213 :
45214 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
45215 : {
45216 0 : const struct ndr_interface_call *call = NULL;
45217 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
45218 : PyObject *ret;
45219 : char *retstr;
45220 :
45221 0 : if (ndr_table_lsarpc.num_calls < 75) {
45222 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRSetForestTrustInformation_ndr_print");
45223 0 : return NULL;
45224 : }
45225 0 : call = &ndr_table_lsarpc.calls[74];
45226 :
45227 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
45228 0 : ret = PyUnicode_FromString(retstr);
45229 0 : TALLOC_FREE(retstr);
45230 :
45231 0 : return ret;
45232 : }
45233 :
45234 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45235 : {
45236 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_print(py_obj, "lsa_lsaRSetForestTrustInformation_in", NDR_IN);
45237 : }
45238 :
45239 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45240 : {
45241 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_print(py_obj, "lsa_lsaRSetForestTrustInformation_out", NDR_OUT);
45242 : }
45243 :
45244 : static PyMethodDef py_lsa_lsaRSetForestTrustInformation_methods[] = {
45245 : { "opnum", (PyCFunction)py_lsa_lsaRSetForestTrustInformation_ndr_opnum, METH_NOARGS|METH_CLASS,
45246 : "lsa.lsaRSetForestTrustInformation.opnum() -> 74 (0x4a) " },
45247 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
45248 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
45249 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
45250 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
45251 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
45252 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
45253 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
45254 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
45255 : { "__ndr_print_in__", (PyCFunction)py_lsa_lsaRSetForestTrustInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
45256 : { "__ndr_print_out__", (PyCFunction)py_lsa_lsaRSetForestTrustInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
45257 : { NULL, NULL, 0, NULL }
45258 : };
45259 :
45260 :
45261 : static PyTypeObject lsa_lsaRSetForestTrustInformation_Type = {
45262 : PyVarObject_HEAD_INIT(NULL, 0)
45263 : .tp_name = "lsa.lsaRSetForestTrustInformation",
45264 : .tp_getset = py_lsa_lsaRSetForestTrustInformation_getsetters,
45265 : .tp_methods = py_lsa_lsaRSetForestTrustInformation_methods,
45266 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
45267 : .tp_new = py_lsa_lsaRSetForestTrustInformation_new,
45268 : };
45269 :
45270 68 : static bool pack_py_lsa_lsaRSetForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct lsa_lsaRSetForestTrustInformation *r)
45271 : {
45272 : PyObject *py_handle;
45273 : PyObject *py_trusted_domain_name;
45274 : PyObject *py_highest_record_type;
45275 : PyObject *py_forest_trust_info;
45276 : PyObject *py_check_only;
45277 68 : const char *kwnames[] = {
45278 : "handle", "trusted_domain_name", "highest_record_type", "forest_trust_info", "check_only", NULL
45279 : };
45280 :
45281 68 : 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)) {
45282 0 : return false;
45283 : }
45284 :
45285 68 : if (py_handle == NULL) {
45286 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
45287 0 : return false;
45288 : }
45289 68 : r->in.handle = talloc_ptrtype(r, r->in.handle);
45290 68 : if (r->in.handle == NULL) {
45291 0 : PyErr_NoMemory();
45292 0 : return false;
45293 : }
45294 68 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
45295 68 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
45296 0 : PyErr_NoMemory();
45297 0 : return false;
45298 : }
45299 68 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
45300 68 : if (py_trusted_domain_name == NULL) {
45301 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trusted_domain_name");
45302 0 : return false;
45303 : }
45304 68 : r->in.trusted_domain_name = talloc_ptrtype(r, r->in.trusted_domain_name);
45305 68 : if (r->in.trusted_domain_name == NULL) {
45306 0 : PyErr_NoMemory();
45307 0 : return false;
45308 : }
45309 68 : PY_CHECK_TYPE(&lsa_StringLarge_Type, py_trusted_domain_name, return false;);
45310 68 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain_name)) == NULL) {
45311 0 : PyErr_NoMemory();
45312 0 : return false;
45313 : }
45314 68 : r->in.trusted_domain_name = (struct lsa_StringLarge *)pytalloc_get_ptr(py_trusted_domain_name);
45315 68 : if (py_highest_record_type == NULL) {
45316 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.highest_record_type");
45317 0 : return false;
45318 : }
45319 : {
45320 68 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.highest_record_type));
45321 68 : if (PyLong_Check(py_highest_record_type)) {
45322 : unsigned long long test_var;
45323 68 : test_var = PyLong_AsUnsignedLongLong(py_highest_record_type);
45324 68 : if (PyErr_Occurred() != NULL) {
45325 0 : return false;
45326 : }
45327 68 : if (test_var > uint_max) {
45328 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45329 : PyLong_Type.tp_name, uint_max, test_var);
45330 0 : return false;
45331 : }
45332 68 : r->in.highest_record_type = test_var;
45333 : } else {
45334 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45335 : PyLong_Type.tp_name);
45336 0 : return false;
45337 : }
45338 : }
45339 68 : if (py_forest_trust_info == NULL) {
45340 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.forest_trust_info");
45341 0 : return false;
45342 : }
45343 68 : r->in.forest_trust_info = talloc_ptrtype(r, r->in.forest_trust_info);
45344 68 : if (r->in.forest_trust_info == NULL) {
45345 0 : PyErr_NoMemory();
45346 0 : return false;
45347 : }
45348 68 : PY_CHECK_TYPE(&lsa_ForestTrustInformation_Type, py_forest_trust_info, return false;);
45349 68 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_forest_trust_info)) == NULL) {
45350 0 : PyErr_NoMemory();
45351 0 : return false;
45352 : }
45353 68 : r->in.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_forest_trust_info);
45354 68 : if (py_check_only == NULL) {
45355 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.check_only");
45356 0 : return false;
45357 : }
45358 : {
45359 68 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.check_only));
45360 68 : if (PyLong_Check(py_check_only)) {
45361 : unsigned long long test_var;
45362 68 : test_var = PyLong_AsUnsignedLongLong(py_check_only);
45363 68 : if (PyErr_Occurred() != NULL) {
45364 0 : return false;
45365 : }
45366 68 : if (test_var > uint_max) {
45367 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45368 : PyLong_Type.tp_name, uint_max, test_var);
45369 0 : return false;
45370 : }
45371 68 : r->in.check_only = test_var;
45372 : } else {
45373 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45374 : PyLong_Type.tp_name);
45375 0 : return false;
45376 : }
45377 : }
45378 68 : return true;
45379 : }
45380 :
45381 68 : static PyObject *unpack_py_lsa_lsaRSetForestTrustInformation_args_out(struct lsa_lsaRSetForestTrustInformation *r)
45382 : {
45383 : PyObject *result;
45384 : PyObject *py_collision_info;
45385 68 : if (*r->out.collision_info == NULL) {
45386 52 : py_collision_info = Py_None;
45387 52 : Py_INCREF(py_collision_info);
45388 : } else {
45389 16 : py_collision_info = pytalloc_reference_ex(&lsa_ForestTrustCollisionInfo_Type, *r->out.collision_info, *r->out.collision_info);
45390 : }
45391 68 : result = py_collision_info;
45392 68 : if (NT_STATUS_IS_ERR(r->out.result)) {
45393 0 : PyErr_SetNTSTATUS(r->out.result);
45394 0 : return NULL;
45395 : }
45396 :
45397 68 : return result;
45398 : }
45399 :
45400 :
45401 0 : static PyObject *py_lsa_LookupSids3_in_get_sids(PyObject *obj, void *closure)
45402 : {
45403 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45404 : PyObject *py_sids;
45405 0 : if (object->in.sids == NULL) {
45406 0 : Py_RETURN_NONE;
45407 : }
45408 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->in.sids, object->in.sids);
45409 0 : return py_sids;
45410 : }
45411 :
45412 0 : static int py_lsa_LookupSids3_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
45413 : {
45414 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45415 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
45416 0 : if (value == NULL) {
45417 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
45418 0 : return -1;
45419 : }
45420 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
45421 0 : if (object->in.sids == NULL) {
45422 0 : PyErr_NoMemory();
45423 0 : return -1;
45424 : }
45425 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
45426 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45427 0 : PyErr_NoMemory();
45428 0 : return -1;
45429 : }
45430 0 : object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
45431 0 : return 0;
45432 : }
45433 :
45434 0 : static PyObject *py_lsa_LookupSids3_out_get_domains(PyObject *obj, void *closure)
45435 : {
45436 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45437 : PyObject *py_domains;
45438 0 : if (object->out.domains == NULL) {
45439 0 : Py_RETURN_NONE;
45440 : }
45441 0 : if (*object->out.domains == NULL) {
45442 0 : py_domains = Py_None;
45443 0 : Py_INCREF(py_domains);
45444 : } else {
45445 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
45446 : }
45447 0 : return py_domains;
45448 : }
45449 :
45450 0 : static int py_lsa_LookupSids3_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
45451 : {
45452 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45453 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
45454 0 : if (value == NULL) {
45455 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
45456 0 : return -1;
45457 : }
45458 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
45459 0 : if (object->out.domains == NULL) {
45460 0 : PyErr_NoMemory();
45461 0 : return -1;
45462 : }
45463 0 : if (value == Py_None) {
45464 0 : *object->out.domains = NULL;
45465 : } else {
45466 0 : *object->out.domains = NULL;
45467 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
45468 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45469 0 : PyErr_NoMemory();
45470 0 : return -1;
45471 : }
45472 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
45473 : }
45474 0 : return 0;
45475 : }
45476 :
45477 0 : static PyObject *py_lsa_LookupSids3_in_get_names(PyObject *obj, void *closure)
45478 : {
45479 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45480 : PyObject *py_names;
45481 0 : if (object->in.names == NULL) {
45482 0 : Py_RETURN_NONE;
45483 : }
45484 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, object->in.names, object->in.names);
45485 0 : return py_names;
45486 : }
45487 :
45488 0 : static int py_lsa_LookupSids3_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
45489 : {
45490 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45491 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.names));
45492 0 : if (value == NULL) {
45493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
45494 0 : return -1;
45495 : }
45496 0 : object->in.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names);
45497 0 : if (object->in.names == NULL) {
45498 0 : PyErr_NoMemory();
45499 0 : return -1;
45500 : }
45501 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, value, return -1;);
45502 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45503 0 : PyErr_NoMemory();
45504 0 : return -1;
45505 : }
45506 0 : object->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(value);
45507 0 : return 0;
45508 : }
45509 :
45510 0 : static PyObject *py_lsa_LookupSids3_out_get_names(PyObject *obj, void *closure)
45511 : {
45512 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45513 : PyObject *py_names;
45514 0 : if (object->out.names == NULL) {
45515 0 : Py_RETURN_NONE;
45516 : }
45517 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, object->out.names, object->out.names);
45518 0 : return py_names;
45519 : }
45520 :
45521 0 : static int py_lsa_LookupSids3_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
45522 : {
45523 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45524 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
45525 0 : if (value == NULL) {
45526 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.names");
45527 0 : return -1;
45528 : }
45529 0 : object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
45530 0 : if (object->out.names == NULL) {
45531 0 : PyErr_NoMemory();
45532 0 : return -1;
45533 : }
45534 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, value, return -1;);
45535 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45536 0 : PyErr_NoMemory();
45537 0 : return -1;
45538 : }
45539 0 : object->out.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(value);
45540 0 : return 0;
45541 : }
45542 :
45543 0 : static PyObject *py_lsa_LookupSids3_in_get_level(PyObject *obj, void *closure)
45544 : {
45545 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45546 : PyObject *py_level;
45547 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
45548 0 : return py_level;
45549 : }
45550 :
45551 0 : static int py_lsa_LookupSids3_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
45552 : {
45553 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45554 0 : if (value == NULL) {
45555 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
45556 0 : return -1;
45557 : }
45558 : {
45559 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
45560 0 : if (PyLong_Check(value)) {
45561 : unsigned long long test_var;
45562 0 : test_var = PyLong_AsUnsignedLongLong(value);
45563 0 : if (PyErr_Occurred() != NULL) {
45564 0 : return -1;
45565 : }
45566 0 : if (test_var > uint_max) {
45567 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45568 : PyLong_Type.tp_name, uint_max, test_var);
45569 0 : return -1;
45570 : }
45571 0 : object->in.level = test_var;
45572 : } else {
45573 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45574 : PyLong_Type.tp_name);
45575 0 : return -1;
45576 : }
45577 : }
45578 0 : return 0;
45579 : }
45580 :
45581 0 : static PyObject *py_lsa_LookupSids3_in_get_count(PyObject *obj, void *closure)
45582 : {
45583 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45584 : PyObject *py_count;
45585 0 : if (object->in.count == NULL) {
45586 0 : Py_RETURN_NONE;
45587 : }
45588 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
45589 0 : return py_count;
45590 : }
45591 :
45592 0 : static int py_lsa_LookupSids3_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
45593 : {
45594 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45595 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
45596 0 : if (value == NULL) {
45597 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
45598 0 : return -1;
45599 : }
45600 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
45601 0 : if (object->in.count == NULL) {
45602 0 : PyErr_NoMemory();
45603 0 : return -1;
45604 : }
45605 : {
45606 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
45607 0 : if (PyLong_Check(value)) {
45608 : unsigned long long test_var;
45609 0 : test_var = PyLong_AsUnsignedLongLong(value);
45610 0 : if (PyErr_Occurred() != NULL) {
45611 0 : return -1;
45612 : }
45613 0 : if (test_var > uint_max) {
45614 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45615 : PyLong_Type.tp_name, uint_max, test_var);
45616 0 : return -1;
45617 : }
45618 0 : *object->in.count = test_var;
45619 : } else {
45620 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45621 : PyLong_Type.tp_name);
45622 0 : return -1;
45623 : }
45624 : }
45625 0 : return 0;
45626 : }
45627 :
45628 0 : static PyObject *py_lsa_LookupSids3_out_get_count(PyObject *obj, void *closure)
45629 : {
45630 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45631 : PyObject *py_count;
45632 0 : if (object->out.count == NULL) {
45633 0 : Py_RETURN_NONE;
45634 : }
45635 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
45636 0 : return py_count;
45637 : }
45638 :
45639 0 : static int py_lsa_LookupSids3_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
45640 : {
45641 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45642 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
45643 0 : if (value == NULL) {
45644 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
45645 0 : return -1;
45646 : }
45647 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
45648 0 : if (object->out.count == NULL) {
45649 0 : PyErr_NoMemory();
45650 0 : return -1;
45651 : }
45652 : {
45653 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
45654 0 : if (PyLong_Check(value)) {
45655 : unsigned long long test_var;
45656 0 : test_var = PyLong_AsUnsignedLongLong(value);
45657 0 : if (PyErr_Occurred() != NULL) {
45658 0 : return -1;
45659 : }
45660 0 : if (test_var > uint_max) {
45661 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45662 : PyLong_Type.tp_name, uint_max, test_var);
45663 0 : return -1;
45664 : }
45665 0 : *object->out.count = test_var;
45666 : } else {
45667 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45668 : PyLong_Type.tp_name);
45669 0 : return -1;
45670 : }
45671 : }
45672 0 : return 0;
45673 : }
45674 :
45675 0 : static PyObject *py_lsa_LookupSids3_in_get_lookup_options(PyObject *obj, void *closure)
45676 : {
45677 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45678 : PyObject *py_lookup_options;
45679 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)object->in.lookup_options);
45680 0 : return py_lookup_options;
45681 : }
45682 :
45683 0 : static int py_lsa_LookupSids3_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
45684 : {
45685 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45686 0 : if (value == NULL) {
45687 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lookup_options");
45688 0 : return -1;
45689 : }
45690 : {
45691 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
45692 0 : if (PyLong_Check(value)) {
45693 : unsigned long long test_var;
45694 0 : test_var = PyLong_AsUnsignedLongLong(value);
45695 0 : if (PyErr_Occurred() != NULL) {
45696 0 : return -1;
45697 : }
45698 0 : if (test_var > uint_max) {
45699 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45700 : PyLong_Type.tp_name, uint_max, test_var);
45701 0 : return -1;
45702 : }
45703 0 : object->in.lookup_options = test_var;
45704 : } else {
45705 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45706 : PyLong_Type.tp_name);
45707 0 : return -1;
45708 : }
45709 : }
45710 0 : return 0;
45711 : }
45712 :
45713 0 : static PyObject *py_lsa_LookupSids3_in_get_client_revision(PyObject *obj, void *closure)
45714 : {
45715 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45716 : PyObject *py_client_revision;
45717 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)object->in.client_revision);
45718 0 : return py_client_revision;
45719 : }
45720 :
45721 0 : static int py_lsa_LookupSids3_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
45722 : {
45723 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45724 0 : if (value == NULL) {
45725 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_revision");
45726 0 : return -1;
45727 : }
45728 : {
45729 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
45730 0 : if (PyLong_Check(value)) {
45731 : unsigned long long test_var;
45732 0 : test_var = PyLong_AsUnsignedLongLong(value);
45733 0 : if (PyErr_Occurred() != NULL) {
45734 0 : return -1;
45735 : }
45736 0 : if (test_var > uint_max) {
45737 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45738 : PyLong_Type.tp_name, uint_max, test_var);
45739 0 : return -1;
45740 : }
45741 0 : object->in.client_revision = test_var;
45742 : } else {
45743 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45744 : PyLong_Type.tp_name);
45745 0 : return -1;
45746 : }
45747 : }
45748 0 : return 0;
45749 : }
45750 :
45751 0 : static PyObject *py_lsa_LookupSids3_get_result(PyObject *obj, void *closure)
45752 : {
45753 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45754 : PyObject *py_result;
45755 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
45756 0 : return py_result;
45757 : }
45758 :
45759 0 : static int py_lsa_LookupSids3_set_result(PyObject *py_obj, PyObject *value, void *closure)
45760 : {
45761 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45762 0 : if (value == NULL) {
45763 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
45764 0 : return -1;
45765 : }
45766 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
45767 0 : return 0;
45768 : }
45769 :
45770 : static PyGetSetDef py_lsa_LookupSids3_getsetters[] = {
45771 : {
45772 : .name = discard_const_p(char, "in_sids"),
45773 : .get = py_lsa_LookupSids3_in_get_sids,
45774 : .set = py_lsa_LookupSids3_in_set_sids,
45775 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
45776 : },
45777 : {
45778 : .name = discard_const_p(char, "out_domains"),
45779 : .get = py_lsa_LookupSids3_out_get_domains,
45780 : .set = py_lsa_LookupSids3_out_set_domains,
45781 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
45782 : },
45783 : {
45784 : .name = discard_const_p(char, "in_names"),
45785 : .get = py_lsa_LookupSids3_in_get_names,
45786 : .set = py_lsa_LookupSids3_in_set_names,
45787 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray2")
45788 : },
45789 : {
45790 : .name = discard_const_p(char, "out_names"),
45791 : .get = py_lsa_LookupSids3_out_get_names,
45792 : .set = py_lsa_LookupSids3_out_set_names,
45793 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray2")
45794 : },
45795 : {
45796 : .name = discard_const_p(char, "in_level"),
45797 : .get = py_lsa_LookupSids3_in_get_level,
45798 : .set = py_lsa_LookupSids3_in_set_level,
45799 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
45800 : },
45801 : {
45802 : .name = discard_const_p(char, "in_count"),
45803 : .get = py_lsa_LookupSids3_in_get_count,
45804 : .set = py_lsa_LookupSids3_in_set_count,
45805 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
45806 : },
45807 : {
45808 : .name = discard_const_p(char, "out_count"),
45809 : .get = py_lsa_LookupSids3_out_get_count,
45810 : .set = py_lsa_LookupSids3_out_set_count,
45811 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
45812 : },
45813 : {
45814 : .name = discard_const_p(char, "in_lookup_options"),
45815 : .get = py_lsa_LookupSids3_in_get_lookup_options,
45816 : .set = py_lsa_LookupSids3_in_set_lookup_options,
45817 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
45818 : },
45819 : {
45820 : .name = discard_const_p(char, "in_client_revision"),
45821 : .get = py_lsa_LookupSids3_in_get_client_revision,
45822 : .set = py_lsa_LookupSids3_in_set_client_revision,
45823 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
45824 : },
45825 : {
45826 : .name = discard_const_p(char, "result"),
45827 : .get = py_lsa_LookupSids3_get_result,
45828 : .set = py_lsa_LookupSids3_set_result,
45829 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
45830 : },
45831 : { .name = NULL }
45832 : };
45833 :
45834 0 : static PyObject *py_lsa_LookupSids3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
45835 : {
45836 0 : PyObject *self = pytalloc_new(struct lsa_LookupSids3, type);
45837 0 : struct lsa_LookupSids3 *_self = (struct lsa_LookupSids3 *)pytalloc_get_ptr(self);
45838 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
45839 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
45840 : /* a pointer to a NULL pointer */
45841 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
45842 0 : _self->in.names = talloc_zero(mem_ctx, struct lsa_TransNameArray2);
45843 0 : _self->out.names = talloc_zero(mem_ctx, struct lsa_TransNameArray2);
45844 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
45845 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
45846 0 : return self;
45847 : }
45848 :
45849 0 : static PyObject *py_lsa_LookupSids3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
45850 : {
45851 :
45852 :
45853 0 : return PyLong_FromLong(76);
45854 : }
45855 :
45856 0 : static PyObject *py_lsa_LookupSids3_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
45857 : {
45858 0 : const struct ndr_interface_call *call = NULL;
45859 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45860 0 : PyObject *ret = NULL;
45861 0 : struct ndr_push *push = NULL;
45862 : DATA_BLOB blob;
45863 : enum ndr_err_code err;
45864 :
45865 0 : if (ndr_table_lsarpc.num_calls < 77) {
45866 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids3_ndr_pack");
45867 0 : return NULL;
45868 : }
45869 0 : call = &ndr_table_lsarpc.calls[76];
45870 :
45871 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
45872 0 : if (push == NULL) {
45873 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45874 0 : return NULL;
45875 : }
45876 :
45877 0 : push->flags |= ndr_push_flags;
45878 :
45879 0 : err = call->ndr_push(push, ndr_inout_flags, object);
45880 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45881 0 : TALLOC_FREE(push);
45882 0 : PyErr_SetNdrError(err);
45883 0 : return NULL;
45884 : }
45885 0 : blob = ndr_push_blob(push);
45886 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
45887 0 : TALLOC_FREE(push);
45888 0 : return ret;
45889 : }
45890 :
45891 0 : static PyObject *py_lsa_LookupSids3_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45892 : {
45893 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45894 0 : PyObject *bigendian_obj = NULL;
45895 0 : PyObject *ndr64_obj = NULL;
45896 0 : uint32_t ndr_push_flags = 0;
45897 :
45898 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
45899 : discard_const_p(char *, kwnames),
45900 : &bigendian_obj,
45901 : &ndr64_obj)) {
45902 0 : return NULL;
45903 : }
45904 :
45905 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45906 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45907 : }
45908 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45909 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45910 : }
45911 :
45912 0 : return py_lsa_LookupSids3_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
45913 : }
45914 :
45915 0 : static PyObject *py_lsa_LookupSids3_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45916 : {
45917 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45918 0 : PyObject *bigendian_obj = NULL;
45919 0 : PyObject *ndr64_obj = NULL;
45920 0 : uint32_t ndr_push_flags = 0;
45921 :
45922 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
45923 : discard_const_p(char *, kwnames),
45924 : &bigendian_obj,
45925 : &ndr64_obj)) {
45926 0 : return NULL;
45927 : }
45928 :
45929 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45930 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45931 : }
45932 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45933 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45934 : }
45935 :
45936 0 : return py_lsa_LookupSids3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
45937 : }
45938 :
45939 0 : static PyObject *py_lsa_LookupSids3_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
45940 : {
45941 0 : const struct ndr_interface_call *call = NULL;
45942 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45943 0 : struct ndr_pull *pull = NULL;
45944 : enum ndr_err_code err;
45945 :
45946 0 : if (ndr_table_lsarpc.num_calls < 77) {
45947 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids3_ndr_unpack");
45948 0 : return NULL;
45949 : }
45950 0 : call = &ndr_table_lsarpc.calls[76];
45951 :
45952 0 : pull = ndr_pull_init_blob(blob, object);
45953 0 : if (pull == NULL) {
45954 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45955 0 : return NULL;
45956 : }
45957 :
45958 0 : pull->flags |= ndr_pull_flags;
45959 :
45960 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
45961 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45962 0 : TALLOC_FREE(pull);
45963 0 : PyErr_SetNdrError(err);
45964 0 : return NULL;
45965 : }
45966 0 : if (!allow_remaining) {
45967 : uint32_t highest_ofs;
45968 :
45969 0 : if (pull->offset > pull->relative_highest_offset) {
45970 0 : highest_ofs = pull->offset;
45971 : } else {
45972 0 : highest_ofs = pull->relative_highest_offset;
45973 : }
45974 0 : if (highest_ofs < pull->data_size) {
45975 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
45976 : "not all bytes consumed ofs[%u] size[%u]",
45977 : highest_ofs, pull->data_size);
45978 0 : TALLOC_FREE(pull);
45979 0 : PyErr_SetNdrError(err);
45980 0 : return NULL;
45981 : }
45982 : }
45983 :
45984 0 : TALLOC_FREE(pull);
45985 0 : Py_RETURN_NONE;
45986 : }
45987 :
45988 0 : static PyObject *py_lsa_LookupSids3_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45989 : {
45990 : DATA_BLOB blob;
45991 0 : Py_ssize_t blob_length = 0;
45992 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45993 0 : PyObject *bigendian_obj = NULL;
45994 0 : PyObject *ndr64_obj = NULL;
45995 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45996 0 : PyObject *allow_remaining_obj = NULL;
45997 0 : bool allow_remaining = false;
45998 :
45999 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
46000 : discard_const_p(char *, kwnames),
46001 : &blob.data, &blob_length,
46002 : &bigendian_obj,
46003 : &ndr64_obj,
46004 : &allow_remaining_obj)) {
46005 0 : return NULL;
46006 : }
46007 0 : blob.length = blob_length;
46008 :
46009 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46010 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46011 : }
46012 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46013 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46014 : }
46015 :
46016 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46017 0 : allow_remaining = true;
46018 : }
46019 :
46020 0 : return py_lsa_LookupSids3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
46021 : }
46022 :
46023 0 : static PyObject *py_lsa_LookupSids3_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46024 : {
46025 : DATA_BLOB blob;
46026 0 : Py_ssize_t blob_length = 0;
46027 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46028 0 : PyObject *bigendian_obj = NULL;
46029 0 : PyObject *ndr64_obj = NULL;
46030 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46031 0 : PyObject *allow_remaining_obj = NULL;
46032 0 : bool allow_remaining = false;
46033 :
46034 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
46035 : discard_const_p(char *, kwnames),
46036 : &blob.data, &blob_length,
46037 : &bigendian_obj,
46038 : &ndr64_obj,
46039 : &allow_remaining_obj)) {
46040 0 : return NULL;
46041 : }
46042 0 : blob.length = blob_length;
46043 :
46044 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46045 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46046 : }
46047 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46048 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46049 : }
46050 :
46051 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46052 0 : allow_remaining = true;
46053 : }
46054 :
46055 0 : return py_lsa_LookupSids3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
46056 : }
46057 :
46058 0 : static PyObject *py_lsa_LookupSids3_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
46059 : {
46060 0 : const struct ndr_interface_call *call = NULL;
46061 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
46062 : PyObject *ret;
46063 : char *retstr;
46064 :
46065 0 : if (ndr_table_lsarpc.num_calls < 77) {
46066 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids3_ndr_print");
46067 0 : return NULL;
46068 : }
46069 0 : call = &ndr_table_lsarpc.calls[76];
46070 :
46071 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
46072 0 : ret = PyUnicode_FromString(retstr);
46073 0 : TALLOC_FREE(retstr);
46074 :
46075 0 : return ret;
46076 : }
46077 :
46078 0 : static PyObject *py_lsa_LookupSids3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46079 : {
46080 0 : return py_lsa_LookupSids3_ndr_print(py_obj, "lsa_LookupSids3_in", NDR_IN);
46081 : }
46082 :
46083 0 : static PyObject *py_lsa_LookupSids3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46084 : {
46085 0 : return py_lsa_LookupSids3_ndr_print(py_obj, "lsa_LookupSids3_out", NDR_OUT);
46086 : }
46087 :
46088 : static PyMethodDef py_lsa_LookupSids3_methods[] = {
46089 : { "opnum", (PyCFunction)py_lsa_LookupSids3_ndr_opnum, METH_NOARGS|METH_CLASS,
46090 : "lsa.LookupSids3.opnum() -> 76 (0x4c) " },
46091 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids3_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
46092 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
46093 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids3_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
46094 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
46095 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids3_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
46096 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
46097 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids3_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
46098 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
46099 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupSids3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
46100 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupSids3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
46101 : { NULL, NULL, 0, NULL }
46102 : };
46103 :
46104 :
46105 : static PyTypeObject lsa_LookupSids3_Type = {
46106 : PyVarObject_HEAD_INIT(NULL, 0)
46107 : .tp_name = "lsa.LookupSids3",
46108 : .tp_getset = py_lsa_LookupSids3_getsetters,
46109 : .tp_methods = py_lsa_LookupSids3_methods,
46110 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
46111 : .tp_new = py_lsa_LookupSids3_new,
46112 : };
46113 :
46114 9 : static bool pack_py_lsa_LookupSids3_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids3 *r)
46115 : {
46116 : PyObject *py_sids;
46117 : PyObject *py_names;
46118 : PyObject *py_level;
46119 : PyObject *py_count;
46120 : PyObject *py_lookup_options;
46121 : PyObject *py_client_revision;
46122 9 : const char *kwnames[] = {
46123 : "sids", "names", "level", "count", "lookup_options", "client_revision", NULL
46124 : };
46125 :
46126 9 : 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)) {
46127 0 : return false;
46128 : }
46129 :
46130 9 : if (py_sids == NULL) {
46131 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
46132 0 : return false;
46133 : }
46134 9 : r->in.sids = talloc_ptrtype(r, r->in.sids);
46135 9 : if (r->in.sids == NULL) {
46136 0 : PyErr_NoMemory();
46137 0 : return false;
46138 : }
46139 9 : PY_CHECK_TYPE(&lsa_SidArray_Type, py_sids, return false;);
46140 9 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
46141 0 : PyErr_NoMemory();
46142 0 : return false;
46143 : }
46144 9 : r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
46145 9 : if (py_names == NULL) {
46146 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
46147 0 : return false;
46148 : }
46149 9 : r->in.names = talloc_ptrtype(r, r->in.names);
46150 9 : if (r->in.names == NULL) {
46151 0 : PyErr_NoMemory();
46152 0 : return false;
46153 : }
46154 9 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, py_names, return false;);
46155 9 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_names)) == NULL) {
46156 0 : PyErr_NoMemory();
46157 0 : return false;
46158 : }
46159 9 : r->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_names);
46160 9 : if (py_level == NULL) {
46161 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
46162 0 : return false;
46163 : }
46164 : {
46165 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
46166 9 : if (PyLong_Check(py_level)) {
46167 : unsigned long long test_var;
46168 9 : test_var = PyLong_AsUnsignedLongLong(py_level);
46169 9 : if (PyErr_Occurred() != NULL) {
46170 0 : return false;
46171 : }
46172 9 : if (test_var > uint_max) {
46173 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46174 : PyLong_Type.tp_name, uint_max, test_var);
46175 0 : return false;
46176 : }
46177 9 : r->in.level = test_var;
46178 : } else {
46179 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46180 : PyLong_Type.tp_name);
46181 0 : return false;
46182 : }
46183 : }
46184 9 : if (py_count == NULL) {
46185 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
46186 0 : return false;
46187 : }
46188 9 : r->in.count = talloc_ptrtype(r, r->in.count);
46189 9 : if (r->in.count == NULL) {
46190 0 : PyErr_NoMemory();
46191 0 : return false;
46192 : }
46193 : {
46194 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
46195 9 : if (PyLong_Check(py_count)) {
46196 : unsigned long long test_var;
46197 9 : test_var = PyLong_AsUnsignedLongLong(py_count);
46198 9 : if (PyErr_Occurred() != NULL) {
46199 0 : return false;
46200 : }
46201 9 : if (test_var > uint_max) {
46202 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46203 : PyLong_Type.tp_name, uint_max, test_var);
46204 0 : return false;
46205 : }
46206 9 : *r->in.count = test_var;
46207 : } else {
46208 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46209 : PyLong_Type.tp_name);
46210 0 : return false;
46211 : }
46212 : }
46213 9 : if (py_lookup_options == NULL) {
46214 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lookup_options");
46215 0 : return false;
46216 : }
46217 : {
46218 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
46219 9 : if (PyLong_Check(py_lookup_options)) {
46220 : unsigned long long test_var;
46221 9 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
46222 9 : if (PyErr_Occurred() != NULL) {
46223 0 : return false;
46224 : }
46225 9 : if (test_var > uint_max) {
46226 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46227 : PyLong_Type.tp_name, uint_max, test_var);
46228 0 : return false;
46229 : }
46230 9 : r->in.lookup_options = test_var;
46231 : } else {
46232 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46233 : PyLong_Type.tp_name);
46234 0 : return false;
46235 : }
46236 : }
46237 9 : if (py_client_revision == NULL) {
46238 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_revision");
46239 0 : return false;
46240 : }
46241 : {
46242 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
46243 9 : if (PyLong_Check(py_client_revision)) {
46244 : unsigned long long test_var;
46245 9 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
46246 9 : if (PyErr_Occurred() != NULL) {
46247 0 : return false;
46248 : }
46249 9 : if (test_var > uint_max) {
46250 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46251 : PyLong_Type.tp_name, uint_max, test_var);
46252 0 : return false;
46253 : }
46254 9 : r->in.client_revision = test_var;
46255 : } else {
46256 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46257 : PyLong_Type.tp_name);
46258 0 : return false;
46259 : }
46260 : }
46261 9 : return true;
46262 : }
46263 :
46264 8 : static PyObject *unpack_py_lsa_LookupSids3_args_out(struct lsa_LookupSids3 *r)
46265 : {
46266 : PyObject *result;
46267 : PyObject *py_domains;
46268 : PyObject *py_names;
46269 : PyObject *py_count;
46270 8 : result = PyTuple_New(3);
46271 8 : if (*r->out.domains == NULL) {
46272 0 : py_domains = Py_None;
46273 0 : Py_INCREF(py_domains);
46274 : } else {
46275 8 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
46276 : }
46277 8 : PyTuple_SetItem(result, 0, py_domains);
46278 8 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, r->out.names, r->out.names);
46279 8 : PyTuple_SetItem(result, 1, py_names);
46280 8 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
46281 8 : PyTuple_SetItem(result, 2, py_count);
46282 8 : if (NT_STATUS_IS_ERR(r->out.result)) {
46283 0 : PyErr_SetNTSTATUS(r->out.result);
46284 0 : return NULL;
46285 : }
46286 :
46287 8 : return result;
46288 : }
46289 :
46290 :
46291 0 : static PyObject *py_lsa_LookupNames4_in_get_num_names(PyObject *obj, void *closure)
46292 : {
46293 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46294 : PyObject *py_num_names;
46295 0 : py_num_names = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_names);
46296 0 : return py_num_names;
46297 : }
46298 :
46299 0 : static int py_lsa_LookupNames4_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
46300 : {
46301 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46302 0 : if (value == NULL) {
46303 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_names");
46304 0 : return -1;
46305 : }
46306 : {
46307 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names));
46308 0 : if (PyLong_Check(value)) {
46309 : unsigned long long test_var;
46310 0 : test_var = PyLong_AsUnsignedLongLong(value);
46311 0 : if (PyErr_Occurred() != NULL) {
46312 0 : return -1;
46313 : }
46314 0 : if (test_var > uint_max) {
46315 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46316 : PyLong_Type.tp_name, uint_max, test_var);
46317 0 : return -1;
46318 : }
46319 0 : object->in.num_names = test_var;
46320 : } else {
46321 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46322 : PyLong_Type.tp_name);
46323 0 : return -1;
46324 : }
46325 : }
46326 0 : return 0;
46327 : }
46328 :
46329 0 : static PyObject *py_lsa_LookupNames4_in_get_names(PyObject *obj, void *closure)
46330 : {
46331 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46332 : PyObject *py_names;
46333 0 : py_names = PyList_New(object->in.num_names);
46334 0 : if (py_names == NULL) {
46335 0 : return NULL;
46336 : }
46337 : {
46338 : int names_cntr_0;
46339 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) {
46340 : PyObject *py_names_0;
46341 0 : py_names_0 = pytalloc_reference_ex(&lsa_String_Type, object->in.names, &object->in.names[names_cntr_0]);
46342 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
46343 : }
46344 : }
46345 0 : return py_names;
46346 : }
46347 :
46348 0 : static int py_lsa_LookupNames4_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
46349 : {
46350 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46351 0 : if (value == NULL) {
46352 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
46353 0 : return -1;
46354 : }
46355 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
46356 : {
46357 : int names_cntr_0;
46358 0 : object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value));
46359 0 : if (!object->in.names) { return -1;; }
46360 0 : talloc_set_name_const(object->in.names, "ARRAY: object->in.names");
46361 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
46362 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
46363 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names[names_cntr_0]");
46364 0 : return -1;
46365 : }
46366 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
46367 0 : if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
46368 0 : PyErr_NoMemory();
46369 0 : return -1;
46370 : }
46371 0 : object->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
46372 : }
46373 : }
46374 0 : return 0;
46375 : }
46376 :
46377 0 : static PyObject *py_lsa_LookupNames4_out_get_domains(PyObject *obj, void *closure)
46378 : {
46379 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46380 : PyObject *py_domains;
46381 0 : if (object->out.domains == NULL) {
46382 0 : Py_RETURN_NONE;
46383 : }
46384 0 : if (*object->out.domains == NULL) {
46385 0 : py_domains = Py_None;
46386 0 : Py_INCREF(py_domains);
46387 : } else {
46388 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
46389 : }
46390 0 : return py_domains;
46391 : }
46392 :
46393 0 : static int py_lsa_LookupNames4_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
46394 : {
46395 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46396 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
46397 0 : if (value == NULL) {
46398 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
46399 0 : return -1;
46400 : }
46401 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
46402 0 : if (object->out.domains == NULL) {
46403 0 : PyErr_NoMemory();
46404 0 : return -1;
46405 : }
46406 0 : if (value == Py_None) {
46407 0 : *object->out.domains = NULL;
46408 : } else {
46409 0 : *object->out.domains = NULL;
46410 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
46411 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46412 0 : PyErr_NoMemory();
46413 0 : return -1;
46414 : }
46415 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
46416 : }
46417 0 : return 0;
46418 : }
46419 :
46420 0 : static PyObject *py_lsa_LookupNames4_in_get_sids(PyObject *obj, void *closure)
46421 : {
46422 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46423 : PyObject *py_sids;
46424 0 : if (object->in.sids == NULL) {
46425 0 : Py_RETURN_NONE;
46426 : }
46427 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, object->in.sids, object->in.sids);
46428 0 : return py_sids;
46429 : }
46430 :
46431 0 : static int py_lsa_LookupNames4_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
46432 : {
46433 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46434 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
46435 0 : if (value == NULL) {
46436 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
46437 0 : return -1;
46438 : }
46439 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
46440 0 : if (object->in.sids == NULL) {
46441 0 : PyErr_NoMemory();
46442 0 : return -1;
46443 : }
46444 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, value, return -1;);
46445 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46446 0 : PyErr_NoMemory();
46447 0 : return -1;
46448 : }
46449 0 : object->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(value);
46450 0 : return 0;
46451 : }
46452 :
46453 0 : static PyObject *py_lsa_LookupNames4_out_get_sids(PyObject *obj, void *closure)
46454 : {
46455 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46456 : PyObject *py_sids;
46457 0 : if (object->out.sids == NULL) {
46458 0 : Py_RETURN_NONE;
46459 : }
46460 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, object->out.sids, object->out.sids);
46461 0 : return py_sids;
46462 : }
46463 :
46464 0 : static int py_lsa_LookupNames4_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
46465 : {
46466 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46467 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
46468 0 : if (value == NULL) {
46469 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
46470 0 : return -1;
46471 : }
46472 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
46473 0 : if (object->out.sids == NULL) {
46474 0 : PyErr_NoMemory();
46475 0 : return -1;
46476 : }
46477 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, value, return -1;);
46478 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46479 0 : PyErr_NoMemory();
46480 0 : return -1;
46481 : }
46482 0 : object->out.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(value);
46483 0 : return 0;
46484 : }
46485 :
46486 0 : static PyObject *py_lsa_LookupNames4_in_get_level(PyObject *obj, void *closure)
46487 : {
46488 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46489 : PyObject *py_level;
46490 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
46491 0 : return py_level;
46492 : }
46493 :
46494 0 : static int py_lsa_LookupNames4_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
46495 : {
46496 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46497 0 : if (value == NULL) {
46498 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
46499 0 : return -1;
46500 : }
46501 : {
46502 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
46503 0 : if (PyLong_Check(value)) {
46504 : unsigned long long test_var;
46505 0 : test_var = PyLong_AsUnsignedLongLong(value);
46506 0 : if (PyErr_Occurred() != NULL) {
46507 0 : return -1;
46508 : }
46509 0 : if (test_var > uint_max) {
46510 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46511 : PyLong_Type.tp_name, uint_max, test_var);
46512 0 : return -1;
46513 : }
46514 0 : object->in.level = test_var;
46515 : } else {
46516 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46517 : PyLong_Type.tp_name);
46518 0 : return -1;
46519 : }
46520 : }
46521 0 : return 0;
46522 : }
46523 :
46524 0 : static PyObject *py_lsa_LookupNames4_in_get_count(PyObject *obj, void *closure)
46525 : {
46526 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46527 : PyObject *py_count;
46528 0 : if (object->in.count == NULL) {
46529 0 : Py_RETURN_NONE;
46530 : }
46531 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
46532 0 : return py_count;
46533 : }
46534 :
46535 0 : static int py_lsa_LookupNames4_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
46536 : {
46537 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46538 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
46539 0 : if (value == NULL) {
46540 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
46541 0 : return -1;
46542 : }
46543 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
46544 0 : if (object->in.count == NULL) {
46545 0 : PyErr_NoMemory();
46546 0 : return -1;
46547 : }
46548 : {
46549 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
46550 0 : if (PyLong_Check(value)) {
46551 : unsigned long long test_var;
46552 0 : test_var = PyLong_AsUnsignedLongLong(value);
46553 0 : if (PyErr_Occurred() != NULL) {
46554 0 : return -1;
46555 : }
46556 0 : if (test_var > uint_max) {
46557 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46558 : PyLong_Type.tp_name, uint_max, test_var);
46559 0 : return -1;
46560 : }
46561 0 : *object->in.count = test_var;
46562 : } else {
46563 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46564 : PyLong_Type.tp_name);
46565 0 : return -1;
46566 : }
46567 : }
46568 0 : return 0;
46569 : }
46570 :
46571 0 : static PyObject *py_lsa_LookupNames4_out_get_count(PyObject *obj, void *closure)
46572 : {
46573 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46574 : PyObject *py_count;
46575 0 : if (object->out.count == NULL) {
46576 0 : Py_RETURN_NONE;
46577 : }
46578 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
46579 0 : return py_count;
46580 : }
46581 :
46582 0 : static int py_lsa_LookupNames4_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
46583 : {
46584 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46585 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
46586 0 : if (value == NULL) {
46587 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
46588 0 : return -1;
46589 : }
46590 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
46591 0 : if (object->out.count == NULL) {
46592 0 : PyErr_NoMemory();
46593 0 : return -1;
46594 : }
46595 : {
46596 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
46597 0 : if (PyLong_Check(value)) {
46598 : unsigned long long test_var;
46599 0 : test_var = PyLong_AsUnsignedLongLong(value);
46600 0 : if (PyErr_Occurred() != NULL) {
46601 0 : return -1;
46602 : }
46603 0 : if (test_var > uint_max) {
46604 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46605 : PyLong_Type.tp_name, uint_max, test_var);
46606 0 : return -1;
46607 : }
46608 0 : *object->out.count = test_var;
46609 : } else {
46610 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46611 : PyLong_Type.tp_name);
46612 0 : return -1;
46613 : }
46614 : }
46615 0 : return 0;
46616 : }
46617 :
46618 0 : static PyObject *py_lsa_LookupNames4_in_get_lookup_options(PyObject *obj, void *closure)
46619 : {
46620 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46621 : PyObject *py_lookup_options;
46622 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)object->in.lookup_options);
46623 0 : return py_lookup_options;
46624 : }
46625 :
46626 0 : static int py_lsa_LookupNames4_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
46627 : {
46628 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46629 0 : if (value == NULL) {
46630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lookup_options");
46631 0 : return -1;
46632 : }
46633 : {
46634 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
46635 0 : if (PyLong_Check(value)) {
46636 : unsigned long long test_var;
46637 0 : test_var = PyLong_AsUnsignedLongLong(value);
46638 0 : if (PyErr_Occurred() != NULL) {
46639 0 : return -1;
46640 : }
46641 0 : if (test_var > uint_max) {
46642 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46643 : PyLong_Type.tp_name, uint_max, test_var);
46644 0 : return -1;
46645 : }
46646 0 : object->in.lookup_options = test_var;
46647 : } else {
46648 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46649 : PyLong_Type.tp_name);
46650 0 : return -1;
46651 : }
46652 : }
46653 0 : return 0;
46654 : }
46655 :
46656 0 : static PyObject *py_lsa_LookupNames4_in_get_client_revision(PyObject *obj, void *closure)
46657 : {
46658 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46659 : PyObject *py_client_revision;
46660 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)object->in.client_revision);
46661 0 : return py_client_revision;
46662 : }
46663 :
46664 0 : static int py_lsa_LookupNames4_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
46665 : {
46666 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46667 0 : if (value == NULL) {
46668 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_revision");
46669 0 : return -1;
46670 : }
46671 : {
46672 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
46673 0 : if (PyLong_Check(value)) {
46674 : unsigned long long test_var;
46675 0 : test_var = PyLong_AsUnsignedLongLong(value);
46676 0 : if (PyErr_Occurred() != NULL) {
46677 0 : return -1;
46678 : }
46679 0 : if (test_var > uint_max) {
46680 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46681 : PyLong_Type.tp_name, uint_max, test_var);
46682 0 : return -1;
46683 : }
46684 0 : object->in.client_revision = test_var;
46685 : } else {
46686 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46687 : PyLong_Type.tp_name);
46688 0 : return -1;
46689 : }
46690 : }
46691 0 : return 0;
46692 : }
46693 :
46694 0 : static PyObject *py_lsa_LookupNames4_get_result(PyObject *obj, void *closure)
46695 : {
46696 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46697 : PyObject *py_result;
46698 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
46699 0 : return py_result;
46700 : }
46701 :
46702 0 : static int py_lsa_LookupNames4_set_result(PyObject *py_obj, PyObject *value, void *closure)
46703 : {
46704 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46705 0 : if (value == NULL) {
46706 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
46707 0 : return -1;
46708 : }
46709 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
46710 0 : return 0;
46711 : }
46712 :
46713 : static PyGetSetDef py_lsa_LookupNames4_getsetters[] = {
46714 : {
46715 : .name = discard_const_p(char, "in_num_names"),
46716 : .get = py_lsa_LookupNames4_in_get_num_names,
46717 : .set = py_lsa_LookupNames4_in_set_num_names,
46718 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
46719 : },
46720 : {
46721 : .name = discard_const_p(char, "in_names"),
46722 : .get = py_lsa_LookupNames4_in_get_names,
46723 : .set = py_lsa_LookupNames4_in_set_names,
46724 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
46725 : },
46726 : {
46727 : .name = discard_const_p(char, "out_domains"),
46728 : .get = py_lsa_LookupNames4_out_get_domains,
46729 : .set = py_lsa_LookupNames4_out_set_domains,
46730 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
46731 : },
46732 : {
46733 : .name = discard_const_p(char, "in_sids"),
46734 : .get = py_lsa_LookupNames4_in_get_sids,
46735 : .set = py_lsa_LookupNames4_in_set_sids,
46736 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray3")
46737 : },
46738 : {
46739 : .name = discard_const_p(char, "out_sids"),
46740 : .get = py_lsa_LookupNames4_out_get_sids,
46741 : .set = py_lsa_LookupNames4_out_set_sids,
46742 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray3")
46743 : },
46744 : {
46745 : .name = discard_const_p(char, "in_level"),
46746 : .get = py_lsa_LookupNames4_in_get_level,
46747 : .set = py_lsa_LookupNames4_in_set_level,
46748 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
46749 : },
46750 : {
46751 : .name = discard_const_p(char, "in_count"),
46752 : .get = py_lsa_LookupNames4_in_get_count,
46753 : .set = py_lsa_LookupNames4_in_set_count,
46754 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
46755 : },
46756 : {
46757 : .name = discard_const_p(char, "out_count"),
46758 : .get = py_lsa_LookupNames4_out_get_count,
46759 : .set = py_lsa_LookupNames4_out_set_count,
46760 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
46761 : },
46762 : {
46763 : .name = discard_const_p(char, "in_lookup_options"),
46764 : .get = py_lsa_LookupNames4_in_get_lookup_options,
46765 : .set = py_lsa_LookupNames4_in_set_lookup_options,
46766 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
46767 : },
46768 : {
46769 : .name = discard_const_p(char, "in_client_revision"),
46770 : .get = py_lsa_LookupNames4_in_get_client_revision,
46771 : .set = py_lsa_LookupNames4_in_set_client_revision,
46772 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
46773 : },
46774 : {
46775 : .name = discard_const_p(char, "result"),
46776 : .get = py_lsa_LookupNames4_get_result,
46777 : .set = py_lsa_LookupNames4_set_result,
46778 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
46779 : },
46780 : { .name = NULL }
46781 : };
46782 :
46783 0 : static PyObject *py_lsa_LookupNames4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
46784 : {
46785 0 : PyObject *self = pytalloc_new(struct lsa_LookupNames4, type);
46786 0 : struct lsa_LookupNames4 *_self = (struct lsa_LookupNames4 *)pytalloc_get_ptr(self);
46787 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
46788 : /* a pointer to a NULL pointer */
46789 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
46790 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray3);
46791 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray3);
46792 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
46793 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
46794 0 : return self;
46795 : }
46796 :
46797 0 : static PyObject *py_lsa_LookupNames4_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
46798 : {
46799 :
46800 :
46801 0 : return PyLong_FromLong(77);
46802 : }
46803 :
46804 0 : static PyObject *py_lsa_LookupNames4_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
46805 : {
46806 0 : const struct ndr_interface_call *call = NULL;
46807 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46808 0 : PyObject *ret = NULL;
46809 0 : struct ndr_push *push = NULL;
46810 : DATA_BLOB blob;
46811 : enum ndr_err_code err;
46812 :
46813 0 : if (ndr_table_lsarpc.num_calls < 78) {
46814 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames4_ndr_pack");
46815 0 : return NULL;
46816 : }
46817 0 : call = &ndr_table_lsarpc.calls[77];
46818 :
46819 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
46820 0 : if (push == NULL) {
46821 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
46822 0 : return NULL;
46823 : }
46824 :
46825 0 : push->flags |= ndr_push_flags;
46826 :
46827 0 : err = call->ndr_push(push, ndr_inout_flags, object);
46828 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
46829 0 : TALLOC_FREE(push);
46830 0 : PyErr_SetNdrError(err);
46831 0 : return NULL;
46832 : }
46833 0 : blob = ndr_push_blob(push);
46834 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
46835 0 : TALLOC_FREE(push);
46836 0 : return ret;
46837 : }
46838 :
46839 0 : static PyObject *py_lsa_LookupNames4_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46840 : {
46841 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
46842 0 : PyObject *bigendian_obj = NULL;
46843 0 : PyObject *ndr64_obj = NULL;
46844 0 : uint32_t ndr_push_flags = 0;
46845 :
46846 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
46847 : discard_const_p(char *, kwnames),
46848 : &bigendian_obj,
46849 : &ndr64_obj)) {
46850 0 : return NULL;
46851 : }
46852 :
46853 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46854 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
46855 : }
46856 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46857 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
46858 : }
46859 :
46860 0 : return py_lsa_LookupNames4_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
46861 : }
46862 :
46863 0 : static PyObject *py_lsa_LookupNames4_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46864 : {
46865 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
46866 0 : PyObject *bigendian_obj = NULL;
46867 0 : PyObject *ndr64_obj = NULL;
46868 0 : uint32_t ndr_push_flags = 0;
46869 :
46870 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
46871 : discard_const_p(char *, kwnames),
46872 : &bigendian_obj,
46873 : &ndr64_obj)) {
46874 0 : return NULL;
46875 : }
46876 :
46877 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46878 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
46879 : }
46880 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46881 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
46882 : }
46883 :
46884 0 : return py_lsa_LookupNames4_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
46885 : }
46886 :
46887 0 : static PyObject *py_lsa_LookupNames4_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
46888 : {
46889 0 : const struct ndr_interface_call *call = NULL;
46890 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46891 0 : struct ndr_pull *pull = NULL;
46892 : enum ndr_err_code err;
46893 :
46894 0 : if (ndr_table_lsarpc.num_calls < 78) {
46895 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames4_ndr_unpack");
46896 0 : return NULL;
46897 : }
46898 0 : call = &ndr_table_lsarpc.calls[77];
46899 :
46900 0 : pull = ndr_pull_init_blob(blob, object);
46901 0 : if (pull == NULL) {
46902 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
46903 0 : return NULL;
46904 : }
46905 :
46906 0 : pull->flags |= ndr_pull_flags;
46907 :
46908 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
46909 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
46910 0 : TALLOC_FREE(pull);
46911 0 : PyErr_SetNdrError(err);
46912 0 : return NULL;
46913 : }
46914 0 : if (!allow_remaining) {
46915 : uint32_t highest_ofs;
46916 :
46917 0 : if (pull->offset > pull->relative_highest_offset) {
46918 0 : highest_ofs = pull->offset;
46919 : } else {
46920 0 : highest_ofs = pull->relative_highest_offset;
46921 : }
46922 0 : if (highest_ofs < pull->data_size) {
46923 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
46924 : "not all bytes consumed ofs[%u] size[%u]",
46925 : highest_ofs, pull->data_size);
46926 0 : TALLOC_FREE(pull);
46927 0 : PyErr_SetNdrError(err);
46928 0 : return NULL;
46929 : }
46930 : }
46931 :
46932 0 : TALLOC_FREE(pull);
46933 0 : Py_RETURN_NONE;
46934 : }
46935 :
46936 0 : static PyObject *py_lsa_LookupNames4_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46937 : {
46938 : DATA_BLOB blob;
46939 0 : Py_ssize_t blob_length = 0;
46940 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46941 0 : PyObject *bigendian_obj = NULL;
46942 0 : PyObject *ndr64_obj = NULL;
46943 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46944 0 : PyObject *allow_remaining_obj = NULL;
46945 0 : bool allow_remaining = false;
46946 :
46947 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
46948 : discard_const_p(char *, kwnames),
46949 : &blob.data, &blob_length,
46950 : &bigendian_obj,
46951 : &ndr64_obj,
46952 : &allow_remaining_obj)) {
46953 0 : return NULL;
46954 : }
46955 0 : blob.length = blob_length;
46956 :
46957 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46958 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46959 : }
46960 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46961 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46962 : }
46963 :
46964 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46965 0 : allow_remaining = true;
46966 : }
46967 :
46968 0 : return py_lsa_LookupNames4_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
46969 : }
46970 :
46971 0 : static PyObject *py_lsa_LookupNames4_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46972 : {
46973 : DATA_BLOB blob;
46974 0 : Py_ssize_t blob_length = 0;
46975 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46976 0 : PyObject *bigendian_obj = NULL;
46977 0 : PyObject *ndr64_obj = NULL;
46978 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46979 0 : PyObject *allow_remaining_obj = NULL;
46980 0 : bool allow_remaining = false;
46981 :
46982 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
46983 : discard_const_p(char *, kwnames),
46984 : &blob.data, &blob_length,
46985 : &bigendian_obj,
46986 : &ndr64_obj,
46987 : &allow_remaining_obj)) {
46988 0 : return NULL;
46989 : }
46990 0 : blob.length = blob_length;
46991 :
46992 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46993 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46994 : }
46995 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46996 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46997 : }
46998 :
46999 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
47000 0 : allow_remaining = true;
47001 : }
47002 :
47003 0 : return py_lsa_LookupNames4_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
47004 : }
47005 :
47006 0 : static PyObject *py_lsa_LookupNames4_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
47007 : {
47008 0 : const struct ndr_interface_call *call = NULL;
47009 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
47010 : PyObject *ret;
47011 : char *retstr;
47012 :
47013 0 : if (ndr_table_lsarpc.num_calls < 78) {
47014 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames4_ndr_print");
47015 0 : return NULL;
47016 : }
47017 0 : call = &ndr_table_lsarpc.calls[77];
47018 :
47019 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
47020 0 : ret = PyUnicode_FromString(retstr);
47021 0 : TALLOC_FREE(retstr);
47022 :
47023 0 : return ret;
47024 : }
47025 :
47026 0 : static PyObject *py_lsa_LookupNames4_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
47027 : {
47028 0 : return py_lsa_LookupNames4_ndr_print(py_obj, "lsa_LookupNames4_in", NDR_IN);
47029 : }
47030 :
47031 0 : static PyObject *py_lsa_LookupNames4_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
47032 : {
47033 0 : return py_lsa_LookupNames4_ndr_print(py_obj, "lsa_LookupNames4_out", NDR_OUT);
47034 : }
47035 :
47036 : static PyMethodDef py_lsa_LookupNames4_methods[] = {
47037 : { "opnum", (PyCFunction)py_lsa_LookupNames4_ndr_opnum, METH_NOARGS|METH_CLASS,
47038 : "lsa.LookupNames4.opnum() -> 77 (0x4d) " },
47039 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames4_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
47040 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
47041 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames4_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
47042 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
47043 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames4_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
47044 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
47045 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames4_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
47046 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
47047 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupNames4_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
47048 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupNames4_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
47049 : { NULL, NULL, 0, NULL }
47050 : };
47051 :
47052 :
47053 : static PyTypeObject lsa_LookupNames4_Type = {
47054 : PyVarObject_HEAD_INIT(NULL, 0)
47055 : .tp_name = "lsa.LookupNames4",
47056 : .tp_getset = py_lsa_LookupNames4_getsetters,
47057 : .tp_methods = py_lsa_LookupNames4_methods,
47058 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
47059 : .tp_new = py_lsa_LookupNames4_new,
47060 : };
47061 :
47062 7 : static bool pack_py_lsa_LookupNames4_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames4 *r)
47063 : {
47064 : PyObject *py_names;
47065 : PyObject *py_sids;
47066 : PyObject *py_level;
47067 : PyObject *py_count;
47068 : PyObject *py_lookup_options;
47069 : PyObject *py_client_revision;
47070 7 : const char *kwnames[] = {
47071 : "names", "sids", "level", "count", "lookup_options", "client_revision", NULL
47072 : };
47073 :
47074 7 : 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)) {
47075 0 : return false;
47076 : }
47077 :
47078 7 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
47079 7 : r->in.num_names = PyList_GET_SIZE(py_names);
47080 7 : if (py_names == NULL) {
47081 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
47082 0 : return false;
47083 : }
47084 7 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
47085 : {
47086 : int names_cntr_0;
47087 7 : r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
47088 7 : if (!r->in.names) { return false;; }
47089 7 : talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
47090 15 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
47091 8 : if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) {
47092 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names[names_cntr_0]");
47093 0 : return false;
47094 : }
47095 8 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
47096 8 : if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
47097 0 : PyErr_NoMemory();
47098 0 : return false;
47099 : }
47100 8 : r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
47101 : }
47102 : }
47103 7 : if (py_sids == NULL) {
47104 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
47105 0 : return false;
47106 : }
47107 7 : r->in.sids = talloc_ptrtype(r, r->in.sids);
47108 7 : if (r->in.sids == NULL) {
47109 0 : PyErr_NoMemory();
47110 0 : return false;
47111 : }
47112 7 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, py_sids, return false;);
47113 7 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
47114 0 : PyErr_NoMemory();
47115 0 : return false;
47116 : }
47117 7 : r->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_sids);
47118 7 : if (py_level == NULL) {
47119 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
47120 0 : return false;
47121 : }
47122 : {
47123 7 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
47124 7 : if (PyLong_Check(py_level)) {
47125 : unsigned long long test_var;
47126 7 : test_var = PyLong_AsUnsignedLongLong(py_level);
47127 7 : if (PyErr_Occurred() != NULL) {
47128 0 : return false;
47129 : }
47130 7 : if (test_var > uint_max) {
47131 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47132 : PyLong_Type.tp_name, uint_max, test_var);
47133 0 : return false;
47134 : }
47135 7 : r->in.level = test_var;
47136 : } else {
47137 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47138 : PyLong_Type.tp_name);
47139 0 : return false;
47140 : }
47141 : }
47142 7 : if (py_count == NULL) {
47143 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
47144 0 : return false;
47145 : }
47146 7 : r->in.count = talloc_ptrtype(r, r->in.count);
47147 7 : if (r->in.count == NULL) {
47148 0 : PyErr_NoMemory();
47149 0 : return false;
47150 : }
47151 : {
47152 7 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
47153 7 : if (PyLong_Check(py_count)) {
47154 : unsigned long long test_var;
47155 7 : test_var = PyLong_AsUnsignedLongLong(py_count);
47156 7 : if (PyErr_Occurred() != NULL) {
47157 0 : return false;
47158 : }
47159 7 : if (test_var > uint_max) {
47160 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47161 : PyLong_Type.tp_name, uint_max, test_var);
47162 0 : return false;
47163 : }
47164 7 : *r->in.count = test_var;
47165 : } else {
47166 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47167 : PyLong_Type.tp_name);
47168 0 : return false;
47169 : }
47170 : }
47171 7 : if (py_lookup_options == NULL) {
47172 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lookup_options");
47173 0 : return false;
47174 : }
47175 : {
47176 7 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
47177 7 : if (PyLong_Check(py_lookup_options)) {
47178 : unsigned long long test_var;
47179 7 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
47180 7 : if (PyErr_Occurred() != NULL) {
47181 0 : return false;
47182 : }
47183 7 : if (test_var > uint_max) {
47184 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47185 : PyLong_Type.tp_name, uint_max, test_var);
47186 0 : return false;
47187 : }
47188 7 : r->in.lookup_options = test_var;
47189 : } else {
47190 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47191 : PyLong_Type.tp_name);
47192 0 : return false;
47193 : }
47194 : }
47195 7 : if (py_client_revision == NULL) {
47196 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_revision");
47197 0 : return false;
47198 : }
47199 : {
47200 7 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
47201 7 : if (PyLong_Check(py_client_revision)) {
47202 : unsigned long long test_var;
47203 7 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
47204 7 : if (PyErr_Occurred() != NULL) {
47205 0 : return false;
47206 : }
47207 7 : if (test_var > uint_max) {
47208 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47209 : PyLong_Type.tp_name, uint_max, test_var);
47210 0 : return false;
47211 : }
47212 7 : r->in.client_revision = test_var;
47213 : } else {
47214 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47215 : PyLong_Type.tp_name);
47216 0 : return false;
47217 : }
47218 : }
47219 7 : return true;
47220 : }
47221 :
47222 6 : static PyObject *unpack_py_lsa_LookupNames4_args_out(struct lsa_LookupNames4 *r)
47223 : {
47224 : PyObject *result;
47225 : PyObject *py_domains;
47226 : PyObject *py_sids;
47227 : PyObject *py_count;
47228 6 : result = PyTuple_New(3);
47229 6 : if (*r->out.domains == NULL) {
47230 0 : py_domains = Py_None;
47231 0 : Py_INCREF(py_domains);
47232 : } else {
47233 6 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
47234 : }
47235 6 : PyTuple_SetItem(result, 0, py_domains);
47236 6 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, r->out.sids, r->out.sids);
47237 6 : PyTuple_SetItem(result, 1, py_sids);
47238 6 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
47239 6 : PyTuple_SetItem(result, 2, py_count);
47240 6 : if (NT_STATUS_IS_ERR(r->out.result)) {
47241 0 : PyErr_SetNTSTATUS(r->out.result);
47242 0 : return NULL;
47243 : }
47244 :
47245 6 : return result;
47246 : }
47247 :
47248 : const struct PyNdrRpcMethodDef py_ndr_lsarpc_methods[] = {
47249 : { "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 },
47250 : { "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 },
47251 : { "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 },
47252 : { "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 },
47253 : { "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 },
47254 : { "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 },
47255 : { "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 },
47256 : { "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 },
47257 : { "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 },
47258 : { "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 },
47259 : { "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 },
47260 : { "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 },
47261 : { "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 },
47262 : { "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 },
47263 : { "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 },
47264 : { "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 },
47265 : { "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 },
47266 : { "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 },
47267 : { "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 },
47268 : { "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 },
47269 : { "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 },
47270 : { "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 },
47271 : { "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 },
47272 : { "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 },
47273 : { "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 },
47274 : { "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 },
47275 : { "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 },
47276 : { "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 },
47277 : { "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 },
47278 : { "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 },
47279 : { "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 },
47280 : { "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 },
47281 : { "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 },
47282 : { "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 },
47283 : { "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 },
47284 : { "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 },
47285 : { "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 },
47286 : { "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 },
47287 : { "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 },
47288 : { "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 },
47289 : { "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 },
47290 : { "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 },
47291 : { "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 },
47292 : { "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 },
47293 : { "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 },
47294 : { "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 },
47295 : { "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 },
47296 : { "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 },
47297 : { "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 },
47298 : { "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 },
47299 : { "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 },
47300 : { "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 },
47301 : { "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 },
47302 : { "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 },
47303 : { "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 },
47304 : { "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 },
47305 : { "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 },
47306 : { "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 },
47307 : { "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 },
47308 : { "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 },
47309 : {0}
47310 : };
47311 :
47312 241 : static PyObject *interface_lsarpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
47313 : {
47314 241 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_lsarpc);
47315 : }
47316 :
47317 : #define PY_DOC_LSARPC "Local Security Authority"
47318 : static PyTypeObject lsarpc_InterfaceType = {
47319 : PyVarObject_HEAD_INIT(NULL, 0)
47320 : .tp_name = "lsa.lsarpc",
47321 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
47322 : .tp_doc = "lsarpc(binding, lp_ctx=None, credentials=None) -> connection\n"
47323 : "\n"
47324 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
47325 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
47326 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_LSARPC,
47327 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
47328 : .tp_new = interface_lsarpc_new,
47329 : };
47330 :
47331 30 : static PyObject *syntax_lsarpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
47332 : {
47333 30 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_lsarpc.syntax_id);
47334 : }
47335 :
47336 : #define PY_DOC_LSARPC_SYNTAX "Local Security Authority"
47337 : static PyTypeObject lsarpc_SyntaxType = {
47338 : PyVarObject_HEAD_INIT(NULL, 0)
47339 : .tp_name = "lsa.lsarpc_abstract_syntax",
47340 : .tp_doc = "lsarpc_abstract_syntax()\n"PY_DOC_LSARPC_SYNTAX,
47341 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
47342 : .tp_new = syntax_lsarpc_new,
47343 : };
47344 :
47345 : static PyMethodDef lsa_methods[] = {
47346 : { NULL, NULL, 0, NULL }
47347 : };
47348 :
47349 : static struct PyModuleDef moduledef = {
47350 : PyModuleDef_HEAD_INIT,
47351 : .m_name = "lsa",
47352 : .m_doc = "lsa DCE/RPC",
47353 : .m_size = -1,
47354 : .m_methods = lsa_methods,
47355 : };
47356 3514 : MODULE_INIT_FUNC(lsa)
47357 : {
47358 3514 : PyObject *m = NULL;
47359 3514 : PyObject *dep_samba_dcerpc_misc = NULL;
47360 3514 : PyObject *dep_samba_dcerpc_security = NULL;
47361 3514 : PyObject *dep_talloc = NULL;
47362 3514 : PyObject *dep_samba_dcerpc_base = NULL;
47363 :
47364 3514 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
47365 3514 : if (dep_samba_dcerpc_misc == NULL)
47366 0 : goto out;
47367 :
47368 3514 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
47369 3514 : if (dep_samba_dcerpc_security == NULL)
47370 0 : goto out;
47371 :
47372 3514 : dep_talloc = PyImport_ImportModule("talloc");
47373 3514 : if (dep_talloc == NULL)
47374 0 : goto out;
47375 :
47376 3514 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
47377 3514 : if (dep_samba_dcerpc_base == NULL)
47378 0 : goto out;
47379 :
47380 3514 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
47381 3514 : if (BaseObject_Type == NULL)
47382 0 : goto out;
47383 :
47384 3514 : security_descriptor_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "descriptor");
47385 3514 : if (security_descriptor_Type == NULL)
47386 0 : goto out;
47387 :
47388 3514 : dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
47389 3514 : if (dom_sid_Type == NULL)
47390 0 : goto out;
47391 :
47392 3514 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
47393 3514 : if (GUID_Type == NULL)
47394 0 : goto out;
47395 :
47396 3514 : policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
47397 3514 : if (policy_handle_Type == NULL)
47398 0 : goto out;
47399 :
47400 3514 : sec_desc_buf_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "sec_desc_buf");
47401 3514 : if (sec_desc_buf_Type == NULL)
47402 0 : goto out;
47403 :
47404 3514 : ndr_pointer_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ndr_pointer");
47405 3514 : if (ndr_pointer_Type == NULL)
47406 0 : goto out;
47407 :
47408 3514 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
47409 3514 : if (ClientConnection_Type == NULL)
47410 0 : goto out;
47411 :
47412 3514 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
47413 3514 : if (ndr_syntax_id_Type == NULL)
47414 0 : goto out;
47415 :
47416 3514 : lsa_String_Type.tp_base = BaseObject_Type;
47417 3514 : lsa_String_Type.tp_basicsize = pytalloc_BaseObject_size();
47418 :
47419 3514 : lsa_StringLarge_Type.tp_base = BaseObject_Type;
47420 3514 : lsa_StringLarge_Type.tp_basicsize = pytalloc_BaseObject_size();
47421 :
47422 3514 : lsa_Strings_Type.tp_base = BaseObject_Type;
47423 3514 : lsa_Strings_Type.tp_basicsize = pytalloc_BaseObject_size();
47424 :
47425 3514 : lsa_AsciiString_Type.tp_base = BaseObject_Type;
47426 3514 : lsa_AsciiString_Type.tp_basicsize = pytalloc_BaseObject_size();
47427 :
47428 3514 : lsa_AsciiStringLarge_Type.tp_base = BaseObject_Type;
47429 3514 : lsa_AsciiStringLarge_Type.tp_basicsize = pytalloc_BaseObject_size();
47430 :
47431 3514 : lsa_BinaryString_Type.tp_base = BaseObject_Type;
47432 3514 : lsa_BinaryString_Type.tp_basicsize = pytalloc_BaseObject_size();
47433 :
47434 3514 : lsa_LUID_Type.tp_base = BaseObject_Type;
47435 3514 : lsa_LUID_Type.tp_basicsize = pytalloc_BaseObject_size();
47436 :
47437 3514 : lsa_PrivEntry_Type.tp_base = BaseObject_Type;
47438 3514 : lsa_PrivEntry_Type.tp_basicsize = pytalloc_BaseObject_size();
47439 :
47440 3514 : lsa_PrivArray_Type.tp_base = BaseObject_Type;
47441 3514 : lsa_PrivArray_Type.tp_basicsize = pytalloc_BaseObject_size();
47442 :
47443 3514 : lsa_QosInfo_Type.tp_base = BaseObject_Type;
47444 3514 : lsa_QosInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47445 :
47446 3514 : lsa_ObjectAttribute_Type.tp_base = BaseObject_Type;
47447 3514 : lsa_ObjectAttribute_Type.tp_basicsize = pytalloc_BaseObject_size();
47448 :
47449 3514 : lsa_AuditLogInfo_Type.tp_base = BaseObject_Type;
47450 3514 : lsa_AuditLogInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47451 :
47452 3514 : lsa_AuditEventsInfo_Type.tp_base = BaseObject_Type;
47453 3514 : lsa_AuditEventsInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47454 :
47455 3514 : lsa_DomainInfo_Type.tp_base = BaseObject_Type;
47456 3514 : lsa_DomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47457 :
47458 3514 : lsa_PDAccountInfo_Type.tp_base = BaseObject_Type;
47459 3514 : lsa_PDAccountInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47460 :
47461 3514 : lsa_ServerRole_Type.tp_base = BaseObject_Type;
47462 3514 : lsa_ServerRole_Type.tp_basicsize = pytalloc_BaseObject_size();
47463 :
47464 3514 : lsa_ReplicaSourceInfo_Type.tp_base = BaseObject_Type;
47465 3514 : lsa_ReplicaSourceInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47466 :
47467 3514 : lsa_DefaultQuotaInfo_Type.tp_base = BaseObject_Type;
47468 3514 : lsa_DefaultQuotaInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47469 :
47470 3514 : lsa_ModificationInfo_Type.tp_base = BaseObject_Type;
47471 3514 : lsa_ModificationInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47472 :
47473 3514 : lsa_AuditFullSetInfo_Type.tp_base = BaseObject_Type;
47474 3514 : lsa_AuditFullSetInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47475 :
47476 3514 : lsa_AuditFullQueryInfo_Type.tp_base = BaseObject_Type;
47477 3514 : lsa_AuditFullQueryInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47478 :
47479 3514 : lsa_DnsDomainInfo_Type.tp_base = BaseObject_Type;
47480 3514 : lsa_DnsDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47481 :
47482 3514 : lsa_PolicyInformation_Type.tp_base = BaseObject_Type;
47483 3514 : lsa_PolicyInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
47484 :
47485 3514 : lsa_SidPtr_Type.tp_base = BaseObject_Type;
47486 3514 : lsa_SidPtr_Type.tp_basicsize = pytalloc_BaseObject_size();
47487 :
47488 3514 : lsa_SidArray_Type.tp_base = BaseObject_Type;
47489 3514 : lsa_SidArray_Type.tp_basicsize = pytalloc_BaseObject_size();
47490 :
47491 3514 : lsa_DomainList_Type.tp_base = BaseObject_Type;
47492 3514 : lsa_DomainList_Type.tp_basicsize = pytalloc_BaseObject_size();
47493 :
47494 3514 : lsa_TranslatedSid_Type.tp_base = BaseObject_Type;
47495 3514 : lsa_TranslatedSid_Type.tp_basicsize = pytalloc_BaseObject_size();
47496 :
47497 3514 : lsa_TransSidArray_Type.tp_base = BaseObject_Type;
47498 3514 : lsa_TransSidArray_Type.tp_basicsize = pytalloc_BaseObject_size();
47499 :
47500 3514 : lsa_RefDomainList_Type.tp_base = BaseObject_Type;
47501 3514 : lsa_RefDomainList_Type.tp_basicsize = pytalloc_BaseObject_size();
47502 :
47503 3514 : lsa_TranslatedName_Type.tp_base = BaseObject_Type;
47504 3514 : lsa_TranslatedName_Type.tp_basicsize = pytalloc_BaseObject_size();
47505 :
47506 3514 : lsa_TransNameArray_Type.tp_base = BaseObject_Type;
47507 3514 : lsa_TransNameArray_Type.tp_basicsize = pytalloc_BaseObject_size();
47508 :
47509 3514 : lsa_LUIDAttribute_Type.tp_base = BaseObject_Type;
47510 3514 : lsa_LUIDAttribute_Type.tp_basicsize = pytalloc_BaseObject_size();
47511 :
47512 3514 : lsa_PrivilegeSet_Type.tp_base = BaseObject_Type;
47513 3514 : lsa_PrivilegeSet_Type.tp_basicsize = pytalloc_BaseObject_size();
47514 :
47515 3514 : lsa_DATA_BUF_Type.tp_base = BaseObject_Type;
47516 3514 : lsa_DATA_BUF_Type.tp_basicsize = pytalloc_BaseObject_size();
47517 :
47518 3514 : lsa_DATA_BUF2_Type.tp_base = BaseObject_Type;
47519 3514 : lsa_DATA_BUF2_Type.tp_basicsize = pytalloc_BaseObject_size();
47520 :
47521 3514 : lsa_TrustDomainInfoName_Type.tp_base = BaseObject_Type;
47522 3514 : lsa_TrustDomainInfoName_Type.tp_basicsize = pytalloc_BaseObject_size();
47523 :
47524 3514 : lsa_TrustDomainInfoControllers_Type.tp_base = BaseObject_Type;
47525 3514 : lsa_TrustDomainInfoControllers_Type.tp_basicsize = pytalloc_BaseObject_size();
47526 :
47527 3514 : lsa_TrustDomainInfoPosixOffset_Type.tp_base = BaseObject_Type;
47528 3514 : lsa_TrustDomainInfoPosixOffset_Type.tp_basicsize = pytalloc_BaseObject_size();
47529 :
47530 3514 : lsa_TrustDomainInfoPassword_Type.tp_base = BaseObject_Type;
47531 3514 : lsa_TrustDomainInfoPassword_Type.tp_basicsize = pytalloc_BaseObject_size();
47532 :
47533 3514 : lsa_TrustDomainInfoBasic_Type.tp_base = BaseObject_Type;
47534 3514 : lsa_TrustDomainInfoBasic_Type.tp_basicsize = pytalloc_BaseObject_size();
47535 :
47536 3514 : lsa_TrustDomainInfoInfoEx_Type.tp_base = BaseObject_Type;
47537 3514 : lsa_TrustDomainInfoInfoEx_Type.tp_basicsize = pytalloc_BaseObject_size();
47538 :
47539 3514 : lsa_TrustDomainInfoBuffer_Type.tp_base = BaseObject_Type;
47540 3514 : lsa_TrustDomainInfoBuffer_Type.tp_basicsize = pytalloc_BaseObject_size();
47541 :
47542 3514 : lsa_TrustDomainInfoAuthInfo_Type.tp_base = BaseObject_Type;
47543 3514 : lsa_TrustDomainInfoAuthInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47544 :
47545 3514 : lsa_TrustDomainInfoFullInfo_Type.tp_base = BaseObject_Type;
47546 3514 : lsa_TrustDomainInfoFullInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47547 :
47548 3514 : lsa_TrustDomainInfoAuthInfoInternal_Type.tp_base = BaseObject_Type;
47549 3514 : lsa_TrustDomainInfoAuthInfoInternal_Type.tp_basicsize = pytalloc_BaseObject_size();
47550 :
47551 3514 : lsa_TrustDomainInfoFullInfoInternal_Type.tp_base = BaseObject_Type;
47552 3514 : lsa_TrustDomainInfoFullInfoInternal_Type.tp_basicsize = pytalloc_BaseObject_size();
47553 :
47554 3514 : lsa_TrustDomainInfoInfoEx2Internal_Type.tp_base = BaseObject_Type;
47555 3514 : lsa_TrustDomainInfoInfoEx2Internal_Type.tp_basicsize = pytalloc_BaseObject_size();
47556 :
47557 3514 : lsa_TrustDomainInfoFullInfo2Internal_Type.tp_base = BaseObject_Type;
47558 3514 : lsa_TrustDomainInfoFullInfo2Internal_Type.tp_basicsize = pytalloc_BaseObject_size();
47559 :
47560 3514 : lsa_TrustDomainInfoSupportedEncTypes_Type.tp_base = BaseObject_Type;
47561 3514 : lsa_TrustDomainInfoSupportedEncTypes_Type.tp_basicsize = pytalloc_BaseObject_size();
47562 :
47563 3514 : lsa_TrustedDomainInfo_Type.tp_base = BaseObject_Type;
47564 3514 : lsa_TrustedDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47565 :
47566 3514 : lsa_DATA_BUF_PTR_Type.tp_base = BaseObject_Type;
47567 3514 : lsa_DATA_BUF_PTR_Type.tp_basicsize = pytalloc_BaseObject_size();
47568 :
47569 3514 : lsa_RightAttribute_Type.tp_base = BaseObject_Type;
47570 3514 : lsa_RightAttribute_Type.tp_basicsize = pytalloc_BaseObject_size();
47571 :
47572 3514 : lsa_RightSet_Type.tp_base = BaseObject_Type;
47573 3514 : lsa_RightSet_Type.tp_basicsize = pytalloc_BaseObject_size();
47574 :
47575 3514 : lsa_DomainListEx_Type.tp_base = BaseObject_Type;
47576 3514 : lsa_DomainListEx_Type.tp_basicsize = pytalloc_BaseObject_size();
47577 :
47578 3514 : lsa_DomainInfoKerberos_Type.tp_base = BaseObject_Type;
47579 3514 : lsa_DomainInfoKerberos_Type.tp_basicsize = pytalloc_BaseObject_size();
47580 :
47581 3514 : lsa_DomainInfoEfs_Type.tp_base = BaseObject_Type;
47582 3514 : lsa_DomainInfoEfs_Type.tp_basicsize = pytalloc_BaseObject_size();
47583 :
47584 3514 : lsa_DomainInformationPolicy_Type.tp_base = BaseObject_Type;
47585 3514 : lsa_DomainInformationPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
47586 :
47587 3514 : lsa_TranslatedName2_Type.tp_base = BaseObject_Type;
47588 3514 : lsa_TranslatedName2_Type.tp_basicsize = pytalloc_BaseObject_size();
47589 :
47590 3514 : lsa_TransNameArray2_Type.tp_base = BaseObject_Type;
47591 3514 : lsa_TransNameArray2_Type.tp_basicsize = pytalloc_BaseObject_size();
47592 :
47593 3514 : lsa_TranslatedSid2_Type.tp_base = BaseObject_Type;
47594 3514 : lsa_TranslatedSid2_Type.tp_basicsize = pytalloc_BaseObject_size();
47595 :
47596 3514 : lsa_TransSidArray2_Type.tp_base = BaseObject_Type;
47597 3514 : lsa_TransSidArray2_Type.tp_basicsize = pytalloc_BaseObject_size();
47598 :
47599 3514 : lsa_TranslatedSid3_Type.tp_base = BaseObject_Type;
47600 3514 : lsa_TranslatedSid3_Type.tp_basicsize = pytalloc_BaseObject_size();
47601 :
47602 3514 : lsa_TransSidArray3_Type.tp_base = BaseObject_Type;
47603 3514 : lsa_TransSidArray3_Type.tp_basicsize = pytalloc_BaseObject_size();
47604 :
47605 3514 : lsa_ForestTrustBinaryData_Type.tp_base = BaseObject_Type;
47606 3514 : lsa_ForestTrustBinaryData_Type.tp_basicsize = pytalloc_BaseObject_size();
47607 :
47608 3514 : lsa_ForestTrustDomainInfo_Type.tp_base = BaseObject_Type;
47609 3514 : lsa_ForestTrustDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47610 :
47611 3514 : lsa_ForestTrustData_Type.tp_base = BaseObject_Type;
47612 3514 : lsa_ForestTrustData_Type.tp_basicsize = pytalloc_BaseObject_size();
47613 :
47614 3514 : lsa_ForestTrustRecord_Type.tp_base = BaseObject_Type;
47615 3514 : lsa_ForestTrustRecord_Type.tp_basicsize = pytalloc_BaseObject_size();
47616 :
47617 3514 : lsa_ForestTrustInformation_Type.tp_base = BaseObject_Type;
47618 3514 : lsa_ForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
47619 :
47620 3514 : lsa_ForestTrustCollisionRecord_Type.tp_base = BaseObject_Type;
47621 3514 : lsa_ForestTrustCollisionRecord_Type.tp_basicsize = pytalloc_BaseObject_size();
47622 :
47623 3514 : lsa_ForestTrustCollisionInfo_Type.tp_base = BaseObject_Type;
47624 3514 : lsa_ForestTrustCollisionInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47625 :
47626 3514 : lsa_Close_Type.tp_base = BaseObject_Type;
47627 3514 : lsa_Close_Type.tp_basicsize = pytalloc_BaseObject_size();
47628 :
47629 3514 : lsa_Delete_Type.tp_base = BaseObject_Type;
47630 3514 : lsa_Delete_Type.tp_basicsize = pytalloc_BaseObject_size();
47631 :
47632 3514 : lsa_EnumPrivs_Type.tp_base = BaseObject_Type;
47633 3514 : lsa_EnumPrivs_Type.tp_basicsize = pytalloc_BaseObject_size();
47634 :
47635 3514 : lsa_QuerySecurity_Type.tp_base = BaseObject_Type;
47636 3514 : lsa_QuerySecurity_Type.tp_basicsize = pytalloc_BaseObject_size();
47637 :
47638 3514 : lsa_SetSecObj_Type.tp_base = BaseObject_Type;
47639 3514 : lsa_SetSecObj_Type.tp_basicsize = pytalloc_BaseObject_size();
47640 :
47641 3514 : lsa_OpenPolicy_Type.tp_base = BaseObject_Type;
47642 3514 : lsa_OpenPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
47643 :
47644 3514 : lsa_QueryInfoPolicy_Type.tp_base = BaseObject_Type;
47645 3514 : lsa_QueryInfoPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
47646 :
47647 3514 : lsa_SetInfoPolicy_Type.tp_base = BaseObject_Type;
47648 3514 : lsa_SetInfoPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
47649 :
47650 3514 : lsa_CreateAccount_Type.tp_base = BaseObject_Type;
47651 3514 : lsa_CreateAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47652 :
47653 3514 : lsa_EnumAccounts_Type.tp_base = BaseObject_Type;
47654 3514 : lsa_EnumAccounts_Type.tp_basicsize = pytalloc_BaseObject_size();
47655 :
47656 3514 : lsa_CreateTrustedDomain_Type.tp_base = BaseObject_Type;
47657 3514 : lsa_CreateTrustedDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
47658 :
47659 3514 : lsa_EnumTrustDom_Type.tp_base = BaseObject_Type;
47660 3514 : lsa_EnumTrustDom_Type.tp_basicsize = pytalloc_BaseObject_size();
47661 :
47662 3514 : lsa_LookupNames_Type.tp_base = BaseObject_Type;
47663 3514 : lsa_LookupNames_Type.tp_basicsize = pytalloc_BaseObject_size();
47664 :
47665 3514 : lsa_LookupSids_Type.tp_base = BaseObject_Type;
47666 3514 : lsa_LookupSids_Type.tp_basicsize = pytalloc_BaseObject_size();
47667 :
47668 3514 : lsa_CreateSecret_Type.tp_base = BaseObject_Type;
47669 3514 : lsa_CreateSecret_Type.tp_basicsize = pytalloc_BaseObject_size();
47670 :
47671 3514 : lsa_OpenAccount_Type.tp_base = BaseObject_Type;
47672 3514 : lsa_OpenAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47673 :
47674 3514 : lsa_EnumPrivsAccount_Type.tp_base = BaseObject_Type;
47675 3514 : lsa_EnumPrivsAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47676 :
47677 3514 : lsa_AddPrivilegesToAccount_Type.tp_base = BaseObject_Type;
47678 3514 : lsa_AddPrivilegesToAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47679 :
47680 3514 : lsa_RemovePrivilegesFromAccount_Type.tp_base = BaseObject_Type;
47681 3514 : lsa_RemovePrivilegesFromAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47682 :
47683 3514 : lsa_GetSystemAccessAccount_Type.tp_base = BaseObject_Type;
47684 3514 : lsa_GetSystemAccessAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47685 :
47686 3514 : lsa_SetSystemAccessAccount_Type.tp_base = BaseObject_Type;
47687 3514 : lsa_SetSystemAccessAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47688 :
47689 3514 : lsa_OpenTrustedDomain_Type.tp_base = BaseObject_Type;
47690 3514 : lsa_OpenTrustedDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
47691 :
47692 3514 : lsa_QueryTrustedDomainInfo_Type.tp_base = BaseObject_Type;
47693 3514 : lsa_QueryTrustedDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47694 :
47695 3514 : lsa_SetInformationTrustedDomain_Type.tp_base = BaseObject_Type;
47696 3514 : lsa_SetInformationTrustedDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
47697 :
47698 3514 : lsa_OpenSecret_Type.tp_base = BaseObject_Type;
47699 3514 : lsa_OpenSecret_Type.tp_basicsize = pytalloc_BaseObject_size();
47700 :
47701 3514 : lsa_SetSecret_Type.tp_base = BaseObject_Type;
47702 3514 : lsa_SetSecret_Type.tp_basicsize = pytalloc_BaseObject_size();
47703 :
47704 3514 : lsa_QuerySecret_Type.tp_base = BaseObject_Type;
47705 3514 : lsa_QuerySecret_Type.tp_basicsize = pytalloc_BaseObject_size();
47706 :
47707 3514 : lsa_LookupPrivValue_Type.tp_base = BaseObject_Type;
47708 3514 : lsa_LookupPrivValue_Type.tp_basicsize = pytalloc_BaseObject_size();
47709 :
47710 3514 : lsa_LookupPrivName_Type.tp_base = BaseObject_Type;
47711 3514 : lsa_LookupPrivName_Type.tp_basicsize = pytalloc_BaseObject_size();
47712 :
47713 3514 : lsa_LookupPrivDisplayName_Type.tp_base = BaseObject_Type;
47714 3514 : lsa_LookupPrivDisplayName_Type.tp_basicsize = pytalloc_BaseObject_size();
47715 :
47716 3514 : lsa_DeleteObject_Type.tp_base = BaseObject_Type;
47717 3514 : lsa_DeleteObject_Type.tp_basicsize = pytalloc_BaseObject_size();
47718 :
47719 3514 : lsa_EnumAccountsWithUserRight_Type.tp_base = BaseObject_Type;
47720 3514 : lsa_EnumAccountsWithUserRight_Type.tp_basicsize = pytalloc_BaseObject_size();
47721 :
47722 3514 : lsa_EnumAccountRights_Type.tp_base = BaseObject_Type;
47723 3514 : lsa_EnumAccountRights_Type.tp_basicsize = pytalloc_BaseObject_size();
47724 :
47725 3514 : lsa_AddAccountRights_Type.tp_base = BaseObject_Type;
47726 3514 : lsa_AddAccountRights_Type.tp_basicsize = pytalloc_BaseObject_size();
47727 :
47728 3514 : lsa_RemoveAccountRights_Type.tp_base = BaseObject_Type;
47729 3514 : lsa_RemoveAccountRights_Type.tp_basicsize = pytalloc_BaseObject_size();
47730 :
47731 3514 : lsa_QueryTrustedDomainInfoBySid_Type.tp_base = BaseObject_Type;
47732 3514 : lsa_QueryTrustedDomainInfoBySid_Type.tp_basicsize = pytalloc_BaseObject_size();
47733 :
47734 3514 : lsa_SetTrustedDomainInfo_Type.tp_base = BaseObject_Type;
47735 3514 : lsa_SetTrustedDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47736 :
47737 3514 : lsa_DeleteTrustedDomain_Type.tp_base = BaseObject_Type;
47738 3514 : lsa_DeleteTrustedDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
47739 :
47740 3514 : lsa_StorePrivateData_Type.tp_base = BaseObject_Type;
47741 3514 : lsa_StorePrivateData_Type.tp_basicsize = pytalloc_BaseObject_size();
47742 :
47743 3514 : lsa_RetrievePrivateData_Type.tp_base = BaseObject_Type;
47744 3514 : lsa_RetrievePrivateData_Type.tp_basicsize = pytalloc_BaseObject_size();
47745 :
47746 3514 : lsa_OpenPolicy2_Type.tp_base = BaseObject_Type;
47747 3514 : lsa_OpenPolicy2_Type.tp_basicsize = pytalloc_BaseObject_size();
47748 :
47749 3514 : lsa_GetUserName_Type.tp_base = BaseObject_Type;
47750 3514 : lsa_GetUserName_Type.tp_basicsize = pytalloc_BaseObject_size();
47751 :
47752 3514 : lsa_QueryInfoPolicy2_Type.tp_base = BaseObject_Type;
47753 3514 : lsa_QueryInfoPolicy2_Type.tp_basicsize = pytalloc_BaseObject_size();
47754 :
47755 3514 : lsa_SetInfoPolicy2_Type.tp_base = BaseObject_Type;
47756 3514 : lsa_SetInfoPolicy2_Type.tp_basicsize = pytalloc_BaseObject_size();
47757 :
47758 3514 : lsa_QueryTrustedDomainInfoByName_Type.tp_base = BaseObject_Type;
47759 3514 : lsa_QueryTrustedDomainInfoByName_Type.tp_basicsize = pytalloc_BaseObject_size();
47760 :
47761 3514 : lsa_SetTrustedDomainInfoByName_Type.tp_base = BaseObject_Type;
47762 3514 : lsa_SetTrustedDomainInfoByName_Type.tp_basicsize = pytalloc_BaseObject_size();
47763 :
47764 3514 : lsa_EnumTrustedDomainsEx_Type.tp_base = BaseObject_Type;
47765 3514 : lsa_EnumTrustedDomainsEx_Type.tp_basicsize = pytalloc_BaseObject_size();
47766 :
47767 3514 : lsa_CreateTrustedDomainEx_Type.tp_base = BaseObject_Type;
47768 3514 : lsa_CreateTrustedDomainEx_Type.tp_basicsize = pytalloc_BaseObject_size();
47769 :
47770 3514 : lsa_CloseTrustedDomainEx_Type.tp_base = BaseObject_Type;
47771 3514 : lsa_CloseTrustedDomainEx_Type.tp_basicsize = pytalloc_BaseObject_size();
47772 :
47773 3514 : lsa_QueryDomainInformationPolicy_Type.tp_base = BaseObject_Type;
47774 3514 : lsa_QueryDomainInformationPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
47775 :
47776 3514 : lsa_SetDomainInformationPolicy_Type.tp_base = BaseObject_Type;
47777 3514 : lsa_SetDomainInformationPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
47778 :
47779 3514 : lsa_OpenTrustedDomainByName_Type.tp_base = BaseObject_Type;
47780 3514 : lsa_OpenTrustedDomainByName_Type.tp_basicsize = pytalloc_BaseObject_size();
47781 :
47782 3514 : lsa_LookupSids2_Type.tp_base = BaseObject_Type;
47783 3514 : lsa_LookupSids2_Type.tp_basicsize = pytalloc_BaseObject_size();
47784 :
47785 3514 : lsa_LookupNames2_Type.tp_base = BaseObject_Type;
47786 3514 : lsa_LookupNames2_Type.tp_basicsize = pytalloc_BaseObject_size();
47787 :
47788 3514 : lsa_CreateTrustedDomainEx2_Type.tp_base = BaseObject_Type;
47789 3514 : lsa_CreateTrustedDomainEx2_Type.tp_basicsize = pytalloc_BaseObject_size();
47790 :
47791 3514 : lsa_LookupNames3_Type.tp_base = BaseObject_Type;
47792 3514 : lsa_LookupNames3_Type.tp_basicsize = pytalloc_BaseObject_size();
47793 :
47794 3514 : lsa_lsaRQueryForestTrustInformation_Type.tp_base = BaseObject_Type;
47795 3514 : lsa_lsaRQueryForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
47796 :
47797 3514 : lsa_lsaRSetForestTrustInformation_Type.tp_base = BaseObject_Type;
47798 3514 : lsa_lsaRSetForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
47799 :
47800 3514 : lsa_LookupSids3_Type.tp_base = BaseObject_Type;
47801 3514 : lsa_LookupSids3_Type.tp_basicsize = pytalloc_BaseObject_size();
47802 :
47803 3514 : lsa_LookupNames4_Type.tp_base = BaseObject_Type;
47804 3514 : lsa_LookupNames4_Type.tp_basicsize = pytalloc_BaseObject_size();
47805 :
47806 3514 : lsarpc_InterfaceType.tp_base = ClientConnection_Type;
47807 :
47808 3514 : lsarpc_SyntaxType.tp_base = ndr_syntax_id_Type;
47809 3514 : lsarpc_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
47810 :
47811 3514 : if (PyType_Ready(&lsa_String_Type) < 0)
47812 0 : goto out;
47813 3514 : if (PyType_Ready(&lsa_StringLarge_Type) < 0)
47814 0 : goto out;
47815 3514 : if (PyType_Ready(&lsa_Strings_Type) < 0)
47816 0 : goto out;
47817 3514 : if (PyType_Ready(&lsa_AsciiString_Type) < 0)
47818 0 : goto out;
47819 3514 : if (PyType_Ready(&lsa_AsciiStringLarge_Type) < 0)
47820 0 : goto out;
47821 3514 : if (PyType_Ready(&lsa_BinaryString_Type) < 0)
47822 0 : goto out;
47823 3514 : if (PyType_Ready(&lsa_LUID_Type) < 0)
47824 0 : goto out;
47825 3514 : if (PyType_Ready(&lsa_PrivEntry_Type) < 0)
47826 0 : goto out;
47827 3514 : if (PyType_Ready(&lsa_PrivArray_Type) < 0)
47828 0 : goto out;
47829 3514 : if (PyType_Ready(&lsa_QosInfo_Type) < 0)
47830 0 : goto out;
47831 3514 : if (PyType_Ready(&lsa_ObjectAttribute_Type) < 0)
47832 0 : goto out;
47833 3514 : if (PyType_Ready(&lsa_AuditLogInfo_Type) < 0)
47834 0 : goto out;
47835 3514 : if (PyType_Ready(&lsa_AuditEventsInfo_Type) < 0)
47836 0 : goto out;
47837 3514 : if (PyType_Ready(&lsa_DomainInfo_Type) < 0)
47838 0 : goto out;
47839 3514 : if (PyType_Ready(&lsa_PDAccountInfo_Type) < 0)
47840 0 : goto out;
47841 3514 : if (PyType_Ready(&lsa_ServerRole_Type) < 0)
47842 0 : goto out;
47843 3514 : if (PyType_Ready(&lsa_ReplicaSourceInfo_Type) < 0)
47844 0 : goto out;
47845 3514 : if (PyType_Ready(&lsa_DefaultQuotaInfo_Type) < 0)
47846 0 : goto out;
47847 3514 : if (PyType_Ready(&lsa_ModificationInfo_Type) < 0)
47848 0 : goto out;
47849 3514 : if (PyType_Ready(&lsa_AuditFullSetInfo_Type) < 0)
47850 0 : goto out;
47851 3514 : if (PyType_Ready(&lsa_AuditFullQueryInfo_Type) < 0)
47852 0 : goto out;
47853 3514 : if (PyType_Ready(&lsa_DnsDomainInfo_Type) < 0)
47854 0 : goto out;
47855 3514 : if (PyType_Ready(&lsa_PolicyInformation_Type) < 0)
47856 0 : goto out;
47857 3514 : if (PyType_Ready(&lsa_SidPtr_Type) < 0)
47858 0 : goto out;
47859 3514 : if (PyType_Ready(&lsa_SidArray_Type) < 0)
47860 0 : goto out;
47861 3514 : if (PyType_Ready(&lsa_DomainList_Type) < 0)
47862 0 : goto out;
47863 3514 : if (PyType_Ready(&lsa_TranslatedSid_Type) < 0)
47864 0 : goto out;
47865 3514 : if (PyType_Ready(&lsa_TransSidArray_Type) < 0)
47866 0 : goto out;
47867 3514 : if (PyType_Ready(&lsa_RefDomainList_Type) < 0)
47868 0 : goto out;
47869 3514 : if (PyType_Ready(&lsa_TranslatedName_Type) < 0)
47870 0 : goto out;
47871 3514 : if (PyType_Ready(&lsa_TransNameArray_Type) < 0)
47872 0 : goto out;
47873 3514 : if (PyType_Ready(&lsa_LUIDAttribute_Type) < 0)
47874 0 : goto out;
47875 3514 : if (PyType_Ready(&lsa_PrivilegeSet_Type) < 0)
47876 0 : goto out;
47877 3514 : if (PyType_Ready(&lsa_DATA_BUF_Type) < 0)
47878 0 : goto out;
47879 3514 : if (PyType_Ready(&lsa_DATA_BUF2_Type) < 0)
47880 0 : goto out;
47881 3514 : if (PyType_Ready(&lsa_TrustDomainInfoName_Type) < 0)
47882 0 : goto out;
47883 3514 : if (PyType_Ready(&lsa_TrustDomainInfoControllers_Type) < 0)
47884 0 : goto out;
47885 3514 : if (PyType_Ready(&lsa_TrustDomainInfoPosixOffset_Type) < 0)
47886 0 : goto out;
47887 3514 : if (PyType_Ready(&lsa_TrustDomainInfoPassword_Type) < 0)
47888 0 : goto out;
47889 3514 : if (PyType_Ready(&lsa_TrustDomainInfoBasic_Type) < 0)
47890 0 : goto out;
47891 3514 : if (PyType_Ready(&lsa_TrustDomainInfoInfoEx_Type) < 0)
47892 0 : goto out;
47893 3514 : if (PyType_Ready(&lsa_TrustDomainInfoBuffer_Type) < 0)
47894 0 : goto out;
47895 3514 : if (PyType_Ready(&lsa_TrustDomainInfoAuthInfo_Type) < 0)
47896 0 : goto out;
47897 3514 : if (PyType_Ready(&lsa_TrustDomainInfoFullInfo_Type) < 0)
47898 0 : goto out;
47899 3514 : if (PyType_Ready(&lsa_TrustDomainInfoAuthInfoInternal_Type) < 0)
47900 0 : goto out;
47901 3514 : if (PyType_Ready(&lsa_TrustDomainInfoFullInfoInternal_Type) < 0)
47902 0 : goto out;
47903 3514 : if (PyType_Ready(&lsa_TrustDomainInfoInfoEx2Internal_Type) < 0)
47904 0 : goto out;
47905 3514 : if (PyType_Ready(&lsa_TrustDomainInfoFullInfo2Internal_Type) < 0)
47906 0 : goto out;
47907 3514 : if (PyType_Ready(&lsa_TrustDomainInfoSupportedEncTypes_Type) < 0)
47908 0 : goto out;
47909 3514 : if (PyType_Ready(&lsa_TrustedDomainInfo_Type) < 0)
47910 0 : goto out;
47911 3514 : if (PyType_Ready(&lsa_DATA_BUF_PTR_Type) < 0)
47912 0 : goto out;
47913 3514 : if (PyType_Ready(&lsa_RightAttribute_Type) < 0)
47914 0 : goto out;
47915 3514 : if (PyType_Ready(&lsa_RightSet_Type) < 0)
47916 0 : goto out;
47917 3514 : if (PyType_Ready(&lsa_DomainListEx_Type) < 0)
47918 0 : goto out;
47919 3514 : if (PyType_Ready(&lsa_DomainInfoKerberos_Type) < 0)
47920 0 : goto out;
47921 3514 : if (PyType_Ready(&lsa_DomainInfoEfs_Type) < 0)
47922 0 : goto out;
47923 3514 : if (PyType_Ready(&lsa_DomainInformationPolicy_Type) < 0)
47924 0 : goto out;
47925 3514 : if (PyType_Ready(&lsa_TranslatedName2_Type) < 0)
47926 0 : goto out;
47927 3514 : if (PyType_Ready(&lsa_TransNameArray2_Type) < 0)
47928 0 : goto out;
47929 3514 : if (PyType_Ready(&lsa_TranslatedSid2_Type) < 0)
47930 0 : goto out;
47931 3514 : if (PyType_Ready(&lsa_TransSidArray2_Type) < 0)
47932 0 : goto out;
47933 3514 : if (PyType_Ready(&lsa_TranslatedSid3_Type) < 0)
47934 0 : goto out;
47935 3514 : if (PyType_Ready(&lsa_TransSidArray3_Type) < 0)
47936 0 : goto out;
47937 3514 : if (PyType_Ready(&lsa_ForestTrustBinaryData_Type) < 0)
47938 0 : goto out;
47939 3514 : if (PyType_Ready(&lsa_ForestTrustDomainInfo_Type) < 0)
47940 0 : goto out;
47941 3514 : if (PyType_Ready(&lsa_ForestTrustData_Type) < 0)
47942 0 : goto out;
47943 3514 : if (PyType_Ready(&lsa_ForestTrustRecord_Type) < 0)
47944 0 : goto out;
47945 3514 : if (PyType_Ready(&lsa_ForestTrustInformation_Type) < 0)
47946 0 : goto out;
47947 3514 : if (PyType_Ready(&lsa_ForestTrustCollisionRecord_Type) < 0)
47948 0 : goto out;
47949 3514 : if (PyType_Ready(&lsa_ForestTrustCollisionInfo_Type) < 0)
47950 0 : goto out;
47951 3514 : if (PyType_Ready(&lsa_Close_Type) < 0)
47952 0 : goto out;
47953 3514 : if (PyType_Ready(&lsa_Delete_Type) < 0)
47954 0 : goto out;
47955 3514 : if (PyType_Ready(&lsa_EnumPrivs_Type) < 0)
47956 0 : goto out;
47957 3514 : if (PyType_Ready(&lsa_QuerySecurity_Type) < 0)
47958 0 : goto out;
47959 3514 : if (PyType_Ready(&lsa_SetSecObj_Type) < 0)
47960 0 : goto out;
47961 3514 : if (PyType_Ready(&lsa_OpenPolicy_Type) < 0)
47962 0 : goto out;
47963 3514 : if (PyType_Ready(&lsa_QueryInfoPolicy_Type) < 0)
47964 0 : goto out;
47965 3514 : if (PyType_Ready(&lsa_SetInfoPolicy_Type) < 0)
47966 0 : goto out;
47967 3514 : if (PyType_Ready(&lsa_CreateAccount_Type) < 0)
47968 0 : goto out;
47969 3514 : if (PyType_Ready(&lsa_EnumAccounts_Type) < 0)
47970 0 : goto out;
47971 3514 : if (PyType_Ready(&lsa_CreateTrustedDomain_Type) < 0)
47972 0 : goto out;
47973 3514 : if (PyType_Ready(&lsa_EnumTrustDom_Type) < 0)
47974 0 : goto out;
47975 3514 : if (PyType_Ready(&lsa_LookupNames_Type) < 0)
47976 0 : goto out;
47977 3514 : if (PyType_Ready(&lsa_LookupSids_Type) < 0)
47978 0 : goto out;
47979 3514 : if (PyType_Ready(&lsa_CreateSecret_Type) < 0)
47980 0 : goto out;
47981 3514 : if (PyType_Ready(&lsa_OpenAccount_Type) < 0)
47982 0 : goto out;
47983 3514 : if (PyType_Ready(&lsa_EnumPrivsAccount_Type) < 0)
47984 0 : goto out;
47985 3514 : if (PyType_Ready(&lsa_AddPrivilegesToAccount_Type) < 0)
47986 0 : goto out;
47987 3514 : if (PyType_Ready(&lsa_RemovePrivilegesFromAccount_Type) < 0)
47988 0 : goto out;
47989 3514 : if (PyType_Ready(&lsa_GetSystemAccessAccount_Type) < 0)
47990 0 : goto out;
47991 3514 : if (PyType_Ready(&lsa_SetSystemAccessAccount_Type) < 0)
47992 0 : goto out;
47993 3514 : if (PyType_Ready(&lsa_OpenTrustedDomain_Type) < 0)
47994 0 : goto out;
47995 3514 : if (PyType_Ready(&lsa_QueryTrustedDomainInfo_Type) < 0)
47996 0 : goto out;
47997 3514 : if (PyType_Ready(&lsa_SetInformationTrustedDomain_Type) < 0)
47998 0 : goto out;
47999 3514 : if (PyType_Ready(&lsa_OpenSecret_Type) < 0)
48000 0 : goto out;
48001 3514 : if (PyType_Ready(&lsa_SetSecret_Type) < 0)
48002 0 : goto out;
48003 3514 : if (PyType_Ready(&lsa_QuerySecret_Type) < 0)
48004 0 : goto out;
48005 3514 : if (PyType_Ready(&lsa_LookupPrivValue_Type) < 0)
48006 0 : goto out;
48007 3514 : if (PyType_Ready(&lsa_LookupPrivName_Type) < 0)
48008 0 : goto out;
48009 3514 : if (PyType_Ready(&lsa_LookupPrivDisplayName_Type) < 0)
48010 0 : goto out;
48011 3514 : if (PyType_Ready(&lsa_DeleteObject_Type) < 0)
48012 0 : goto out;
48013 3514 : if (PyType_Ready(&lsa_EnumAccountsWithUserRight_Type) < 0)
48014 0 : goto out;
48015 3514 : if (PyType_Ready(&lsa_EnumAccountRights_Type) < 0)
48016 0 : goto out;
48017 3514 : if (PyType_Ready(&lsa_AddAccountRights_Type) < 0)
48018 0 : goto out;
48019 3514 : if (PyType_Ready(&lsa_RemoveAccountRights_Type) < 0)
48020 0 : goto out;
48021 3514 : if (PyType_Ready(&lsa_QueryTrustedDomainInfoBySid_Type) < 0)
48022 0 : goto out;
48023 3514 : if (PyType_Ready(&lsa_SetTrustedDomainInfo_Type) < 0)
48024 0 : goto out;
48025 3514 : if (PyType_Ready(&lsa_DeleteTrustedDomain_Type) < 0)
48026 0 : goto out;
48027 3514 : if (PyType_Ready(&lsa_StorePrivateData_Type) < 0)
48028 0 : goto out;
48029 3514 : if (PyType_Ready(&lsa_RetrievePrivateData_Type) < 0)
48030 0 : goto out;
48031 3514 : if (PyType_Ready(&lsa_OpenPolicy2_Type) < 0)
48032 0 : goto out;
48033 3514 : if (PyType_Ready(&lsa_GetUserName_Type) < 0)
48034 0 : goto out;
48035 3514 : if (PyType_Ready(&lsa_QueryInfoPolicy2_Type) < 0)
48036 0 : goto out;
48037 3514 : if (PyType_Ready(&lsa_SetInfoPolicy2_Type) < 0)
48038 0 : goto out;
48039 3514 : if (PyType_Ready(&lsa_QueryTrustedDomainInfoByName_Type) < 0)
48040 0 : goto out;
48041 3514 : if (PyType_Ready(&lsa_SetTrustedDomainInfoByName_Type) < 0)
48042 0 : goto out;
48043 3514 : if (PyType_Ready(&lsa_EnumTrustedDomainsEx_Type) < 0)
48044 0 : goto out;
48045 3514 : if (PyType_Ready(&lsa_CreateTrustedDomainEx_Type) < 0)
48046 0 : goto out;
48047 3514 : if (PyType_Ready(&lsa_CloseTrustedDomainEx_Type) < 0)
48048 0 : goto out;
48049 3514 : if (PyType_Ready(&lsa_QueryDomainInformationPolicy_Type) < 0)
48050 0 : goto out;
48051 3514 : if (PyType_Ready(&lsa_SetDomainInformationPolicy_Type) < 0)
48052 0 : goto out;
48053 3514 : if (PyType_Ready(&lsa_OpenTrustedDomainByName_Type) < 0)
48054 0 : goto out;
48055 3514 : if (PyType_Ready(&lsa_LookupSids2_Type) < 0)
48056 0 : goto out;
48057 3514 : if (PyType_Ready(&lsa_LookupNames2_Type) < 0)
48058 0 : goto out;
48059 3514 : if (PyType_Ready(&lsa_CreateTrustedDomainEx2_Type) < 0)
48060 0 : goto out;
48061 3514 : if (PyType_Ready(&lsa_LookupNames3_Type) < 0)
48062 0 : goto out;
48063 3514 : if (PyType_Ready(&lsa_lsaRQueryForestTrustInformation_Type) < 0)
48064 0 : goto out;
48065 3514 : if (PyType_Ready(&lsa_lsaRSetForestTrustInformation_Type) < 0)
48066 0 : goto out;
48067 3514 : if (PyType_Ready(&lsa_LookupSids3_Type) < 0)
48068 0 : goto out;
48069 3514 : if (PyType_Ready(&lsa_LookupNames4_Type) < 0)
48070 0 : goto out;
48071 3514 : if (PyType_Ready(&lsarpc_InterfaceType) < 0)
48072 0 : goto out;
48073 3514 : if (PyType_Ready(&lsarpc_SyntaxType) < 0)
48074 0 : goto out;
48075 3514 : if (!PyInterface_AddNdrRpcMethods(&lsarpc_InterfaceType, py_ndr_lsarpc_methods))
48076 0 : return NULL;
48077 :
48078 : #ifdef PY_STRING_PATCH
48079 3514 : PY_STRING_PATCH(&lsa_String_Type);
48080 : #endif
48081 : #ifdef PY_STRINGLARGE_PATCH
48082 : PY_STRINGLARGE_PATCH(&lsa_StringLarge_Type);
48083 : #endif
48084 : #ifdef PY_STRINGS_PATCH
48085 : PY_STRINGS_PATCH(&lsa_Strings_Type);
48086 : #endif
48087 : #ifdef PY_ASCIISTRING_PATCH
48088 : PY_ASCIISTRING_PATCH(&lsa_AsciiString_Type);
48089 : #endif
48090 : #ifdef PY_ASCIISTRINGLARGE_PATCH
48091 : PY_ASCIISTRINGLARGE_PATCH(&lsa_AsciiStringLarge_Type);
48092 : #endif
48093 : #ifdef PY_BINARYSTRING_PATCH
48094 : PY_BINARYSTRING_PATCH(&lsa_BinaryString_Type);
48095 : #endif
48096 : #ifdef PY_LUID_PATCH
48097 : PY_LUID_PATCH(&lsa_LUID_Type);
48098 : #endif
48099 : #ifdef PY_PRIVENTRY_PATCH
48100 : PY_PRIVENTRY_PATCH(&lsa_PrivEntry_Type);
48101 : #endif
48102 : #ifdef PY_PRIVARRAY_PATCH
48103 : PY_PRIVARRAY_PATCH(&lsa_PrivArray_Type);
48104 : #endif
48105 : #ifdef PY_QOSINFO_PATCH
48106 : PY_QOSINFO_PATCH(&lsa_QosInfo_Type);
48107 : #endif
48108 : #ifdef PY_OBJECTATTRIBUTE_PATCH
48109 : PY_OBJECTATTRIBUTE_PATCH(&lsa_ObjectAttribute_Type);
48110 : #endif
48111 : #ifdef PY_AUDITLOGINFO_PATCH
48112 : PY_AUDITLOGINFO_PATCH(&lsa_AuditLogInfo_Type);
48113 : #endif
48114 : #ifdef PY_AUDITEVENTSINFO_PATCH
48115 : PY_AUDITEVENTSINFO_PATCH(&lsa_AuditEventsInfo_Type);
48116 : #endif
48117 : #ifdef PY_DOMAININFO_PATCH
48118 : PY_DOMAININFO_PATCH(&lsa_DomainInfo_Type);
48119 : #endif
48120 : #ifdef PY_PDACCOUNTINFO_PATCH
48121 : PY_PDACCOUNTINFO_PATCH(&lsa_PDAccountInfo_Type);
48122 : #endif
48123 : #ifdef PY_SERVERROLE_PATCH
48124 : PY_SERVERROLE_PATCH(&lsa_ServerRole_Type);
48125 : #endif
48126 : #ifdef PY_REPLICASOURCEINFO_PATCH
48127 : PY_REPLICASOURCEINFO_PATCH(&lsa_ReplicaSourceInfo_Type);
48128 : #endif
48129 : #ifdef PY_DEFAULTQUOTAINFO_PATCH
48130 : PY_DEFAULTQUOTAINFO_PATCH(&lsa_DefaultQuotaInfo_Type);
48131 : #endif
48132 : #ifdef PY_MODIFICATIONINFO_PATCH
48133 : PY_MODIFICATIONINFO_PATCH(&lsa_ModificationInfo_Type);
48134 : #endif
48135 : #ifdef PY_AUDITFULLSETINFO_PATCH
48136 : PY_AUDITFULLSETINFO_PATCH(&lsa_AuditFullSetInfo_Type);
48137 : #endif
48138 : #ifdef PY_AUDITFULLQUERYINFO_PATCH
48139 : PY_AUDITFULLQUERYINFO_PATCH(&lsa_AuditFullQueryInfo_Type);
48140 : #endif
48141 : #ifdef PY_DNSDOMAININFO_PATCH
48142 : PY_DNSDOMAININFO_PATCH(&lsa_DnsDomainInfo_Type);
48143 : #endif
48144 : #ifdef PY_POLICYINFORMATION_PATCH
48145 : PY_POLICYINFORMATION_PATCH(&lsa_PolicyInformation_Type);
48146 : #endif
48147 : #ifdef PY_SIDPTR_PATCH
48148 : PY_SIDPTR_PATCH(&lsa_SidPtr_Type);
48149 : #endif
48150 : #ifdef PY_SIDARRAY_PATCH
48151 : PY_SIDARRAY_PATCH(&lsa_SidArray_Type);
48152 : #endif
48153 : #ifdef PY_DOMAINLIST_PATCH
48154 : PY_DOMAINLIST_PATCH(&lsa_DomainList_Type);
48155 : #endif
48156 : #ifdef PY_TRANSLATEDSID_PATCH
48157 : PY_TRANSLATEDSID_PATCH(&lsa_TranslatedSid_Type);
48158 : #endif
48159 : #ifdef PY_TRANSSIDARRAY_PATCH
48160 : PY_TRANSSIDARRAY_PATCH(&lsa_TransSidArray_Type);
48161 : #endif
48162 : #ifdef PY_REFDOMAINLIST_PATCH
48163 : PY_REFDOMAINLIST_PATCH(&lsa_RefDomainList_Type);
48164 : #endif
48165 : #ifdef PY_TRANSLATEDNAME_PATCH
48166 : PY_TRANSLATEDNAME_PATCH(&lsa_TranslatedName_Type);
48167 : #endif
48168 : #ifdef PY_TRANSNAMEARRAY_PATCH
48169 : PY_TRANSNAMEARRAY_PATCH(&lsa_TransNameArray_Type);
48170 : #endif
48171 : #ifdef PY_LUIDATTRIBUTE_PATCH
48172 : PY_LUIDATTRIBUTE_PATCH(&lsa_LUIDAttribute_Type);
48173 : #endif
48174 : #ifdef PY_PRIVILEGESET_PATCH
48175 : PY_PRIVILEGESET_PATCH(&lsa_PrivilegeSet_Type);
48176 : #endif
48177 : #ifdef PY_DATA_BUF_PATCH
48178 : PY_DATA_BUF_PATCH(&lsa_DATA_BUF_Type);
48179 : #endif
48180 : #ifdef PY_DATA_BUF2_PATCH
48181 : PY_DATA_BUF2_PATCH(&lsa_DATA_BUF2_Type);
48182 : #endif
48183 : #ifdef PY_TRUSTDOMAININFONAME_PATCH
48184 : PY_TRUSTDOMAININFONAME_PATCH(&lsa_TrustDomainInfoName_Type);
48185 : #endif
48186 : #ifdef PY_TRUSTDOMAININFOCONTROLLERS_PATCH
48187 : PY_TRUSTDOMAININFOCONTROLLERS_PATCH(&lsa_TrustDomainInfoControllers_Type);
48188 : #endif
48189 : #ifdef PY_TRUSTDOMAININFOPOSIXOFFSET_PATCH
48190 : PY_TRUSTDOMAININFOPOSIXOFFSET_PATCH(&lsa_TrustDomainInfoPosixOffset_Type);
48191 : #endif
48192 : #ifdef PY_TRUSTDOMAININFOPASSWORD_PATCH
48193 : PY_TRUSTDOMAININFOPASSWORD_PATCH(&lsa_TrustDomainInfoPassword_Type);
48194 : #endif
48195 : #ifdef PY_TRUSTDOMAININFOBASIC_PATCH
48196 : PY_TRUSTDOMAININFOBASIC_PATCH(&lsa_TrustDomainInfoBasic_Type);
48197 : #endif
48198 : #ifdef PY_TRUSTDOMAININFOINFOEX_PATCH
48199 : PY_TRUSTDOMAININFOINFOEX_PATCH(&lsa_TrustDomainInfoInfoEx_Type);
48200 : #endif
48201 : #ifdef PY_TRUSTDOMAININFOBUFFER_PATCH
48202 : PY_TRUSTDOMAININFOBUFFER_PATCH(&lsa_TrustDomainInfoBuffer_Type);
48203 : #endif
48204 : #ifdef PY_TRUSTDOMAININFOAUTHINFO_PATCH
48205 : PY_TRUSTDOMAININFOAUTHINFO_PATCH(&lsa_TrustDomainInfoAuthInfo_Type);
48206 : #endif
48207 : #ifdef PY_TRUSTDOMAININFOFULLINFO_PATCH
48208 : PY_TRUSTDOMAININFOFULLINFO_PATCH(&lsa_TrustDomainInfoFullInfo_Type);
48209 : #endif
48210 : #ifdef PY_TRUSTDOMAININFOAUTHINFOINTERNAL_PATCH
48211 : PY_TRUSTDOMAININFOAUTHINFOINTERNAL_PATCH(&lsa_TrustDomainInfoAuthInfoInternal_Type);
48212 : #endif
48213 : #ifdef PY_TRUSTDOMAININFOFULLINFOINTERNAL_PATCH
48214 : PY_TRUSTDOMAININFOFULLINFOINTERNAL_PATCH(&lsa_TrustDomainInfoFullInfoInternal_Type);
48215 : #endif
48216 : #ifdef PY_TRUSTDOMAININFOINFOEX2INTERNAL_PATCH
48217 : PY_TRUSTDOMAININFOINFOEX2INTERNAL_PATCH(&lsa_TrustDomainInfoInfoEx2Internal_Type);
48218 : #endif
48219 : #ifdef PY_TRUSTDOMAININFOFULLINFO2INTERNAL_PATCH
48220 : PY_TRUSTDOMAININFOFULLINFO2INTERNAL_PATCH(&lsa_TrustDomainInfoFullInfo2Internal_Type);
48221 : #endif
48222 : #ifdef PY_TRUSTDOMAININFOSUPPORTEDENCTYPES_PATCH
48223 : PY_TRUSTDOMAININFOSUPPORTEDENCTYPES_PATCH(&lsa_TrustDomainInfoSupportedEncTypes_Type);
48224 : #endif
48225 : #ifdef PY_TRUSTEDDOMAININFO_PATCH
48226 : PY_TRUSTEDDOMAININFO_PATCH(&lsa_TrustedDomainInfo_Type);
48227 : #endif
48228 : #ifdef PY_DATA_BUF_PTR_PATCH
48229 : PY_DATA_BUF_PTR_PATCH(&lsa_DATA_BUF_PTR_Type);
48230 : #endif
48231 : #ifdef PY_RIGHTATTRIBUTE_PATCH
48232 : PY_RIGHTATTRIBUTE_PATCH(&lsa_RightAttribute_Type);
48233 : #endif
48234 : #ifdef PY_RIGHTSET_PATCH
48235 : PY_RIGHTSET_PATCH(&lsa_RightSet_Type);
48236 : #endif
48237 : #ifdef PY_DOMAINLISTEX_PATCH
48238 : PY_DOMAINLISTEX_PATCH(&lsa_DomainListEx_Type);
48239 : #endif
48240 : #ifdef PY_DOMAININFOKERBEROS_PATCH
48241 : PY_DOMAININFOKERBEROS_PATCH(&lsa_DomainInfoKerberos_Type);
48242 : #endif
48243 : #ifdef PY_DOMAININFOEFS_PATCH
48244 : PY_DOMAININFOEFS_PATCH(&lsa_DomainInfoEfs_Type);
48245 : #endif
48246 : #ifdef PY_DOMAININFORMATIONPOLICY_PATCH
48247 : PY_DOMAININFORMATIONPOLICY_PATCH(&lsa_DomainInformationPolicy_Type);
48248 : #endif
48249 : #ifdef PY_TRANSLATEDNAME2_PATCH
48250 : PY_TRANSLATEDNAME2_PATCH(&lsa_TranslatedName2_Type);
48251 : #endif
48252 : #ifdef PY_TRANSNAMEARRAY2_PATCH
48253 : PY_TRANSNAMEARRAY2_PATCH(&lsa_TransNameArray2_Type);
48254 : #endif
48255 : #ifdef PY_TRANSLATEDSID2_PATCH
48256 : PY_TRANSLATEDSID2_PATCH(&lsa_TranslatedSid2_Type);
48257 : #endif
48258 : #ifdef PY_TRANSSIDARRAY2_PATCH
48259 : PY_TRANSSIDARRAY2_PATCH(&lsa_TransSidArray2_Type);
48260 : #endif
48261 : #ifdef PY_TRANSLATEDSID3_PATCH
48262 : PY_TRANSLATEDSID3_PATCH(&lsa_TranslatedSid3_Type);
48263 : #endif
48264 : #ifdef PY_TRANSSIDARRAY3_PATCH
48265 : PY_TRANSSIDARRAY3_PATCH(&lsa_TransSidArray3_Type);
48266 : #endif
48267 : #ifdef PY_FORESTTRUSTBINARYDATA_PATCH
48268 : PY_FORESTTRUSTBINARYDATA_PATCH(&lsa_ForestTrustBinaryData_Type);
48269 : #endif
48270 : #ifdef PY_FORESTTRUSTDOMAININFO_PATCH
48271 : PY_FORESTTRUSTDOMAININFO_PATCH(&lsa_ForestTrustDomainInfo_Type);
48272 : #endif
48273 : #ifdef PY_FORESTTRUSTDATA_PATCH
48274 : PY_FORESTTRUSTDATA_PATCH(&lsa_ForestTrustData_Type);
48275 : #endif
48276 : #ifdef PY_FORESTTRUSTRECORD_PATCH
48277 : PY_FORESTTRUSTRECORD_PATCH(&lsa_ForestTrustRecord_Type);
48278 : #endif
48279 : #ifdef PY_FORESTTRUSTINFORMATION_PATCH
48280 : PY_FORESTTRUSTINFORMATION_PATCH(&lsa_ForestTrustInformation_Type);
48281 : #endif
48282 : #ifdef PY_FORESTTRUSTCOLLISIONRECORD_PATCH
48283 : PY_FORESTTRUSTCOLLISIONRECORD_PATCH(&lsa_ForestTrustCollisionRecord_Type);
48284 : #endif
48285 : #ifdef PY_FORESTTRUSTCOLLISIONINFO_PATCH
48286 : PY_FORESTTRUSTCOLLISIONINFO_PATCH(&lsa_ForestTrustCollisionInfo_Type);
48287 : #endif
48288 : #ifdef PY_CLOSE_PATCH
48289 : PY_CLOSE_PATCH(&lsa_Close_Type);
48290 : #endif
48291 : #ifdef PY_DELETE_PATCH
48292 : PY_DELETE_PATCH(&lsa_Delete_Type);
48293 : #endif
48294 : #ifdef PY_ENUMPRIVS_PATCH
48295 : PY_ENUMPRIVS_PATCH(&lsa_EnumPrivs_Type);
48296 : #endif
48297 : #ifdef PY_QUERYSECURITY_PATCH
48298 : PY_QUERYSECURITY_PATCH(&lsa_QuerySecurity_Type);
48299 : #endif
48300 : #ifdef PY_SETSECOBJ_PATCH
48301 : PY_SETSECOBJ_PATCH(&lsa_SetSecObj_Type);
48302 : #endif
48303 : #ifdef PY_OPENPOLICY_PATCH
48304 : PY_OPENPOLICY_PATCH(&lsa_OpenPolicy_Type);
48305 : #endif
48306 : #ifdef PY_QUERYINFOPOLICY_PATCH
48307 : PY_QUERYINFOPOLICY_PATCH(&lsa_QueryInfoPolicy_Type);
48308 : #endif
48309 : #ifdef PY_SETINFOPOLICY_PATCH
48310 : PY_SETINFOPOLICY_PATCH(&lsa_SetInfoPolicy_Type);
48311 : #endif
48312 : #ifdef PY_CREATEACCOUNT_PATCH
48313 : PY_CREATEACCOUNT_PATCH(&lsa_CreateAccount_Type);
48314 : #endif
48315 : #ifdef PY_ENUMACCOUNTS_PATCH
48316 : PY_ENUMACCOUNTS_PATCH(&lsa_EnumAccounts_Type);
48317 : #endif
48318 : #ifdef PY_CREATETRUSTEDDOMAIN_PATCH
48319 : PY_CREATETRUSTEDDOMAIN_PATCH(&lsa_CreateTrustedDomain_Type);
48320 : #endif
48321 : #ifdef PY_ENUMTRUSTDOM_PATCH
48322 : PY_ENUMTRUSTDOM_PATCH(&lsa_EnumTrustDom_Type);
48323 : #endif
48324 : #ifdef PY_LOOKUPNAMES_PATCH
48325 : PY_LOOKUPNAMES_PATCH(&lsa_LookupNames_Type);
48326 : #endif
48327 : #ifdef PY_LOOKUPSIDS_PATCH
48328 : PY_LOOKUPSIDS_PATCH(&lsa_LookupSids_Type);
48329 : #endif
48330 : #ifdef PY_CREATESECRET_PATCH
48331 : PY_CREATESECRET_PATCH(&lsa_CreateSecret_Type);
48332 : #endif
48333 : #ifdef PY_OPENACCOUNT_PATCH
48334 : PY_OPENACCOUNT_PATCH(&lsa_OpenAccount_Type);
48335 : #endif
48336 : #ifdef PY_ENUMPRIVSACCOUNT_PATCH
48337 : PY_ENUMPRIVSACCOUNT_PATCH(&lsa_EnumPrivsAccount_Type);
48338 : #endif
48339 : #ifdef PY_ADDPRIVILEGESTOACCOUNT_PATCH
48340 : PY_ADDPRIVILEGESTOACCOUNT_PATCH(&lsa_AddPrivilegesToAccount_Type);
48341 : #endif
48342 : #ifdef PY_REMOVEPRIVILEGESFROMACCOUNT_PATCH
48343 : PY_REMOVEPRIVILEGESFROMACCOUNT_PATCH(&lsa_RemovePrivilegesFromAccount_Type);
48344 : #endif
48345 : #ifdef PY_GETSYSTEMACCESSACCOUNT_PATCH
48346 : PY_GETSYSTEMACCESSACCOUNT_PATCH(&lsa_GetSystemAccessAccount_Type);
48347 : #endif
48348 : #ifdef PY_SETSYSTEMACCESSACCOUNT_PATCH
48349 : PY_SETSYSTEMACCESSACCOUNT_PATCH(&lsa_SetSystemAccessAccount_Type);
48350 : #endif
48351 : #ifdef PY_OPENTRUSTEDDOMAIN_PATCH
48352 : PY_OPENTRUSTEDDOMAIN_PATCH(&lsa_OpenTrustedDomain_Type);
48353 : #endif
48354 : #ifdef PY_QUERYTRUSTEDDOMAININFO_PATCH
48355 : PY_QUERYTRUSTEDDOMAININFO_PATCH(&lsa_QueryTrustedDomainInfo_Type);
48356 : #endif
48357 : #ifdef PY_SETINFORMATIONTRUSTEDDOMAIN_PATCH
48358 : PY_SETINFORMATIONTRUSTEDDOMAIN_PATCH(&lsa_SetInformationTrustedDomain_Type);
48359 : #endif
48360 : #ifdef PY_OPENSECRET_PATCH
48361 : PY_OPENSECRET_PATCH(&lsa_OpenSecret_Type);
48362 : #endif
48363 : #ifdef PY_SETSECRET_PATCH
48364 : PY_SETSECRET_PATCH(&lsa_SetSecret_Type);
48365 : #endif
48366 : #ifdef PY_QUERYSECRET_PATCH
48367 : PY_QUERYSECRET_PATCH(&lsa_QuerySecret_Type);
48368 : #endif
48369 : #ifdef PY_LOOKUPPRIVVALUE_PATCH
48370 : PY_LOOKUPPRIVVALUE_PATCH(&lsa_LookupPrivValue_Type);
48371 : #endif
48372 : #ifdef PY_LOOKUPPRIVNAME_PATCH
48373 : PY_LOOKUPPRIVNAME_PATCH(&lsa_LookupPrivName_Type);
48374 : #endif
48375 : #ifdef PY_LOOKUPPRIVDISPLAYNAME_PATCH
48376 : PY_LOOKUPPRIVDISPLAYNAME_PATCH(&lsa_LookupPrivDisplayName_Type);
48377 : #endif
48378 : #ifdef PY_DELETEOBJECT_PATCH
48379 : PY_DELETEOBJECT_PATCH(&lsa_DeleteObject_Type);
48380 : #endif
48381 : #ifdef PY_ENUMACCOUNTSWITHUSERRIGHT_PATCH
48382 : PY_ENUMACCOUNTSWITHUSERRIGHT_PATCH(&lsa_EnumAccountsWithUserRight_Type);
48383 : #endif
48384 : #ifdef PY_ENUMACCOUNTRIGHTS_PATCH
48385 : PY_ENUMACCOUNTRIGHTS_PATCH(&lsa_EnumAccountRights_Type);
48386 : #endif
48387 : #ifdef PY_ADDACCOUNTRIGHTS_PATCH
48388 : PY_ADDACCOUNTRIGHTS_PATCH(&lsa_AddAccountRights_Type);
48389 : #endif
48390 : #ifdef PY_REMOVEACCOUNTRIGHTS_PATCH
48391 : PY_REMOVEACCOUNTRIGHTS_PATCH(&lsa_RemoveAccountRights_Type);
48392 : #endif
48393 : #ifdef PY_QUERYTRUSTEDDOMAININFOBYSID_PATCH
48394 : PY_QUERYTRUSTEDDOMAININFOBYSID_PATCH(&lsa_QueryTrustedDomainInfoBySid_Type);
48395 : #endif
48396 : #ifdef PY_SETTRUSTEDDOMAININFO_PATCH
48397 : PY_SETTRUSTEDDOMAININFO_PATCH(&lsa_SetTrustedDomainInfo_Type);
48398 : #endif
48399 : #ifdef PY_DELETETRUSTEDDOMAIN_PATCH
48400 : PY_DELETETRUSTEDDOMAIN_PATCH(&lsa_DeleteTrustedDomain_Type);
48401 : #endif
48402 : #ifdef PY_STOREPRIVATEDATA_PATCH
48403 : PY_STOREPRIVATEDATA_PATCH(&lsa_StorePrivateData_Type);
48404 : #endif
48405 : #ifdef PY_RETRIEVEPRIVATEDATA_PATCH
48406 : PY_RETRIEVEPRIVATEDATA_PATCH(&lsa_RetrievePrivateData_Type);
48407 : #endif
48408 : #ifdef PY_OPENPOLICY2_PATCH
48409 : PY_OPENPOLICY2_PATCH(&lsa_OpenPolicy2_Type);
48410 : #endif
48411 : #ifdef PY_GETUSERNAME_PATCH
48412 : PY_GETUSERNAME_PATCH(&lsa_GetUserName_Type);
48413 : #endif
48414 : #ifdef PY_QUERYINFOPOLICY2_PATCH
48415 : PY_QUERYINFOPOLICY2_PATCH(&lsa_QueryInfoPolicy2_Type);
48416 : #endif
48417 : #ifdef PY_SETINFOPOLICY2_PATCH
48418 : PY_SETINFOPOLICY2_PATCH(&lsa_SetInfoPolicy2_Type);
48419 : #endif
48420 : #ifdef PY_QUERYTRUSTEDDOMAININFOBYNAME_PATCH
48421 : PY_QUERYTRUSTEDDOMAININFOBYNAME_PATCH(&lsa_QueryTrustedDomainInfoByName_Type);
48422 : #endif
48423 : #ifdef PY_SETTRUSTEDDOMAININFOBYNAME_PATCH
48424 : PY_SETTRUSTEDDOMAININFOBYNAME_PATCH(&lsa_SetTrustedDomainInfoByName_Type);
48425 : #endif
48426 : #ifdef PY_ENUMTRUSTEDDOMAINSEX_PATCH
48427 : PY_ENUMTRUSTEDDOMAINSEX_PATCH(&lsa_EnumTrustedDomainsEx_Type);
48428 : #endif
48429 : #ifdef PY_CREATETRUSTEDDOMAINEX_PATCH
48430 : PY_CREATETRUSTEDDOMAINEX_PATCH(&lsa_CreateTrustedDomainEx_Type);
48431 : #endif
48432 : #ifdef PY_CLOSETRUSTEDDOMAINEX_PATCH
48433 : PY_CLOSETRUSTEDDOMAINEX_PATCH(&lsa_CloseTrustedDomainEx_Type);
48434 : #endif
48435 : #ifdef PY_QUERYDOMAININFORMATIONPOLICY_PATCH
48436 : PY_QUERYDOMAININFORMATIONPOLICY_PATCH(&lsa_QueryDomainInformationPolicy_Type);
48437 : #endif
48438 : #ifdef PY_SETDOMAININFORMATIONPOLICY_PATCH
48439 : PY_SETDOMAININFORMATIONPOLICY_PATCH(&lsa_SetDomainInformationPolicy_Type);
48440 : #endif
48441 : #ifdef PY_OPENTRUSTEDDOMAINBYNAME_PATCH
48442 : PY_OPENTRUSTEDDOMAINBYNAME_PATCH(&lsa_OpenTrustedDomainByName_Type);
48443 : #endif
48444 : #ifdef PY_LOOKUPSIDS2_PATCH
48445 : PY_LOOKUPSIDS2_PATCH(&lsa_LookupSids2_Type);
48446 : #endif
48447 : #ifdef PY_LOOKUPNAMES2_PATCH
48448 : PY_LOOKUPNAMES2_PATCH(&lsa_LookupNames2_Type);
48449 : #endif
48450 : #ifdef PY_CREATETRUSTEDDOMAINEX2_PATCH
48451 : PY_CREATETRUSTEDDOMAINEX2_PATCH(&lsa_CreateTrustedDomainEx2_Type);
48452 : #endif
48453 : #ifdef PY_LOOKUPNAMES3_PATCH
48454 : PY_LOOKUPNAMES3_PATCH(&lsa_LookupNames3_Type);
48455 : #endif
48456 : #ifdef PY_LSARQUERYFORESTTRUSTINFORMATION_PATCH
48457 : PY_LSARQUERYFORESTTRUSTINFORMATION_PATCH(&lsa_lsaRQueryForestTrustInformation_Type);
48458 : #endif
48459 : #ifdef PY_LSARSETFORESTTRUSTINFORMATION_PATCH
48460 : PY_LSARSETFORESTTRUSTINFORMATION_PATCH(&lsa_lsaRSetForestTrustInformation_Type);
48461 : #endif
48462 : #ifdef PY_LOOKUPSIDS3_PATCH
48463 : PY_LOOKUPSIDS3_PATCH(&lsa_LookupSids3_Type);
48464 : #endif
48465 : #ifdef PY_LOOKUPNAMES4_PATCH
48466 : PY_LOOKUPNAMES4_PATCH(&lsa_LookupNames4_Type);
48467 : #endif
48468 : #ifdef PY_LSARPC_PATCH
48469 : PY_LSARPC_PATCH(&lsarpc_InterfaceType);
48470 : #endif
48471 : #ifdef PY_LSARPC_ABSTRACT_SYNTAX_PATCH
48472 : PY_LSARPC_ABSTRACT_SYNTAX_PATCH(&lsarpc_SyntaxType);
48473 : #endif
48474 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
48475 : PY_ABSTRACT_SYNTAX_PATCH(&lsarpc_SyntaxType);
48476 : #endif
48477 :
48478 3514 : m = PyModule_Create(&moduledef);
48479 3514 : if (m == NULL)
48480 0 : goto out;
48481 :
48482 3514 : PyModule_AddObject(m, "LSA_POLICY_ALL_ACCESS", PyLong_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)));
48483 3514 : PyModule_AddObject(m, "LSA_POLICY_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|LSA_POLICY_VIEW_LOCAL_INFORMATION|LSA_POLICY_VIEW_AUDIT_INFORMATION|LSA_POLICY_GET_PRIVATE_INFORMATION)));
48484 3514 : PyModule_AddObject(m, "LSA_POLICY_WRITE", PyLong_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)));
48485 3514 : PyModule_AddObject(m, "LSA_POLICY_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|LSA_POLICY_VIEW_LOCAL_INFORMATION|LSA_POLICY_LOOKUP_NAMES)));
48486 3514 : PyModule_AddObject(m, "LSA_ACCOUNT_ALL_ACCESS", PyLong_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|LSA_ACCOUNT_VIEW|LSA_ACCOUNT_ADJUST_PRIVILEGES|LSA_ACCOUNT_ADJUST_QUOTAS|LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS)));
48487 3514 : PyModule_AddObject(m, "LSA_ACCOUNT_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|LSA_ACCOUNT_VIEW)));
48488 3514 : PyModule_AddObject(m, "LSA_ACCOUNT_WRITE", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|LSA_ACCOUNT_ADJUST_PRIVILEGES|LSA_ACCOUNT_ADJUST_QUOTAS|LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS)));
48489 3514 : PyModule_AddObject(m, "LSA_ACCOUNT_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS)));
48490 3514 : PyModule_AddObject(m, "LSA_SECRET_ALL_ACCESS", PyLong_FromLong((LSA_SECRET_QUERY_VALUE|LSA_SECRET_SET_VALUE|SEC_STD_DELETE|STANDARD_RIGHTS_READ_ACCESS|SEC_STD_WRITE_DAC|SEC_STD_WRITE_OWNER)));
48491 3514 : PyModule_AddObject(m, "LSA_SECRET_READ", PyLong_FromLong((LSA_SECRET_QUERY_VALUE|STANDARD_RIGHTS_READ_ACCESS)));
48492 3514 : PyModule_AddObject(m, "LSA_SECRET_WRITE", PyLong_FromLong((LSA_SECRET_SET_VALUE|STANDARD_RIGHTS_READ_ACCESS)));
48493 3514 : PyModule_AddObject(m, "LSA_SECRET_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS)));
48494 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_ALL_ACCESS", PyLong_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)));
48495 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_READ", PyLong_FromLong((LSA_TRUSTED_QUERY_DOMAIN_NAME|STANDARD_RIGHTS_READ_ACCESS)));
48496 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_WRITE", PyLong_FromLong((LSA_TRUSTED_SET_CONTROLLERS|LSA_TRUSTED_SET_POSIX|LSA_TRUSTED_SET_AUTH|STANDARD_RIGHTS_READ_ACCESS)));
48497 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_EXECUTE", PyLong_FromLong((LSA_TRUSTED_QUERY_DOMAIN_NAME|LSA_TRUSTED_QUERY_POSIX|STANDARD_RIGHTS_READ_ACCESS)));
48498 3514 : PyModule_AddObject(m, "LSA_ENUM_TRUST_DOMAIN_MULTIPLIER", PyLong_FromUnsignedLongLong(60));
48499 3514 : PyModule_AddObject(m, "LSA_REF_DOMAIN_LIST_MULTIPLIER", PyLong_FromUnsignedLongLong(32));
48500 3514 : PyModule_AddObject(m, "LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER", PyLong_FromUnsignedLongLong(82));
48501 3514 : PyModule_AddObject(m, "LSA_TLN_DISABLED_MASK", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TLN_DISABLED_NEW|LSA_TLN_DISABLED_ADMIN|LSA_TLN_DISABLED_CONFLICT)));
48502 3514 : PyModule_AddObject(m, "LSA_SID_DISABLED_MASK", PyLong_FromUnsignedLongLong((uint32_t)(LSA_SID_DISABLED_ADMIN|LSA_SID_DISABLED_CONFLICT)));
48503 3514 : PyModule_AddObject(m, "LSA_NB_DISABLED_MASK", PyLong_FromUnsignedLongLong((uint32_t)(LSA_NB_DISABLED_ADMIN|LSA_NB_DISABLED_CONFLICT)));
48504 3514 : PyModule_AddObject(m, "LSA_CLIENT_REVISION_NO_DNS", PyLong_FromUnsignedLongLong(0x00000001));
48505 3514 : PyModule_AddObject(m, "LSA_CLIENT_REVISION_DNS", PyLong_FromUnsignedLongLong(0x00000002));
48506 3514 : PyModule_AddObject(m, "LSA_LOOKUP_OPTIONS_NO_ISOLATED", PyLong_FromUnsignedLongLong(0x80000000));
48507 3514 : PyModule_AddObject(m, "LSA_POLICY_VIEW_LOCAL_INFORMATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_VIEW_LOCAL_INFORMATION));
48508 3514 : PyModule_AddObject(m, "LSA_POLICY_VIEW_AUDIT_INFORMATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_VIEW_AUDIT_INFORMATION));
48509 3514 : PyModule_AddObject(m, "LSA_POLICY_GET_PRIVATE_INFORMATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_GET_PRIVATE_INFORMATION));
48510 3514 : PyModule_AddObject(m, "LSA_POLICY_TRUST_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_TRUST_ADMIN));
48511 3514 : PyModule_AddObject(m, "LSA_POLICY_CREATE_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_CREATE_ACCOUNT));
48512 3514 : PyModule_AddObject(m, "LSA_POLICY_CREATE_SECRET", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_CREATE_SECRET));
48513 3514 : PyModule_AddObject(m, "LSA_POLICY_CREATE_PRIVILEGE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_CREATE_PRIVILEGE));
48514 3514 : PyModule_AddObject(m, "LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS));
48515 3514 : PyModule_AddObject(m, "LSA_POLICY_SET_AUDIT_REQUIREMENTS", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_SET_AUDIT_REQUIREMENTS));
48516 3514 : PyModule_AddObject(m, "LSA_POLICY_AUDIT_LOG_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_AUDIT_LOG_ADMIN));
48517 3514 : PyModule_AddObject(m, "LSA_POLICY_SERVER_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_SERVER_ADMIN));
48518 3514 : PyModule_AddObject(m, "LSA_POLICY_LOOKUP_NAMES", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_LOOKUP_NAMES));
48519 3514 : PyModule_AddObject(m, "LSA_POLICY_NOTIFICATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_NOTIFICATION));
48520 3514 : PyModule_AddObject(m, "LSA_ACCOUNT_VIEW", PyLong_FromUnsignedLongLong((uint32_t)LSA_ACCOUNT_VIEW));
48521 3514 : PyModule_AddObject(m, "LSA_ACCOUNT_ADJUST_PRIVILEGES", PyLong_FromUnsignedLongLong((uint32_t)LSA_ACCOUNT_ADJUST_PRIVILEGES));
48522 3514 : PyModule_AddObject(m, "LSA_ACCOUNT_ADJUST_QUOTAS", PyLong_FromUnsignedLongLong((uint32_t)LSA_ACCOUNT_ADJUST_QUOTAS));
48523 3514 : PyModule_AddObject(m, "LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS", PyLong_FromUnsignedLongLong((uint32_t)LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS));
48524 3514 : PyModule_AddObject(m, "LSA_SECRET_SET_VALUE", PyLong_FromUnsignedLongLong((uint32_t)LSA_SECRET_SET_VALUE));
48525 3514 : PyModule_AddObject(m, "LSA_SECRET_QUERY_VALUE", PyLong_FromUnsignedLongLong((uint32_t)LSA_SECRET_QUERY_VALUE));
48526 3514 : PyModule_AddObject(m, "LSA_TRUSTED_QUERY_DOMAIN_NAME", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_QUERY_DOMAIN_NAME));
48527 3514 : PyModule_AddObject(m, "LSA_TRUSTED_QUERY_CONTROLLERS", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_QUERY_CONTROLLERS));
48528 3514 : PyModule_AddObject(m, "LSA_TRUSTED_SET_CONTROLLERS", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_SET_CONTROLLERS));
48529 3514 : PyModule_AddObject(m, "LSA_TRUSTED_QUERY_POSIX", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_QUERY_POSIX));
48530 3514 : PyModule_AddObject(m, "LSA_TRUSTED_SET_POSIX", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_SET_POSIX));
48531 3514 : PyModule_AddObject(m, "LSA_TRUSTED_SET_AUTH", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_SET_AUTH));
48532 3514 : PyModule_AddObject(m, "LSA_TRUSTED_QUERY_AUTH", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_QUERY_AUTH));
48533 3514 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_NONE", PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_NONE));
48534 3514 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_SUCCESS", PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_SUCCESS));
48535 3514 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_FAILURE", PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_FAILURE));
48536 3514 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_ALL", PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_ALL));
48537 3514 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_CLEAR", PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_CLEAR));
48538 3514 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_SYSTEM", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_SYSTEM));
48539 3514 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_LOGON", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_LOGON));
48540 3514 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS));
48541 3514 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS));
48542 3514 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_PROCCESS_TRACKING", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_PROCCESS_TRACKING));
48543 3514 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES));
48544 3514 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT));
48545 3514 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS));
48546 3514 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_ACCOUNT_LOGON", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_ACCOUNT_LOGON));
48547 3514 : PyModule_AddObject(m, "LSA_ROLE_BACKUP", PyLong_FromUnsignedLongLong((uint32_t)LSA_ROLE_BACKUP));
48548 3514 : PyModule_AddObject(m, "LSA_ROLE_PRIMARY", PyLong_FromUnsignedLongLong((uint32_t)LSA_ROLE_PRIMARY));
48549 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_LOG", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_AUDIT_LOG));
48550 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_EVENTS", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_AUDIT_EVENTS));
48551 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_DOMAIN", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_DOMAIN));
48552 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_PD", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_PD));
48553 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_ACCOUNT_DOMAIN", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_ACCOUNT_DOMAIN));
48554 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_ROLE", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_ROLE));
48555 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_REPLICA", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_REPLICA));
48556 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_QUOTA", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_QUOTA));
48557 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_MOD", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_MOD));
48558 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_FULL_SET", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_AUDIT_FULL_SET));
48559 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_FULL_QUERY", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_AUDIT_FULL_QUERY));
48560 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_DNS", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_DNS));
48561 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_DNS_INT", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_DNS_INT));
48562 3514 : PyModule_AddObject(m, "LSA_POLICY_INFO_L_ACCOUNT_DOMAIN", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_L_ACCOUNT_DOMAIN));
48563 3514 : PyModule_AddObject(m, "SID_NAME_USE_NONE", PyLong_FromLong((uint16_t)SID_NAME_USE_NONE));
48564 3514 : PyModule_AddObject(m, "SID_NAME_USER", PyLong_FromLong((uint16_t)SID_NAME_USER));
48565 3514 : PyModule_AddObject(m, "SID_NAME_DOM_GRP", PyLong_FromLong((uint16_t)SID_NAME_DOM_GRP));
48566 3514 : PyModule_AddObject(m, "SID_NAME_DOMAIN", PyLong_FromLong((uint16_t)SID_NAME_DOMAIN));
48567 3514 : PyModule_AddObject(m, "SID_NAME_ALIAS", PyLong_FromLong((uint16_t)SID_NAME_ALIAS));
48568 3514 : PyModule_AddObject(m, "SID_NAME_WKN_GRP", PyLong_FromLong((uint16_t)SID_NAME_WKN_GRP));
48569 3514 : PyModule_AddObject(m, "SID_NAME_DELETED", PyLong_FromLong((uint16_t)SID_NAME_DELETED));
48570 3514 : PyModule_AddObject(m, "SID_NAME_INVALID", PyLong_FromLong((uint16_t)SID_NAME_INVALID));
48571 3514 : PyModule_AddObject(m, "SID_NAME_UNKNOWN", PyLong_FromLong((uint16_t)SID_NAME_UNKNOWN));
48572 3514 : PyModule_AddObject(m, "SID_NAME_COMPUTER", PyLong_FromLong((uint16_t)SID_NAME_COMPUTER));
48573 3514 : PyModule_AddObject(m, "SID_NAME_LABEL", PyLong_FromLong((uint16_t)SID_NAME_LABEL));
48574 3514 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_ALL", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_ALL));
48575 3514 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_DOMAINS_ONLY", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_DOMAINS_ONLY));
48576 3514 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY));
48577 3514 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY));
48578 3514 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY));
48579 3514 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2));
48580 3514 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC));
48581 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_NAME", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_NAME));
48582 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS));
48583 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET));
48584 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_PASSWORD", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_PASSWORD));
48585 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_BASIC", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_BASIC));
48586 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_INFO_EX", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_INFO_EX));
48587 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO));
48588 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_FULL_INFO));
48589 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL));
48590 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL));
48591 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL));
48592 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL));
48593 3514 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES));
48594 3514 : PyModule_AddObject(m, "LSA_TRUST_DIRECTION_INBOUND", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_DIRECTION_INBOUND));
48595 3514 : PyModule_AddObject(m, "LSA_TRUST_DIRECTION_OUTBOUND", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_DIRECTION_OUTBOUND));
48596 3514 : PyModule_AddObject(m, "LSA_TRUST_TYPE_DOWNLEVEL", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_TYPE_DOWNLEVEL));
48597 3514 : PyModule_AddObject(m, "LSA_TRUST_TYPE_UPLEVEL", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_TYPE_UPLEVEL));
48598 3514 : PyModule_AddObject(m, "LSA_TRUST_TYPE_MIT", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_TYPE_MIT));
48599 3514 : PyModule_AddObject(m, "LSA_TRUST_TYPE_DCE", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_TYPE_DCE));
48600 3514 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE));
48601 3514 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY));
48602 3514 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN));
48603 3514 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE));
48604 3514 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION));
48605 3514 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_WITHIN_FOREST", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_WITHIN_FOREST));
48606 3514 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL));
48607 3514 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION));
48608 3514 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION_NO_TGT_DELEGATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION_NO_TGT_DELEGATION));
48609 3514 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_PIM_TRUST", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_PIM_TRUST));
48610 3514 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION_ENABLE_TGT_DELEGATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION_ENABLE_TGT_DELEGATION));
48611 3514 : PyModule_AddObject(m, "TRUST_AUTH_TYPE_NONE", PyLong_FromUnsignedLongLong((uint32_t)TRUST_AUTH_TYPE_NONE));
48612 3514 : PyModule_AddObject(m, "TRUST_AUTH_TYPE_NT4OWF", PyLong_FromUnsignedLongLong((uint32_t)TRUST_AUTH_TYPE_NT4OWF));
48613 3514 : PyModule_AddObject(m, "TRUST_AUTH_TYPE_CLEAR", PyLong_FromUnsignedLongLong((uint32_t)TRUST_AUTH_TYPE_CLEAR));
48614 3514 : PyModule_AddObject(m, "TRUST_AUTH_TYPE_VERSION", PyLong_FromUnsignedLongLong((uint32_t)TRUST_AUTH_TYPE_VERSION));
48615 3514 : PyModule_AddObject(m, "LSA_POLICY_KERBEROS_VALIDATE_CLIENT", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_KERBEROS_VALIDATE_CLIENT));
48616 3514 : PyModule_AddObject(m, "LSA_DOMAIN_INFO_POLICY_EFS", PyLong_FromLong((uint16_t)LSA_DOMAIN_INFO_POLICY_EFS));
48617 3514 : PyModule_AddObject(m, "LSA_DOMAIN_INFO_POLICY_KERBEROS", PyLong_FromLong((uint16_t)LSA_DOMAIN_INFO_POLICY_KERBEROS));
48618 3514 : PyModule_AddObject(m, "LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES", PyLong_FromUnsignedLongLong((uint32_t)LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES));
48619 3514 : PyModule_AddObject(m, "LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES_LOCAL", PyLong_FromUnsignedLongLong((uint32_t)LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES_LOCAL));
48620 3514 : PyModule_AddObject(m, "LSA_CLIENT_REVISION_1", PyLong_FromUnsignedLongLong((uint32_t)LSA_CLIENT_REVISION_1));
48621 3514 : PyModule_AddObject(m, "LSA_CLIENT_REVISION_2", PyLong_FromUnsignedLongLong((uint32_t)LSA_CLIENT_REVISION_2));
48622 3514 : PyModule_AddObject(m, "LSA_TLN_DISABLED_NEW", PyLong_FromUnsignedLongLong((uint32_t)LSA_TLN_DISABLED_NEW));
48623 3514 : PyModule_AddObject(m, "LSA_TLN_DISABLED_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_TLN_DISABLED_ADMIN));
48624 3514 : PyModule_AddObject(m, "LSA_TLN_DISABLED_CONFLICT", PyLong_FromUnsignedLongLong((uint32_t)LSA_TLN_DISABLED_CONFLICT));
48625 3514 : PyModule_AddObject(m, "LSA_SID_DISABLED_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_SID_DISABLED_ADMIN));
48626 3514 : PyModule_AddObject(m, "LSA_SID_DISABLED_CONFLICT", PyLong_FromUnsignedLongLong((uint32_t)LSA_SID_DISABLED_CONFLICT));
48627 3514 : PyModule_AddObject(m, "LSA_NB_DISABLED_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_NB_DISABLED_ADMIN));
48628 3514 : PyModule_AddObject(m, "LSA_NB_DISABLED_CONFLICT", PyLong_FromUnsignedLongLong((uint32_t)LSA_NB_DISABLED_CONFLICT));
48629 3514 : PyModule_AddObject(m, "LSA_FOREST_TRUST_TOP_LEVEL_NAME", PyLong_FromLong((uint16_t)LSA_FOREST_TRUST_TOP_LEVEL_NAME));
48630 3514 : PyModule_AddObject(m, "LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX", PyLong_FromLong((uint16_t)LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX));
48631 3514 : PyModule_AddObject(m, "LSA_FOREST_TRUST_DOMAIN_INFO", PyLong_FromLong((uint16_t)LSA_FOREST_TRUST_DOMAIN_INFO));
48632 3514 : PyModule_AddObject(m, "LSA_FOREST_TRUST_RECORD_TYPE_LAST", PyLong_FromLong((uint16_t)LSA_FOREST_TRUST_RECORD_TYPE_LAST));
48633 3514 : PyModule_AddObject(m, "LSA_FOREST_TRUST_COLLISION_TDO", PyLong_FromUnsignedLongLong((uint32_t)LSA_FOREST_TRUST_COLLISION_TDO));
48634 3514 : PyModule_AddObject(m, "LSA_FOREST_TRUST_COLLISION_XREF", PyLong_FromUnsignedLongLong((uint32_t)LSA_FOREST_TRUST_COLLISION_XREF));
48635 3514 : PyModule_AddObject(m, "LSA_FOREST_TRUST_COLLISION_OTHER", PyLong_FromUnsignedLongLong((uint32_t)LSA_FOREST_TRUST_COLLISION_OTHER));
48636 3514 : Py_INCREF((PyObject *)(void *)&lsa_String_Type);
48637 3514 : PyModule_AddObject(m, "String", (PyObject *)(void *)&lsa_String_Type);
48638 3514 : Py_INCREF((PyObject *)(void *)&lsa_StringLarge_Type);
48639 3514 : PyModule_AddObject(m, "StringLarge", (PyObject *)(void *)&lsa_StringLarge_Type);
48640 3514 : Py_INCREF((PyObject *)(void *)&lsa_Strings_Type);
48641 3514 : PyModule_AddObject(m, "Strings", (PyObject *)(void *)&lsa_Strings_Type);
48642 3514 : Py_INCREF((PyObject *)(void *)&lsa_AsciiString_Type);
48643 3514 : PyModule_AddObject(m, "AsciiString", (PyObject *)(void *)&lsa_AsciiString_Type);
48644 3514 : Py_INCREF((PyObject *)(void *)&lsa_AsciiStringLarge_Type);
48645 3514 : PyModule_AddObject(m, "AsciiStringLarge", (PyObject *)(void *)&lsa_AsciiStringLarge_Type);
48646 3514 : Py_INCREF((PyObject *)(void *)&lsa_BinaryString_Type);
48647 3514 : PyModule_AddObject(m, "BinaryString", (PyObject *)(void *)&lsa_BinaryString_Type);
48648 3514 : Py_INCREF((PyObject *)(void *)&lsa_LUID_Type);
48649 3514 : PyModule_AddObject(m, "LUID", (PyObject *)(void *)&lsa_LUID_Type);
48650 3514 : Py_INCREF((PyObject *)(void *)&lsa_PrivEntry_Type);
48651 3514 : PyModule_AddObject(m, "PrivEntry", (PyObject *)(void *)&lsa_PrivEntry_Type);
48652 3514 : Py_INCREF((PyObject *)(void *)&lsa_PrivArray_Type);
48653 3514 : PyModule_AddObject(m, "PrivArray", (PyObject *)(void *)&lsa_PrivArray_Type);
48654 3514 : Py_INCREF((PyObject *)(void *)&lsa_QosInfo_Type);
48655 3514 : PyModule_AddObject(m, "QosInfo", (PyObject *)(void *)&lsa_QosInfo_Type);
48656 3514 : Py_INCREF((PyObject *)(void *)&lsa_ObjectAttribute_Type);
48657 3514 : PyModule_AddObject(m, "ObjectAttribute", (PyObject *)(void *)&lsa_ObjectAttribute_Type);
48658 3514 : Py_INCREF((PyObject *)(void *)&lsa_AuditLogInfo_Type);
48659 3514 : PyModule_AddObject(m, "AuditLogInfo", (PyObject *)(void *)&lsa_AuditLogInfo_Type);
48660 3514 : Py_INCREF((PyObject *)(void *)&lsa_AuditEventsInfo_Type);
48661 3514 : PyModule_AddObject(m, "AuditEventsInfo", (PyObject *)(void *)&lsa_AuditEventsInfo_Type);
48662 3514 : Py_INCREF((PyObject *)(void *)&lsa_DomainInfo_Type);
48663 3514 : PyModule_AddObject(m, "DomainInfo", (PyObject *)(void *)&lsa_DomainInfo_Type);
48664 3514 : Py_INCREF((PyObject *)(void *)&lsa_PDAccountInfo_Type);
48665 3514 : PyModule_AddObject(m, "PDAccountInfo", (PyObject *)(void *)&lsa_PDAccountInfo_Type);
48666 3514 : Py_INCREF((PyObject *)(void *)&lsa_ServerRole_Type);
48667 3514 : PyModule_AddObject(m, "ServerRole", (PyObject *)(void *)&lsa_ServerRole_Type);
48668 3514 : Py_INCREF((PyObject *)(void *)&lsa_ReplicaSourceInfo_Type);
48669 3514 : PyModule_AddObject(m, "ReplicaSourceInfo", (PyObject *)(void *)&lsa_ReplicaSourceInfo_Type);
48670 3514 : Py_INCREF((PyObject *)(void *)&lsa_DefaultQuotaInfo_Type);
48671 3514 : PyModule_AddObject(m, "DefaultQuotaInfo", (PyObject *)(void *)&lsa_DefaultQuotaInfo_Type);
48672 3514 : Py_INCREF((PyObject *)(void *)&lsa_ModificationInfo_Type);
48673 3514 : PyModule_AddObject(m, "ModificationInfo", (PyObject *)(void *)&lsa_ModificationInfo_Type);
48674 3514 : Py_INCREF((PyObject *)(void *)&lsa_AuditFullSetInfo_Type);
48675 3514 : PyModule_AddObject(m, "AuditFullSetInfo", (PyObject *)(void *)&lsa_AuditFullSetInfo_Type);
48676 3514 : Py_INCREF((PyObject *)(void *)&lsa_AuditFullQueryInfo_Type);
48677 3514 : PyModule_AddObject(m, "AuditFullQueryInfo", (PyObject *)(void *)&lsa_AuditFullQueryInfo_Type);
48678 3514 : Py_INCREF((PyObject *)(void *)&lsa_DnsDomainInfo_Type);
48679 3514 : PyModule_AddObject(m, "DnsDomainInfo", (PyObject *)(void *)&lsa_DnsDomainInfo_Type);
48680 3514 : Py_INCREF((PyObject *)(void *)&lsa_PolicyInformation_Type);
48681 3514 : PyModule_AddObject(m, "PolicyInformation", (PyObject *)(void *)&lsa_PolicyInformation_Type);
48682 3514 : Py_INCREF((PyObject *)(void *)&lsa_SidPtr_Type);
48683 3514 : PyModule_AddObject(m, "SidPtr", (PyObject *)(void *)&lsa_SidPtr_Type);
48684 3514 : Py_INCREF((PyObject *)(void *)&lsa_SidArray_Type);
48685 3514 : PyModule_AddObject(m, "SidArray", (PyObject *)(void *)&lsa_SidArray_Type);
48686 3514 : Py_INCREF((PyObject *)(void *)&lsa_DomainList_Type);
48687 3514 : PyModule_AddObject(m, "DomainList", (PyObject *)(void *)&lsa_DomainList_Type);
48688 3514 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedSid_Type);
48689 3514 : PyModule_AddObject(m, "TranslatedSid", (PyObject *)(void *)&lsa_TranslatedSid_Type);
48690 3514 : Py_INCREF((PyObject *)(void *)&lsa_TransSidArray_Type);
48691 3514 : PyModule_AddObject(m, "TransSidArray", (PyObject *)(void *)&lsa_TransSidArray_Type);
48692 3514 : Py_INCREF((PyObject *)(void *)&lsa_RefDomainList_Type);
48693 3514 : PyModule_AddObject(m, "RefDomainList", (PyObject *)(void *)&lsa_RefDomainList_Type);
48694 3514 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedName_Type);
48695 3514 : PyModule_AddObject(m, "TranslatedName", (PyObject *)(void *)&lsa_TranslatedName_Type);
48696 3514 : Py_INCREF((PyObject *)(void *)&lsa_TransNameArray_Type);
48697 3514 : PyModule_AddObject(m, "TransNameArray", (PyObject *)(void *)&lsa_TransNameArray_Type);
48698 3514 : Py_INCREF((PyObject *)(void *)&lsa_LUIDAttribute_Type);
48699 3514 : PyModule_AddObject(m, "LUIDAttribute", (PyObject *)(void *)&lsa_LUIDAttribute_Type);
48700 3514 : Py_INCREF((PyObject *)(void *)&lsa_PrivilegeSet_Type);
48701 3514 : PyModule_AddObject(m, "PrivilegeSet", (PyObject *)(void *)&lsa_PrivilegeSet_Type);
48702 3514 : Py_INCREF((PyObject *)(void *)&lsa_DATA_BUF_Type);
48703 3514 : PyModule_AddObject(m, "DATA_BUF", (PyObject *)(void *)&lsa_DATA_BUF_Type);
48704 3514 : Py_INCREF((PyObject *)(void *)&lsa_DATA_BUF2_Type);
48705 3514 : PyModule_AddObject(m, "DATA_BUF2", (PyObject *)(void *)&lsa_DATA_BUF2_Type);
48706 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoName_Type);
48707 3514 : PyModule_AddObject(m, "TrustDomainInfoName", (PyObject *)(void *)&lsa_TrustDomainInfoName_Type);
48708 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoControllers_Type);
48709 3514 : PyModule_AddObject(m, "TrustDomainInfoControllers", (PyObject *)(void *)&lsa_TrustDomainInfoControllers_Type);
48710 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoPosixOffset_Type);
48711 3514 : PyModule_AddObject(m, "TrustDomainInfoPosixOffset", (PyObject *)(void *)&lsa_TrustDomainInfoPosixOffset_Type);
48712 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoPassword_Type);
48713 3514 : PyModule_AddObject(m, "TrustDomainInfoPassword", (PyObject *)(void *)&lsa_TrustDomainInfoPassword_Type);
48714 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoBasic_Type);
48715 3514 : PyModule_AddObject(m, "TrustDomainInfoBasic", (PyObject *)(void *)&lsa_TrustDomainInfoBasic_Type);
48716 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoInfoEx_Type);
48717 3514 : PyModule_AddObject(m, "TrustDomainInfoInfoEx", (PyObject *)(void *)&lsa_TrustDomainInfoInfoEx_Type);
48718 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoBuffer_Type);
48719 3514 : PyModule_AddObject(m, "TrustDomainInfoBuffer", (PyObject *)(void *)&lsa_TrustDomainInfoBuffer_Type);
48720 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoAuthInfo_Type);
48721 3514 : PyModule_AddObject(m, "TrustDomainInfoAuthInfo", (PyObject *)(void *)&lsa_TrustDomainInfoAuthInfo_Type);
48722 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoFullInfo_Type);
48723 3514 : PyModule_AddObject(m, "TrustDomainInfoFullInfo", (PyObject *)(void *)&lsa_TrustDomainInfoFullInfo_Type);
48724 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoAuthInfoInternal_Type);
48725 3514 : PyModule_AddObject(m, "TrustDomainInfoAuthInfoInternal", (PyObject *)(void *)&lsa_TrustDomainInfoAuthInfoInternal_Type);
48726 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoFullInfoInternal_Type);
48727 3514 : PyModule_AddObject(m, "TrustDomainInfoFullInfoInternal", (PyObject *)(void *)&lsa_TrustDomainInfoFullInfoInternal_Type);
48728 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoInfoEx2Internal_Type);
48729 3514 : PyModule_AddObject(m, "TrustDomainInfoInfoEx2Internal", (PyObject *)(void *)&lsa_TrustDomainInfoInfoEx2Internal_Type);
48730 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoFullInfo2Internal_Type);
48731 3514 : PyModule_AddObject(m, "TrustDomainInfoFullInfo2Internal", (PyObject *)(void *)&lsa_TrustDomainInfoFullInfo2Internal_Type);
48732 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoSupportedEncTypes_Type);
48733 3514 : PyModule_AddObject(m, "TrustDomainInfoSupportedEncTypes", (PyObject *)(void *)&lsa_TrustDomainInfoSupportedEncTypes_Type);
48734 3514 : Py_INCREF((PyObject *)(void *)&lsa_TrustedDomainInfo_Type);
48735 3514 : PyModule_AddObject(m, "TrustedDomainInfo", (PyObject *)(void *)&lsa_TrustedDomainInfo_Type);
48736 3514 : Py_INCREF((PyObject *)(void *)&lsa_DATA_BUF_PTR_Type);
48737 3514 : PyModule_AddObject(m, "DATA_BUF_PTR", (PyObject *)(void *)&lsa_DATA_BUF_PTR_Type);
48738 3514 : Py_INCREF((PyObject *)(void *)&lsa_RightAttribute_Type);
48739 3514 : PyModule_AddObject(m, "RightAttribute", (PyObject *)(void *)&lsa_RightAttribute_Type);
48740 3514 : Py_INCREF((PyObject *)(void *)&lsa_RightSet_Type);
48741 3514 : PyModule_AddObject(m, "RightSet", (PyObject *)(void *)&lsa_RightSet_Type);
48742 3514 : Py_INCREF((PyObject *)(void *)&lsa_DomainListEx_Type);
48743 3514 : PyModule_AddObject(m, "DomainListEx", (PyObject *)(void *)&lsa_DomainListEx_Type);
48744 3514 : Py_INCREF((PyObject *)(void *)&lsa_DomainInfoKerberos_Type);
48745 3514 : PyModule_AddObject(m, "DomainInfoKerberos", (PyObject *)(void *)&lsa_DomainInfoKerberos_Type);
48746 3514 : Py_INCREF((PyObject *)(void *)&lsa_DomainInfoEfs_Type);
48747 3514 : PyModule_AddObject(m, "DomainInfoEfs", (PyObject *)(void *)&lsa_DomainInfoEfs_Type);
48748 3514 : Py_INCREF((PyObject *)(void *)&lsa_DomainInformationPolicy_Type);
48749 3514 : PyModule_AddObject(m, "DomainInformationPolicy", (PyObject *)(void *)&lsa_DomainInformationPolicy_Type);
48750 3514 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedName2_Type);
48751 3514 : PyModule_AddObject(m, "TranslatedName2", (PyObject *)(void *)&lsa_TranslatedName2_Type);
48752 3514 : Py_INCREF((PyObject *)(void *)&lsa_TransNameArray2_Type);
48753 3514 : PyModule_AddObject(m, "TransNameArray2", (PyObject *)(void *)&lsa_TransNameArray2_Type);
48754 3514 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedSid2_Type);
48755 3514 : PyModule_AddObject(m, "TranslatedSid2", (PyObject *)(void *)&lsa_TranslatedSid2_Type);
48756 3514 : Py_INCREF((PyObject *)(void *)&lsa_TransSidArray2_Type);
48757 3514 : PyModule_AddObject(m, "TransSidArray2", (PyObject *)(void *)&lsa_TransSidArray2_Type);
48758 3514 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedSid3_Type);
48759 3514 : PyModule_AddObject(m, "TranslatedSid3", (PyObject *)(void *)&lsa_TranslatedSid3_Type);
48760 3514 : Py_INCREF((PyObject *)(void *)&lsa_TransSidArray3_Type);
48761 3514 : PyModule_AddObject(m, "TransSidArray3", (PyObject *)(void *)&lsa_TransSidArray3_Type);
48762 3514 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustBinaryData_Type);
48763 3514 : PyModule_AddObject(m, "ForestTrustBinaryData", (PyObject *)(void *)&lsa_ForestTrustBinaryData_Type);
48764 3514 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustDomainInfo_Type);
48765 3514 : PyModule_AddObject(m, "ForestTrustDomainInfo", (PyObject *)(void *)&lsa_ForestTrustDomainInfo_Type);
48766 3514 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustData_Type);
48767 3514 : PyModule_AddObject(m, "ForestTrustData", (PyObject *)(void *)&lsa_ForestTrustData_Type);
48768 3514 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustRecord_Type);
48769 3514 : PyModule_AddObject(m, "ForestTrustRecord", (PyObject *)(void *)&lsa_ForestTrustRecord_Type);
48770 3514 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustInformation_Type);
48771 3514 : PyModule_AddObject(m, "ForestTrustInformation", (PyObject *)(void *)&lsa_ForestTrustInformation_Type);
48772 3514 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustCollisionRecord_Type);
48773 3514 : PyModule_AddObject(m, "ForestTrustCollisionRecord", (PyObject *)(void *)&lsa_ForestTrustCollisionRecord_Type);
48774 3514 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustCollisionInfo_Type);
48775 3514 : PyModule_AddObject(m, "ForestTrustCollisionInfo", (PyObject *)(void *)&lsa_ForestTrustCollisionInfo_Type);
48776 3514 : Py_INCREF((PyObject *)(void *)&lsa_Close_Type);
48777 3514 : PyModule_AddObject(m, "Close", (PyObject *)(void *)&lsa_Close_Type);
48778 3514 : Py_INCREF((PyObject *)(void *)&lsa_Delete_Type);
48779 3514 : PyModule_AddObject(m, "Delete", (PyObject *)(void *)&lsa_Delete_Type);
48780 3514 : Py_INCREF((PyObject *)(void *)&lsa_EnumPrivs_Type);
48781 3514 : PyModule_AddObject(m, "EnumPrivs", (PyObject *)(void *)&lsa_EnumPrivs_Type);
48782 3514 : Py_INCREF((PyObject *)(void *)&lsa_QuerySecurity_Type);
48783 3514 : PyModule_AddObject(m, "QuerySecurity", (PyObject *)(void *)&lsa_QuerySecurity_Type);
48784 3514 : Py_INCREF((PyObject *)(void *)&lsa_SetSecObj_Type);
48785 3514 : PyModule_AddObject(m, "SetSecObj", (PyObject *)(void *)&lsa_SetSecObj_Type);
48786 3514 : Py_INCREF((PyObject *)(void *)&lsa_OpenPolicy_Type);
48787 3514 : PyModule_AddObject(m, "OpenPolicy", (PyObject *)(void *)&lsa_OpenPolicy_Type);
48788 3514 : Py_INCREF((PyObject *)(void *)&lsa_QueryInfoPolicy_Type);
48789 3514 : PyModule_AddObject(m, "QueryInfoPolicy", (PyObject *)(void *)&lsa_QueryInfoPolicy_Type);
48790 3514 : Py_INCREF((PyObject *)(void *)&lsa_SetInfoPolicy_Type);
48791 3514 : PyModule_AddObject(m, "SetInfoPolicy", (PyObject *)(void *)&lsa_SetInfoPolicy_Type);
48792 3514 : Py_INCREF((PyObject *)(void *)&lsa_CreateAccount_Type);
48793 3514 : PyModule_AddObject(m, "CreateAccount", (PyObject *)(void *)&lsa_CreateAccount_Type);
48794 3514 : Py_INCREF((PyObject *)(void *)&lsa_EnumAccounts_Type);
48795 3514 : PyModule_AddObject(m, "EnumAccounts", (PyObject *)(void *)&lsa_EnumAccounts_Type);
48796 3514 : Py_INCREF((PyObject *)(void *)&lsa_CreateTrustedDomain_Type);
48797 3514 : PyModule_AddObject(m, "CreateTrustedDomain", (PyObject *)(void *)&lsa_CreateTrustedDomain_Type);
48798 3514 : Py_INCREF((PyObject *)(void *)&lsa_EnumTrustDom_Type);
48799 3514 : PyModule_AddObject(m, "EnumTrustDom", (PyObject *)(void *)&lsa_EnumTrustDom_Type);
48800 3514 : Py_INCREF((PyObject *)(void *)&lsa_LookupNames_Type);
48801 3514 : PyModule_AddObject(m, "LookupNames", (PyObject *)(void *)&lsa_LookupNames_Type);
48802 3514 : Py_INCREF((PyObject *)(void *)&lsa_LookupSids_Type);
48803 3514 : PyModule_AddObject(m, "LookupSids", (PyObject *)(void *)&lsa_LookupSids_Type);
48804 3514 : Py_INCREF((PyObject *)(void *)&lsa_CreateSecret_Type);
48805 3514 : PyModule_AddObject(m, "CreateSecret", (PyObject *)(void *)&lsa_CreateSecret_Type);
48806 3514 : Py_INCREF((PyObject *)(void *)&lsa_OpenAccount_Type);
48807 3514 : PyModule_AddObject(m, "OpenAccount", (PyObject *)(void *)&lsa_OpenAccount_Type);
48808 3514 : Py_INCREF((PyObject *)(void *)&lsa_EnumPrivsAccount_Type);
48809 3514 : PyModule_AddObject(m, "EnumPrivsAccount", (PyObject *)(void *)&lsa_EnumPrivsAccount_Type);
48810 3514 : Py_INCREF((PyObject *)(void *)&lsa_AddPrivilegesToAccount_Type);
48811 3514 : PyModule_AddObject(m, "AddPrivilegesToAccount", (PyObject *)(void *)&lsa_AddPrivilegesToAccount_Type);
48812 3514 : Py_INCREF((PyObject *)(void *)&lsa_RemovePrivilegesFromAccount_Type);
48813 3514 : PyModule_AddObject(m, "RemovePrivilegesFromAccount", (PyObject *)(void *)&lsa_RemovePrivilegesFromAccount_Type);
48814 3514 : Py_INCREF((PyObject *)(void *)&lsa_GetSystemAccessAccount_Type);
48815 3514 : PyModule_AddObject(m, "GetSystemAccessAccount", (PyObject *)(void *)&lsa_GetSystemAccessAccount_Type);
48816 3514 : Py_INCREF((PyObject *)(void *)&lsa_SetSystemAccessAccount_Type);
48817 3514 : PyModule_AddObject(m, "SetSystemAccessAccount", (PyObject *)(void *)&lsa_SetSystemAccessAccount_Type);
48818 3514 : Py_INCREF((PyObject *)(void *)&lsa_OpenTrustedDomain_Type);
48819 3514 : PyModule_AddObject(m, "OpenTrustedDomain", (PyObject *)(void *)&lsa_OpenTrustedDomain_Type);
48820 3514 : Py_INCREF((PyObject *)(void *)&lsa_QueryTrustedDomainInfo_Type);
48821 3514 : PyModule_AddObject(m, "QueryTrustedDomainInfo", (PyObject *)(void *)&lsa_QueryTrustedDomainInfo_Type);
48822 3514 : Py_INCREF((PyObject *)(void *)&lsa_SetInformationTrustedDomain_Type);
48823 3514 : PyModule_AddObject(m, "SetInformationTrustedDomain", (PyObject *)(void *)&lsa_SetInformationTrustedDomain_Type);
48824 3514 : Py_INCREF((PyObject *)(void *)&lsa_OpenSecret_Type);
48825 3514 : PyModule_AddObject(m, "OpenSecret", (PyObject *)(void *)&lsa_OpenSecret_Type);
48826 3514 : Py_INCREF((PyObject *)(void *)&lsa_SetSecret_Type);
48827 3514 : PyModule_AddObject(m, "SetSecret", (PyObject *)(void *)&lsa_SetSecret_Type);
48828 3514 : Py_INCREF((PyObject *)(void *)&lsa_QuerySecret_Type);
48829 3514 : PyModule_AddObject(m, "QuerySecret", (PyObject *)(void *)&lsa_QuerySecret_Type);
48830 3514 : Py_INCREF((PyObject *)(void *)&lsa_LookupPrivValue_Type);
48831 3514 : PyModule_AddObject(m, "LookupPrivValue", (PyObject *)(void *)&lsa_LookupPrivValue_Type);
48832 3514 : Py_INCREF((PyObject *)(void *)&lsa_LookupPrivName_Type);
48833 3514 : PyModule_AddObject(m, "LookupPrivName", (PyObject *)(void *)&lsa_LookupPrivName_Type);
48834 3514 : Py_INCREF((PyObject *)(void *)&lsa_LookupPrivDisplayName_Type);
48835 3514 : PyModule_AddObject(m, "LookupPrivDisplayName", (PyObject *)(void *)&lsa_LookupPrivDisplayName_Type);
48836 3514 : Py_INCREF((PyObject *)(void *)&lsa_DeleteObject_Type);
48837 3514 : PyModule_AddObject(m, "DeleteObject", (PyObject *)(void *)&lsa_DeleteObject_Type);
48838 3514 : Py_INCREF((PyObject *)(void *)&lsa_EnumAccountsWithUserRight_Type);
48839 3514 : PyModule_AddObject(m, "EnumAccountsWithUserRight", (PyObject *)(void *)&lsa_EnumAccountsWithUserRight_Type);
48840 3514 : Py_INCREF((PyObject *)(void *)&lsa_EnumAccountRights_Type);
48841 3514 : PyModule_AddObject(m, "EnumAccountRights", (PyObject *)(void *)&lsa_EnumAccountRights_Type);
48842 3514 : Py_INCREF((PyObject *)(void *)&lsa_AddAccountRights_Type);
48843 3514 : PyModule_AddObject(m, "AddAccountRights", (PyObject *)(void *)&lsa_AddAccountRights_Type);
48844 3514 : Py_INCREF((PyObject *)(void *)&lsa_RemoveAccountRights_Type);
48845 3514 : PyModule_AddObject(m, "RemoveAccountRights", (PyObject *)(void *)&lsa_RemoveAccountRights_Type);
48846 3514 : Py_INCREF((PyObject *)(void *)&lsa_QueryTrustedDomainInfoBySid_Type);
48847 3514 : PyModule_AddObject(m, "QueryTrustedDomainInfoBySid", (PyObject *)(void *)&lsa_QueryTrustedDomainInfoBySid_Type);
48848 3514 : Py_INCREF((PyObject *)(void *)&lsa_SetTrustedDomainInfo_Type);
48849 3514 : PyModule_AddObject(m, "SetTrustedDomainInfo", (PyObject *)(void *)&lsa_SetTrustedDomainInfo_Type);
48850 3514 : Py_INCREF((PyObject *)(void *)&lsa_DeleteTrustedDomain_Type);
48851 3514 : PyModule_AddObject(m, "DeleteTrustedDomain", (PyObject *)(void *)&lsa_DeleteTrustedDomain_Type);
48852 3514 : Py_INCREF((PyObject *)(void *)&lsa_StorePrivateData_Type);
48853 3514 : PyModule_AddObject(m, "StorePrivateData", (PyObject *)(void *)&lsa_StorePrivateData_Type);
48854 3514 : Py_INCREF((PyObject *)(void *)&lsa_RetrievePrivateData_Type);
48855 3514 : PyModule_AddObject(m, "RetrievePrivateData", (PyObject *)(void *)&lsa_RetrievePrivateData_Type);
48856 3514 : Py_INCREF((PyObject *)(void *)&lsa_OpenPolicy2_Type);
48857 3514 : PyModule_AddObject(m, "OpenPolicy2", (PyObject *)(void *)&lsa_OpenPolicy2_Type);
48858 3514 : Py_INCREF((PyObject *)(void *)&lsa_GetUserName_Type);
48859 3514 : PyModule_AddObject(m, "GetUserName", (PyObject *)(void *)&lsa_GetUserName_Type);
48860 3514 : Py_INCREF((PyObject *)(void *)&lsa_QueryInfoPolicy2_Type);
48861 3514 : PyModule_AddObject(m, "QueryInfoPolicy2", (PyObject *)(void *)&lsa_QueryInfoPolicy2_Type);
48862 3514 : Py_INCREF((PyObject *)(void *)&lsa_SetInfoPolicy2_Type);
48863 3514 : PyModule_AddObject(m, "SetInfoPolicy2", (PyObject *)(void *)&lsa_SetInfoPolicy2_Type);
48864 3514 : Py_INCREF((PyObject *)(void *)&lsa_QueryTrustedDomainInfoByName_Type);
48865 3514 : PyModule_AddObject(m, "QueryTrustedDomainInfoByName", (PyObject *)(void *)&lsa_QueryTrustedDomainInfoByName_Type);
48866 3514 : Py_INCREF((PyObject *)(void *)&lsa_SetTrustedDomainInfoByName_Type);
48867 3514 : PyModule_AddObject(m, "SetTrustedDomainInfoByName", (PyObject *)(void *)&lsa_SetTrustedDomainInfoByName_Type);
48868 3514 : Py_INCREF((PyObject *)(void *)&lsa_EnumTrustedDomainsEx_Type);
48869 3514 : PyModule_AddObject(m, "EnumTrustedDomainsEx", (PyObject *)(void *)&lsa_EnumTrustedDomainsEx_Type);
48870 3514 : Py_INCREF((PyObject *)(void *)&lsa_CreateTrustedDomainEx_Type);
48871 3514 : PyModule_AddObject(m, "CreateTrustedDomainEx", (PyObject *)(void *)&lsa_CreateTrustedDomainEx_Type);
48872 3514 : Py_INCREF((PyObject *)(void *)&lsa_CloseTrustedDomainEx_Type);
48873 3514 : PyModule_AddObject(m, "CloseTrustedDomainEx", (PyObject *)(void *)&lsa_CloseTrustedDomainEx_Type);
48874 3514 : Py_INCREF((PyObject *)(void *)&lsa_QueryDomainInformationPolicy_Type);
48875 3514 : PyModule_AddObject(m, "QueryDomainInformationPolicy", (PyObject *)(void *)&lsa_QueryDomainInformationPolicy_Type);
48876 3514 : Py_INCREF((PyObject *)(void *)&lsa_SetDomainInformationPolicy_Type);
48877 3514 : PyModule_AddObject(m, "SetDomainInformationPolicy", (PyObject *)(void *)&lsa_SetDomainInformationPolicy_Type);
48878 3514 : Py_INCREF((PyObject *)(void *)&lsa_OpenTrustedDomainByName_Type);
48879 3514 : PyModule_AddObject(m, "OpenTrustedDomainByName", (PyObject *)(void *)&lsa_OpenTrustedDomainByName_Type);
48880 3514 : Py_INCREF((PyObject *)(void *)&lsa_LookupSids2_Type);
48881 3514 : PyModule_AddObject(m, "LookupSids2", (PyObject *)(void *)&lsa_LookupSids2_Type);
48882 3514 : Py_INCREF((PyObject *)(void *)&lsa_LookupNames2_Type);
48883 3514 : PyModule_AddObject(m, "LookupNames2", (PyObject *)(void *)&lsa_LookupNames2_Type);
48884 3514 : Py_INCREF((PyObject *)(void *)&lsa_CreateTrustedDomainEx2_Type);
48885 3514 : PyModule_AddObject(m, "CreateTrustedDomainEx2", (PyObject *)(void *)&lsa_CreateTrustedDomainEx2_Type);
48886 3514 : Py_INCREF((PyObject *)(void *)&lsa_LookupNames3_Type);
48887 3514 : PyModule_AddObject(m, "LookupNames3", (PyObject *)(void *)&lsa_LookupNames3_Type);
48888 3514 : Py_INCREF((PyObject *)(void *)&lsa_lsaRQueryForestTrustInformation_Type);
48889 3514 : PyModule_AddObject(m, "lsaRQueryForestTrustInformation", (PyObject *)(void *)&lsa_lsaRQueryForestTrustInformation_Type);
48890 3514 : Py_INCREF((PyObject *)(void *)&lsa_lsaRSetForestTrustInformation_Type);
48891 3514 : PyModule_AddObject(m, "lsaRSetForestTrustInformation", (PyObject *)(void *)&lsa_lsaRSetForestTrustInformation_Type);
48892 3514 : Py_INCREF((PyObject *)(void *)&lsa_LookupSids3_Type);
48893 3514 : PyModule_AddObject(m, "LookupSids3", (PyObject *)(void *)&lsa_LookupSids3_Type);
48894 3514 : Py_INCREF((PyObject *)(void *)&lsa_LookupNames4_Type);
48895 3514 : PyModule_AddObject(m, "LookupNames4", (PyObject *)(void *)&lsa_LookupNames4_Type);
48896 3514 : Py_INCREF((PyObject *)(void *)&lsarpc_InterfaceType);
48897 3514 : PyModule_AddObject(m, "lsarpc", (PyObject *)(void *)&lsarpc_InterfaceType);
48898 3514 : Py_INCREF((PyObject *)(void *)&lsarpc_SyntaxType);
48899 3514 : PyModule_AddObject(m, "lsarpc_abstract_syntax", (PyObject *)(void *)&lsarpc_SyntaxType);
48900 3514 : Py_INCREF((PyObject *)(void *)&lsarpc_SyntaxType);
48901 3514 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&lsarpc_SyntaxType);
48902 : #ifdef PY_MOD_LSA_PATCH
48903 : PY_MOD_LSA_PATCH(m);
48904 : #endif
48905 3514 : out:
48906 3514 : Py_XDECREF(dep_samba_dcerpc_misc);
48907 3514 : Py_XDECREF(dep_samba_dcerpc_security);
48908 3514 : Py_XDECREF(dep_talloc);
48909 3514 : Py_XDECREF(dep_samba_dcerpc_base);
48910 3514 : return m;
48911 :
48912 : }
|